add phase_interpolation_min_vel setting

This commit is contained in:
Samuel Sadok
2020-12-15 15:02:34 +01:00
parent f4007a6909
commit 8068c18aaa
3 changed files with 7 additions and 0 deletions
+3
View File
@@ -792,6 +792,9 @@ bool Encoder::update() {
vel_estimate_counts_ = 0.0f; //align delta-sigma on zero to prevent jitter
snap_to_zero_vel = true;
}
if (std::abs(vel_estimate_counts_ / (float)config_.cpr) < config_.phase_interpolation_min_vel) {
snap_to_zero_vel = true;
}
// Outputs from Encoder for Controller
pos_estimate_ = pos_estimate_counts_ / (float)config_.cpr;
+1
View File
@@ -35,6 +35,7 @@ public:
int32_t direction = 0; // direction with respect to motor
bool use_index_offset = true;
bool enable_phase_interpolation = true; // Use velocity to interpolate inside the count state
float phase_interpolation_min_vel = 0.0f;
bool find_idx_on_lockin_only = false; // Only be sensitive during lockin scan constant vel state
bool ignore_illegal_hall_state = false; // dont error on bad states like 000 or 111
uint8_t hall_polarity = 0;
+3
View File
@@ -981,6 +981,9 @@ interfaces:
direction: int32
pre_calibrated: {type: bool, c_setter: set_pre_calibrated}
enable_phase_interpolation: bool
phase_interpolation_min_vel:
type: float32
unit: turns/s
bandwidth: {type: float32, c_setter: set_bandwidth}
calib_range: float32
calib_scan_distance: float32