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.

TMS320F28027: How to use HAL_disablePwm and HAL_disablePwm together safely and quickly?

Part Number: TMS320F28027
Other Parts Discussed in Thread: MOTORWARE

My application needs to disable pwm under certain conditions, so I call HAL_disablePwm, the motor enters high-impedance mode, and then, under certain conditions, I need to re-enable pwm and output force, because after calling HAL_disablePwm, the current loop Still running, it will cause the accumulation of UI, so I first called PID_setUi(ctrlobj->pidHandle_Id,_IQ(0)); to clean up the UI of the id axis, then I enabled pwm, called HAL_enablePwm; and immediately output iq Shaft current, I can quickly freeze the motor, how to solve the problem of freeze? Or how to use HAL_disablePwm and HAL_enablePwm safely, quickly and effectively?

  • You can add a flag variable to stop or start the motor. You can use the flag to call HAL_enablePwm() or HAL_disablePwm(), and enable or disable the PI controller.Make sure that the PI controllers are enabled after calling HAL_enablePwm(), and reset the Ui of the speed, Iq and Iq PI controllers to zero before calling HAL_enablePwm().

    The example lab like lab05a~10a in motorWare should meet your requirement if you didn't make any changes in the lab.

  • What I mean is that before turning on the pwm, I cleared the UI of the id axis, and then I turned on the pwm, and I felt that the motor thumped a bit, and there was an obvious stuttering phenomenon. How do I use HAL_enablePwm and HAL_disablePwm smoothly? I use the speed loop, When I don’t need it, I first disable the speed loop, and then call HAL_disablePwm. When it needs to be enabled, I first turn on the speed loop, then clear the UI of the id, and then call HAL_enablePwm, and the motor has an obvious sense of stuttering.

  • You can reset the Ui of all of the PI controller before you tune on the PWM.

    Which example lab are you using?