#ifndef _SMO_OBSERVER_H__ #define _SMO_OBSERVER_H__ #include "foc/core/PI_Controller.h" typedef struct { float ts; float bandwith; //PLL带宽 float lpf_wc; //低通滤波截止频率 float lpf_ceof; //通过截止频率和采样率计算出的一阶低通滤波器系数 float Ksmo; //滑膜增益 float Ksta; //sigmoid 函数最大饱和 PLL_t pll; float pll_kp; float pll_ki; float pll_integrator; float pll_max_rad_pers; float Ialpha_hat; //估计alpha电流 float IBeta_hat; //估计beta电流 float est_eAlpha; //估计反电动势alpha float est_eBeta; //估计反电动势beta float est_eAlpha_Filted; float est_eBeta_Filted; bool dir_ccw; float est_angle; //degree float est_angle_out; float est_rad_pers; //每秒度数 float est_rad_pers_filted; float est_rpm; float motor_r; float motor_ld; float motor_lq; float motor_poles; }smo_observer_t; void smo_observer_init(float pll_bandwith, float lpf_wc, float Ksmo, float Ksta); float smo_observer_update(float uAlpha, float uBeta, float iAlpha, float iBeta); float smo_observer_angle(void); float smo_observer_vel(void); smo_observer_t *get_smo(void); #endif /* _SMO_OBSERVER_H__ */