hi,8883.New Wordpad Document.doc
I tried to implement sinusoidal epwm technique using rtdx. For this, i generated a sine wave of freq 50 hz, amplitude 1 in matlab and biased it up by 1 to get 2vp-p from 0 to 2 v. i gave the sampling time as 0.002 and 10 samples to get a frequency of 50hz..
TBPRD of epwm was fixed at 37452. Counter-UP DOWN. CMPA values are given through an input port using rtdx. The CMPA values are the values of the sine wave samples which were generated as i told before.The TBPRD value will give the time period of the epwm wave as 0.002(it is equal to sampling time of the sine wave.) So each period of epwm waveform will have a duty cycle which corresponds to a CMPA value equal to the sine wave value multiplied by a constant.
using From rtdx, i gave the value 18726 in real time and multiplied it with the samples of sine wave so that the peak value of 2v would correspond to a CMPA value of 37452 and the other sine wave samples would be scaled accordingly.
In epwm block. i cleared the epwmA wave whent CTR=CAU and set the epwm wave when CTR=CAD.
But when i observed the output of the epwm, the duty cycle of the wave form was fixed. It was not varying even though the input CMPA values followed a sine wave pattern .
I read the values of the sine wave at the input port of epwm block using TO RTDX block and plotted them. They followed a sine wave pattern. This means that the sine wave samples were properly received at the dsp kit . but this is not shown in the form of varying duty cycles of the pwm output.
kindly help me..