I think the closed-loop PMSM_ClosedLoop_s32k144 control example in the new mbd toolbox 4.1.0 is similar with FOC_TC file which is in Module 7: Torque Control. Could you tell me what is the difference between them? And when I run freemaster for closed-loop pmdm motor control example and I am not seeing any .
In general, the main difference between a Torque Control and the Speed Control is just the what is happening in the Slow Loop:
Now, a true Torque Control System, requires a position sensors like an encoder/resolver that can provides the rotor actual position even at low speed or stall. The Hall sensors which are equipped for this motor in the kit, do now actually allows you to control the torque at low speed. For such purpose you really need to have a proper motor+sensor setup.
In the M7 we tried to show, what it takes to build such a system, but if you analyse the model you will see that is just a incremental variation over the open loop V/f control method. Basically, the rotor position is imposed based on on a ramp while the torque is selected from a LUT (see figure 3 from the lecture)
Controlling the motor in Torque Mode - might be challenging without a proper load since the rotor might accelerate until the voltage is saturate.
Hence, my advice:
- try to evaluate the Speed Control first
- if possible, replace the Hall sensor as primary speed/position feedback with an encoder ( your motor + your sensor)
- update the model to make your the SW is still working
- then, remove the Speed Controller and impose the command as a Torque/Current Reference
Hope this helps!
I saw FOC is not migrated into model-based design toolbox 4.1.0 so I slightly changed the closed-loop control module of pmsm in 4.1.0 so it maintains the same functionality with FOC. My approach is to remove speed feedback from slow loop control and instead of that insert lookup table which nxp provided using experiments, so speed command can directly convert into torque reference. Motor runs by 30 degrees at first and then stop spinning. Can you check my file below. I will appreciate any valuable ideas, or to be ideal please modify my model to work properly.