Part Number:TMS320F280049COther Parts Discussed in Thread:C2000WARE
TI 案列 C:\ti\c2000\C2000Ware_DigitalPower_SDK_4_02_00_00\solutions\tidm_02008中锁相环 SPLL_1PH_SOGI_FLL_run()函数执行如下:
static inline void SPLL_1PH_SOGI_FLL_run(SPLL_1PH_SOGI_FLL *spll_obj, float32_t acValue)
{
float32_t osgx,osgy,temp;
//
// Update the spll_obj->u[0] with the grid value
//
spll_obj->u[0]=acValue;
//
// Orthogonal Signal Generator
//
spll_obj->osg_u[0]=(spll_obj->osg_coeff.osg_b0*
(spll_obj->u[0]-spll_obj->u[2])) +
(spll_obj->osg_coeff.osg_a1*spll_obj->osg_u[1]) +
(spll_obj->osg_coeff.osg_a2*spll_obj->osg_u[2]);
spll_obj->osg_u[2]=spll_obj->osg_u[1];
spll_obj->osg_u[1]=spll_obj->osg_u[0];
spll_obj->osg_qu[0]=(spll_obj->osg_coeff.osg_qb0*spll_obj->u[0]) +
(spll_obj->osg_coeff.osg_qb1*spll_obj->u[1]) +
(spll_obj->osg_coeff.osg_qb2*spll_obj->u[2]) +
(spll_obj->osg_coeff.osg_a1*spll_obj->osg_qu[1]) +
(spll_obj->osg_coeff.osg_a2*spll_obj->osg_qu[2]);
spll_obj->osg_qu[2]=spll_obj->osg_qu[1];
spll_obj->osg_qu[1]=spll_obj->osg_qu[0];
spll_obj->u[2]=spll_obj->u[1];
spll_obj->u[1]=spll_obj->u[0];
//
// Park Transform from alpha beta to d-q axis
//
spll_obj->u_Q[0]=(spll_obj->cosine*spll_obj->osg_u[0]) +
(spll_obj->sine*spll_obj->osg_qu[0]);
spll_obj->u_D[0]=(spll_obj->cosine*spll_obj->osg_qu[0]) –
(spll_obj->sine*spll_obj->osg_u[0]);
//
// Loop Filter
//
spll_obj->ylf[0]=spll_obj->ylf[1] +
(spll_obj->lpf_coeff.b0*spll_obj->u_Q[0]) +
(spll_obj->lpf_coeff.b1*spll_obj->u_Q[1]);
spll_obj->ylf[1]=spll_obj->ylf[0];
//spll_obj->ylf[0] = (spll_obj->ylf[0]>0.5)?0.5:spll_obj->ylf[0];
//spll_obj->ylf[0] = (spll_obj->ylf[0]<-0.5)?-0.5:spll_obj->ylf[0];
spll_obj->u_Q[1]=spll_obj->u_Q[0];
//
// VCO
//
spll_obj->fo=spll_obj->fn+spll_obj->ylf[0];
spll_obj->theta=spll_obj->theta + (spll_obj->fo*spll_obj->delta_t)*
(float32_t)(2.0*3.1415926f);
if(spll_obj->theta>(float32_t)(2.0*3.1415926f))
{
spll_obj->theta=spll_obj->theta-(float32_t)(2.0*3.1415926f);
}
spll_obj->sine=(float32_t)sinf(spll_obj->theta);
spll_obj->cosine=(float32_t)cosf(spll_obj->theta);
//
// FLL
//
spll_obj->ef2 = ((spll_obj->u[0] – spll_obj->osg_u[0])*spll_obj->osg_qu[0])
* spll_obj->gamma * spll_obj->delta_t*-1.0f;
spll_obj->x3[0]=spll_obj->x3[1] + spll_obj->ef2;
//spll_obj->x3[0]= (spll_obj->x3[0]>1.0)?1.0:spll_obj->x3[0];
//spll_obj->x3[0]= (spll_obj->x3[0]<-1.0)?-1.0:spll_obj->x3[0];
spll_obj->x3[1]=spll_obj->x3[0];
spll_obj->w_dash = spll_obj->wc + spll_obj->x3[0];
spll_obj->fn = spll_obj->w_dash / (2.0*3.1415926f);
osgx = (float32_t)(2.0f*spll_obj->k*spll_obj->w_dash*spll_obj->delta_t);
osgy = (float32_t)(spll_obj->w_dash * spll_obj->delta_t * spll_obj->w_dash *
spll_obj->delta_t);
temp = (float32_t)1.0f/(osgx+osgy+4.0f);
spll_obj->osg_coeff.osg_b0=((float32_t)osgx*temp);
spll_obj->osg_coeff.osg_b2=((float32_t)(-1.0f)*spll_obj->osg_coeff.osg_b0);
spll_obj->osg_coeff.osg_a1=((float32_t)(2.0f*(4.0f-osgy))*temp);
spll_obj->osg_coeff.osg_a2=((float32_t)(osgx-osgy-4)*temp);
spll_obj->osg_coeff.osg_qb0=((float32_t)(spll_obj->k*osgy)*temp);
spll_obj->osg_coeff.osg_qb1=(spll_obj->osg_coeff.osg_qb0*(float32_t)(2.0));
spll_obj->osg_coeff.osg_qb2=spll_obj->osg_coeff.osg_qb0;
}
红色部分FLL模块,用于实时更新OSGI的系数(b0、b1、a1、a2、qb0、qb1、qb2),我想知道FLL计算过程的原理或依据是什么?
我在《Software Phase Locked Loop Design Using C2000 Microcontrollers for Single Phase Grid Connected Inverter 》中没有找到相关的描述。
Yale Li:
file:///C:/ti/c2000/C2000Ware_DigitalPower_SDK_4_04_00_00/docs/html/dplib_html/group___s_p_l_l__1_p_h___s_o_g_i___f_l_l.html
请看一下Detailed Description部分。