Add compensation term for axis debounce during homing

This commit is contained in:
Unknown
2019-08-24 23:48:16 -04:00
parent 6edb34df77
commit ec2cd83f1f
+1 -1
View File
@@ -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;