update encoder during calib

This commit is contained in:
Oskar Weigl
2018-04-26 13:46:47 -07:00
parent 4420d3873a
commit 7d6ddc96b2
3 changed files with 7 additions and 1 deletions
+2
View File
@@ -148,6 +148,8 @@ bool Encoder::run_offset_calibration() {
// scan forward
i = 0;
axis_->run_control_loop([&](){
axis_->encoder_.update(nullptr, nullptr, nullptr);
float phase = wrap_pm_pi(scan_distance * (float)i / (float)num_steps - scan_distance / 2.0f);
float v_alpha = voltage_magnitude * arm_cos_f32(phase);
float v_beta = voltage_magnitude * arm_sin_f32(phase);