Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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.

DRV8312-C2-KIT: How to change the direction on BLDC_Sensored

Part Number: DRV8312-C2-KIT

Hi ,

i am running BLDC_Sensored on DRV8312-C2-KIT . How can I change the motor direction  ?

Thanks

Ash

  • There are two methods to change the motor direction.

    1. Modify the MOD6CNT_MACRO() as below, this method is more easy to implement.
    if(SpeedRef > 0)
    {
    if (v.TrigInput > 0)
    {
    if (v.Counter == 5) /* Reset the counter when it is 5 */
    v.Counter = 0;
    else
    v.Counter++; /* Otherwise, increment by 1 */
    }
    else
    {
    if (v.TrigInput > 0)
    {
    if (v.Counter == 0) /* Reset the counter when it is 0 */
    v.Counter = 5;
    else
    v.Counter--; /* Otherwise, decrease by 1 */
    }
    }
    2. Modify BLDCPWM_MACRO() for Positive and Negative speed reference with different states sequence.

    Btw, you should slow down the motor to Zero and restart before changing the direction.
  • Thank you so much for quick reply and clear direction .
    I am gonna try it soon .

    Regards
    Ash
  • That method can change the direction on open loop case . How to make it happen on closed loop either fixed duty Cycle or with PID ?

    Thanks again

    Ash

  • It's the same, Changing the commutation sequence per reference speed to change the rotation direction, that doesn't depend on open loop/close loop.
  • Thanks for reply .

    Regardless of I used the SpeedRef or my mod1.Direction(I added) to count-down or count-up on counter  !  Motor turns clockwise . By having the speedRef negative or my direction change to CClockwise ,motor turns 1/3 of the revolution in correct direction and then back to clockwise again !

    Thanks

    Ash

  • Sorry. You have to also change the commutation states based the hall input signal.

    // Comment the following if-else-if statements in case of
    // inverted Hall logics for commutation states.
    if (hall1.HallGpioAccepted==5)
    pwm1.CmtnPointer = 0;

    else if (hall1.HallGpioAccepted==1)
    pwm1.CmtnPointer = 1;

    else if (hall1.HallGpioAccepted==3)
    pwm1.CmtnPointer = 2;

    else if (hall1.HallGpioAccepted==2)
    pwm1.CmtnPointer = 3;

    else if (hall1.HallGpioAccepted==6)
    pwm1.CmtnPointer = 4;

    else if (hall1.HallGpioAccepted==4)
    pwm1.CmtnPointer = 5;