#ifndef __ACIM_ESTIMATOR_HPP #define __ACIM_ESTIMATOR_HPP #include #include #include class AcimEstimator : public ComponentBase { public: struct Config_t { float slip_velocity = 14.706f; // [rad/s electrical] = 1/rotor_tau }; void update(uint32_t timestamp) final; // Config Config_t config_; // Inputs InputPort rotor_phase_src_; InputPort rotor_phase_vel_src_; InputPort idq_src_; // State variables bool active_ = false; uint32_t last_timestamp_ = 0; float rotor_flux_ = 0.0f; // [A] float phase_offset_ = 0.0f; // [A] // Outputs OutputPort slip_vel_ = 0.0f; // [rad/s electrical] OutputPort stator_phase_vel_ = 0.0f; // [rad/s] rotor flux angular velocity estimate OutputPort stator_phase_ = 0.0f; // [rad] rotor flux phase angle estimate }; #endif // __ACIM_ESTIMATOR_HPP