Other Parts Discussed in Thread: CONTROLSUITE, C2000WARE
Tool/software: Code Composer Studio
Dear Sir/ Madam,
I am trying to generate a sine wave using ramp generator object (available in solar library) using TMS320F28069-LAUNCH PAD .
Step 1. Interrupt created using EPWM interrupt at 50kHz.
Step2. Created a ramp generation object.
RAMPGEN_IQ rgen1;
Step3. Initiated the ramp generation object.
RAMPGEN_IQ_init(&rgen1);
rgen1.Freq = _IQ24(GRID_FREQ);
rgen1.StepAngleMax = _IQ24(1.0/INV_FREQ);
Step 4: Call the ramp generation macro from the service routine
RAMPGEN_IQ_MACRO(rgen1);
Step 5: Assign the output of the ramp generator to a variable to see the output (GLOBAL_Q=24),
tri=_IQ24toF(rgen1.Out);
## I got a proper ramp waveform in the tri variable, which start from zero to one and repeat.
Step 6. I tried to create a normal sin wave using the math library .
va_ref=sin(tri*2*PI);
## Here also I got proper sin waveform.
Step 7. Now, I tried to use IQ math library. (GLOBAL_Q=24), (InvSione initiated as _iq24)
InvSine = _IQsinPU(rgen1.Out);
### But here I am not able to get proper sinusoidal waveform. Whenever sin waveform is touching magniude '1', some distortion is initiating.
### I tried to use other tools from the library (i.e. SPLL and other), there also same distortion is coming.
- 1st case with normal sin from math library
2. second case "math.h" is removed from the project and sine generated with _IQsinPU function


