spinTAC-Motion中IPARK变换前面有个位置角的补偿,这个是什么原理
Eric Ma:
没看到你说的角度补偿,麻烦附图并说明清楚。
Eric
,
user6513239:
就是这一块,很疑惑,具体如何计算出来的补偿角度也不是很理解
,
user6513239:
就是这一块。并且这个补偿角度如何计算出来的也不是很理解,望解答。
,
user6513239:
{_iq angleComp_pu;
// compensate angle delayangleComp_pu = CTRL_angleDelayComp(handle, angle_pu);//位置角度补偿
// compute the sin/cos phasorCTRL_computePhasor(angleComp_pu,&phasor);}
// set the phasor in the inverse Park transformIPARK_setPhasor(obj->iparkHandle,&phasor);
// run the inverse Park moduleIPARK_run(obj->iparkHandle,CTRL_getVdq_out_addr(handle),CTRL_getVab_out_addr(handle));
// run the space Vector Generator (SVGEN) moduleSVGEN_run(obj->svgenHandle,CTRL_getVab_out_addr(handle),&(pPwmData->Tabc));
——————————————————————————————————
位置角度补偿函数inline _iq CTRL_angleDelayComp(CTRL_Handle handle, const _iq angle_pu)
{CTRL_Obj *obj = (CTRL_Obj *)handle;_iq angleDelta_pu = _IQmpy(EST_getFm_pu(obj->estHandle),_IQ(USER_IQ_FULL_SCALE_FREQ_Hz/(USER_PWM_FREQ_kHz*1000.0)));_iq angleUncomp_pu = angle_pu;_iq angleCompFactor = _IQ(1.0 + (float_t)USER_NUM_PWM_TICKS_PER_ISR_TICK * (float_t)USER_NUM_ISR_TICKS_PER_CTRL_TICK * ((float_t)USER_NUM_CTRL_TICKS_PER_EST_TICK – 0.5));_iq angleDeltaComp_pu = _IQmpy(angleDelta_pu, angleCompFactor);uint32_t angleMask = ((uint32_t)0xFFFFFFFF >> (32 – GLOBAL_Q));_iq angleTmp_pu;_iq angleComp_pu;
// increment the angleangleTmp_pu = angleUncomp_pu + angleDeltaComp_pu;
// mask the angle for wrap around// note: must account for the sign of the angleangleComp_pu = _IQabs(angleTmp_pu) & angleMask;
// account for signif(angleTmp_pu < 0){angleComp_pu = -angleComp_pu;}
return(angleComp_pu);
}