1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-08-27 08:14:31 +02:00

WIP - Trying to get homing working

This commit is contained in:
bdring
2021-07-24 14:08:42 -05:00
parent 507f8898c3
commit 37dfa314d5
4 changed files with 24 additions and 32 deletions

View File

@@ -23,7 +23,7 @@
void setup() { void setup() {
// # ifdef DEBUG_PIN_DUMP // # ifdef DEBUG_PIN_DUMP
delay(2000); //delay(2000); // BJD removed mystery delay
// # endif // # endif
grbl_init(); grbl_init();

View File

@@ -18,20 +18,23 @@ axes:
x: x:
steps_per_mm: 1500 steps_per_mm: 1500
max_rate: 50000 max_rate: 50000
acceleration: 5000 steps_per_mm: 800
max_travel: 100000 max_rate: 5000
acceleration: 100
max_travel: 10
homing: homing:
cycle: 2 cycle: 1
mpos: 10 mpos: 10
positive_direction: false positive_direction: true
feed_rate: 100.000 feed_rate: 100.000
seek_rate: 200.000 seek_rate: 200.000
debounce_ms: 500 debounce_ms: 500
pulloff: 1.000 pulloff: 1.000
square: true
gang0: gang0:
endstops: endstops:
limit_neg: gpio.17:low:pu limit_pos: gpio.17:low:pu
hard_limits: false hard_limits: false
stepstick: stepstick:
direction: gpio.14 direction: gpio.14
@@ -43,7 +46,7 @@ axes:
steps_per_mm: 800 steps_per_mm: 800
max_rate: 2000 max_rate: 2000
acceleration: 25 acceleration: 25
max_travel: 1000 max_travel: 10
homing: homing:
cycle: 2 cycle: 2
mpos: 10 mpos: 10
@@ -61,33 +64,14 @@ axes:
direction: gpio.15 direction: gpio.15
step: gpio.26 step: gpio.26
gang1: 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: endstops:
limit_neg: gpio.16:low:pu limit_neg: gpio.16:low:pu
hard_limits: true hard_limits: true
stepstick: stepstick:
direction: gpio.33 direction: gpio.33
step: gpio.27 step: gpio.27
gang1:
null_motor:
comms: comms:
wifi_ap: wifi_ap:

View File

@@ -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 // XXX we need to include gang1 in the remaining mask
// The following might fail if only one gang has limit switches. Anaylze me. // 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 | (cycle_mask << 16);
//uint32_t remainingMotors = cycle_mask; // this works!!! but not for squaring
uint32_t old = 0;
do { do {
if (approach) { if (approach) {
// Check limit state. Lock out cycle axes when they change. // Check limit state. Lock out cycle axes when they change.
// XXX do we check only the switch in the direction of motion? // 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); config->_axes->stop_motors(limitedAxes);
bit_false(remainingMotors, limitedAxes); bit_false(remainingMotors, limitedAxes);
} }

View File

@@ -108,9 +108,6 @@ namespace Machine {
void Axes::stop_motors(uint32_t mask) { bit_false(_motorLockoutMask, mask); } void Axes::stop_motors(uint32_t mask) { bit_false(_motorLockoutMask, mask); }
void IRAM_ATTR Axes::step(uint8_t step_mask, uint8_t dir_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; auto n_axis = _numberAxis;
//log_info("motors_set_direction_pins:0x%02X", onMask); //log_info("motors_set_direction_pins:0x%02X", onMask);