mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-21 23:44:48 +08:00
Reset vel_integrator_current when going into closed loop mode
This commit is contained in:
@@ -302,6 +302,10 @@ bool Axis::run_sensorless_control_loop() {
|
||||
bool Axis::run_closed_loop_control_loop() {
|
||||
// To avoid any transient on startup, we intialize the setpoint to be the current position
|
||||
controller_.pos_setpoint_ = encoder_.pos_estimate_;
|
||||
|
||||
// Avoid integrator windup issues
|
||||
controller_.vel_integrator_current_ = 0.0f;
|
||||
|
||||
set_step_dir_active(config_.enable_step_dir);
|
||||
run_control_loop([this]() {
|
||||
// Note that all estimators are updated in the loop prefix in run_control_loop
|
||||
|
||||
Reference in New Issue
Block a user