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.

HAL_disablePwm (halHandle) contradicts flying start



Evaluation board:  drv8301-hc-evm revd

Lab 10e Flying Start

Flying start only lets the program execute motor_RunCtrl (ctrlHandle) in while (); to start and stop the control motor. If I repeatedly execute HAL_disablePwm (halHandle) when the motor stops, flying start can not start the motor properly. If there is no flying start routine, the motor start will not be affected.

I want to change USER_MOTOR_MAX_CURRENT in while () to achieve output torque limitation after motor_Run Ctrl (ctrl Handle); control motor stops; but in order to effectively change output torque, we must also implement CTRL_setParams (ctrlHandle, & gUser Params); at this time, the motor does not turn, but also has PWM output.

Connecting the motor does not perform motor_Run Ctrl (ctrl Handle); the motor may turn automatically, which is very dangerous, unless HAL_disablePwm (halHandle) is repeatedly executed when the motor stops, the PWM can be turned off, but flying start can not start the motor normally, requesting guidance.

  • What change did you do in the example lab? And what function do you want to implement?

    Please don't change anything in motor_RunCtrl() and add HAL_disablePwm() or HAL_enablePwm at anywhere else if you want to implement flying start function as well. Flying start needs to enable PWM always to sample the currents and voltages of motor that will be used to estimate the speed and position of the motor.

  • I have finished a product with routine 10a, but without routine 10e Flying start function, I added routine 10e Flying start function to routine 10a. After repeated tests, it was confirmed that the transplantation was successful.

    This product is called dental implant machine. When the motor stops, it can adjust the speed and torque through the screen. If the motor can not adjust the torque when it stops, this product will be meaningless.

    Routine 10e Flying start motor can be stopped directly,Why can't PWM be turned off in routine 10a?Procedure is as follows

      if(gMotorVars.Flag_RunState == false)  

    {

     gPwmData.Tabc.value[0] = _IQ(0.0);  

    gPwmData.Tabc.value[1] = _IQ(0.0);

     gPwmData.Tabc.value[2] = _IQ(0.0);

     // disable the PWM  HAL_disablePwm(halHandle);

      }

  • Please check if HAL_disablePwm(halHandle) is called when the motor is stopped, if not, the PWM should be output with 50% duty as you showed the code above.

  • I'm sure HAL_disablePwm(halHandle) is called when the motor is stopped,the PWM can be turned off, but flying start can not start the motor normally.Why?

     

  • For flying start, you can disable HAL_disablePwm() and set gMotorVars.Flag_Run_Identify to "false" to stop the motor, you must keep the motor in running state always, only need to disable the speed and current loop, and set the pwm duty to 50%.

    Please look through the lab10e first before you want to change anything in the project.