-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new board - CNC_3040 based on ESP32 module (#82)
* Add new board - CNC_3040 * fix name mixup
- Loading branch information
Showing
7 changed files
with
1,591 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/* | ||
cnc3040.h - An embedded CNC Controller with rs274/ngc (g-code) support | ||
Driver code for ESP32 | ||
Part of grblHAL | ||
Copyright (c) 2021-2022 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 <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#if N_ABC_MOTORS > 1 | ||
#error "Axis configuration is not supported!" | ||
#endif | ||
|
||
#define BOARD_NAME "CNC3040 4-axis CNC" | ||
#define BOARD_URL "https://github.com/shaise/GrblCNC/tree/master/Hardware/GrblCnc3040" | ||
|
||
// timer definitions | ||
#define STEP_TIMER_GROUP TIMER_GROUP_0 | ||
#define STEP_TIMER_INDEX TIMER_0 | ||
|
||
#if MODBUS_ENABLE | ||
#error VFD Spindle not supported! | ||
#endif | ||
|
||
#if KEYPAD_ENABLE == 2 | ||
#define UART2_TX_PIN GPIO_NUM_17 | ||
#define UART2_RX_PIN GPIO_NUM_16 | ||
#elif KEYPAD_ENABLE == 1 | ||
#error I2C Keypad not supported! | ||
#endif | ||
|
||
#if SDCARD_ENABLE | ||
#error SD card not supported! | ||
#endif | ||
|
||
// Define step pulse output pins. | ||
#define X_STEP_PIN GPIO_NUM_32 | ||
#define Y_STEP_PIN GPIO_NUM_25 | ||
#define Z_STEP_PIN GPIO_NUM_27 | ||
|
||
// Define step direction output pins. NOTE: All direction pins must be on the same port. | ||
#define X_DIRECTION_PIN GPIO_NUM_33 | ||
#define Y_DIRECTION_PIN GPIO_NUM_26 | ||
#define Z_DIRECTION_PIN GPIO_NUM_18 | ||
|
||
// Define stepper driver enable/disable output pin(s). | ||
#define STEPPERS_ENABLE_PIN GPIO_NUM_15 | ||
|
||
// Define homing/hard limit switch input pins and limit interrupt vectors. | ||
#define X_LIMIT_PIN GPIO_NUM_36 // VP | ||
#define Y_LIMIT_PIN GPIO_NUM_39 // VN | ||
#define Z_LIMIT_PIN GPIO_NUM_34 | ||
|
||
// 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 GPIO_NUM_5 | ||
#define M3_DIRECTION_PIN GPIO_NUM_4 | ||
#endif | ||
|
||
// Define spindle enable and spindle direction output pins. | ||
|
||
#define SPINDLE_ENABLE_PIN GPIO_NUM_2 | ||
#define SPINDLEPWMPIN GPIO_NUM_21 | ||
|
||
// Define flood and mist coolant enable output pins. | ||
|
||
#define COOLANT_FLOOD_PIN GPIO_NUM_22 | ||
#define COOLANT_MIST_PIN GPIO_NUM_23 | ||
|
||
// Define user-control CONTROLs (cycle start, reset, feed hold) input pins. | ||
// N/A | ||
|
||
// Define probe switch input pin. | ||
#if PROBE_ENABLE | ||
#define PROBE_PIN GPIO_NUM_19 | ||
#endif | ||
|
||
#if SAFETY_DOOR_ENABLE | ||
#define SAFETY_DOOR_PIN GPIO_NUM_35 // ATC Door | ||
#else | ||
#define AUXINPUT0_PIN GPIO_NUM_35 // ATC Door | ||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
; PlatformIO Project Configuration File | ||
; | ||
; Build options: build flags, source filter | ||
; Upload options: custom upload port, speed and extra flags | ||
; Library options: dependencies, extra library storages | ||
; Advanced options: extra scripting | ||
; | ||
; Please visit documentation for the other options and examples | ||
; https://docs.platformio.org/page/projectconf.html | ||
|
||
[platformio] | ||
src_dir = main | ||
include_dir = main | ||
|
||
[wifi_networking] | ||
build_flags = | ||
|
||
[env:esp32doit-devkit-v1] | ||
platform = espressif32 @ ~3.4.0 | ||
framework = espidf | ||
board = esp32doit-devkit-v1 | ||
board_build.partitions = partitions.csv | ||
board_build.cmake_extra_args = | ||
-DWIFI_ENABLE=1 | ||
-DSDKCONFIG_DEFAULTS="sdkconfig.cnc3040" | ||
-DKEYPAD_ENABLE=1 | ||
-DmDNS=ON | ||
board_build.embed_files = | ||
main/embedded/favicon.ico | ||
main/embedded/ap_login.html | ||
main/embedded/index.html.gz | ||
build_flags = | ||
-Wimplicit-fallthrough=1 | ||
-Wno-missing-field-initializers | ||
-Wno-maybe-uninitialized | ||
-Wno-stringop-truncation | ||
-DBOARD_CNC3040=1 | ||
-DN_AXIS=4 | ||
-DWIFI_ENABLE=1 | ||
-DN_AXIS=4 | ||
-DPROBE_ENABLE=1 | ||
-DBLUETOOTH_ENABLE=0 | ||
-DWIFI_ENABLE=1 | ||
-DTELNET_ENABLE=1 | ||
-DWIFI_SOFTAP=0 | ||
-DSAFETY_DOOR_ENABLE=1 | ||
-DKEYPAD_ENABLE=2 | ||
-DMDNS_ENABLE=1 | ||
; -DCONFIG_IDF_TARGET_ESP32=1 | ||
; -DSPI_FLASH_SEC_SIZE=4096 | ||
monitor_speed=115200 | ||
|
||
lib_compat_mode = off |
Oops, something went wrong.