Skip to content

Commit 411494c

Browse files
committed
Revert "Fixed the encoder offset calibration to work correctly when calib_scan_distance is not a multiple of 4pi"
This reverts commit b52cd87. Reverted fix - see `bug_fixes` branch instead
1 parent b52cd87 commit 411494c

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

CHANGELOG.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Unreleased Features
22
Please add a note of your changes below this heading if you make a Pull Request.
33

4-
### Changed
5-
Fixed the encoder offset calibration to work correctly when calib_scan_distance is not a multiple of 4pi
6-
74
# Releases
85
## [0.5.1] - 2020-09-27
96
### Added

Firmware/MotorControl/encoder.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,10 @@ bool Encoder::run_offset_calibration() {
202202
else
203203
return false;
204204

205-
// go to start position of forward scan for start_lock_duration to get ready to scan
205+
// go to motor zero phase for start_lock_duration to get ready to scan
206206
int i = 0;
207207
axis_->run_control_loop([&](){
208-
float phase = wrap_pm_pi(0 - config_.calib_scan_distance / 2.0f);
209-
float v_alpha = voltage_magnitude * our_arm_cos_f32(phase);
210-
float v_beta = voltage_magnitude * our_arm_sin_f32(phase);
211-
if (!axis_->motor_.enqueue_voltage_timings(v_alpha, v_beta))
208+
if (!axis_->motor_.enqueue_voltage_timings(voltage_magnitude, 0.0f))
212209
return false; // error set inside enqueue_voltage_timings
213210
axis_->motor_.log_timing(TIMING_LOG_ENC_CALIB);
214211
return ++i < start_lock_duration * current_meas_hz;

0 commit comments

Comments
 (0)