aci_fe.c
来自「异步电机矢量控制c源程序」· C语言 代码 · 共 69 行
C
69 行
/*=====================================================================================
File name: ACI_FE.C (IQ version)
Originator: Digital Control Systems Group
Texas Instruments
Description: Flux Estimator of Induction Motor
=====================================================================================
History:
-------------------------------------------------------------------------------------
04-15-2005 Version 3.20
12-15-2005 Version 3.22 : Change the sign in current model equation
-------------------------------------------------------------------------------------*/
#include "IQmathLib.h" // Include header for IQmath library
// Don't forget to set a proper GLOBAL_Q in "IQmathLib.h" file
#include "dmctype.h"
#include "aci_fe.h"
void aci_fe_calc(ACIFE *v)
{
_iq IDsE, Error, OldEmf;
// Park transformation on the measured stator current
IDsE = _IQmpy(v->IQsS,_IQsinPU(v->ThetaFlux));
IDsE += _IQmpy(v->IDsS,_IQcosPU(v->ThetaFlux));
// The current model section (Classical Rotor Flux Vector Control Equation)
v->FluxDrE = _IQmpy(v->K1,v->FluxDrE) + _IQmpy(v->K2,IDsE);
// Inverse park transformation on the rotor flux from the current model
v->FluxDrS = _IQmpy(v->FluxDrE,_IQcosPU(v->ThetaFlux));
v->FluxQrS = _IQmpy(v->FluxDrE,_IQsinPU(v->ThetaFlux));
// Compute the stator flux based on the rotor flux from current model
v->FluxDsS = _IQmpy(v->K3,v->FluxDrS) + _IQmpy(v->K4,v->IDsS);
v->FluxQsS = _IQmpy(v->K3,v->FluxQrS) + _IQmpy(v->K4,v->IQsS);
// Conventional PI controller section
Error = v->PsiDsS - v->FluxDsS;
v->UCompDsS = _IQmpy(v->Kp,Error) + v->UiDsS;
v->UiDsS = _IQmpy(v->Kp,_IQmpy(v->Ki,Error)) + v->UiDsS;
Error = v->PsiQsS - v->FluxQsS;
v->UCompQsS = _IQmpy(v->Kp,Error) + v->UiQsS;
v->UiQsS = _IQmpy(v->Kp,_IQmpy(v->Ki,Error)) + v->UiQsS;
// Compute the estimated stator flux based on the integral of back emf
OldEmf = v->EmfDsS;
v->EmfDsS = v->UDsS - v->UCompDsS - _IQmpy(v->K5,v->IDsS);
v->PsiDsS = v->PsiDsS + _IQmpy(_IQ(0.5),_IQmpy(v->K6,(v->EmfDsS + OldEmf)));
OldEmf = v->EmfQsS;
v->EmfQsS = v->UQsS - v->UCompQsS - _IQmpy(v->K5,v->IQsS);
v->PsiQsS = v->PsiQsS + _IQmpy(_IQ(0.5),_IQmpy(v->K6,(v->EmfQsS + OldEmf)));
// Compute the estimated rotor flux based on the stator flux from the integral of back emf
v->PsiDrS = _IQmpy(v->K7,v->PsiDsS) - _IQmpy(v->K8,v->IDsS);
v->PsiQrS = _IQmpy(v->K7,v->PsiQsS) - _IQmpy(v->K8,v->IQsS);
// Compute the rotor flux angle
v->ThetaFlux = _IQatan2PU(v->PsiQrS,v->PsiDrS);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?