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.

ePWM module Zero State Setting at Code Halt & IGBT Failure

I am using Mathworks Embedded Coder and Simulink to auto generate code from a control model that is downloaded to an F28335 processor for a motor control application. During debugging sessions, I frequently halted the code in code composer studio. This halting has led to a number of power stages (IRAM IGBTs) to fail because the ePWM modules, upon halting the code, don’t go to the zero vector state automatically. Instead one or more of the power stage legs will stay ON when I want all three phases to go all low (or all high – 000 or 111 states – i.e. zero vector states).

I’ve been reading up on the ePWM module in the Matlab help files, and in the TI ePWM documentation, and I just figured out a way to fix this issue. I'm posting it here, so that if others have this problem, they can look to this post for help.

Here's the code I added to the System Start block in my Simulink model:

/* Emulation Mode Bits */                                                                                                                                                   

EPwm1Regs.TBCTL.bit.FREE_SOFT = 0x0001;                                                                                                                                     

EPwm2Regs.TBCTL.bit.FREE_SOFT = 0x0001; 

EPwm3Regs.TBCTL.bit.FREE_SOFT = 0x0001;      

It changes the emulation mode bits to stop when a counter completes a whole cycle. This code sends my PWM logic signals to zero state 111. This is correlated to the "Free, soft" field of this register.

Also, for reference, look here for TI documentation on this register:

SPRUG04A–October 2008–Revised July 2009, TMS320x2833x, 2823x Enhanced Pulse Width Modulator (ePWM) Module, pg. 91