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.

controlSuite中SolarExplorer_PVInverter_F2803x的一个计算问题

在这个例程中,进入锁相环之前,为什么要把采样的交流电压除以2送给锁相环函数?如下面第二行代码

Vac_in=(long)((long)Vac_FB<<9)-Offset_Volt; // shift to convert to Q21

spll1.AC_input=Vac_in>>1;

SPLL_1ph_MACRO(spll1);

此外,后面计算中对电流、电压又有乘以2

inv_meas_cur_lleg1_inst=(((int32) Ileg1_fb) <<12)-_IQ24(0.5);
inv_meas_cur_lleg2_inst=(((int32) Ileg2_fb) <<12)-_IQ24(0.5);

inv_meas_cur_diff_inst = (inv_meas_cur_lleg1_inst - inv_meas_cur_lleg2_inst)<<1;

inv_meas_vol_inst =((long)((long)Vac_FB<<12)-_IQ24(0.5))<<1; // shift to convert to Q24