diff --git a/.gitignore b/.gitignore index 81e5096f..40c50802 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ Thumbs.db embedded/node_modules embedded/dist *~ +.pio/ +.vscode/ \ No newline at end of file diff --git a/Grbl_Esp32/Machines/3x_v3.h b/Grbl_Esp32/Machines/3x_v3.h index c8c6fa37..5d8313fc 100644 --- a/Grbl_Esp32/Machines/3x_v3.h +++ b/Grbl_Esp32/Machines/3x_v3.h @@ -12,9 +12,9 @@ #define Z_DIRECTION_PIN GPIO_NUM_33 #define LIMIT_MASK B111 -#define X_AXIS_LIMIT_PIN GPIO_NUM_2 // labeled X Limit -#define Y_AXIS_LIMIT_PIN GPIO_NUM_4 // labeled Y Limit -#define Y_AXIS_LIMIT_PIN GPIO_NUM_15 // labeled Z Limit +#define X_LIMIT_PIN GPIO_NUM_2 // labeled X Limit +#define Y_LIMIT_PIN GPIO_NUM_4 // labeled Y Limit +#define Z_LIMIT_PIN GPIO_NUM_15 // labeled Z Limit // OK to comment out to use pin for other features #define STEPPERS_DISABLE_PIN GPIO_NUM_13 diff --git a/Grbl_Esp32/Machines/3x_v4.h b/Grbl_Esp32/Machines/3x_v4.h index 642e85d3..8c8835e8 100644 --- a/Grbl_Esp32/Machines/3x_v4.h +++ b/Grbl_Esp32/Machines/3x_v4.h @@ -12,9 +12,9 @@ #define Z_DIRECTION_PIN GPIO_NUM_33 #define LIMIT_MASK B111 -#define X_AXIS_LIMIT_PIN GPIO_NUM_17 -#define Y_AXIS_LIMIT_PIN GPIO_NUM_4 -#define Z_AXIS_LIMIT_PIN GPIO_NUM_16 +#define X_LIMIT_PIN GPIO_NUM_17 +#define Y_LIMIT_PIN GPIO_NUM_4 +#define Z_LIMIT_PIN GPIO_NUM_16 // OK to comment out to use pin for other features #define STEPPERS_DISABLE_PIN GPIO_NUM_13 diff --git a/Grbl_Esp32/Machines/atari_1020.h b/Grbl_Esp32/Machines/atari_1020.h index 2042573f..972ad5bd 100644 --- a/Grbl_Esp32/Machines/atari_1020.h +++ b/Grbl_Esp32/Machines/atari_1020.h @@ -25,6 +25,10 @@ #define MACHINE_NAME "MACHINE_ATARI_1020" // ================== CPU MAP ====================== +#ifdef USE_RMT_STEPS + #undef USE_RMT_STEPS +#endif + #define USE_UNIPOLAR #define X_UNIPOLAR @@ -69,7 +73,7 @@ #endif #ifdef INVERT_CONTROL_PIN_MASK - #undef IGNORE_CONTROL_PINS + #undef INVERT_CONTROL_PIN_MASK #endif #define INVERT_CONTROL_PIN_MASK B01110000 diff --git a/Grbl_Esp32/Machines/custom_machine_template.h b/Grbl_Esp32/Machines/custom_machine_template.h index 57ee32e0..23cbb91a 100644 --- a/Grbl_Esp32/Machines/custom_machine_template.h +++ b/Grbl_Esp32/Machines/custom_machine_template.h @@ -42,16 +42,16 @@ // for all the things that can go here // Assign CPU pins to machine functions, for example: -// #define X_STEP_PIN GPIO_NUM_12 -// #define X_DIRECTION_PIN GPIO_NUM_26 -// #define X_AXIS_LIMIT_PIN GPIO_NUM_2 +#define X_STEP_PIN GPIO_NUM_12 +#define X_DIRECTION_PIN GPIO_NUM_26 +#define X_LIMIT_PIN GPIO_NUM_2 // #define SPINDLE_PWM_PIN GPIO_NUM_17 // #define CONTROL_SAFETY_DOOR_PIN GPIO_NUM_35 // Set the number of bits to the number of limit switches -// #define LIMIT_MASK B111 +#define LIMIT_MASK B111 // ============== Enable custom features ======================= diff --git a/Grbl_Esp32/Machines/test_drive.h b/Grbl_Esp32/Machines/test_drive.h index 7bb6ebc3..e2813ac2 100644 --- a/Grbl_Esp32/Machines/test_drive.h +++ b/Grbl_Esp32/Machines/test_drive.h @@ -15,3 +15,7 @@ #define MACHINE_NAME "MACHINE_DEFAULT - Demo Only No I/O!" #define LIMIT_MASK 0 // no limit pins + +#ifdef USE_RMT_STEPS +#undef USE_RMT_STEPS // Suppress unused variable warning +#endif diff --git a/Grbl_Esp32/config.h b/Grbl_Esp32/config.h index 3e91fa8d..d5e0ca5d 100644 --- a/Grbl_Esp32/config.h +++ b/Grbl_Esp32/config.h @@ -41,6 +41,53 @@ Some features should not be changed. See notes below. // It is no longer necessary to edit this file to choose // a machine configuration; edit machine.h instead +// 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 (1<