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.

Lab12b : sometimes motor reving up in wrong direction

I’m running a gimbal motor with a quadrature encoder on a DRV8312EVM board. Stepping through most of the labs, i’m now at 12b. (speed control with Spintac controller and encoder feedback). 

Setting the run-identify flag to 1 get’s the motor running as expected most of the time. However sometimes when changing this flag from 0 to 1 the motor revs up in wrong direction to its maximum speed. 

What is going on here? And most important how to prevent this from happening.

 Many thanks,

 Paul

  • In the MAIN_ISR there is a piece of code that zero offsets the encoder, that is called when the Estimator is recalculating the stator resistance.

    Does this mean that Flag_enableRsRecalc has to be true at startup, even when there is no need for the stator resistance to be recalculated?

    Thank, Paul

  • Paul,

    Yes.  That piece of code will align the encoder with the motor rotor.  During the stator resistance recalculation, the motor rotor is aligned to a zero degree electrical angle.  At this point we can save the encoder position and are able to perform FOC control using the motor encoder instead of the FAST estimator.

    Until you replace that code with your own alignment mechanism you need to have the Flag_enableRsRecalc set to true.