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.

CCS/BOOSTXL-DRV8301: how to completely turn on/off a switches on an inverter leg, with addition of deadtime?

Part Number: BOOSTXL-DRV8301
Other Parts Discussed in Thread: CONTROLSUITE

Tool/software: Code Composer Studio

Hello,

I am trying to implement the direct torque control (DTC) algorithm on a PMSM and I am using BoostXL-DRV8301. I have looked at FOC examples of TI and as I understood, the interrupt is triggered at zero of Epwm1 and at its period ADCs are read. In DTC the switches are turned on and off completely at each sampling time. So the basic approach is to open and close the switches by setting or clearing each GPIO. So in order to incorporate the deadtime, I Clear all GPIOs and after some delay, I Set the GPIOs that I want, but the "fault" LED on the Boostxl-drv8301 turn on and then the program stops running, which I think is related to overcurrent protection.

So my questions:

1. Is it possible to use the same technique as the FOC and define GPIOs as PWMs? I tried doing that and for the CMPA value I gave PWM_period for switching on and "0" for switching off. In this case, I wasn't able to incorporate deadtime. Is there any way to do it?

Regards,

Ata

  • Ata,

    Can you tell us your goals with this design and the changes you are making? What's the application?

    Regards,

    -Adam

  • Adam,

    DTC is another approach for motor control. But as I said, contrary to FOC, the switches are not manipulated with PWM (specifically SVPWM). In DTC, the switches are either completely on or completely off for the sampling time. So suppose one leg of the three-phase inverter. The high switch is on and the low switch is off, then at the next sampling time the high switch should be off and low switch should be on and of course, there should be a deadtime to prevent shoot-through.

    So compared to examples of ControlSuite, I am using Epwm4 to trigger interrupt and go to the main_ISR to run the algorithm. Also I am defining GPIO0-5 as output, not PWMs so that I can set/clear them. ( Actually, I prefer to define them as PWMs, but I don't know how I should incorporate deadtime in that case. Note that if the duty cycle is not 0 or 100%, I know how to use deadtime but my problem is when I use duty cycle of 0 or 100% to open or close a switch).

    So my question is how to manipulate switches with 0 or 100% duty cycle and consider deadtime when switches change state.

    This is how I have implemented switching on/off the GPIOs for a certain switching mode in the system

    void mode1(void){
        GpioDataRegs.GPACLEAR.bit.GPIO0= 1;
        GpioDataRegs.GPACLEAR.bit.GPIO1= 1;
        GpioDataRegs.GPACLEAR.bit.GPIO2= 1;
        GpioDataRegs.GPACLEAR.bit.GPIO3= 1;
        GpioDataRegs.GPACLEAR.bit.GPIO4= 1;
        GpioDataRegs.GPACLEAR.bit.GPIO5= 1;
        delay_loop1();
    
        GpioDataRegs.GPASET.bit.GPIO0= 1;
        GpioDataRegs.GPACLEAR.bit.GPIO1= 1;
        GpioDataRegs.GPACLEAR.bit.GPIO2= 1;
        GpioDataRegs.GPASET.bit.GPIO3= 1;
        GpioDataRegs.GPACLEAR.bit.GPIO4= 1;
        GpioDataRegs.GPASET.bit.GPIO5= 1;
    
    }
    
    void Gpio_setup(void)
    {
        EALLOW;
        GpioCtrlRegs.GPAPUD.bit.GPIO0 = 0;
        GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 0;
        GpioCtrlRegs.GPADIR.bit.GPIO0 = 1;
    
        GpioCtrlRegs.GPAPUD.bit.GPIO1 = 0;
        GpioCtrlRegs.GPAMUX1.bit.GPIO1 = 0;
        GpioCtrlRegs.GPADIR.bit.GPIO1 = 1;
    
        GpioCtrlRegs.GPAPUD.bit.GPIO2 = 0;
        GpioCtrlRegs.GPAMUX1.bit.GPIO2 = 0;
        GpioCtrlRegs.GPADIR.bit.GPIO2 = 1;
    
        GpioCtrlRegs.GPAPUD.bit.GPIO3 = 0;
        GpioCtrlRegs.GPAMUX1.bit.GPIO3 = 0;
        GpioCtrlRegs.GPADIR.bit.GPIO3 = 1;
    
        GpioCtrlRegs.GPAPUD.bit.GPIO4 = 0;
        GpioCtrlRegs.GPAMUX1.bit.GPIO4 = 0;
        GpioCtrlRegs.GPADIR.bit.GPIO4 = 1;
    
        GpioCtrlRegs.GPAPUD.bit.GPIO5 = 0;
        GpioCtrlRegs.GPAMUX1.bit.GPIO5 = 0;
        GpioCtrlRegs.GPADIR.bit.GPIO5 = 1;
    
    
        GpioCtrlRegs.GPAPUD.bit.GPIO24 = 0;
        GpioCtrlRegs.GPAMUX2.bit.GPIO24 = 0;
        GpioCtrlRegs.GPADIR.bit.GPIO24 = 1;
    
        GpioCtrlRegs.GPDPUD.bit.GPIO124 = 0;
        GpioDataRegs.GPDSET.bit.GPIO124= 1;
        GpioCtrlRegs.GPDMUX2.bit.GPIO124 = 0;
        GpioCtrlRegs.GPDDIR.bit.GPIO124 =1;
    
    
    
        EDIS;
    
    
    }
    
    void delay_loop1(void)
    {
        long i;
        for (i = 0; i < delay_length1;  i++) {}
    }
    
    
    

    , which I think is slower than PWMs.

  • Ata,

    I am unable to support code debug, please post on the appropriate MCU forum.

    Regards,

    -Adam