// initialize and configure offsets using filters
{
uint16_t cnt = 0;
_iq b0 = _IQ(gUserParams.offsetPole_rps/(float_t)gUserParams.ctrlFreq_Hz);
_iq a1 = (b0 – _IQ(1.0));
_iq b1 = _IQ(0.0);
for(cnt=0;cnt<6;cnt++)
{
filterHandle[cnt] = FILTER_FO_init(&filter[cnt],sizeof(filter[0]));
FILTER_FO_setDenCoeffs(filterHandle[cnt],a1);
FILTER_FO_setNumCoeffs(filterHandle[cnt],b0,b1);
FILTER_FO_setInitialConditions(filterHandle[cnt],_IQ(0.0),_IQ(0.0));
}
gMotorVars.Flag_enableOffsetcalc = false;
}
偏值的极点是 #define USER_OFFSET_POLE_rps (20.0) // 20.0 Default, do not change
#define USER_VOLTAGE_FILTER_POLE_Hz (364.682) 这是硬件的极点频率
为什么 滤波器的极点频率不用硬件的极点频率?