diff --git a/Grbl_Esp32/Grbl_Esp32.ino b/Grbl_Esp32/Grbl_Esp32.ino index b641e820..6cb436c1 100644 --- a/Grbl_Esp32/Grbl_Esp32.ino +++ b/Grbl_Esp32/Grbl_Esp32.ino @@ -23,7 +23,7 @@ void setup() { // # ifdef DEBUG_PIN_DUMP - delay(2000); + //delay(2000); // BJD removed mystery delay // # endif grbl_init(); diff --git a/Grbl_Esp32/data/config.yaml b/Grbl_Esp32/data/config.yaml index d353b889..a140214e 100644 --- a/Grbl_Esp32/data/config.yaml +++ b/Grbl_Esp32/data/config.yaml @@ -18,20 +18,23 @@ axes: x: steps_per_mm: 1500 max_rate: 50000 - acceleration: 5000 - max_travel: 100000 + steps_per_mm: 800 + max_rate: 5000 + acceleration: 100 + max_travel: 10 homing: - cycle: 2 + cycle: 1 mpos: 10 - positive_direction: false + positive_direction: true feed_rate: 100.000 seek_rate: 200.000 debounce_ms: 500 pulloff: 1.000 + square: true gang0: endstops: - limit_neg: gpio.17:low:pu + limit_pos: gpio.17:low:pu hard_limits: false stepstick: direction: gpio.14 @@ -43,7 +46,7 @@ axes: steps_per_mm: 800 max_rate: 2000 acceleration: 25 - max_travel: 1000 + max_travel: 10 homing: cycle: 2 mpos: 10 @@ -61,33 +64,14 @@ axes: direction: gpio.15 step: gpio.26 gang1: - null_motor: - - z: - steps_per_mm: 800 - max_rate: 2000 - acceleration: 25 - max_travel: 10 - homing: - cycle: 1 - mpos: 10 - positive_direction: false - seek_rate: 300.000 - feed_rate: 30.000 - seek_scaler: 2.000 - feed_scaler: 1.000 - debounce_ms: 500 - pulloff: 1.000 - - gang0: endstops: limit_neg: gpio.16:low:pu hard_limits: true stepstick: direction: gpio.33 step: gpio.27 - gang1: - null_motor: + + comms: wifi_ap: diff --git a/Grbl_Esp32/src/Limits.cpp b/Grbl_Esp32/src/Limits.cpp index cf23eb01..c95be810 100644 --- a/Grbl_Esp32/src/Limits.cpp +++ b/Grbl_Esp32/src/Limits.cpp @@ -244,12 +244,23 @@ static void limits_go_home(uint8_t cycle_mask, uint32_t n_locate_cycles) { // XXX we need to include gang1 in the remaining mask // The following might fail if only one gang has limit switches. Anaylze me. uint32_t remainingMotors = cycle_mask | (cycle_mask << 16); + //uint32_t remainingMotors = cycle_mask; // this works!!! but not for squaring + + uint32_t old = 0; do { if (approach) { // Check limit state. Lock out cycle axes when they change. // XXX do we check only the switch in the direction of motion? - uint32_t limitedAxes = limits_check(remainingMotors); + uint32_t limitedAxes = limits_check(-1); + + if (old != remainingMotors) { + //log_info("remainingMotors: " << remainingMotors); + log_info("remainingMotors: 0x" << String(remainingMotors, 16)); + log_info("limitedAxes: 0x" << String(limitedAxes, 16)); + old = remainingMotors; + } + config->_axes->stop_motors(limitedAxes); bit_false(remainingMotors, limitedAxes); } diff --git a/Grbl_Esp32/src/Machine/Axes.cpp b/Grbl_Esp32/src/Machine/Axes.cpp index 5b5ce835..3853a35f 100644 --- a/Grbl_Esp32/src/Machine/Axes.cpp +++ b/Grbl_Esp32/src/Machine/Axes.cpp @@ -108,9 +108,6 @@ namespace Machine { void Axes::stop_motors(uint32_t mask) { bit_false(_motorLockoutMask, mask); } void IRAM_ATTR Axes::step(uint8_t step_mask, uint8_t dir_mask) { - // Do not step motors that are locked out during homing - step_mask &= _motorLockoutMask; - auto n_axis = _numberAxis; //log_info("motors_set_direction_pins:0x%02X", onMask);