Skip to content

Commit

Permalink
Updating bemf observer for a more general implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Shobuj-Paul committed Feb 23, 2024
1 parent 6eb45af commit 384c878
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions include/observers/bemf_observer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class BemfObserver
const SetBemfParams& set_bemf_params,
const SetTrackerParams& set_tracker_params,
const ExtBemfParams& ext_bemf_params,
const ExtTrackerParams& ext_tracker_params, const uint8_t pos_obs_mode,
const uint8_t idle_mode, const uint8_t opmode, const uint8_t num_rotor_poles,
const uint8_t freq_mode, const bool force_bemf, const bool en_dis_6_step_comm);
const ExtTrackerParams& ext_tracker_params,
const uint8_t idle_mode, const uint8_t num_rotor_poles,
const bool force_bemf, const bool en_dis_6_step_comm);
};
} // namespace observers
11 changes: 5 additions & 6 deletions src/observers/bemf_observer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ observers::BemfOutput observers::BemfObserver::loop(const math::FrameABC& line_c
const SetBemfParams& set_bemf_params,
const SetTrackerParams& set_tracker_params,
const ExtBemfParams& ext_bemf_params,
const ExtTrackerParams& ext_tracker_params, const uint8_t pos_obs_mode,
const uint8_t idle_mode, const uint8_t opmode, const uint8_t num_rotor_poles,
const uint8_t freq_mode, const bool force_bemf, const bool en_dis_6_step_comm)
const ExtTrackerParams& ext_tracker_params,
const uint8_t idle_mode, const uint8_t num_rotor_poles,
const bool force_bemf, const bool en_dis_6_step_comm)
{
observers::BemfOutput output;

Expand Down Expand Up @@ -39,11 +39,11 @@ observers::BemfOutput observers::BemfObserver::loop(const math::FrameABC& line_c
}

dq_update.gains = observers::BemfGains(0.0001, 0.0001, 0.1, Ts, 0);
dq_update.config = [freq_mode, opmode, this]() {
dq_update.config = [this]() {
controllers::PIConfig config = { 0.1, 0.1, Ts, -180, 180 };
return config;
}();
tracker.config = [freq_mode, opmode, this]() {
tracker.config = [this]() {
controllers::PIConfig config = { 0.1, 0.1, Ts, -180, 180 };
return config;
}();
Expand Down Expand Up @@ -100,7 +100,6 @@ observers::BemfOutput observers::BemfObserver::loop(const math::FrameABC& line_c
}();

// Bemf Stability SMD
if (pos_obs_mode == 2) {}
if (idle_mode) {}
if (force_bemf) {}

Expand Down

0 comments on commit 384c878

Please sign in to comment.