mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-30 09:39:49 +02:00
Auto squaring improvement
When squaring axes the first motion with both motors will only do a seek move and a back off, rather than a seek, back off plus a locate, back off squence. This speeds up the homing sequence. The dual move does not need a locate cycle, because each side will get a locate cycle when they are individually homed.
This commit is contained in:
@@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
#include "grbl.h"
|
#include "grbl.h"
|
||||||
|
|
||||||
|
uint8_t n_homing_locate_cycle = N_HOMING_LOCATE_CYCLE;
|
||||||
|
|
||||||
xQueueHandle limit_sw_queue; // used by limit switch debouncing
|
xQueueHandle limit_sw_queue; // used by limit switch debouncing
|
||||||
|
|
||||||
// Homing axis search distance multiplier. Computed by this value times the cycle travel.
|
// Homing axis search distance multiplier. Computed by this value times the cycle travel.
|
||||||
@@ -89,7 +91,7 @@ void limits_go_home(uint8_t cycle_mask)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Initialize variables used for homing computations.
|
// Initialize variables used for homing computations.
|
||||||
uint8_t n_cycle = (2*N_HOMING_LOCATE_CYCLE+1);
|
uint8_t n_cycle = (2*n_homing_locate_cycle+1);
|
||||||
uint8_t step_pin[N_AXIS];
|
uint8_t step_pin[N_AXIS];
|
||||||
float target[N_AXIS];
|
float target[N_AXIS];
|
||||||
float max_travel = 0.0;
|
float max_travel = 0.0;
|
||||||
|
@@ -28,6 +28,8 @@
|
|||||||
#ifndef grbl_limits_h
|
#ifndef grbl_limits_h
|
||||||
#define grbl_limits_h
|
#define grbl_limits_h
|
||||||
|
|
||||||
|
extern uint8_t n_homing_locate_cycle;
|
||||||
|
|
||||||
#define SQUARING_MODE_DUAL 0 // both motors run
|
#define SQUARING_MODE_DUAL 0 // both motors run
|
||||||
#define SQUARING_MODE_A 1 // A motor runs
|
#define SQUARING_MODE_A 1 // A motor runs
|
||||||
#define SQUARING_MODE_B 2 // B motor runs
|
#define SQUARING_MODE_B 2 // B motor runs
|
||||||
|
@@ -262,6 +262,8 @@ void mc_homing_cycle(uint8_t cycle_mask)
|
|||||||
// -------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------
|
||||||
// Perform homing routine. NOTE: Special motion case. Only system reset works.
|
// Perform homing routine. NOTE: Special motion case. Only system reset works.
|
||||||
|
|
||||||
|
n_homing_locate_cycle = N_HOMING_LOCATE_CYCLE;
|
||||||
|
|
||||||
#ifdef HOMING_SINGLE_AXIS_COMMANDS
|
#ifdef HOMING_SINGLE_AXIS_COMMANDS
|
||||||
/*
|
/*
|
||||||
if (cycle_mask) { limits_go_home(cycle_mask); } // Perform homing cycle based on mask.
|
if (cycle_mask) { limits_go_home(cycle_mask); } // Perform homing cycle based on mask.
|
||||||
@@ -272,8 +274,10 @@ void mc_homing_cycle(uint8_t cycle_mask)
|
|||||||
limits_go_home(cycle_mask); // Homing cycle 0
|
limits_go_home(cycle_mask); // Homing cycle 0
|
||||||
else {
|
else {
|
||||||
ganged_mode = SQUARING_MODE_DUAL;
|
ganged_mode = SQUARING_MODE_DUAL;
|
||||||
|
n_homing_locate_cycle = 0; // don't do a second touch cycle
|
||||||
limits_go_home(cycle_mask);
|
limits_go_home(cycle_mask);
|
||||||
ganged_mode = SQUARING_MODE_A;
|
ganged_mode = SQUARING_MODE_A;
|
||||||
|
n_homing_locate_cycle = N_HOMING_LOCATE_CYCLE; // restore to default value
|
||||||
limits_go_home(cycle_mask);
|
limits_go_home(cycle_mask);
|
||||||
ganged_mode = SQUARING_MODE_B;
|
ganged_mode = SQUARING_MODE_B;
|
||||||
limits_go_home(cycle_mask);
|
limits_go_home(cycle_mask);
|
||||||
@@ -289,8 +293,10 @@ void mc_homing_cycle(uint8_t cycle_mask)
|
|||||||
limits_go_home(HOMING_CYCLE_0); // Homing cycle 0
|
limits_go_home(HOMING_CYCLE_0); // Homing cycle 0
|
||||||
else {
|
else {
|
||||||
ganged_mode = SQUARING_MODE_DUAL;
|
ganged_mode = SQUARING_MODE_DUAL;
|
||||||
|
n_homing_locate_cycle = 0; // don't do a second touch cycle
|
||||||
limits_go_home(HOMING_CYCLE_0);
|
limits_go_home(HOMING_CYCLE_0);
|
||||||
ganged_mode = SQUARING_MODE_A;
|
ganged_mode = SQUARING_MODE_A;
|
||||||
|
n_homing_locate_cycle = N_HOMING_LOCATE_CYCLE; // restore to default value
|
||||||
limits_go_home(HOMING_CYCLE_0);
|
limits_go_home(HOMING_CYCLE_0);
|
||||||
ganged_mode = SQUARING_MODE_B;
|
ganged_mode = SQUARING_MODE_B;
|
||||||
limits_go_home(HOMING_CYCLE_0);
|
limits_go_home(HOMING_CYCLE_0);
|
||||||
@@ -302,8 +308,10 @@ void mc_homing_cycle(uint8_t cycle_mask)
|
|||||||
limits_go_home(HOMING_CYCLE_1);
|
limits_go_home(HOMING_CYCLE_1);
|
||||||
else {
|
else {
|
||||||
ganged_mode = SQUARING_MODE_DUAL;
|
ganged_mode = SQUARING_MODE_DUAL;
|
||||||
|
n_homing_locate_cycle = 0; // don't do a second touch cycle
|
||||||
limits_go_home(HOMING_CYCLE_1);
|
limits_go_home(HOMING_CYCLE_1);
|
||||||
ganged_mode = SQUARING_MODE_A;
|
ganged_mode = SQUARING_MODE_A;
|
||||||
|
n_homing_locate_cycle = N_HOMING_LOCATE_CYCLE; // restore to default value
|
||||||
limits_go_home(HOMING_CYCLE_1);
|
limits_go_home(HOMING_CYCLE_1);
|
||||||
ganged_mode = SQUARING_MODE_B;
|
ganged_mode = SQUARING_MODE_B;
|
||||||
limits_go_home(HOMING_CYCLE_1);
|
limits_go_home(HOMING_CYCLE_1);
|
||||||
@@ -316,8 +324,10 @@ void mc_homing_cycle(uint8_t cycle_mask)
|
|||||||
limits_go_home(HOMING_CYCLE_2);
|
limits_go_home(HOMING_CYCLE_2);
|
||||||
else {
|
else {
|
||||||
ganged_mode = SQUARING_MODE_DUAL;
|
ganged_mode = SQUARING_MODE_DUAL;
|
||||||
|
n_homing_locate_cycle = 0; // don't do a second touch cycle
|
||||||
limits_go_home(HOMING_CYCLE_2);
|
limits_go_home(HOMING_CYCLE_2);
|
||||||
ganged_mode = SQUARING_MODE_A;
|
ganged_mode = SQUARING_MODE_A;
|
||||||
|
n_homing_locate_cycle = N_HOMING_LOCATE_CYCLE; // restore to default value
|
||||||
limits_go_home(HOMING_CYCLE_2);
|
limits_go_home(HOMING_CYCLE_2);
|
||||||
ganged_mode = SQUARING_MODE_B;
|
ganged_mode = SQUARING_MODE_B;
|
||||||
limits_go_home(HOMING_CYCLE_2);
|
limits_go_home(HOMING_CYCLE_2);
|
||||||
|
Reference in New Issue
Block a user