From 18f2ad6bd135de90b0e93efb8d62c824083ef6a3 Mon Sep 17 00:00:00 2001 From: bdring Date: Wed, 30 Jun 2021 21:19:55 -0500 Subject: [PATCH] Fixed homing speeds and pulloff --- Grbl_Esp32/data/config.yaml | 7 ++++--- Grbl_Esp32/src/Limits.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Grbl_Esp32/data/config.yaml b/Grbl_Esp32/data/config.yaml index 7571d2fb..8fb54200 100644 --- a/Grbl_Esp32/data/config.yaml +++ b/Grbl_Esp32/data/config.yaml @@ -23,7 +23,7 @@ axes: mpos: 10 positive_direction: false feed_rate: 50.000 - seek_rate: 100.000 + seek_rate: 200.000 gang0: endstops: @@ -44,7 +44,7 @@ axes: mpos: 10 positive_direction: false feed_rate: 50.000 - seek_rate: 200.000 + seek_rate: 500.000 gang0: endstops: @@ -65,7 +65,8 @@ axes: mpos: 10 positive_direction: true feed_rate: 50.000 - seek_rate: 200.000 + seek_rate: 100.000 + locate_scaler: 2.000 gang0: endstops: diff --git a/Grbl_Esp32/src/Limits.cpp b/Grbl_Esp32/src/Limits.cpp index 8da2d2c3..783e127b 100644 --- a/Grbl_Esp32/src/Limits.cpp +++ b/Grbl_Esp32/src/Limits.cpp @@ -125,6 +125,7 @@ void limits_go_home(uint8_t cycle_mask, uint32_t n_locate_cycles) { // Set search mode with approach at seek rate to quickly engage the specified cycle_mask limit switches. bool approach = true; + bool seek = true; uint8_t n_active_axis; AxisMask limit_state, axislock; float homing_rate = 0.0; @@ -160,7 +161,7 @@ void limits_go_home(uint8_t cycle_mask, uint32_t n_locate_cycles) { if (axis_debounce > debounce) { debounce = axis_debounce; } - auto axis_homing_rate = approach ? homing->_seekRate : homing->_feedRate; + auto axis_homing_rate = seek ? homing->_seekRate : homing->_feedRate; // Accumulate the squares of the homing rates for later use // in computing the aggregate feed rate. @@ -192,7 +193,7 @@ void limits_go_home(uint8_t cycle_mask, uint32_t n_locate_cycles) { for (int axis = 0; axis < n_axis; axis++) { auto axisConfig = config->_axes->_axis[axis]; auto homing = axisConfig->_homing; - auto scaler = approach ? homing->_search_scaler : homing->_locate_scaler; + auto scaler = approach ? homing->_search_scaler : 1.0; if (bitnum_istrue(axislock, axis)) { target[axis] *= limitingRate * scaler; } @@ -220,6 +221,7 @@ void limits_go_home(uint8_t cycle_mask, uint32_t n_locate_cycles) { } sys.homing_axis_lock = axislock; } + seek = false; st_prep_buffer(); // Check and prep segment buffer. NOTE: Should take no longer than 200us. // Exit routines: No time to run protocol_execute_realtime() in this loop. if (rtSafetyDoor || rtReset || rtCycleStop) {