Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

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/TMS320F28377S: C2000™ microcontrollers forum

Part Number: TMS320F28377S
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

i have been trying to develop spwm code for 3 phase inverter and have been partially successful. The code seems to work but it has an error of holding the high state for 4 periods (20k epwm freq).

the specs are:

20k epwm signal, 60hz sine wave (thus 333 LUT).

below is my workspace showing the sinewave's output. used the interrupt to access the LUT and update the compare values every time the carrier signal  reaches zero.

SPWM code 

Sope video and image

As can be seen in the above image, it maintains a 1 state for 4 periods of the carrier frequency.

any help is appreciated, thanks.

  • An SME has been notified and will respond. Thanks.

  • Hi,

    Is the duty saturating at the peak? What is the expected duty during those 4 cycles?
    It may just be due to the saturation of the duty at the peak.

    Also, are you using the sgen library?
    If not, please refer to C:\ti\c2000\C2000Ware_3_01_00_00\libraries\dsp\SGEN\c28

  • It seems to be the peak seeing that the pulses are increasing and decreasing just before and right after it.

    If peak saturation is the problem, any advice on how to fix it?  I was trying to avoid this, which is why i reduced the max value for the sin to 4000.

    No, am not using the sgen library. Tried to but it just wasn't working on the 28377s (and couldn't find examples for it, all the examples are for 2833x), a direction to any example or how to set it up for 28377s would be appreciated.

    I also tried uaing iqmath but was unsuccessful which made me resorted to just creating a sine LUT in the main.

    below is the sin values and i have also dded a youtube link of the scope output

    Your reply is very much appreciated, thanks.

  • You can view the CMPA values - which you are calculating and storing in b[index]. This should tell you why the values are saturating at certain cycles.

  • Hi, i did just that yesterday while at the lab.

    in the sine table i posted in my previous comment, from the 4th row, 11th column there are 4 repeated values of 3999 and also from the 10th row and column   3 repeated values of 0 (due to float values being rounded to integers). 

    could this in anyway be the problem?

  • Hi,

    the value of 3999 could not result in a complete high pulse, because it is smaller than the period you've used.
    It could be the duty value of zero resulting in the the high pulse.
    You can check and debug by changing this value, since you are using the table anyway - you can edit the table entries and root cause the problem.