mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-03 03:13:25 +02:00
Added setup of ganged steper direction pins
This commit is contained in:
@@ -44,7 +44,7 @@ Some features should not be changed. See notes below.
|
||||
// The CPU map is the main definition of the machine/controller you want to use
|
||||
// These are typically found in the cpu_map.h file.
|
||||
// See Github repo wiki for more details
|
||||
#define CPU_MAP_ESP32 // these are defined in cpu_map.h
|
||||
#define CPU_MAP_TEST_DRIVE // these are defined in cpu_map.h
|
||||
|
||||
// Number of axes defined (steppers, servos, etc) (valid range: 3 to 6)
|
||||
// Even if your machine only uses less than the minimum of 3, you should select 3
|
||||
|
@@ -1012,20 +1012,27 @@
|
||||
#ifdef N_AXIS
|
||||
#undef N_AXIS
|
||||
#endif
|
||||
#define N_AXIS 4 // can be 3 or 4. (if 3 install bypass jumper next to the A driver)
|
||||
#define N_AXIS 3 // can be 3 or 4. (if 3 install bypass jumper next to the A driver)
|
||||
|
||||
#define USE_TRINAMIC
|
||||
#define TRINAMIC_DAISY_CHAIN
|
||||
|
||||
// Use SPI enable instead of the enable pin
|
||||
// The hardware enable pin is tied to ground
|
||||
#define USE_TRINAMIC_ENABLE
|
||||
#define USE_TRINAMIC_ENABLE
|
||||
|
||||
// The ESP32 RMT feature will generate the step pulse timing
|
||||
#define USE_RMT_STEPS
|
||||
|
||||
// allow two motors on an axis
|
||||
#define USE_GANGED_AXES
|
||||
|
||||
#define X_DRIVER_TMC2130 // Which Driver Type?
|
||||
#define X_RSENSE 0.11f // .11 Ohm...typical of 2130 type 0.075 typical for TMC5160
|
||||
#define X_STEP_PIN GPIO_NUM_12
|
||||
#define X_DIRECTION_PIN GPIO_NUM_14
|
||||
#define X2_STEP_PIN GPIO_NUM_33
|
||||
#define X2_DIRECTION_PIN GPIO_NUM_32
|
||||
#define X_TRINAMIC // using SPI control
|
||||
#define X_CS_PIN GPIO_NUM_17 // Daisy Chain, all share same CS pin
|
||||
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
// Grbl versioning system
|
||||
#define GRBL_VERSION "1.1f"
|
||||
#define GRBL_VERSION_BUILD "20200221"
|
||||
#define GRBL_VERSION_BUILD "20200222"
|
||||
|
||||
//#include <sdkconfig.h>
|
||||
#include <Arduino.h>
|
||||
|
@@ -271,8 +271,6 @@ void trinamic_stepper_enable(bool enable) {
|
||||
|
||||
previous_state = enable;
|
||||
|
||||
grbl_msg_sendf(CLIENT_SERIAL, MSG_LEVEL_INFO, "Trinamic Enable: %d", enable);
|
||||
|
||||
if (enable)
|
||||
toff = TRINAMIC_DEFAULT_TOFF;
|
||||
else
|
||||
|
@@ -509,24 +509,44 @@ void stepper_init()
|
||||
#ifdef X_DIRECTION_PIN
|
||||
pinMode(X_DIRECTION_PIN, OUTPUT);
|
||||
#endif
|
||||
#ifdef X2_DIRECTION_PIN
|
||||
pinMode(X2_DIRECTION_PIN, OUTPUT);
|
||||
#endif
|
||||
|
||||
#ifdef Y_DIRECTION_PIN
|
||||
pinMode(Y_DIRECTION_PIN, OUTPUT);
|
||||
#endif
|
||||
#ifdef Y2_DIRECTION_PIN
|
||||
pinMode(Y2_DIRECTION_PIN, OUTPUT);
|
||||
#endif
|
||||
|
||||
#ifdef Z_DIRECTION_PIN
|
||||
pinMode(Z_DIRECTION_PIN, OUTPUT);
|
||||
#endif
|
||||
#ifdef Z2_DIRECTION_PIN
|
||||
pinMode(Z2_DIRECTION_PIN, OUTPUT);
|
||||
#endif
|
||||
|
||||
#ifdef A_DIRECTION_PIN
|
||||
pinMode(A_DIRECTION_PIN, OUTPUT);
|
||||
#endif
|
||||
#ifdef A2_DIRECTION_PIN
|
||||
pinMode(A2_DIRECTION_PIN, OUTPUT);
|
||||
#endif
|
||||
|
||||
#ifdef B_DIRECTION_PIN
|
||||
pinMode(B_DIRECTION_PIN, OUTPUT);
|
||||
#endif
|
||||
#ifdef B2_DIRECTION_PIN
|
||||
pinMode(B2_DIRECTION_PIN, OUTPUT);
|
||||
#endif
|
||||
|
||||
#ifdef C_DIRECTION_PIN
|
||||
pinMode(C_DIRECTION_PIN, OUTPUT);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef C2_DIRECTION_PIN
|
||||
pinMode(C2_DIRECTION_PIN, OUTPUT);
|
||||
#endif
|
||||
|
||||
// setup stepper timer interrupt
|
||||
|
||||
@@ -747,7 +767,7 @@ void set_direction_pins_on(uint8_t onMask)
|
||||
digitalWrite(X_DIRECTION_PIN, (onMask & (1<<X_AXIS)));
|
||||
#endif
|
||||
#ifdef X2_DIRECTION_PIN // optional ganged axis
|
||||
digitalWrite(X2_DIRECTION_PIN, (onMask & (1<<X_AXIS)));
|
||||
digitalWrite(X2_DIRECTION_PIN, (onMask & (1<<X_AXIS)));
|
||||
#endif
|
||||
|
||||
#ifdef Y_DIRECTION_PIN
|
||||
|
Reference in New Issue
Block a user