I looked at the example model:S12ZVM_FOC_Sensorless.slx, and the motor was always running at the speed command. so, I want to start or stop the motor drive according to the switch input. but, I couldn't find PMF or GDU module Enable/Disable Blockset except Configuration blockset in S12zvmx MBD toolbox ver1.2.
How do I fix it?
Hi d.hlee,
Indeed there is no dedicated block to enable/disable the PWM generation for this toolbox.
Anyhow there are a few options you can explore to overcome this in case you wish to start/stop the motor on a particular IO switch.
#1: you could implement a logic to modify the Torque Reference (after the speed controller) with the help of a standard Simulink Switch Block that allows the speed controller computations only when the you wish. For the rest of the time, even if the PWM is still active is should be set at 50% duty cycle - which corresponds to a 0 Amps torque reference.
#2: you could implement a subsystem just before the PMF and in case the GPI is set to the value you wish for disable you simply set the duty cycles to 50%. Anyhow - this method should work in sync with the rest of the control logic in case you wish to stop/restart multiple times because you need to re-initialize the PI controllers since otherwise you will get faults due to high currents/voltage due to discontinuities.
#3: you could use the Simulink Custom Code and implement your own PMF/GDU start/stop sequence and call that piece of code in your Simulink model.
Hope this helps!
Daniel