mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-10 13:16:23 +08:00
Add compensation term for axis debounce during homing
This commit is contained in:
@@ -320,7 +320,7 @@ bool Axis::run_closed_loop_control_loop() {
|
||||
controller_.vel_setpoint_ = 0.0f; // Change directions without decelerating
|
||||
|
||||
// Set our current position in encoder counts to make control more logical
|
||||
encoder_.set_linear_count(min_endstop_.config_.offset);
|
||||
encoder_.set_linear_count(min_endstop_.config_.offset - static_cast<int32_t>(controller_.config_.homing_speed * min_endstop_.config_.debounce_ms / 1000.0f));
|
||||
|
||||
controller_.config_.control_mode = Controller::CTRL_MODE_POSITION_CONTROL;
|
||||
controller_.config_.input_mode = Controller::INPUT_MODE_TRAP_TRAJ;
|
||||
|
||||
Reference in New Issue
Block a user