Improve the behaviour of the HOMING sequence

This commit is contained in:
Paul Guenette
2019-07-18 17:29:21 +02:00
parent 0ab104346f
commit fbd7ab2738
3 changed files with 28 additions and 10 deletions
+7 -1
View File
@@ -61,12 +61,18 @@ void Controller::start_anticogging_calibration() {
//TODO: This needs to be upgraded to use its own run_control_loop!
bool Controller::home_axis() {
if (axis_->min_endstop_.config_.enabled) {
axis_->homing_.storedControlMode = config_.control_mode;
axis_->homing_.storedInputMode = config_.input_mode;
config_.control_mode = CTRL_MODE_VELOCITY_CONTROL;
config_.input_mode = INPUT_MODE_VEL_RAMP;
input_pos_ = 0.0f;
input_pos_updated();
input_vel_ = -config_.homing_speed;
input_current_ = 0.0f;
axis_->homing_state_ = HOMING_STATE_HOMING;
axis_->homing_.homing_state = HOMING_STATE_HOMING;
} else {
return false;
}