📄 aci_se.c
字号:
/*=====================================================================================
File name: ACI_SE.C (IQ version)
Originator: Digital Control Systems Group
Texas Instruments
Description: Open-loop Speed Estimator of Induction Motor
=====================================================================================
History:
-------------------------------------------------------------------------------------
05-15-2002 Release Rev 1.0
-------------------------------------------------------------------------------------*/
#include "IQmathLib.h" /* Include header for IQmath library */
/* Don't forget to set a proper GLOBAL_Q in "IQmathLib.h" file */
#include "aci_se.h"
void aci_se_calc(ACISE *v)
{
_iq w_slip, w_syn;
/* Slip computation */
v->psi_r_2 = _IQmpy(v->psi_dr_se,v->psi_dr_se)+_IQmpy(v->psi_qr_se,v->psi_qr_se);
w_slip = _IQmpy(v->K1_se,(_IQmpy(v->psi_dr_se,v->i_qs_se) - _IQmpy(v->psi_qr_se,v->i_ds_se)));
w_slip = _IQdiv(w_slip,v->psi_r_2);
/* Synchronous speed computation */
if ((v->theta_r_se < DIFF_MAX_LIMIT)&(v->theta_r_se > DIFF_MIN_LIMIT))
/* Q21 = Q21*(GLOBAL_Q-GLOBAL_Q) */
w_syn = _IQmpy(v->K2_se,(v->theta_r_se - v->theta_r_old));
else w_syn = v->wr_psi_r;
/* low-pass filter */
/* Q21 = GLOBAL_Q*Q21 + GLOBAL_Q*Q21 */
v->wr_psi_r = _IQmpy(v->K3_se,v->wr_psi_r) + _IQmpy(v->K4_se,w_syn);
v->theta_r_old = v->theta_r_se;
/* Q21 = Q21 - GLOBAL_Q */
v->wr_hat_se = v->wr_psi_r - _IQtoIQ21(w_slip);
if (v->wr_hat_se>_IQ21(1))
v->wr_hat_se = _IQ(1);
else if (v->wr_hat_se<_IQ21(-1))
v->wr_hat_se = _IQ(-1);
else
v->wr_hat_se = _IQ21toIQ(v->wr_hat_se);
/* Q0 = Q0*GLOBAL_Q => _IQXmpy(), X = GLOBAL_Q */
v->wr_hat_rpm_se = _IQmpy(v->base_rpm_se,v->wr_hat_se);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -