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.

TMS320F28035: current consideration in ramp sine generation

Part Number: TMS320F28035


Hi,

I have generated sine using ramp library as below:

/***init***/
#define GRID_FREQ    50
#define INV_FREQ    12800.0

RAMPGEN_IQ rgen1;

RAMPGEN_IQ_init(&rgen1);
rgen1.Freq = _IQ24(GRID_FREQ);
rgen1.StepAngleMax = _IQ24(1.0/INV_FREQ);


/****Int_ISR()*****/
//Read ADC of current on ISR
inv_meas_cur_inst = ((int32)((int32) IINV_FB << 12) - offset_GridCurrent) << 1;

RAMPGEN_IQ_MACRO(rgen1);
IntSineRampgen = _IQsinPU(rgen1.Out);
duty_inv_pu=_IQ24mpy(IntSineRampgen,InvModIndex);

duty_inv_pu= (duty_inv_pu>_IQ24(1.0))?_IQ24(1.0):duty_inv_pu;
duty_inv_pu= (duty_inv_pu<_IQ24(-1.0))?_IQ24(-1.0):duty_inv_pu;
duty_inv = _IQ24mpy((long)(INV_PWM_PERIOD),_IQ24abs(duty_inv_pu));


I have take CT input  on ADC for current measurement.
I want to add current input to my output sine so It can balance voltage using current input.
Please guide me how can i add current input on ramp sine.

Thanks,