mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-02-08 08:21:52 +08:00
make hall calib 30s by default
This commit is contained in:
@@ -259,7 +259,7 @@ bool Encoder::run_hall_polarity_calibration() {
|
||||
|
||||
bool Encoder::run_hall_phase_calibration() {
|
||||
Axis::LockinConfig_t lockin_config = axis_->config_.calibration_lockin;
|
||||
lockin_config.finish_distance = lockin_config.vel * 10.0f; // run for 10 seconds
|
||||
lockin_config.finish_distance = lockin_config.vel * 30.0f; // run for 30 seconds
|
||||
lockin_config.finish_on_distance = true;
|
||||
lockin_config.finish_on_enc_idx = false;
|
||||
lockin_config.finish_on_vel = false;
|
||||
@@ -760,6 +760,7 @@ bool Encoder::update() {
|
||||
float delta_pos_counts = (float)(shadow_count_ - encoder_model(pos_estimate_counts_));
|
||||
float delta_pos_cpr_counts = (float)(count_in_cpr_ - encoder_model(pos_cpr_counts_));
|
||||
delta_pos_cpr_counts = wrap_pm(delta_pos_cpr_counts, (float)(config_.cpr));
|
||||
delta_pos_cpr_counts_ += 0.1f * (delta_pos_cpr_counts - delta_pos_cpr_counts_); // for debug
|
||||
// pll feedback
|
||||
pos_estimate_counts_ += current_meas_period * pll_kp_ * delta_pos_counts;
|
||||
pos_cpr_counts_ += current_meas_period * pll_kp_ * delta_pos_cpr_counts;
|
||||
|
||||
@@ -99,6 +99,7 @@ public:
|
||||
OutputPort<float> phase_vel_ = 0.0f; // [rad/s]
|
||||
float pos_estimate_counts_ = 0.0f; // [count]
|
||||
float pos_cpr_counts_ = 0.0f; // [count]
|
||||
float delta_pos_cpr_counts_ = 0.0f; // [count] phase detector result for debug
|
||||
float vel_estimate_counts_ = 0.0f; // [count/s]
|
||||
float pll_kp_ = 0.0f; // [count/s / count]
|
||||
float pll_ki_ = 0.0f; // [(count/s^2) / count]
|
||||
|
||||
@@ -974,6 +974,7 @@ interfaces:
|
||||
pos_estimate: {type: readonly float32, c_getter: pos_estimate_.get_any().value_or(0.0f)}
|
||||
pos_estimate_counts: readonly float32
|
||||
pos_cpr_counts: readonly float32
|
||||
delta_pos_cpr_counts: readonly float32
|
||||
pos_circular: {type: readonly float32, c_getter: pos_circular_.get_any().value_or(0.0f)}
|
||||
hall_state: readonly uint8
|
||||
vel_estimate: {type: readonly float32, c_getter: vel_estimate_.get_any().value_or(0.0f)}
|
||||
|
||||
Reference in New Issue
Block a user