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/TMS320F28379D: TMS320F28379D hysteresis controller

Part Number: TMS320F28379D


Tool/software: Code Composer Studio

I need to build a hysteresis current controller for the single phase inverter system. A function generator will provide the reference current signal , to compared with current signal obtained by the LEM current from the device. A analog comparator system will compare with these two signals to produce a complementary PWM signal ( bipolar PWM) to control the inverter. A RL load is connect in the inverter Ac side. The DC side will be connnected to a DC source (30V). My question will be : 

1) How can i implement the hysteresis controller band , i am think about use the software level: ADC two signals simutanously and produce a error, if the error is bigger than 0.1 (for example)... and if error is smalller than 0.1.... For the analogue circuity, it seems to be difficult to define a prefered hysteresis band range. And if anyone think analog method is effective, could you explain me how in detail

2) The output will be used to control the PWM to produce a complementatry PWM signal to control the inverter, can i ask how to acheive the aim, if someone can describe me briefly. 

Thank you very much.

  • Min,

    Unfortunately the scope of support we can offer we cannot detail each and every item you will need to consider, as that is part of your engineering development. We can offer general directions.

    Ultimately what you will use will depend on the specifics of your system, the frequency limits etc

    1. You might not need function generator
    2. On C2000 we have dual comparators i.e. high and low in the CMPSS, which you can use to construct a hysteresis band
    3. They can generate a CMPSS_H and CMPSS_L signals that can be used to change the PWM pattern
    4. Dead band can be inserted by the PWM deadband module

    but here the specifics of the frequency etc will be important to consider in how you configure the PWM.

    You will have to play with the PWM module and the CMPSS and learn.

    You can use the control card to get started for the F283779, initially use a function generator to feed the ADC pin and see PWM behavior out .. and check if it meets expectation
  • Hi Min,

    I'm doing the same stuff. Have you found anything helpful? Maybe we can share some thoughts together.

    So far as I know is that you can use the interior analog comparator sub-system CMPSS in DSP to compare your "error" with your 0.1 value. Each CMPSS has two comparators COMPH and COMPL. COMPH will compare your error with 0.1, when the error is higher than 0.1, COMPH's output CTRIPH will set to 1. Similarly, COMPH's output CTRIPL is 1 when error is smaller than 0.1. You will need to set the configuration up according to CMPSS trip ePWM in the technical reference manual. Then CTRIPH and CTRIpL signals are sent to ePWM's Digital Compare (DC) sub-module, the DC sub-module can be configured to generate DCAEVT and DCBEVT signals based on your CTRIPH and CTRIPL signals. Finally, DCAEVT and DCBEVT can be configured to connect with T1 and T2 of the Action Qualifier module, so it will force ePWM siganl to be generated at the time you want. Also, you can setup Deadband module whatever you want. Please let me know if you have any thoughts.

    Regards,



    Hang Li
  • THe software forced registor in PWM seems to be easier, you don't have to use the comparator, i think
  • Is it fast enough? I tried software force with single phase inverter before, it seems work, but when I want to adjust the band, the band seems reach a limit. It wouldn't change, no matter what error value you enter in the DSP.
  • I am using a fixed hysteresis band so i don't have that concern, i am OK with the speed, i only have 1KHZ PWM perhaps.
  • Hi i dont know if i can have a code fragment example from your side, especially with the comparator and trip side.
  • I haven't developed a full code yet, please take a peek at this thread: 

  • Hi, i am trying to do with the software forced one , i got lots of issues, i don't know if i can have partial of the code fragment, especially the main code part.