diff --git a/.gitmodules b/.gitmodules index 20f873c..71925b7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,12 @@ [submodule "grblHAL_Teensy4/src/grbl"] path = grblHAL_Teensy4/src/grbl - url = https://github.com/grblHAL/core + url = https://github.com/Expatria-Technologies/core [submodule "grblHAL_Teensy4/src/eeprom"] path = grblHAL_Teensy4/src/eeprom url = https://github.com/grblHAL/Plugin_EEPROM [submodule "grblHAL_Teensy4/src/keypad"] path = grblHAL_Teensy4/src/keypad - url = https://github.com/grblHAL/Plugin_I2C_keypad + url = https://github.com/Expatria-Technologies/Plugin_I2C_keypad [submodule "grblHAL_Teensy4/src/networking"] path = grblHAL_Teensy4/src/networking url = https://github.com/grblHAL/Plugin_networking @@ -15,7 +15,7 @@ url = https://github.com/grblHAL/Plugin_SD_card [submodule "grblHAL_Teensy4/src/spindle"] path = grblHAL_Teensy4/src/spindle - url = https://github.com/grblHAL/Plugins_spindle + url = https://github.com/Expatria-Technologies/Plugins_spindle [submodule "grblHAL_Teensy4/src/odometer"] path = grblHAL_Teensy4/src/odometer url = https://github.com/grblHAL/Plugin_odometer diff --git a/grblHAL_Teensy4/platformio.ini b/grblHAL_Teensy4/platformio.ini index 2585d4a..b7b0cdb 100644 --- a/grblHAL_Teensy4/platformio.ini +++ b/grblHAL_Teensy4/platformio.ini @@ -29,8 +29,8 @@ platform = teensy upload_protocol = teensy-cli build_flags = ${env.build_flags} lib_deps = - https://github.com/wwatson4506/uSDFS#uSDFS-non-blocking - https://github.com/wwatson4506/MSC#MSC-non-blocking + #https://github.com/wwatson4506/uSDFS#uSDFS-non-blocking + #https://github.com/wwatson4506/MSC#MSC-non-blocking https://github.com/ddrown/teensy41_ethernet # Included as a stub-example for showing how to structure common environments @@ -47,4 +47,4 @@ board = teensy41 platform = ${common_teensy.platform}@4.12 upload_protocol = ${common_teensy.upload_protocol} build_flags = ${common_teensy.build_flags} -lib_deps = ${common_teensy.lib_deps} +lib_deps = ${common_teensy.lib_deps} \ No newline at end of file diff --git a/grblHAL_Teensy4/src/GRBLHAL2000_map.h b/grblHAL_Teensy4/src/GRBLHAL2000_map.h new file mode 100644 index 0000000..0d201cf --- /dev/null +++ b/grblHAL_Teensy4/src/GRBLHAL2000_map.h @@ -0,0 +1,133 @@ +/* + HAL2000PNC_map.h - driver code for IMXRT1062 processor (on Teensy 4.1 board) + + Part of grblHAL + + + Copyright (c) 2021 Terje Io + + Grbl 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. If not, see . +*/ + +#define BOARD_NAME "GRBLHAL2000 - PRINTNC" +#define HAS_BOARD_INIT +#define HAS_IOPORTS + +#ifdef NETWORK_HOSTNAME + #undef NETWORK_HOSTNAME + #define NETWORK_HOSTNAME "GRBLHAL2000" +#endif + +#if N_AXIS > 5 +#error Max number of axes is 5 for UniversalCNC +#endif + +#if QEI_ENABLE && SPINDLE_SYNC_ENABLE +#error Quadrature encoder and spindle sync cannot be enabled at the same time +#endif + +#define X_STEP_PIN (2u) +#define X_DIRECTION_PIN (3u) +#define X_ENABLE_PIN (10u) +#define X_LIMIT_PIN (20u) + +#define Y_STEP_PIN (4u) +#define Y_DIRECTION_PIN (5u) +#define Y_ENABLE_PIN (10u) +#define Y_LIMIT_PIN (21u) + +#define Z_STEP_PIN (6u) +#define Z_DIRECTION_PIN (7u) +#define Z_ENABLE_PIN (39u) +#define Z_LIMIT_PIN (22u) + +// Define ganged axis or A axis step pulse and step direction output pins. +#if N_ABC_MOTORS > 0 +#define M3_AVAILABLE +#define M3_STEP_PIN (8u) +#define M3_DIRECTION_PIN (9u) +#define M3_LIMIT_PIN (23u) +#define M3_ENABLE_PIN (10u) +#endif + +// Define ganged axis or B axis step pulse and step direction output pins. +#if N_ABC_MOTORS == 2 +#define M4_AVAILABLE +#define M4_STEP_PIN (26u) +#define M4_DIRECTION_PIN (27u) +#define M4_LIMIT_PIN (28u) +#define M4_ENABLE_PIN (10u) +#endif + +// Define spindle enable and spindle direction output pins. +#define SPINDLE_ENABLE_PIN (12u) +#define SPINDLE_DIRECTION_PIN (11u) +#define SPINDLE_PWM_PIN (13u) // NOTE: only pin 12 or pin 13 can be assigned! + +// Define flood and mist coolant enable output pins. +#define COOLANT_FLOOD_PIN (19u) +#define COOLANT_MIST_PIN (18u) + +// Define user-control CONTROLs (cycle start, reset, feed hold, door) input pins. +#define RESET_PIN (40u) //this is halt? +#define FEED_HOLD_PIN (16u) +#define CYCLE_START_PIN (17u) +#if MOTOR_FAULT_ENABLE +#define MOTOR_FAULT_PIN (29u) +#endif + +#define SAFETY_DOOR_PIN (29u) + + +// Define probe switch input pin. +#define PROBE_PIN (15u) + +#if QEI_ENABLE +#define QEI_A_PIN (36u) +#define QEI_B_PIN (30u) +//#define QEI_INDEX_PIN (36u) +#define QEI_SELECT_PIN (31u) +#endif + +#if SPINDLE_SYNC_ENABLE +#define SPINDLE_INDEX_PIN (31u) // ST2 +#define SPINDLE_PULSE_PIN (14u) // ST3 +#endif + +// Define auxillary input pins +#define AUXINPUT0_PIN (36u) // ST0 +#if !QEI_ENABLE +#define AUXINPUT1_PIN (30u) // ST1 +#if !SPINDLE_SYNC_ENABLE +#define AUXINPUT2_PIN (31u) // ST2 +#define AUXINPUT3_PIN (14u) // ST3 +#endif +#endif + +// Define auxillary output pins +#define AUXOUTPUT0_PIN (37u) +#define AUXOUTPUT1_PIN (32u) +#define AUXOUTPUT2_PIN (33u) +//#define AUX_N_OUT 3 +//#define AUX_OUT_MASK 0b111 + +#if KEYPAD_ENABLE +#define KEYPAD_STROBE_PIN (41u) +#endif + +#if EEPROM_ENABLE || KEYPAD_ENABLE +#define I2C_PORT 4 +#define I2C_SCL4 (24u) // Not used, for info only +#define I2C_SDA4 (25u) // Not used, for info only +#endif diff --git a/grblHAL_Teensy4/src/driver.h b/grblHAL_Teensy4/src/driver.h index 3a47705..f1b5082 100644 --- a/grblHAL_Teensy4/src/driver.h +++ b/grblHAL_Teensy4/src/driver.h @@ -66,6 +66,8 @@ #include "T41U5XBB_ss_map.h" #elif defined(BOARD_T41BB5X_PRO) #include "T41BB5X_Pro_map.h" +#elif defined(BOARD_GRBLHAL2000) + #include "GRBLHAL2000_map.h" #elif defined(BOARD_MY_MACHINE) #include "my_machine_map.h" #else // default board diff --git a/grblHAL_Teensy4/src/grbl b/grblHAL_Teensy4/src/grbl index baf5a36..fb2332a 160000 --- a/grblHAL_Teensy4/src/grbl +++ b/grblHAL_Teensy4/src/grbl @@ -1 +1 @@ -Subproject commit baf5a36698611fcbb1b394ce79f473ff04f77268 +Subproject commit fb2332a253b9082707134482e32e55fc64211292 diff --git a/grblHAL_Teensy4/src/keypad b/grblHAL_Teensy4/src/keypad index 74003b8..ed53f4c 160000 --- a/grblHAL_Teensy4/src/keypad +++ b/grblHAL_Teensy4/src/keypad @@ -1 +1 @@ -Subproject commit 74003b831583e14d0a7fff1332c432905ac43fc8 +Subproject commit ed53f4c94f1fb8f40b396894ac65b384c6cacdaa diff --git a/grblHAL_Teensy4/src/my_machine.h b/grblHAL_Teensy4/src/my_machine.h index 2b13cb5..992df21 100644 --- a/grblHAL_Teensy4/src/my_machine.h +++ b/grblHAL_Teensy4/src/my_machine.h @@ -3,7 +3,7 @@ Part of grblHAL - Copyright (c) 2020-2021 Terje Io + Copyright (c) 2020 Terje Io Grbl is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,26 +24,28 @@ // NOTE: Only one board may be enabled! // If none is enabled pin mappings from generic_map.h will be used //#define BOARD_T40X101 -#define BOARD_T41U5XBB +//#define BOARD_T41U5XBB //#define BOARD_T41U5XBB_SS // For a modified T41U5XBB board, allows spindle sync to be enabled. //#define BOARD_T41BB5X_PRO //#define BOARD_CNC_BOOSTERPACK +#define BOARD_GRBLHAL2000 //#define BOARD_MY_MACHINE // Add my_machine_map.h before enabling this! // Configuration // Uncomment to enable, for some a value > 1 may be assigned, if so the default value is shown. /* - Plugin: | ETHERNET¹ | SDCARD¹ | KEYPAD | EEPROM | N_AXIS | + Plugin: | ETHERNET? | SDCARD? | KEYPAD | EEPROM | N_AXIS | ----------------------|-----------|---------|--------|--------|--------| -BOARD_T40X101 | no | no | yes | yes³ | max 4 | -BOARD_T41U5XBB | yes | yes | yes | yes³ | max 5 | +BOARD_T40X101 | no | no | yes | yes? | max 4 | +BOARD_T41U5XBB | yes | yes | yes | yes? | max 5 | BOARD_T41BB5X_PRO | yes | yes | yes | yes | max 5 | -BOARD_CNC_BOOSTERPACK | yes² | yes | yes | yes | max 3 | +BOARD_CNC_BOOSTERPACK | yes? | yes | yes | yes | max 3 | +BOARD_GRBLHAL2000 | yes | yes | yes | yes | max 5 | -¹ Teensy 4.1 only -² External magjack. -³ EEPROM is optional and must be added to the board. +? Teensy 4.1 only +? External magjack. +? EEPROM is optional and must be added to the board. N_AXIS has a default value of 3, edit grbl\config.h to increase. @@ -51,21 +53,20 @@ N_AXIS has a default value of 3, edit grbl\config.h to increase. #define USB_SERIAL_CDC 2 // 1 for Arduino class library and 2 for PJRC C library. Comment out to use UART communication. //#define USB_SERIAL_WAIT 1 // Wait for USB connection before starting grblHAL. -//#define BLUETOOTH_ENABLE 1 // Set to 1 for HC-05 module. Enables Bluetooth plugin. -//#define SPINDLE_HUANYANG 1 // Set to 1 or 2 for Huanyang VFD spindle. Enables spindle plugin. -//#define WEBUI_ENABLE 1 // Enable ESP3D-WEBUI plugin along with networking and SD card plugins. -//#define WEBUI_INFLASH 1 // Store WebUI files in flash instead of on SD card. -//#define ETHERNET_ENABLE 1 // Ethernet streaming. Enables networking plugin. -//#define SDCARD_ENABLE 1 // Run gcode programs from SD card, enables sdcard plugin. +//#define BLUETOOTH_ENABLE 1 // Set to 1 for HC-05 module. Requires Bluetooth plugin. +#define SPINDLE_HUANYANG 1 // Set to 1 or 2 for Huanyang VFD spindle. Requires spindle plugin. +#define SPINDLE_RPM_CONTROLLED //this is required if using Huanyang VFD //#define QEI_ENABLE 1 // Enable quadrature encoder interfaces. Max value is 1. Requires encoder plugin. -//#define KEYPAD_ENABLE 1 // I2C keypad for jogging etc., enables keypad plugin. +#define ETHERNET_ENABLE 1 // Ethernet streaming. Requires networking plugin. +//#define SDCARD_ENABLE 1 // Run gcode programs from SD card, requires sdcard plugin. +#define KEYPAD_ENABLE 1 // I2C keypad for jogging etc., requires keypad plugin. //#define PLASMA_ENABLE 1 // Plasma/THC plugin. To be completed. //#define MCP3221_ENABLE 1 // Enable analog input via MCP3221 ADC. //#define PPI_ENABLE 1 // Laser PPI plugin. To be completed. //#define ODOMETER_ENABLE 1 // Odometer plugin. //#define OPENPNP_ENABLE 1 // OpenPNP plugin. To be completed. -//#define FANS_ENABLE 1 // Enable fan control via M106/M107. Enables fans plugin. -//#define EEPROM_ENABLE 1 // I2C EEPROM support. Set to 1 for 24LC16 (2K), 3 for 24C32 (4K - 32 byte page) and 2 for other sizes. Enables eeprom plugin. +//#define FANS_ENABLE 1 // Enable fan control via M106/M107. Requires fans plugin. +//#define EEPROM_ENABLE 1 // I2C EEPROM support. Set to 1 for 24LC16(2K), 2 for larger sizes. Requires eeprom plugin. //#define EEPROM_IS_FRAM 1 // Uncomment when EEPROM is enabled and chip is FRAM, this to remove write delay. //#define SPINDLE_SYNC_ENABLE 1 // Enable spindle sync support (G33, G76). !! NOTE: Alpha quality - enable only for test or verification. // Currently only available for BOARD_T41BB5X_PRO and BOARD_T41U5XBB_SS. @@ -76,8 +77,8 @@ N_AXIS has a default value of 3, edit grbl\config.h to increase. // of axes can be enabled here. //#define X_GANGED 1 //#define X_AUTO_SQUARE 1 -//#define Y_GANGED 1 -//#define Y_AUTO_SQUARE 1 +#define Y_GANGED 1 +#define Y_AUTO_SQUARE 1 //#define Z_GANGED 1 //#define Z_AUTO_SQUARE 1 // For ganged axes the limit switch input (if available) can be configured to act as a max travel limit switch. @@ -89,24 +90,14 @@ N_AXIS has a default value of 3, edit grbl\config.h to increase. #if ETHERNET_ENABLE > 0 #define TELNET_ENABLE 1 // Telnet daemon - requires Ethernet streaming enabled. +#define FTP_ENABLE 1 // Ftp daemon - requires SD card enabled. #define WEBSOCKET_ENABLE 1 // Websocket daemon - requires Ethernet streaming enabled. -#ifdef SDCARD_ENABLE -//#define FTP_ENABLE 1 // Ftp daemon - requires SD card enabled. -//#define HTTP_ENABLE 1 // http daemon - requires SD card enabled. +#define NETWORK_HOSTNAME "GRBLHAL2000" +#define NETWORK_IPMODE 1 // 0 = static, 1 = DHCP, 2 = AutoIP +#define NETWORK_IP "192.168.5.1" +#define NETWORK_GATEWAY "192.168.5.1" +#define NETWORK_MASK "255.255.255.0" +#define NETWORK_TELNET_PORT 23 +#define NETWORK_WEBSOCKET_PORT 80 +#define NETWORK_HTTP_PORT 80 #endif -// The following symbols have the default values as shown, uncomment and change as needed. -//#define NETWORK_HOSTNAME "GRBL" -//#define NETWORK_IPMODE 1 // 0 = static, 1 = DHCP, 2 = AutoIP -//#define NETWORK_IP "192.168.5.1" -//#define NETWORK_GATEWAY "192.168.5.1" -//#define NETWORK_MASK "255.255.255.0" -//#define NETWORK_FTP_PORT 21 -//#define NETWORK_TELNET_PORT 23 -//#define NETWORK_HTTP_PORT 80 -#if HTTP_ENABLE -//#define NETWORK_WEBSOCKET_PORT 81 -#else -//#define NETWORK_WEBSOCKET_PORT 80 -#endif -#endif -