From b40fd88d16a35e8270a0c2d72f75191b716170af Mon Sep 17 00:00:00 2001 From: bdring Date: Fri, 25 Sep 2020 08:42:57 -0500 Subject: [PATCH] Cleaning up the machine defs Removed unused #defines. --- Grbl_Esp32/src/Config.h | 28 +------------------------ Grbl_Esp32/src/Machines/3axis_rs485.h | 14 +------------ Grbl_Esp32/src/Machines/3axis_v4.h | 13 ------------ Grbl_Esp32/src/Machines/atari_1020.h | 12 ++--------- Grbl_Esp32/src/Machines/midtbot.h | 18 +--------------- Grbl_Esp32/src/Machines/polar_coaster.h | 14 +++---------- Grbl_Esp32/src/Machines/template.h | 17 +-------------- 7 files changed, 9 insertions(+), 107 deletions(-) diff --git a/Grbl_Esp32/src/Config.h b/Grbl_Esp32/src/Config.h index ad29943b..205db46e 100644 --- a/Grbl_Esp32/src/Config.h +++ b/Grbl_Esp32/src/Config.h @@ -46,31 +46,7 @@ Some features should not be changed. See notes below. // machine.h is #included below, after some definitions // that the machine file might choose to undefine. -// Define the homing cycle patterns with bitmasks. The homing cycle first performs a search mode -// to quickly engage the limit switches, followed by a slower locate mode, and finished by a short -// pull-off motion to disengage the limit switches. The following HOMING_CYCLE_x defines are executed -// in order starting with suffix 0 and completes the homing routine for the specified-axes only. If -// an axis is omitted from the defines, it will not home, nor will the system update its position. -// Meaning that this allows for users with non-standard Cartesian machines, such as a lathe (x then z, -// with no y), to configure the homing cycle behavior to their needs. -// NOTE: The homing cycle is designed to allow sharing of limit pins, if the axes are not in the same -// cycle, but this requires some pin settings changes in the machine definition file. For example, the default homing -// cycle can share the Z limit pin with either X or Y limit pins, since they are on different cycles. -// By sharing a pin, this frees up a precious IO pin for other purposes. In theory, all axes limit pins -// may be reduced to one pin, if all axes are homed with separate cycles, or vice versa, all three axes -// on separate pin, but homed in one cycle. Also, it should be noted that the function of hard limits -// will not be affected by pin sharing. - -// NOTE: Defaults are set for a traditional 3-axis CNC machine. Z-axis first to clear, followed by X & Y. -// These homing cycle definitions precede the machine.h file so that the machine -// definition can undefine them if necessary. -#define HOMING_CYCLE_0 bit(Z_AXIS) // TYPICALLY REQUIRED: First move Z to clear workspace. -#define HOMING_CYCLE_1 bit(X_AXIS) -#define HOMING_CYCLE_2 bit(Y_AXIS) - -// NOTE: The following is for for homing X and Y at the same time -// #define HOMING_CYCLE_0 bit(Z_AXIS) // first home z by itself -// #define HOMING_CYCLE_1 (bit(X_AXIS)|bit(Y_AXIS)) // Homes both X-Y in one cycle. NOT COMPATIBLE WITH COREXY!!! +// Note: HOMING_CYCLES are now settings // Inverts pin logic of the control command pins based on a mask. This essentially means you can use // normally-closed switches on the specified pins, rather than the default normally-open switches. @@ -291,8 +267,6 @@ const double SAFETY_DOOR_SPINDLE_DELAY = 4.0; // Float (seconds) const double SAFETY_DOOR_COOLANT_DELAY = 1.0; // Float (seconds) // Enable CoreXY kinematics. Use ONLY with CoreXY machines. -// IMPORTANT: If homing is enabled, you must reconfigure the homing cycle #defines above to -// #define HOMING_CYCLE_0 bit(X_AXIS) and #define HOMING_CYCLE_1 bit(Y_AXIS) // NOTE: This configuration option alters the motion of the X and Y axes to principle of operation // defined at (http://corexy.com/theory.html). Motors are assumed to positioned and wired exactly as // described, if not, motions may move in strange directions. Grbl requires the CoreXY A and B motors diff --git a/Grbl_Esp32/src/Machines/3axis_rs485.h b/Grbl_Esp32/src/Machines/3axis_rs485.h index 0dd02d5e..39a565cb 100644 --- a/Grbl_Esp32/src/Machines/3axis_rs485.h +++ b/Grbl_Esp32/src/Machines/3axis_rs485.h @@ -49,19 +49,7 @@ #define Y2_LIMIT_PIN GPIO_NUM_35 #define Z_LIMIT_PIN GPIO_NUM_34 -#ifdef HOMING_CYCLE_0 - #undef HOMING_CYCLE_0 -#endif -#define HOMING_CYCLE_0 bit(Z_AXIS) // Z first - -#ifdef HOMING_CYCLE_1 - #undef HOMING_CYCLE_1 -#endif -#define HOMING_CYCLE_1 (bit(X_AXIS)|bit(Y_AXIS)) - -#ifdef HOMING_CYCLE_2 - #undef HOMING_CYCLE_2 -#endif +// Set $Homing/Cycle0=X and $Homing/Cycle=XY #define PROBE_PIN GPIO_NUM_14 // labeled Probe #define CONTROL_RESET_PIN GPIO_NUM_27 // labeled Reset diff --git a/Grbl_Esp32/src/Machines/3axis_v4.h b/Grbl_Esp32/src/Machines/3axis_v4.h index 31308420..7b817180 100644 --- a/Grbl_Esp32/src/Machines/3axis_v4.h +++ b/Grbl_Esp32/src/Machines/3axis_v4.h @@ -39,19 +39,6 @@ #define Y_LIMIT_PIN GPIO_NUM_4 #define Z_LIMIT_PIN GPIO_NUM_16 -#ifdef HOMING_CYCLE_0 - #undef HOMING_CYCLE_0 -#endif -#define HOMING_CYCLE_0 bit(Z_AXIS) // Z first - -#ifdef HOMING_CYCLE_1 - #undef HOMING_CYCLE_1 -#endif -#define HOMING_CYCLE_1 (bit(X_AXIS)|bit(Y_AXIS)) - -#ifdef HOMING_CYCLE_2 - #undef HOMING_CYCLE_2 -#endif // OK to comment out to use pin for other features #define STEPPERS_DISABLE_PIN GPIO_NUM_13 diff --git a/Grbl_Esp32/src/Machines/atari_1020.h b/Grbl_Esp32/src/Machines/atari_1020.h index 61d8556b..eecc2146 100644 --- a/Grbl_Esp32/src/Machines/atari_1020.h +++ b/Grbl_Esp32/src/Machines/atari_1020.h @@ -54,16 +54,8 @@ #define SOLENOID_DIRECTION_PIN GPIO_NUM_4 #define SOLENOID_PEN_PIN GPIO_NUM_2 -#ifdef HOMING_CYCLE_0 - #undef HOMING_CYCLE_0 -#endif -#define HOMING_CYCLE_0 bit(X_AXIS) // this 'bot only homes the X axis -#ifdef HOMING_CYCLE_1 - #undef HOMING_CYCLE_1 -#endif -#ifdef HOMING_CYCLE_2 - #undef HOMING_CYCLE_2 -#endif +// this 'bot only homes the X axis +// Set $Homing/Cycle0=0 #define REED_SW_PIN GPIO_NUM_17 diff --git a/Grbl_Esp32/src/Machines/midtbot.h b/Grbl_Esp32/src/Machines/midtbot.h index be77d54d..800faf5b 100644 --- a/Grbl_Esp32/src/Machines/midtbot.h +++ b/Grbl_Esp32/src/Machines/midtbot.h @@ -48,24 +48,8 @@ #define Z_SERVO_CAL_MIN 1.0 // calibration factor for the minimum PWM duty #define Z_SERVO_CAL_MAX 1.0 // calibration factor for the maximum PWM duty -// redefine some stuff from config.h -#ifdef HOMING_CYCLE_0 - #undef HOMING_CYCLE_0 -#endif -#define HOMING_CYCLE_0 bit(Y_AXIS) - -#ifdef HOMING_CYCLE_1 - #undef HOMING_CYCLE_1 -#endif - -#define HOMING_CYCLE_1 bit(X_AXIS) - -#ifdef HOMING_CYCLE_2 - #undef HOMING_CYCLE_2 -#endif - -#define SERVO_PEN_PIN GPIO_NUM_27 +// Set $Homing/Cycle0=Y and $Homing/Cycle1=X #define SPINDLE_TYPE SpindleType::NONE diff --git a/Grbl_Esp32/src/Machines/polar_coaster.h b/Grbl_Esp32/src/Machines/polar_coaster.h index 91526fcb..5e600d76 100644 --- a/Grbl_Esp32/src/Machines/polar_coaster.h +++ b/Grbl_Esp32/src/Machines/polar_coaster.h @@ -74,17 +74,9 @@ #define MACRO_BUTTON_1_PIN GPIO_NUM_12 #define MACRO_BUTTON_2_PIN GPIO_NUM_14 -// redefine some stuff from config.h -#ifdef HOMING_CYCLE_0 - #undef HOMING_CYCLE_0 -#endif -#define HOMING_CYCLE_0 bit(X_AXIS) // this 'bot only homes the X axis -#ifdef HOMING_CYCLE_1 - #undef HOMING_CYCLE_1 -#endif -#ifdef HOMING_CYCLE_2 - #undef HOMING_CYCLE_2 -#endif + +// this 'bot only homes the X axis +// Set $Homing/Cycle0=X // ============= End CPU MAP ================== diff --git a/Grbl_Esp32/src/Machines/template.h b/Grbl_Esp32/src/Machines/template.h index c8967c70..fc321a11 100644 --- a/Grbl_Esp32/src/Machines/template.h +++ b/Grbl_Esp32/src/Machines/template.h @@ -136,22 +136,7 @@ // #define Z_SERVO_CAL_MIN 1.0 // calibration factor for the maximum PWM duty // === Homing cycles -// The default homing order is Z first (HOMING_CYCLE_0), -// then X (HOMING_CYCLE_1), and finally Y (HOMING_CYCLE_2) -// For machines that need different homing order, you can -// undefine HOMING_CYCLE_n and redefine it accordingly. -// For example, the following would first home X and Y -// simultaneously, then A and B simultaneously, and Z -// not at all. - -// #undef HOMING_CYCLE_0 -// #define HOMING_CYCLE_0 (bit(X_AXIS)|bit(Y_AXIS)) - -// #undef HOMING_CYCLE_1 -// #define HOMING_CYCLE_1 (bit(A_AXIS)|bit(B_AXIS)) - -// #undef HOMING_CYCLE_2 -// #endif +// Set them using $Homing/Cycle0= optionally up to $Homing/Cycle5= // === Default settings // Grbl has many run-time settings that the user can changed by