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.

PWM configuration

Other Parts Discussed in Thread: MOTORWARE, DRV8312, DRV8301

Posting this to migrate from an email to e2e for support:

 

Where in the code could we change the outputs for the PWMs on pin 86, 83, and 10 on the processor?

We have some problems with these signals on our custom board and would like to see if there is a way to change the output signals of these pins.

 

---------------------------

This is all done through the HAL interface.

I recommend you read this tutorial

C:\ti\motorware\motorware_1_01_00_13\docs\tutorials\motorware_hal_tutorial.pdf

 

---------------------------

 

Our goal is to make the PWM B-side independent due to our hardware design.  I try to follow your suggestion and make the following changes:

 

In the function:   HAL_setupPwms(), we comment out

// setup the Action-qualifier Continuous Software Force Register (AQCSFRC)

 //     PWM_setActionQualContSWForce_PwmB(obj->pwmHandle[cnt],PWM_ActionQualContSWForce_Set);

 

And replace it with:

if(cnt == 0)

        {

        PWM_setActionQual_CntUp_CmpB_PwmB(obj->pwmHandle[cnt],PWM_ActionQual_Clear);

        PWM_setActionQual_CntDown_CmpB_PwmB(obj->pwmHandle[cnt],PWM_ActionQual_Set);

        }

 

 

We verify with the scope that it does not work;  we still have a constant high signal on the B side. 

can you tell us if we miss anything ?

 

 

 

 

  • First. I want to respond to

    ChrisClearman said:
    Our goal is to make the PWM B-side independent due to our hardware design.

    I don't think this is what you mean. The low-side PWM should not be independent. If it is dependent on the diference with the high-side as a representation of the duty cycle for that phase.

    Which "board" are you using as the baseline for your software?  The DRV8312 examples?  The DRV8312 is a device where you only give the high-side duty command and it controls the low-side on its own, BUT you have to pull the reset line for the low-side...it's very strange and not common for a three phase motor control driver.

    Which driver are you actually using on your custom HW?

    It is much more likely that you have a driver that operates more like the DRV8301 or the high voltage IPM we use on the other evaluation kits.  I would look at the HAL_setupPwms for those examples instead.

  • Hi,

    Is it possible to swap the high and low side PWM?

    A simple hack would be greatly helpful!

    Ravi

  • You need re-setup the Dead-Band Generator Control Register (DBCTL) in HAL_setupPwms(); Please refer to Enhanced Pulse Width Modulator (ePWM) Module chapter of the controller Technical Reference Manual.

    Need to bypass the Dead-band generation in DBCTL register if you need the PWMB output is independent of PWMA.
    Need to setup DBCTL, AQCTLA and AQCTLB if you want to swap the high and low side PWM.

    Upload your expected output waveform on E2E if you have any problem to setup the ePWM module.
  • Thanks.

    Here is the change and it works fine!

          // setup the Action-Qualifier Output A Register (AQCTLA)
          /* RG swapping the low and high pins
          PWM_setActionQual_CntUp_CmpA_PwmA(obj->pwmHandle[cnt],PWM_ActionQual_Set);
          PWM_setActionQual_CntDown_CmpA_PwmA(obj->pwmHandle[cnt],PWM_ActionQual_Clear);
           */
          PWM_setActionQual_CntUp_CmpA_PwmA(obj->pwmHandle[cnt],PWM_ActionQual_Clear);
          PWM_setActionQual_CntDown_CmpA_PwmA(obj->pwmHandle[cnt],PWM_ActionQual_Set);
          PWM_setActionQualSWForce(obj->pwmHandle[cnt], 0x06 );    // one time set (the correct initialisation state)

    In pwm.c


    void PWM_setActionQualSWForce(PWM_Handle pwmHandle, unsigned int regVal)
    {
      PWM_Obj *pwm = (PWM_Obj *)pwmHandle;

      // write directly
      pwm->AQSFRC = regVal;

      return;
    } // end of PWM_setActionQualSWForce() function