Fix bugs in homing by actually testing and using the debugger...

This commit is contained in:
Unknown
2018-09-02 01:59:35 -04:00
parent dd74eed54b
commit 21bdf453c3
3 changed files with 36 additions and 22 deletions
+1 -8
View File
@@ -56,17 +56,10 @@ void Controller::start_anticogging_calibration() {
bool Controller::home_axis() {
if (axis_->config_.min_endstop.enabled) {
set_vel_setpoint(-config_.homing_speed, 0.0f);
axis_->homing_state_ = HOMING_STATE_HOMING;
} else {
return false;
}
axis_->run_control_loop([&](){
if(axis_->min_endstop_state_){
axis_->encoder_.set_linear_count(axis_->config_.min_endstop.offset);
set_pos_setpoint(0.0f, 0.0f, 0.0f);
}
return !axis_->min_endstop_state_;
});
return true;
}