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.
Hi, I'm designing a H-bridge stand alone inverter as my final graduation project. To do the control of my inverter I am going to use a TMS320F28069M DSP. However, I'm really new to DSPs and I would like to know if I correctly understood how to generate a SPWM with the microcontroller. Analogically, the way to get the SPWM is to compare a sine wave to a triangular wave. So, my idea is use the TBCNTR as the triangular wave with amplitude TBPRD and the CMPA as the instantaneous sine wave value. This idea is based in the attached image that can be found in SPRUH18G file.
The way I've found to do so is to configurate the ePWM module as Time-Based and, at every time the TBCNTR reaches CMPA and timer is decrementing, value trigger an interrupt and inside the interrupt code change the CMPA value to the new duty cycle, that will probably be based in a sine table.
So, I just would like to know if the algorithm that I've just suggested is correct or if there is some detail about the ePWM interrupt event that would make the algorithm not to work.
Thanks in advance,
Rafael.
Rafael,
I'm sorry for the delay in responding to your post.
You have correctly described the simplest way to implement SPWM using the C28x PWM architecture. You will need to generate a look-up table to modulate the CMPA compare register, configure the time-base period, and set up the PWM registers. The ISR would simply read the next value in your LUT, possibly scale it, and write it to the CMPA register.
There isn't a code example which does exactly this, but you may like to look at the inverter examples in the "development_kits" sub-directory in controlSUITE. ou can find some useful training resources for the F28069 device here:
http://processors.wiki.ti.com/index.php/C2000_Archived_Workshops
I hope this helps.
Regards,
Richard
Rafael,
I wanted to add we have implemented a sine wave look-up table to labs in the latest F28377D workshops.
The 1-day workshop has this in lab 4:
http://processors.wiki.ti.com/index.php/C2000_One-Day_Workshop
The 3-day workshop shows it in lab11:
http://processors.wiki.ti.com/index.php/C2000_Multi-Day_Workshop
Regards,
Richard