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.
Tool/software:
Hello,
We are using TMS320F280049C Microcontroller for Inverter applications were we are converting DC to AC. But the output current is not stable it is varying with respect to input voltage after we start the inverter without any load (NO-LOAD) . When we Start Inverter without load and the input voltage range we are varying 350 - 450 then the values are in between 1000mA - 4000ma and after applying load we are getting 1A difference. Here is the code
int Ifb_V;
int Ifb_U;
int Ifb_V_real;
int Ifb_U_real;
long ISqrtSum_U;
long ISqrtSum_V;
int Ifb_V_rms;
int Ifb_U_rms;
int Ifb_V_rms_f;
int Ifb_U_rms_f;
float32_t ifb_v_real, ifb_u_real, ifb_total;
/************************ this part of code is in main loop **********************/
Sum2 += AdcbResultRegs.ADCRESULT4;
Sum2 += AdcbResultRegs.ADCRESULT5;
Sum2 += AdcbResultRegs.ADCRESULT6;
Sum2 += AdcbResultRegs.ADCRESULT7;
// calculate the midpoint of Iac_U
Sum3 += AdcaResultRegs.ADCRESULT0;
Sum3 += AdcaResultRegs.ADCRESULT1;
Sum3 += AdcaResultRegs.ADCRESULT2;
Sum3 += AdcaResultRegs.ADCRESULT3;
Ifb_V_ref = Sum2 >> 2; //get reference of Ifb_V channel
Ifb_U_ref = Sum3 >> 2; // get reference of Ifb_U channel
interrupt void epwm1_isr(void)
{
Ifb_V = AdcbResultRegs.ADCRESULT2;
Ifb_U = AdcaResultRegs.ADCRESULT1;
Ifb_V = (int) Ifb_V_ref - Ifb_V; //-30
Ifb_U = Ifb_U - Ifb_U_ref; //+30
Ifb_V_real = (int) (((long) Ifb_V * 85) >> 9); //34.158*1499/512 =10, 1 for 0.01A
Ifb_U_real = (int) (((long) Ifb_U * 85) >> 9); //34.158*1499/512 =10, 1 for 0.01A
ifb_v_real = (float32_t) Ifb_V_real;
ifb_u_real = (float32_t) Ifb_U_real;
ifb_total = ifb_v_real - ifb_u_real; // Not needed
if (abs(Ifb_V_real) > Ifb_real_max)
{
Ifb_real_max = abs(Ifb_V_real);
}
if (abs(Ifb_U_real) > Ifb_real_max)
{
Ifb_real_max = abs(Ifb_U_real);
}
ISqrtSum_U += (long) (Ifb_U_real) * (Ifb_U_real);
ISqrtSum_V += (long) (Ifb_V_real) * (Ifb_V_real);
tempI1 = (ISqrtSum_U * 41) >> 12;
Ifb_U_rms = _IQ1sqrt(tempI1);
Ifb_U_rms = (Ifb_U_rms >> 1);
Ifb_U_rms_f += ((Ifb_U_rms - Ifb_U_rms_f) >> 2);
tempI2 = (ISqrtSum_V * 41) >> 12;
Ifb_V_rms = _IQ1sqrt(tempI2);
Ifb_V_rms = (Ifb_V_rms >> 1);
Ifb_V_rms_f += ((Ifb_V_rms - Ifb_V_rms_f) >> 2);
}
/****************** This is in other function where we are calculating current *******************/
curr_rms_print = (int) (_IQ1int(((Ifb_V_rms_f + Ifb_U_rms_f) >> 1)) >> 1);
curr_rms_print *= 1000; //converting current to mA
void initGlobalVariables(void)
{
ISqrtSum_U = 0;
ISqrtSum_V = 0;
Ifb_V_rms = 0;
Ifb_U_rms = 0;
Ifb_V_rms_f = 0;
Ifb_U_rms_f = 0;
ifb_v_real = 0.0f;
ifb_u_real = 0.0f;
ifb_total = 0.0f;
}
Regards,
Swaminadhan
Hi,
Please allow me a few days to get back to you.
Best Regards,
Ben Collier
Hi,
I am very sorry about the delay, and you still experiencing this issue?
Thank you,
Ben Collier
Hi Ben Collier,
Yes still I am facing that issue. when ever we start inverter in no-load connected the current reading we are getting different values at different voltages that is also in between 340-450 Vdc. After inverter is started then we apply load then it is showing 1A different with actual current value.
Best Regards,
Swaminadhan
Hi,
Why do you think this is a problem with the ADC accuracy? Are you measuring the voltage some other way?
Thanks,
Ben Collier
Hi,
Switching transients in power electronics causing Noise and EMI. Noise can couple into the ADC input lines causing inaccurate readings. Actually we have observed that when inverter is ON without load then different values we are getting when load is connected then different values we are getting. And we also observed that the in the output current waveform.
Thanks,
Swaminadhan
Ok, I understand, this sounds like a system problem rather than a problem with the ADC itself. That is what I was trying to get at, so I can ask for help from the right person.