From 8c85d2fe79909f398445c91a64a51e0dbe8c0f0b Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Sat, 18 Jul 2020 19:05:34 -0700 Subject: [PATCH] Add TODOs Avoid transients when entering closed loop also on Circular position mode. Phase interpolation is snapping to hard. --- Firmware/MotorControl/axis.cpp | 1 + Firmware/MotorControl/encoder.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/Firmware/MotorControl/axis.cpp b/Firmware/MotorControl/axis.cpp index 1c7f8652..f66f8f32 100644 --- a/Firmware/MotorControl/axis.cpp +++ b/Firmware/MotorControl/axis.cpp @@ -319,6 +319,7 @@ bool Axis::run_closed_loop_control_loop() { } // To avoid any transient on startup, we intialize the setpoint to be the current position + // TODO: Also do this for circular position mode controller_.pos_setpoint_ = *controller_.pos_estimate_src_; controller_.input_pos_ = *controller_.pos_estimate_src_; diff --git a/Firmware/MotorControl/encoder.cpp b/Firmware/MotorControl/encoder.cpp index 65bdd662..97801945 100644 --- a/Firmware/MotorControl/encoder.cpp +++ b/Firmware/MotorControl/encoder.cpp @@ -529,6 +529,7 @@ bool Encoder::update() { if (snap_to_zero_vel || !config_.enable_phase_interpolation) { interpolation_ = 0.5f; // reset interpolation if encoder edge comes + // TODO: This isn't correct. At high velocities the first phase in this count may very well not be at the edge. } else if (delta_enc > 0) { interpolation_ = 0.0f; } else if (delta_enc < 0) {