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.

ON OFF control of PWM pins in F28335 controller

Hello everyone,

I need to implement a hysteresis current controller with 28335 DSP. My question is can I manually control the PWM pins of the DSP, based on the command from the hysteresis controller? In that way I can generate the ON signal for the upper switches of the inverter and the complementary signal with the desired dead time will be generated by the ePWM module.

Cheers,

Mohammad

  • Mohammed,

    You cannot do what you want automatically.  While you can force a PWM pin high or low, the complementary pin does not automatically follow nor will you get the deadband.

    How much deadband do you need?

    If you're needed deadband is very short, say less than 400 ns, you might as well just implement the whole thing manually.  USe the PWM in GPIO mode.  Flip one, wait the needed number of cycles (NOPs), and then flip the complementary pins.

    If you need more deadband than you are willing to sit and wait for, I can picture a manual scheme where you control one PWM in software (say, just a GPIO), and configure the complementary PWM to have a duty cycle equal to the deadband you need.  After setting the first PWM active, you would start the timer of the complementary PWM.  After the desired amount of time (set by the compare value), it would change states.  You'd set the compare equal to the needed deadband.  Since the compare is double buffered, you could also load a 0% or 100% duty value depending on whether you want the complementary PWM to stay high or low after the first cycle.  This 0/100% compare value would auto-load at the end of the first period.  See the picture?

    Regards,

    David

  • Thanks you so much David for the detailed response. It helps a lot. But unfortunately I can't see the picture, could you please attach it one more time?

    Regards,
    Mohammad
  • Mohammad,

    "See the picture" is a figure of speech.  I didn't actually attach a picture.  I meant "See what I'm describing?".  Please read my description of the PWM usage in my previous post again and see if you understand it.

    Regards,

    - David

  • Now I "see the picture"! :))
    Thanks again for your help.

    Mohammad
  • Hello everyone,

    After some time, I had a chance to get back to my project. I found an easy way for the task of this topic and wanted to share with others; it might be helpful.

    For ON and OFF control of a leg in an inverter, which is controlled with hysteresis current controller, I think the easiest way could be using the Action-qualifier Continuous Software Force Register (AQCSFRC) register of PWM modules. Using this register, each PWM output (EPWM1, 2, or...) can be forced to have the desired high or low value. As this is done using the EPWM module, the deadband will be set and can be applied to the inverter leg.

    Hope this helps you.

    Mohammad
  • Hi Mohammad,

    I use the output of a comparator to trip the PWMs of a F28377D, however as I have seen for trip events you can not use deadband module. So I was wondering how you implemented your controller. You use an if-condition for a trip event and afterwards you just force the switches? I tried to implement it but my effort was unsuccessful.

    Thanks,

    Panos

  • Hello Panos,

    In my code, I check for the hysteresis bands conditions in the PWM interrupt service routine. In the routine, if the conditions for assigning new values to the PWM pins is satisfied, I assign the desired values to the pins, using the action qualifier software forced registers as I described earlier. This method has some delays, but if the PWM is set to have enough high frequency, I believe this should work well.

    Regards,

    Mohammad