This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PMSM responding badly with torquecontroll in lab5a

I'm having this problem in lab5a where the motor is not accelerating smoothly when applying some/high/max torque. You can see/hear it in this video. When I apply a small enough torque the motor is accelerating smoothly.

It seems like the software is expecting the motor to go faster than it actually does, and ends up with setting too high frequency. I have tried a lot of changes, but nothing gave any useable results.

Calculated Ki(PU): 0.02338
Calculated Kp(PU): 0.8544

Using speedref works great, but torquecontroll is wanted.

Can this have something to do with forcing angle, which is enabled with default values?

  • yes, exactly. your torque command is a steep step function. You need to ramp the torque just like you would ramp a speed command as an acceleration. Or start in speed control mode and once going a certain speed switch to torque control.

    but at some point you may have too much load for perfect start-up. This is where an IPD solution would be used (if your motor supports). Or, in the case of most electric bicycles, you wouldn't produce torque until the wheel was already moving. In this case you need to add "flying start" to lock on to an already moving rotor.
  • So after starting in speed mode and then switch to torque mode, do I still need to ramp the torque? Or do I still need the torque ramping?
    I was under the impression that the PI-regulator would be able to take care of that

    Also the "flying start" will only work if the bike is already moving?
  • "So after starting in speed mode and then switch to torque mode, do I still need to ramp the torque? Or do I still need the torque ramping?"

    No, the torque (Iq_Ref_A) will be ramping as the output from the speed PI controller, depending on how it is tuned and the control update rates.

    " Also the "flying start" will only work if the bike is already moving?"
    Flying start is the capability for the estimator (and then the control system) to synchronize to an already moving rotor. For a smooth take over we recommend seeding the input and output of the speed controller to the speed_est and Iq_fdbk values before setting a new speed_ref.
  • Well after switching to torque (CTRL_setFlag_enableSpeedCtrl(ctrlHandle, false);), shouldn't the Iq PI controller take referance from User_Iqref and not the output of the speed PI controller?
    After disabling it using this method (after 50 rpm) I still get the same result as in my first post.
  • you accelerate to 50 RPM, then disable the speed controller and give it the same last Iq_Ref_A (which was just coming from the speed controller)?

    and then what is the behavior?
  • Right now when I switch I take the last IqRef_A (from gMotorVars) and over # (100/1000/10000) system loops it gradually switch over to the readings on the potentiometer attached. So if I set the potentiometer to maximum the system will smoothly accelerate to max rpm if # system loops (1000+) is high enough - given no load. If given load I get the same result as in the first post.

    When I think about it I might should have used EST_getSpeed_krpm, but will this make a difference? Also I have not tried when switching from speed to torque, to just hold the same IqRef_A to see what happens. Can be done tomorrow though if you think it can make a difference/behave different.
  • I would first hold the last Iq_Ref_A coming from the speed controller.
    Make sure that's stable with a fixed load.
    Then ramp any new Iq_Ref_A command from your throttle/pot so that you aren't getting a large step input to the Iq controller.
  • Alright thanks for the replies, I will try this out tomorrow.
  • I've tried this out now, and the current is ramping up pretty slowly at the moment, but still sometimes during acceleration the problem occurs. At which rpm/speed it happens is variable. I'm using a trajecory delta of 0.0001, ramping up to 5 A (20 A max). The transition from speed to torque goes smoothly.