From 1f2436030d90938944d5ca3ac3760562af0e1b43 Mon Sep 17 00:00:00 2001 From: Pete Date: Mon, 17 May 2021 13:09:17 +0100 Subject: [PATCH] Add the Root 4 Lite CNC machine to the Machines folder (#886) * update for the Root 4 Lite * Return machine.h to use test_drive.hy * Removed some machine definitions Co-authored-by: bdring --- .../Root_Controller_Root_4_Lite_RS485.h | 136 ++++++++++++++++++ Grbl_Esp32/src/Machines/i2s_out_xxyyzz.h | 102 ------------- Grbl_Esp32/src/Machines/i2s_out_xyzabc.h | 105 -------------- .../src/Machines/i2s_out_xyzabc_trinamic.h | 106 -------------- Grbl_Esp32/src/Machines/spi_daisy_4axis_xyz.h | 84 ----------- 5 files changed, 136 insertions(+), 397 deletions(-) create mode 100644 Grbl_Esp32/src/Machines/Root_Controller_Root_4_Lite_RS485.h delete mode 100644 Grbl_Esp32/src/Machines/i2s_out_xxyyzz.h delete mode 100644 Grbl_Esp32/src/Machines/i2s_out_xyzabc.h delete mode 100644 Grbl_Esp32/src/Machines/i2s_out_xyzabc_trinamic.h delete mode 100644 Grbl_Esp32/src/Machines/spi_daisy_4axis_xyz.h diff --git a/Grbl_Esp32/src/Machines/Root_Controller_Root_4_Lite_RS485.h b/Grbl_Esp32/src/Machines/Root_Controller_Root_4_Lite_RS485.h new file mode 100644 index 00000000..d13bf586 --- /dev/null +++ b/Grbl_Esp32/src/Machines/Root_Controller_Root_4_Lite_RS485.h @@ -0,0 +1,136 @@ +#pragma once +// clang-format off + +/* + Root_Controller_Root_4_Lite_RS485.h + + Covers initial release version + + Part of Grbl_ESP32 + Pin assignments for the ESP32 I2S Root Controller 6-axis board + 2018 - Bart Dring + 2020 - Mitch Bradley + 2020 - Michiyasu Odaki + 2020 - Pete Newbery + Grbl_ESP32 is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + Grbl is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with Grbl_ESP32. If not, see . +*/ +#define MACHINE_NAME "Root Controller 3 Axis XYYZ" + +#define N_AXIS 3 + +// === Special Features + +//**I2S (steppers & other output-only pins) +#define USE_I2S_OUT +#define USE_I2S_STEPS +//#define DEFAULT_STEPPER ST_I2S_STATIC +#define USE_STEPSTICK // makes sure MS1,2,3 !reset and !sleep are set + +//Setup I2S Clocking +#define I2S_OUT_BCK GPIO_NUM_22 +#define I2S_OUT_WS GPIO_NUM_21 +#define I2S_OUT_DATA GPIO_NUM_12 + + +//**Motor Socket #1 +#define X_DISABLE_PIN I2SO(7) +#define X_DIRECTION_PIN I2SO(6) +#define X_STEP_PIN I2SO(5) +//**Motor Socket #2 +#define Y_DISABLE_PIN I2SO(4) +#define Y_DIRECTION_PIN I2SO(3) +#define Y_STEP_PIN I2SO(2) +//**Motor Socket #3 +#define Y2_DISABLE_PIN I2SO(1) +#define Y2_DIRECTION_PIN I2SO(0) +#define Y2_STEP_PIN I2SO(15) +//**Motor Socket #4 +#define Z_DISABLE_PIN I2SO(14) +#define Z_DIRECTION_PIN I2SO(13) +#define Z_STEP_PIN I2SO(12) + +//**Motion Control +//200pulses/rev stepper motor with SFU1204 ballscrew with a pitch of 4mm +//equates to 50 Steps/mm * micro stepping +//Steps per MM +#define DEFAULT_X_STEPS_PER_MM 800 +#define DEFAULT_Y_STEPS_PER_MM 800 +#define DEFAULT_Z_STEPS_PER_MM 1000 // 50 Steps/mm * micro stepping * belt ratio +//**Max Feedrate +#define DEFAULT_X_MAX_RATE 1000 +#define DEFAULT_Y_MAX_RATE 1000 +#define DEFAULT_Z_MAX_RATE 1000 +//**Acceleration +#define DEFAULT_X_ACCELERATION 50 +#define DEFAULT_Y_ACCELERATION 50 +#define DEFAULT_Z_ACCELERATION 50 +//**Max travel +#define DEFAULT_X_MAX_TRAVEL 220 +#define DEFAULT_Y_MAX_TRAVEL 278 +#define DEFAULT_Z_MAX_TRAVEL 60 + + +//**Storage +#define ENABLE_SD_CARD + +//**Endstop pins +#define X_LIMIT_PIN GPIO_NUM_2 +#define Y_LIMIT_PIN GPIO_NUM_26 +#define Y2_LIMIT_PIN GPIO_NUM_27 +#define Z_LIMIT_PIN GPIO_NUM_14 +#define PROBE_PIN GPIO_NUM_33 +#define INVERT_CONTROL_PIN_MASK 1 +#define DEFAULT_INVERT_LIMIT_PINS 7 // Enable for NC switch types +//**Homing Routine +#define DEFAULT_HOMING_ENABLE 1 +#define DEFAULT_HOMING_DIR_MASK 0 +#define DEFAULT_SOFT_LIMIT_ENABLE 1 +#define DEFAULT_HARD_LIMIT_ENABLE 1 +#define DEFAULT_HOMING_SQUARED_AXES (bit(Y_AXIS)) +#define DEFAULT_HOMING_FEED_RATE 100 +#define DEFAULT_HOMING_SEEK_RATE 800 +#define DEFAULT_HOMING_PULLOFF 2 +#define HOMING_INIT_LOCK +#define LIMITS_TWO_SWITCHES_ON_AXES 1 +#define DEFAULT_HOMING_CYCLE_0 (1<. -*/ - -#define MACHINE_NAME "ESP32 I2S XXYYZZ Axis Driver Board (StepStick)" - -#ifdef N_AXIS - #undef N_AXIS -#endif -#define N_AXIS 3 - -#ifdef ENABLE_SD_CARD - #undef ENABLE_SD_CARD -#endif - -// === Special Features - -// I2S (steppers & other output-only pins) -#define USE_I2S_OUT -#define USE_I2S_STEPS -//#define DEFAULT_STEPPER ST_I2S_STATIC - -#define USE_STEPSTICK // makes sure MS1,2,3 !reset and !sleep are set - -#define I2S_OUT_BCK GPIO_NUM_22 -#define I2S_OUT_WS GPIO_NUM_17 -#define I2S_OUT_DATA GPIO_NUM_21 - - -#define STEPPER_MS1 GPIO_NUM_23 // MOSI -#define STEPPER_MS2 GPIO_NUM_18 // SCK - -#define STEPPER_X_MS3 I2SO(3) // X_CS -#define STEPPER_Y_MS3 I2SO(6) // Y_CS -#define STEPPER_Z_MS3 I2SO(11) // Z_CS -#define STEPPER_A_MS3 I2SO(14) // A_CS -#define STEPPER_B_MS3 I2SO(19) // B_CS -#define STEPPER_C_MS3 I2SO(22) // C_CS - -#define STEPPER_RESET GPIO_NUM_19 - -#define X_DISABLE_PIN I2SO(0) -#define X_DIRECTION_PIN I2SO(1) -#define X_STEP_PIN I2SO(2) - -#define X2_DIRECTION_PIN I2SO(4) -#define X2_STEP_PIN I2SO(5) -#define X2_DISABLE_PIN I2SO(7) - -#define Y_DISABLE_PIN I2SO(8) -#define Y_DIRECTION_PIN I2SO(9) -#define Y_STEP_PIN I2SO(10) - -#define Y2_DIRECTION_PIN I2SO(12) -#define Y2_STEP_PIN I2SO(13) -#define Y2_DISABLE_PIN I2SO(15) - -#define Z_DISABLE_PIN I2SO(16) -#define Z_DIRECTION_PIN I2SO(17) -#define Z_STEP_PIN I2SO(18) - -#define Z2_DIRECTION_PIN I2SO(20) -#define Z2_STEP_PIN I2SO(21) -#define Z2_DISABLE_PIN I2SO(23) - - -#define SPINDLE_TYPE SpindleType::PWM // only one spindle at a time -#define SPINDLE_OUTPUT_PIN GPIO_NUM_26 -#define SPINDLE_ENABLE_PIN GPIO_NUM_4 -#define SPINDLE_DIR_PIN GPIO_NUM_16 - -#define X_LIMIT_PIN GPIO_NUM_36 -#define Y_LIMIT_PIN GPIO_NUM_39 -#define Z_LIMIT_PIN GPIO_NUM_34 -//#define A_LIMIT_PIN GPIO_NUM_35 -//#define B_LIMIT_PIN GPIO_NUM_32 -//#define C_LIMIT_PIN GPIO_NUM_33 - -#define PROBE_PIN GPIO_NUM_25 - -#define COOLANT_MIST_PIN GPIO_NUM_2 - -// === Default settings -#define DEFAULT_STEP_PULSE_MICROSECONDS I2S_OUT_USEC_PER_PULSE diff --git a/Grbl_Esp32/src/Machines/i2s_out_xyzabc.h b/Grbl_Esp32/src/Machines/i2s_out_xyzabc.h deleted file mode 100644 index 37872267..00000000 --- a/Grbl_Esp32/src/Machines/i2s_out_xyzabc.h +++ /dev/null @@ -1,105 +0,0 @@ -#pragma once -// clang-format off - -/* - i2s_out_xyzabc.h - Part of Grbl_ESP32 - Pin assignments for the ESP32 I2S 6-axis board - 2018 - Bart Dring - 2020 - Mitch Bradley - 2020 - Michiyasu Odaki - Grbl_ESP32 is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - Grbl is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with Grbl_ESP32. If not, see . -*/ -#define MACHINE_NAME "ESP32 I2S 6 Axis Driver Board (StepStick)" - -#ifdef N_AXIS - #undef N_AXIS -#endif -#define N_AXIS 6 - -#ifdef ENABLE_SD_CARD - #undef ENABLE_SD_CARD -#endif - -// === Special Features - -// I2S (steppers & other output-only pins) -#define USE_I2S_OUT -#define USE_I2S_STEPS -//#define DEFAULT_STEPPER ST_I2S_STATIC - -#define USE_STEPSTICK // makes sure MS1,2,3 !reset and !sleep are set - -#define I2S_OUT_BCK GPIO_NUM_22 -#define I2S_OUT_WS GPIO_NUM_17 -#define I2S_OUT_DATA GPIO_NUM_21 - - -#define STEPPER_MS1 GPIO_NUM_23 // MOSI -#define STEPPER_MS2 GPIO_NUM_18 // SCK - -#define STEPPER_X_MS3 I2SO(3) // X_CS -#define STEPPER_Y_MS3 I2SO(6) // Y_CS -#define STEPPER_Z_MS3 I2SO(11) // Z_CS -#define STEPPER_A_MS3 I2SO(14) // A_CS -#define STEPPER_B_MS3 I2SO(19) // B_CS -#define STEPPER_C_MS3 I2SO(22) // C_CS - -#define STEPPER_RESET GPIO_NUM_19 - -#define X_DISABLE_PIN I2SO(0) -#define X_DIRECTION_PIN I2SO(1) -#define X_STEP_PIN I2SO(2) - -#define Y_DIRECTION_PIN I2SO(4) -#define Y_STEP_PIN I2SO(5) -#define Y_DISABLE_PIN I2SO(7) - -#define Z_DISABLE_PIN I2SO(8) -#define Z_DIRECTION_PIN I2SO(9) -#define Z_STEP_PIN I2SO(10) - -#define A_DIRECTION_PIN I2SO(12) -#define A_STEP_PIN I2SO(13) -#define A_DISABLE_PIN I2SO(15) - -#define B_DISABLE_PIN I2SO(16) -#define B_DIRECTION_PIN I2SO(17) -#define B_STEP_PIN I2SO(18) -//#define B_CS_PIN I2SO(19) - -#define C_DIRECTION_PIN I2SO(20) -#define C_STEP_PIN I2SO(21) -//#define C_CS_PIN I2SO(22) -#define C_DISABLE_PIN I2SO(23) - - -#define SPINDLE_TYPE SpindleType::PWM // only one spindle at a time -#define SPINDLE_OUTPUT_PIN GPIO_NUM_26 -#define SPINDLE_ENABLE_PIN GPIO_NUM_4 -#define SPINDLE_DIR_PIN GPIO_NUM_16 - -#define X_LIMIT_PIN GPIO_NUM_36 -#define Y_LIMIT_PIN GPIO_NUM_39 -#define Z_LIMIT_PIN GPIO_NUM_34 -#define A_LIMIT_PIN GPIO_NUM_35 -#define B_LIMIT_PIN GPIO_NUM_32 -#define C_LIMIT_PIN GPIO_NUM_33 - -#define PROBE_PIN GPIO_NUM_25 - -#define COOLANT_MIST_PIN GPIO_NUM_2 - - - -// === Default settings -#define DEFAULT_STEP_PULSE_MICROSECONDS I2S_OUT_USEC_PER_PULSE diff --git a/Grbl_Esp32/src/Machines/i2s_out_xyzabc_trinamic.h b/Grbl_Esp32/src/Machines/i2s_out_xyzabc_trinamic.h deleted file mode 100644 index 3d5cffb7..00000000 --- a/Grbl_Esp32/src/Machines/i2s_out_xyzabc_trinamic.h +++ /dev/null @@ -1,106 +0,0 @@ -#pragma once -// clang-format off - -/* - i2s_out_xyzabc_trinamic.h - Part of Grbl_ESP32 - Pin assignments for the ESP32 SPI 6-axis board - 2018 - Bart Dring - 2020 - Mitch Bradley - 2020 - Michiyasu Odaki - Grbl_ESP32 is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - Grbl is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with Grbl_ESP32. If not, see . -*/ -#define MACHINE_NAME "ESP32 SPI 6 Axis Driver Board Trinamic" - -#ifdef N_AXIS - #undef N_AXIS -#endif -#define N_AXIS 6 - -// === Special Features - -// I2S (steppers & other output-only pins) -#define USE_I2S_OUT -#define USE_I2S_STEPS -//#define DEFAULT_STEPPER ST_I2S_STATIC - -#define I2S_OUT_BCK GPIO_NUM_22 -#define I2S_OUT_WS GPIO_NUM_17 -#define I2S_OUT_DATA GPIO_NUM_21 - -#define TRINAMIC_RUN_MODE TrinamicMode :: CoolStep -#define TRINAMIC_HOMING_MODE TrinamicMode :: CoolStep - -#define X_TRINAMIC_DRIVER 2130 -#define X_DISABLE_PIN I2SO(0) -#define X_DIRECTION_PIN I2SO(1) -#define X_STEP_PIN I2SO(2) -#define X_CS_PIN I2SO(3) -#define X_RSENSE TMC2130_RSENSE_DEFAULT - -#define Y_TRINAMIC_DRIVER 2130 -#define Y_DIRECTION_PIN I2SO(4) -#define Y_STEP_PIN I2SO(5) -#define Y_DISABLE_PIN I2SO(7) -#define Y_CS_PIN I2SO(6) -#define Y_RSENSE X_RSENSE - -#define Z_TRINAMIC_DRIVER 2130 -#define Z_DISABLE_PIN I2SO(8) -#define Z_DIRECTION_PIN I2SO(9) -#define Z_STEP_PIN I2SO(10) -#define Z_CS_PIN I2SO(11) -#define Z_RSENSE X_RSENSE - -#define A_TRINAMIC_DRIVER 2130 -#define A_DIRECTION_PIN I2SO(12) -#define A_STEP_PIN I2SO(13) -#define A_DISABLE_PIN I2SO(15) -#define A_CS_PIN I2SO(14) -#define A_RSENSE X_RSENSE - -#define B_TRINAMIC_DRIVER 2130 -#define B_DISABLE_PIN I2SO(16) -#define B_DIRECTION_PIN I2SO(17) -#define B_STEP_PIN I2SO(18) -#define B_CS_PIN I2SO(19) -#define B_RSENSE X_RSENSE - -#define C_TRINAMIC_DRIVER 2130 -#define C_DIRECTION_PIN I2SO(20) -#define C_STEP_PIN I2SO(21) -#define C_DISABLE_PIN I2SO(23) -#define C_CS_PIN I2SO(22) -#define C_RSENSE X_RSENSE - -/* -#define SPINDLE_TYPE SpindleType::PWM // only one spindle at a time -#define SPINDLE_OUTPUT_PIN GPIO_NUM_26 -#define SPINDLE_ENABLE_PIN GPIO_NUM_4 -#define SPINDLE_DIR_PIN GPIO_NUM_16 -*/ -#define X_LIMIT_PIN GPIO_NUM_33 -#define Y_LIMIT_PIN GPIO_NUM_32 -#define Z_LIMIT_PIN GPIO_NUM_35 -#define A_LIMIT_PIN GPIO_NUM_34 -#define B_LIMIT_PIN GPIO_NUM_39 -#define C_LIMIT_PIN GPIO_NUM_36 - -#define SPINDLE_TYPE SpindleType::RELAY -#define SPINDLE_OUTPUT_PIN GPIO_NUM_26 - -#define PROBE_PIN GPIO_NUM_25 - -#define COOLANT_MIST_PIN GPIO_NUM_2 - -// === Default settings -#define DEFAULT_STEP_PULSE_MICROSECONDS I2S_OUT_USEC_PER_PULSE diff --git a/Grbl_Esp32/src/Machines/spi_daisy_4axis_xyz.h b/Grbl_Esp32/src/Machines/spi_daisy_4axis_xyz.h deleted file mode 100644 index fc9b45f6..00000000 --- a/Grbl_Esp32/src/Machines/spi_daisy_4axis_xyz.h +++ /dev/null @@ -1,84 +0,0 @@ -#pragma once -// clang-format off - -/* - spi_daisy_4axis_xyz.h - Part of Grbl_ESP32 - - Pin assignments for a 4-axis machine using Triaminic drivers - in daisy-chained SPI mode. - https://github.com/bdring/4_Axis_SPI_CNC - - 2019 - Bart Dring - 2020 - Mitch Bradley - - Grbl_ESP32 is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Grbl is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Grbl_ESP32. If not, see . -*/ - -#define MACHINE_NAME "SPI_DAISY_4X_XYZ" - -#ifdef N_AXIS - #undef N_AXIS -#endif -#define N_AXIS 3 - -#define TRINAMIC_DAISY_CHAIN - -#define TRINAMIC_RUN_MODE TrinamicMode :: CoolStep -#define TRINAMIC_HOMING_MODE TrinamicMode :: CoolStep - -// Use SPI enable instead of the enable pin -// The hardware enable pin is tied to ground -#define USE_TRINAMIC_ENABLE - -#define X_TRINAMIC_DRIVER 2130 // Which Driver Type? -#define X_RSENSE TMC2130_RSENSE_DEFAULT -#define X_STEP_PIN GPIO_NUM_12 -#define X_DIRECTION_PIN GPIO_NUM_14 -#define X_CS_PIN GPIO_NUM_17 // Daisy Chain, all share same CS pin - -#define Y_TRINAMIC_DRIVER 2130 // Which Driver Type? -#define Y_RSENSE TMC2130_RSENSE_DEFAULT -#define Y_STEP_PIN GPIO_NUM_27 -#define Y_DIRECTION_PIN GPIO_NUM_26 -#define Y_CS_PIN X_CS_PIN // Daisy Chain, all share same CS pin - -#define Z_TRINAMIC_DRIVER 2130 // Which Driver Type? -#define Z_RSENSE TMC2130_RSENSE_DEFAULT -#define Z_STEP_PIN GPIO_NUM_15 -#define Z_DIRECTION_PIN GPIO_NUM_2 -#define Z_CS_PIN X_CS_PIN // Daisy Chain, all share same CS pin - - -// Mist is a 3.3V output -// Turn on with M7 and off with M9 -#define COOLANT_MIST_PIN GPIO_NUM_21 - -#define SPINDLE_TYPE SpindleType::PWM -#define SPINDLE_OUTPUT_PIN GPIO_NUM_25 -#define SPINDLE_ENABLE_PIN GPIO_NUM_4 - -// Relay operation -// Install Jumper near relay -// For spindle Use max RPM of 1 -// For PWM remove jumper and set MAX RPM to something higher ($30 setting) -// Interlock jumper along top edge needs to be installed for both versions -#define DEFAULT_SPINDLE_RPM_MAX 1 // Should be 1 for relay operation - -#define PROBE_PIN GPIO_NUM_22 - -#define X_LIMIT_PIN GPIO_NUM_36 -#define Y_LIMIT_PIN GPIO_NUM_39 -#define Z_LIMIT_PIN GPIO_NUM_34 -