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.

TMS320F28335: Sine PWM generation using F28335

Part Number: TMS320F28335


I have the same doubt as of that asked in this thread. 

"I'll be using 3 ePWM modules. PWM is brought about comparing the value of CMPA/CMPB to the TBCTR. The value of CMPA is modulated according to a sine wave of the desired frequency, while the triangular wave is the TBCTR counting up to TBPRD and down again (using Up-Down counter). Now, some of the code snippets I've seen around here use a 512 point look-up table which gives a 915 Hz sine signal, but I'm aiming for a 50-60 Hz signal. My switching frequency/PWM frequency is 10kHz. Assuming 60 Hz signal and 10 kHz PWM frequency, I'll need 167 data points, which I'm not sure how to get. "

Question 1.   To obtain a sine wave of frequency 50Hz using the 512 point look-up table restricts us to use a carrier wave frequency (Triangular Wave) of 25600Hz as (512)*(Time Period of the carrier wave) = (Timer Period of desired sine wave=0.02 seconds in my case). In case I want greater flexibility in choosing any desired sampling frequency "HOW IS IT POSSIBLE"? 

  • Anmol,

    I don't have much experience in this area, but:

    According to your post, the period of your carrier wave is a ratio of your sine wave period to your LUT size. If you would like to have a fixed sine wave period  and a variable carrier frequency you will need, assuming you have no other degrees of freedom, to adjust the size of your LUT.

    Maybe you could include several LUTs of different sizes in memory. Another possible solution is to include an algorithm to recalculate the LUT size and LUT values using math libraries and place the resulting LUT in RAM to be used with your PWM.

    Regards,
    Cody