diff --git a/Firmware/MotorControl/axis.cpp b/Firmware/MotorControl/axis.cpp index d7659d35..6130f782 100644 --- a/Firmware/MotorControl/axis.cpp +++ b/Firmware/MotorControl/axis.cpp @@ -173,10 +173,9 @@ bool Axis::do_checks() { // controller_.do_checks(); // Check for endstop presses - bool vel_dependent_stopping = (current_state_ == AXIS_STATE_HOMING) && (controller_.config_.control_mode >= Controller::CTRL_MODE_VELOCITY_CONTROL); - if (min_endstop_.config_.enabled && min_endstop_.get_state() && (!vel_dependent_stopping || controller_.vel_setpoint_ < 0.0f)) { + if (min_endstop_.config_.enabled && min_endstop_.get_state() && !(current_state_ == AXIS_STATE_HOMING)) { error_ |= ERROR_MIN_ENDSTOP_PRESSED; - } else if (max_endstop_.config_.enabled && max_endstop_.get_state() && (!vel_dependent_stopping || controller_.vel_setpoint_ > 0.0f)) { + } else if (max_endstop_.config_.enabled && max_endstop_.get_state() && !(current_state_ == AXIS_STATE_HOMING)) { error_ |= ERROR_MAX_ENDSTOP_PRESSED; } diff --git a/Firmware/MotorControl/axis.hpp b/Firmware/MotorControl/axis.hpp index 6be3c60c..7335502c 100644 --- a/Firmware/MotorControl/axis.hpp +++ b/Firmware/MotorControl/axis.hpp @@ -143,6 +143,7 @@ public: controller_.error_ = Controller::ERROR_NONE; sensorless_estimator_.error_ = SensorlessEstimator::ERROR_NONE; encoder_.error_ = Encoder::ERROR_NONE; + encoder_.spi_error_rate_ = 0.0f; error_ = Axis::ERROR_NONE; } diff --git a/docs/endstops.md b/docs/endstops.md index 6379fb0b..0336b6dd 100644 --- a/docs/endstops.md +++ b/docs/endstops.md @@ -96,7 +96,7 @@ Name | Type | Default --- | -- | -- homing_speed | float | 2000.0f -`homing_speed` is the axis travel speed during homing, in counts/second. +`homing_speed` is the axis travel speed during homing, in counts/second. If you are using SPI based encoders and the axis is homing in the wrong direction, you can enter a negative value for the homing speed and a negative value for the minimum endstop offset. ### Performing the Homing Sequence