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.

spinTAC-Motion中IPARK变换前面有个位置角的补偿,这个是什么原理



spinTAC-Motion中IPARK变换前面有个位置角的补偿,这个是什么原理

  • 没看到你说的角度补偿,麻烦附图并说明清楚。

    Eric

  • 就是这一块,很疑惑,具体如何计算出来的补偿角度也不是很理解

  • 就是这一块。并且这个补偿角度如何计算出来的也不是很理解,望解答。

  • {
    _iq angleComp_pu;


    // compensate angle delay
    angleComp_pu = CTRL_angleDelayComp(handle, angle_pu);//位置角度补偿


    // compute the sin/cos phasor
    CTRL_computePhasor(angleComp_pu,&phasor);
    }


    // set the phasor in the inverse Park transform
    IPARK_setPhasor(obj->iparkHandle,&phasor);


    // run the inverse Park module
    IPARK_run(obj->iparkHandle,CTRL_getVdq_out_addr(handle),CTRL_getVab_out_addr(handle));


    // run the space Vector Generator (SVGEN) module
    SVGEN_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 angle
    angleTmp_pu = angleUncomp_pu + angleDeltaComp_pu;

    // mask the angle for wrap around
    // note: must account for the sign of the angle
    angleComp_pu = _IQabs(angleTmp_pu) & angleMask;

    // account for sign
    if(angleTmp_pu < 0)
    {
    angleComp_pu = -angleComp_pu;
    }

    return(angleComp_pu);
    }