expose sensorless estimator on protocol

This commit is contained in:
Samuel Sadok
2018-03-23 17:10:02 -07:00
parent 69e1b5331a
commit 09b8201868
2 changed files with 14 additions and 1 deletions
+2 -1
View File
@@ -184,7 +184,8 @@ public:
),
make_protocol_object("motor", motor_.make_protocol_definitions()),
make_protocol_object("controller", controller_.make_protocol_definitions()),
make_protocol_object("encoder", encoder_.make_protocol_definitions())
make_protocol_object("encoder", encoder_.make_protocol_definitions()),
make_protocol_object("sensorless_estimator", sensorless_estimator_.make_protocol_definitions())
);
}
};
@@ -26,6 +26,18 @@ public:
float V_alpha_beta_memory_[2] = {0.0f, 0.0f}; // [V]
float pm_flux_linkage_ = 1.58e-3f; // [V / (rad/s)] { 5.51328895422 / (<pole pairs> * <rpm/v>) }
bool estimator_good_ = false;
// Communication protocol definitions
auto make_protocol_definitions() {
return make_protocol_member_list(
make_protocol_property("error", &error_),
make_protocol_property("phase", &phase_),
make_protocol_property("pll_pos", &pll_pos_),
make_protocol_property("pll_vel", &pll_vel_),
make_protocol_property("pll_kp", &pll_kp_),
make_protocol_property("pll_ki", &pll_ki_)
);
}
};
#endif /* __SENSORLESS_ESTIMATOR_HPP */