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.

SM320F28335-EP: Drive (epwm) enable/disable.....

Part Number: SM320F28335-EP
Other Parts Discussed in Thread: C2000WARE

What is the best way to disable my drive when using this part?  Should I turn off the epwm signals and if so how?  I know I can force trip errors but I want to keep actual faults separate.  Thanks

  • Hi Mark,

    There are several ways you could turn off the EPWM signals. What are your conditions to disable the output (i.e. what other input signals would be the source you want to trigger the output to go low? Or what circumstances?)? Could you also perhaps elaborate a bit on what you mean by "want to keep actual faults separate"? A bit more context here can help to decide how to implement turning off the target EPWM. 

    If you are interested in shutting of the EPWM due to over-current or short circuit situations, I would read into utilizing EPWM Trip Zone submodule as a starting point and looking at some of the EPWM examples we have in C2000Ware for the device.

    Best Regards,

    Allison

  • Thanks for the reply Allison, our drives can be disabled either by a user command or a fault.  As you mentioned a short circuit fault is one of those and i am using the trip zone feature as you suggested to turn off the bridge - this is a new feature using trip zones.  But if the user commands the drive "off" what is the best way to disable the bridge than forcing a trip zone?  "I guess I could switch the epwm outputs back to gpios and set them inactive or maybe I could set my control loop to command 0 current or something like that. Right now in the current code when the user commands the drive to disable we force a trip zone which turns the transistors off but since i am adding an overcurrent trip zone feature i cant distinguish between a real fault trip zone or the forced trip zone and each is treated differently.  So i was thinking if i disable the drive (set the epwms inactive) a different way I could use the overcurrent trip zone feature as intended.  See what you think. 

    Thanks

  • Hi Mark

    Thanks for the helpful description! Glad you are able to utilize Trip Zone for your application. Could you also give some details on how the short circuit fault signal is routed in to the device and Trip Zone (i.e. is the a GPIO or perhaps set through CMPSS? Are you shutting off the ePWM as a one-shot or cycle-by-cycle basis?

    If the fault signal is some signal going high or low on a GPIO, I might suggest utilizing eCAP and/or CLB (if you are ok with using the Trip Zone to turn off the ePWM by both user command and fault detect but want to know when a fault occurs, you can use eCAP to detect the rising or falling edge of the fault signal and carry out actions in an interrupt or via CLB to indicate the fault). Just let me know if this is what you are targeting.

    Best Regards,

    Allison

  • The short fault is routed through tz3 which is configured to set to one shot disable epwm1-3.  How do most people turn their drives off (epwm bridge inactive) in response to a user command and not a fault?  thanks

  • Does the 335 have a clb or cmpss?  thanks

  • Hi Mark, apologies I was just working with a different device on this. F28335 does not have CLB or CMPSS. But you could utilize eCAP to detect a signal edge and generate an interrupt if you are trying to go that route as I mentioned. But from your response it seems you actually want two completely separate methods of turning off the EPWMs, is that correct? And can I ask what you meant by disabling by "user command"?

    Best Regards,

    Allison

  • You are correct, i was hoping to disable the bridge (epwm inactive) without forcing a trip zone and am not sure how.  By 'use command' I mean a person commands the drive "off" rather than a self detected fault.  Thanks

  • Hi Mark, 

    Thanks for the explanation. If you keep using the Trip Zone for fault detection to shut off the EPWM, you could try also implementing an asynchronous Action Qualifier software forced event to clear the EPWM output low as second method - so use TZ for faults and AQ s/w force for user command. Would this work for what you are targeting in your setup?

    Best Regards,

    Allison

  • Mark, here is another post with some other details below. Note that it is for a newer device, so there are some EPWM submodules and other notes in there that do not apply for you (e.g. there is no digital compare in F28335 so you don't have to worry about that overriding the AQ force signal), but still wanted to share with you in case you find it useful!

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/946021/tms320f280049-methods-to-enable-or-disable-pwm-output

  • Thanks i will look at this.. what about if i switch the epwm out back to a gpio and i set the output such that the bridge is inactive.  Then back to epwm when i want to control the motor again.  Thanks

  • Hi Mark, 

    As also mentioned in that previous thread I linked, you can use the GPIO muxing as a way to disable the EPWM output. There is a similar case to this described in the following past E2E thread as well, but using a GPIO as a switch to turn the EPWM off: https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/534142/f28377xs-implementing-a-switch-to-enable-disable-pwms, although this is not a common method of turning off your EPWM. 

    My recommendation would typically be to use the TZ when you can. If it is a simple manner of knowing what the source of the trip was (fault vs. user command), you could still try implementing eCAP or using the TZ and AQ force as your two methods or creating your own software flag.

    Best Regards,

    Allison