mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-08 21:30:54 +02:00
Merge remote-tracking branch 'upstream/Devt' into Devt
This commit is contained in:
@@ -193,6 +193,12 @@ Some features should not be changed. See notes below.
|
||||
// define to force Grbl to always set the machine origin at the homed location despite switch orientation.
|
||||
// #define HOMING_FORCE_SET_ORIGIN // Uncomment to enable.
|
||||
|
||||
// Uncomment this define to force Grbl to always set the machine origin at minimum travel positions of
|
||||
// the axes. Note: The $23 setting determines the direction of travel during homing. If an axes homes towards the
|
||||
// minimum, it will set the machine position to 0. If it homes towards the maximum it will set the
|
||||
// machine position to the max travel ($13x), minus the switch pull off ($27).
|
||||
// #define HOMING_FORCE_POSITIVE_SPACE // Uncomment to enable.
|
||||
|
||||
// Number of blocks Grbl executes upon startup. These blocks are stored in EEPROM, where the size
|
||||
// and addresses are defined in settings.h. With the current settings, up to 2 startup blocks may
|
||||
// be stored and executed in order. These startup blocks would typically be used to set the g-code
|
||||
|
@@ -546,7 +546,7 @@
|
||||
#ifdef CPU_MAP_POLAR_COASTER // The Buildlog.net pen polar coaster controller V1
|
||||
#define CPU_MAP_NAME "CPU_MAP_POLAR_COASTER"
|
||||
|
||||
#define USE_KINEMATICS
|
||||
#define USE_KINEMATICS
|
||||
#define FWD_KINEMATICS_REPORTING // report in cartesian
|
||||
#include "polar_coaster.h"
|
||||
|
||||
@@ -913,179 +913,114 @@
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CPU_MAP_MPCNC_V1P2
|
||||
#ifdef CPU_MAP_MPCNC // all versions...select below
|
||||
// This is the CPU Map for the Buildlog.net MPCNC controller
|
||||
|
||||
// uncomment ONE of the following versions
|
||||
//#define V1P1
|
||||
#define V1P2 // works for V1.2.1 as well
|
||||
|
||||
#ifdef V1P1
|
||||
#define CPU_MAP_NAME "CPU_MAP_MPCNC_V1P1"
|
||||
#else // V1P2
|
||||
#define CPU_MAP_NAME "CPU_MAP_MPCNC_V1P2"
|
||||
#endif
|
||||
|
||||
// switch to the correct default settings
|
||||
#ifdef DEFAULTS_GENERIC
|
||||
#undef DEFAULTS_GENERIC
|
||||
#endif
|
||||
#define DEFAULTS_MPCNC
|
||||
|
||||
// switch to the correct default settings
|
||||
#ifdef DEFAULTS_GENERIC
|
||||
#undef DEFAULTS_GENERIC
|
||||
#endif
|
||||
#define DEFAULTS_MPCNC
|
||||
|
||||
#define USE_GANGED_AXES // allow two motors on an axis
|
||||
|
||||
#define X_STEP_PIN GPIO_NUM_12
|
||||
#define X_STEP_B_PIN GPIO_NUM_22 // ganged motor
|
||||
#define X_AXIS_SQUARING
|
||||
|
||||
#define USE_GANGED_AXES // allow two motors on an axis
|
||||
|
||||
#define X_STEP_PIN GPIO_NUM_12
|
||||
#define X_STEP_B_PIN GPIO_NUM_22 // ganged motor
|
||||
#define X_AXIS_SQUARING
|
||||
|
||||
#define Y_STEP_PIN GPIO_NUM_14
|
||||
#define Y_STEP_B_PIN GPIO_NUM_21 // ganged motor
|
||||
#define Y_AXIS_SQUARING
|
||||
|
||||
#define Z_STEP_PIN GPIO_NUM_27
|
||||
|
||||
#define X_DIRECTION_PIN GPIO_NUM_26
|
||||
#define Y_DIRECTION_PIN GPIO_NUM_25
|
||||
#define Z_DIRECTION_PIN GPIO_NUM_33
|
||||
|
||||
// OK to comment out to use pin for other features
|
||||
#define STEPPERS_DISABLE_PIN GPIO_NUM_13
|
||||
#define Y_STEP_PIN GPIO_NUM_14
|
||||
#define Y_STEP_B_PIN GPIO_NUM_21 // ganged motor
|
||||
#define Y_AXIS_SQUARING
|
||||
|
||||
#define Z_STEP_PIN GPIO_NUM_27
|
||||
|
||||
#define X_DIRECTION_PIN GPIO_NUM_26
|
||||
#define Y_DIRECTION_PIN GPIO_NUM_25
|
||||
#define Z_DIRECTION_PIN GPIO_NUM_33
|
||||
|
||||
// OK to comment out to use pin for other features
|
||||
#define STEPPERS_DISABLE_PIN GPIO_NUM_13
|
||||
|
||||
// Note: if you use PWM rather than relay, you could map GPIO_NUM_2 to mist or flood
|
||||
//#define USE_SPINDLE_RELAY
|
||||
|
||||
#ifdef USE_SPINDLE_RELAY
|
||||
// Note: if you use PWM rather than relay, you could map GPIO_NUM_2 to mist or flood
|
||||
//#define USE_SPINDLE_RELAY
|
||||
|
||||
#ifdef USE_SPINDLE_RELAY
|
||||
#ifdef V1P1
|
||||
#define SPINDLE_PWM_PIN GPIO_NUM_17
|
||||
#else // V1p2
|
||||
#define SPINDLE_PWM_PIN GPIO_NUM_2
|
||||
#else
|
||||
#define SPINDLE_PWM_PIN GPIO_NUM_16
|
||||
#define SPINDLE_ENABLE_PIN GPIO_NUM_32
|
||||
#endif
|
||||
|
||||
#define SPINDLE_PWM_CHANNEL 0
|
||||
// PWM Generator is based on 80,000,000 Hz counter
|
||||
// Therefor the freq determines the resolution
|
||||
// 80,000,000 / freq = max resolution
|
||||
// For 5000 that is 80,000,000 / 5000 = 16000
|
||||
// round down to nearest bit count for SPINDLE_PWM_MAX_VALUE = 13bits (8192)
|
||||
#define SPINDLE_PWM_BASE_FREQ 5000 // Hz
|
||||
#define SPINDLE_PWM_BIT_PRECISION 8 // be sure to match this with SPINDLE_PWM_MAX_VALUE
|
||||
#define SPINDLE_PWM_OFF_VALUE 0
|
||||
#define SPINDLE_PWM_MAX_VALUE 255 // (2^SPINDLE_PWM_BIT_PRECISION)
|
||||
|
||||
#ifndef SPINDLE_PWM_MIN_VALUE
|
||||
#define SPINDLE_PWM_MIN_VALUE 1 // Must be greater than zero.
|
||||
#endif
|
||||
|
||||
#define SPINDLE_PWM_RANGE (SPINDLE_PWM_MAX_VALUE-SPINDLE_PWM_MIN_VALUE)
|
||||
|
||||
// Note: Only uncomment this if USE_SPINDLE_RELAY is commented out.
|
||||
// Relay can be used for Spindle or Coolant
|
||||
//#define COOLANT_FLOOD_PIN GPIO_NUM_2
|
||||
|
||||
#define X_LIMIT_PIN GPIO_NUM_17
|
||||
#define Y_LIMIT_PIN GPIO_NUM_4
|
||||
#define Z_LIMIT_PIN GPIO_NUM_15
|
||||
#define LIMIT_MASK B111
|
||||
|
||||
#endif
|
||||
#else
|
||||
#define SPINDLE_PWM_PIN GPIO_NUM_16
|
||||
#define SPINDLE_ENABLE_PIN GPIO_NUM_32
|
||||
#endif
|
||||
|
||||
#define SPINDLE_PWM_CHANNEL 0
|
||||
// PWM Generator is based on 80,000,000 Hz counter
|
||||
// Therefor the freq determines the resolution
|
||||
// 80,000,000 / freq = max resolution
|
||||
// For 5000 that is 80,000,000 / 5000 = 16000
|
||||
// round down to nearest bit count for SPINDLE_PWM_MAX_VALUE = 13bits (8192)
|
||||
#define SPINDLE_PWM_BASE_FREQ 5000 // Hz
|
||||
#define SPINDLE_PWM_BIT_PRECISION 8 // be sure to match this with SPINDLE_PWM_MAX_VALUE
|
||||
#define SPINDLE_PWM_OFF_VALUE 0
|
||||
#define SPINDLE_PWM_MAX_VALUE 255 // (2^SPINDLE_PWM_BIT_PRECISION)
|
||||
|
||||
#ifndef SPINDLE_PWM_MIN_VALUE
|
||||
#define SPINDLE_PWM_MIN_VALUE 1 // Must be greater than zero.
|
||||
#endif
|
||||
|
||||
#define SPINDLE_PWM_RANGE (SPINDLE_PWM_MAX_VALUE-SPINDLE_PWM_MIN_VALUE)
|
||||
|
||||
// Note: Only uncomment this if USE_SPINDLE_RELAY is commented out.
|
||||
// Relay can be used for spindle or either coolant
|
||||
//#define COOLANT_FLOOD_PIN GPIO_NUM_2
|
||||
//#define COOLANT_MIST_PIN GPIO_NUM_2
|
||||
|
||||
#ifdef V1P1 //v1p1
|
||||
#define X_LIMIT_PIN GPIO_NUM_2
|
||||
#else
|
||||
#define X_LIMIT_PIN GPIO_NUM_17
|
||||
#endif
|
||||
|
||||
#define Y_LIMIT_PIN GPIO_NUM_4
|
||||
#define Z_LIMIT_PIN GPIO_NUM_15
|
||||
#define LIMIT_MASK B111
|
||||
|
||||
#ifdef V1P2
|
||||
#ifndef ENABLE_SOFTWARE_DEBOUNCE // V1P2 does not have R/C filters
|
||||
#define ENABLE_SOFTWARE_DEBOUNCE
|
||||
#endif
|
||||
|
||||
#define PROBE_PIN GPIO_NUM_35
|
||||
|
||||
// The default value in config.h is wrong for this controller
|
||||
#ifdef INVERT_CONTROL_PIN_MASK
|
||||
#undef INVERT_CONTROL_PIN_MASK
|
||||
#endif
|
||||
|
||||
#define INVERT_CONTROL_PIN_MASK B1110
|
||||
|
||||
// Note: defualt is #define IGNORE_CONTROL_PINS in config.h
|
||||
// uncomment to these lines to use them
|
||||
#ifdef IGNORE_CONTROL_PINS
|
||||
#undef IGNORE_CONTROL_PINS
|
||||
#endif
|
||||
|
||||
#define CONTROL_RESET_PIN GPIO_NUM_34 // needs external pullup
|
||||
#define CONTROL_FEED_HOLD_PIN GPIO_NUM_36 // needs external pullup
|
||||
#define CONTROL_CYCLE_START_PIN GPIO_NUM_39 // needs external pullup
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CPU_MAP_MPCNC_V1P1
|
||||
// This is the CPU Map for the Buildlog.net MPCNC controller
|
||||
#endif
|
||||
|
||||
#define CPU_MAP_NAME "CPU_MAP_MPCNC_V1P1"
|
||||
#define PROBE_PIN GPIO_NUM_35
|
||||
|
||||
// switch to the correct default settings
|
||||
#ifdef DEFAULTS_GENERIC
|
||||
#undef DEFAULTS_GENERIC
|
||||
#endif
|
||||
#define DEFAULTS_MPCNC
|
||||
|
||||
// The default value in config.h is wrong for this controller
|
||||
#ifdef INVERT_CONTROL_PIN_MASK
|
||||
#undef INVERT_CONTROL_PIN_MASK
|
||||
#endif
|
||||
|
||||
#define USE_GANGED_AXES // allow two motors on an axis
|
||||
|
||||
#define X_STEP_PIN GPIO_NUM_12
|
||||
#define X_STEP_B_PIN GPIO_NUM_22 // ganged motor
|
||||
#define X_AXIS_SQUARING
|
||||
|
||||
#define Y_STEP_PIN GPIO_NUM_14
|
||||
#define Y_STEP_B_PIN GPIO_NUM_21 // ganged motor
|
||||
#define Y_AXIS_SQUARING
|
||||
|
||||
#define Z_STEP_PIN GPIO_NUM_27
|
||||
|
||||
#define X_DIRECTION_PIN GPIO_NUM_26
|
||||
#define Y_DIRECTION_PIN GPIO_NUM_25
|
||||
#define Z_DIRECTION_PIN GPIO_NUM_33
|
||||
|
||||
// OK to comment out to use pin for other features
|
||||
#define STEPPERS_DISABLE_PIN GPIO_NUM_13
|
||||
|
||||
|
||||
// Note: if you use PWM rather than relay, you could map GPIO_NUM_17 to mist or flood
|
||||
#define USE_SPINDLE_RELAY
|
||||
|
||||
#ifdef USE_SPINDLE_RELAY
|
||||
#define SPINDLE_PWM_PIN GPIO_NUM_17
|
||||
#else
|
||||
#define SPINDLE_PWM_PIN GPIO_NUM_16
|
||||
#define SPINDLE_ENABLE_PIN GPIO_NUM_32
|
||||
#endif
|
||||
|
||||
#define SPINDLE_PWM_CHANNEL 0
|
||||
// PWM Generator is based on 80,000,000 Hz counter
|
||||
// Therefor the freq determines the resolution
|
||||
// 80,000,000 / freq = max resolution
|
||||
// For 5000 that is 80,000,000 / 5000 = 16000
|
||||
// round down to nearest bit count for SPINDLE_PWM_MAX_VALUE = 13bits (8192)
|
||||
#define SPINDLE_PWM_BASE_FREQ 5000 // Hz
|
||||
#define SPINDLE_PWM_BIT_PRECISION 8 // be sure to match this with SPINDLE_PWM_MAX_VALUE
|
||||
#define SPINDLE_PWM_OFF_VALUE 0
|
||||
#define SPINDLE_PWM_MAX_VALUE 255 // (2^SPINDLE_PWM_BIT_PRECISION)
|
||||
|
||||
#ifndef SPINDLE_PWM_MIN_VALUE
|
||||
#define SPINDLE_PWM_MIN_VALUE 1 // Must be greater than zero.
|
||||
#endif
|
||||
|
||||
#define SPINDLE_PWM_RANGE (SPINDLE_PWM_MAX_VALUE-SPINDLE_PWM_MIN_VALUE)
|
||||
|
||||
// Note: Only uncomment this if USE_SPINDLE_RELAY is commented out.
|
||||
// Relay can be used for Spindle or Coolant
|
||||
//#define COOLANT_FLOOD_PIN GPIO_NUM_17
|
||||
|
||||
#define X_LIMIT_PIN GPIO_NUM_34
|
||||
#define Y_LIMIT_PIN GPIO_NUM_4
|
||||
#define Z_LIMIT_PIN GPIO_NUM_15
|
||||
#define LIMIT_MASK B111
|
||||
|
||||
#define PROBE_PIN GPIO_NUM_35
|
||||
|
||||
// The default value in config.h is wrong for this controller
|
||||
#ifdef INVERT_CONTROL_PIN_MASK
|
||||
#undef INVERT_CONTROL_PIN_MASK
|
||||
#endif
|
||||
|
||||
#define INVERT_CONTROL_PIN_MASK B1100
|
||||
|
||||
// Note: check the #define IGNORE_CONTROL_PINS is the way you want in config.h
|
||||
//#define CONTROL_RESET_PIN GPIO_NUM_34 // needs external pullup
|
||||
#define CONTROL_FEED_HOLD_PIN GPIO_NUM_36 // needs external pullup
|
||||
#define CONTROL_CYCLE_START_PIN GPIO_NUM_39 // needs external pullup
|
||||
#define INVERT_CONTROL_PIN_MASK B1110
|
||||
|
||||
// Note: default is #define IGNORE_CONTROL_PINS in config.h
|
||||
// uncomment to these lines to use them
|
||||
#ifdef IGNORE_CONTROL_PINS
|
||||
#undef IGNORE_CONTROL_PINS
|
||||
#endif
|
||||
|
||||
#define CONTROL_RESET_PIN GPIO_NUM_34 // needs external pullup
|
||||
#define CONTROL_FEED_HOLD_PIN GPIO_NUM_36 // needs external pullup
|
||||
#define CONTROL_CYCLE_START_PIN GPIO_NUM_39 // needs external pullup
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1093,79 +1028,97 @@
|
||||
// This is the CPU Map for the Buildlog.net MPCNC controller
|
||||
// used in lowrider mode. Low rider has (2) Y and Z and one X motor
|
||||
// These will not match the silkscreen or schematic descriptions
|
||||
#define CPU_MAP_NAME "CPU_MAP_LOWRIDER"
|
||||
//#define V1P1
|
||||
#define V1P2 // works for V1.2.1 as well
|
||||
|
||||
#ifdef V1P1
|
||||
#define CPU_MAP_NAME "CPU_MAP_LOWRIDER_V1P1"
|
||||
#else // V1P2
|
||||
#define CPU_MAP_NAME "CPU_MAP_LOWRIDER_V1P2"
|
||||
#endif
|
||||
|
||||
#define USE_GANGED_AXES // allow two motors on an axis
|
||||
|
||||
#define X_STEP_PIN GPIO_NUM_27 // use Z labeled connector
|
||||
#define X_DIRECTION_PIN GPIO_NUM_33 // use Z labeled connector
|
||||
|
||||
#define Y_STEP_PIN GPIO_NUM_14
|
||||
#define Y_STEP_B_PIN GPIO_NUM_21 // ganged motor
|
||||
#define Y_DIRECTION_PIN GPIO_NUM_25
|
||||
#define Y_AXIS_SQUARING
|
||||
|
||||
#define USE_GANGED_AXES // allow two motors on an axis
|
||||
|
||||
#define X_STEP_PIN GPIO_NUM_27 // use Z labeled connector
|
||||
#define X_DIRECTION_PIN GPIO_NUM_33 // use Z labeled connector
|
||||
|
||||
#define Y_STEP_PIN GPIO_NUM_14
|
||||
#define Y_STEP_B_PIN GPIO_NUM_21 // ganged motor
|
||||
#define Y_DIRECTION_PIN GPIO_NUM_25
|
||||
#define Y_AXIS_SQUARING
|
||||
|
||||
#define Z_STEP_PIN GPIO_NUM_12 // use X labeled connector
|
||||
#define Z_STEP_B_PIN GPIO_NUM_22 // use X labeled connector
|
||||
#define Z_DIRECTION_PIN GPIO_NUM_26 // use X labeled connector
|
||||
#define Z_AXIS_SQUARING
|
||||
|
||||
|
||||
// OK to comment out to use pin for other features
|
||||
#define STEPPERS_DISABLE_PIN GPIO_NUM_13
|
||||
|
||||
|
||||
// Note: if you use PWM rather than relay, you could map GPIO_NUM_17 to mist or flood
|
||||
#define USE_SPINDLE_RELAY
|
||||
|
||||
#ifdef USE_SPINDLE_RELAY
|
||||
#define Z_STEP_PIN GPIO_NUM_12 // use X labeled connector
|
||||
#define Z_STEP_B_PIN GPIO_NUM_22 // use X labeled connector
|
||||
#define Z_DIRECTION_PIN GPIO_NUM_26 // use X labeled connector
|
||||
#define Z_AXIS_SQUARING
|
||||
|
||||
// OK to comment out to use pin for other features
|
||||
#define STEPPERS_DISABLE_PIN GPIO_NUM_13
|
||||
|
||||
// Note: if you use PWM rather than relay, you could map GPIO_NUM_2 to mist or flood
|
||||
//#define USE_SPINDLE_RELAY
|
||||
|
||||
#ifdef USE_SPINDLE_RELAY
|
||||
#ifdef V1P1
|
||||
#define SPINDLE_PWM_PIN GPIO_NUM_17
|
||||
#else
|
||||
#define SPINDLE_PWM_PIN GPIO_NUM_16
|
||||
#define SPINDLE_ENABLE_PIN GPIO_NUM_32
|
||||
#else // V1p2
|
||||
#define SPINDLE_PWM_PIN GPIO_NUM_2
|
||||
#endif
|
||||
#else
|
||||
#define SPINDLE_PWM_PIN GPIO_NUM_16
|
||||
#define SPINDLE_ENABLE_PIN GPIO_NUM_32
|
||||
#endif
|
||||
|
||||
#define SPINDLE_PWM_CHANNEL 0
|
||||
// PWM Generator is based on 80,000,000 Hz counter
|
||||
// Therefor the freq determines the resolution
|
||||
// 80,000,000 / freq = max resolution
|
||||
// For 5000 that is 80,000,000 / 5000 = 16000
|
||||
// round down to nearest bit count for SPINDLE_PWM_MAX_VALUE = 13bits (8192)
|
||||
#define SPINDLE_PWM_BASE_FREQ 5000 // Hz
|
||||
#define SPINDLE_PWM_BIT_PRECISION 8 // be sure to match this with SPINDLE_PWM_MAX_VALUE
|
||||
#define SPINDLE_PWM_OFF_VALUE 0
|
||||
#define SPINDLE_PWM_MAX_VALUE 255 // (2^SPINDLE_PWM_BIT_PRECISION)
|
||||
|
||||
#ifndef SPINDLE_PWM_MIN_VALUE
|
||||
#define SPINDLE_PWM_MIN_VALUE 1 // Must be greater than zero.
|
||||
#endif
|
||||
|
||||
#define SPINDLE_PWM_RANGE (SPINDLE_PWM_MAX_VALUE-SPINDLE_PWM_MIN_VALUE)
|
||||
|
||||
// Note: Only uncomment this if USE_SPINDLE_RELAY is commented out.
|
||||
// Relay can be used for Spindle or Coolant
|
||||
//#define COOLANT_FLOOD_PIN GPIO_NUM_17
|
||||
|
||||
#define X_LIMIT_PIN GPIO_NUM_15
|
||||
#define Y_LIMIT_PIN GPIO_NUM_4
|
||||
|
||||
#ifdef V1P1 //v1p1
|
||||
#define Z_LIMIT_PIN GPIO_NUM_2
|
||||
#else
|
||||
#define Z_LIMIT_PIN GPIO_NUM_17
|
||||
#endif
|
||||
|
||||
#define LIMIT_MASK B111
|
||||
|
||||
#ifdef V1P2
|
||||
#ifndef ENABLE_SOFTWARE_DEBOUNCE // V1P2 does not have R/C filters
|
||||
#define ENABLE_SOFTWARE_DEBOUNCE
|
||||
#endif
|
||||
|
||||
#define SPINDLE_PWM_CHANNEL 0
|
||||
// PWM Generator is based on 80,000,000 Hz counter
|
||||
// Therefor the freq determines the resolution
|
||||
// 80,000,000 / freq = max resolution
|
||||
// For 5000 that is 80,000,000 / 5000 = 16000
|
||||
// round down to nearest bit count for SPINDLE_PWM_MAX_VALUE = 13bits (8192)
|
||||
#define SPINDLE_PWM_BASE_FREQ 5000 // Hz
|
||||
#define SPINDLE_PWM_BIT_PRECISION 8 // be sure to match this with SPINDLE_PWM_MAX_VALUE
|
||||
#define SPINDLE_PWM_OFF_VALUE 0
|
||||
#define SPINDLE_PWM_MAX_VALUE 255 // (2^SPINDLE_PWM_BIT_PRECISION)
|
||||
|
||||
#ifndef SPINDLE_PWM_MIN_VALUE
|
||||
#define SPINDLE_PWM_MIN_VALUE 1 // Must be greater than zero.
|
||||
#endif
|
||||
|
||||
#define SPINDLE_PWM_RANGE (SPINDLE_PWM_MAX_VALUE-SPINDLE_PWM_MIN_VALUE)
|
||||
|
||||
// Note: Only uncomment this if USE_SPINDLE_RELAY is commented out.
|
||||
// Relay can be used for Spindle or Coolant
|
||||
//#define COOLANT_FLOOD_PIN GPIO_NUM_17
|
||||
|
||||
#define X_LIMIT_PIN GPIO_NUM_15
|
||||
#define Y_LIMIT_PIN GPIO_NUM_4
|
||||
#define Z_LIMIT_PIN GPIO_NUM_2
|
||||
#define LIMIT_MASK B111
|
||||
|
||||
#define PROBE_PIN GPIO_NUM_35
|
||||
|
||||
// The default value in config.h is wrong for this controller
|
||||
#ifdef INVERT_CONTROL_PIN_MASK
|
||||
#undef INVERT_CONTROL_PIN_MASK
|
||||
#endif
|
||||
|
||||
#define INVERT_CONTROL_PIN_MASK B1110
|
||||
|
||||
// Note: check the #define IGNORE_CONTROL_PINS is the way you want in config.h
|
||||
#define CONTROL_RESET_PIN GPIO_NUM_34 // needs external pullup
|
||||
#define CONTROL_FEED_HOLD_PIN GPIO_NUM_36 // needs external pullup
|
||||
#define CONTROL_CYCLE_START_PIN GPIO_NUM_39 // needs external pullup
|
||||
|
||||
#endif
|
||||
|
||||
// The default value in config.h is wrong for this controller
|
||||
#ifdef INVERT_CONTROL_PIN_MASK
|
||||
#undef INVERT_CONTROL_PIN_MASK
|
||||
#endif
|
||||
|
||||
#define INVERT_CONTROL_PIN_MASK B1110
|
||||
|
||||
// Note: check the #define IGNORE_CONTROL_PINS is the way you want in config.h
|
||||
#define CONTROL_RESET_PIN GPIO_NUM_34 // needs external pullup
|
||||
#define CONTROL_FEED_HOLD_PIN GPIO_NUM_36 // needs external pullup
|
||||
#define CONTROL_CYCLE_START_PIN GPIO_NUM_39 // needs external pullup
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CPU_MAP_TMC2130_PEN
|
||||
@@ -1180,22 +1133,22 @@
|
||||
#define X_DIRECTION_PIN GPIO_NUM_26
|
||||
#define X_TRINAMIC // using SPI control
|
||||
#define X_DRIVER_TMC2130 // Which Driver Type?
|
||||
#define X_CS_PIN GPIO_NUM_17 //chip select
|
||||
#define X_RSENSE 0.11f // .11 Ohm
|
||||
#define X_MICROSTEPS 32
|
||||
#define X_RMS_CURRENT 750 // run current in mA
|
||||
#define X_HOLD_CURRENT 0.25 // hold current as percentage of run current
|
||||
#define X_CS_PIN GPIO_NUM_17 //chip select
|
||||
#define X_RSENSE 0.11f // .11 Ohm
|
||||
#define X_MICROSTEPS 32
|
||||
#define X_RMS_CURRENT 700 // run current in mA
|
||||
#define X_HOLD_CURRENT 0.25 // hold current as percentage of run current
|
||||
#define X_RMT_CHANNEL 0
|
||||
|
||||
#define Y_STEP_PIN GPIO_NUM_14
|
||||
#define Y_DIRECTION_PIN GPIO_NUM_25
|
||||
#define Y_TRINAMIC // using SPI control
|
||||
#define Y_DRIVER_TMC2130 // Which Driver Type?
|
||||
#define Y_CS_PIN GPIO_NUM_16 //chip select
|
||||
#define Y_RSENSE 0.11f // .11 Ohm
|
||||
#define Y_MICROSTEPS 32
|
||||
#define Y_RMS_CURRENT 750 // in mA
|
||||
#define Y_HOLD_CURRENT 0.25 // hold current as percentage of run current
|
||||
#define Y_CS_PIN GPIO_NUM_16 //chip select
|
||||
#define Y_RSENSE 0.11f // .11 Ohm
|
||||
#define Y_MICROSTEPS 32
|
||||
#define Y_RMS_CURRENT 700 // in mA
|
||||
#define Y_HOLD_CURRENT 0.25 // hold current as percentage of run current
|
||||
#define Y_RMT_CHANNEL 1
|
||||
|
||||
// OK to comment out to use pin for other features
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
// Grbl versioning system
|
||||
#define GRBL_VERSION "1.1f"
|
||||
#define GRBL_VERSION_BUILD "20190916"
|
||||
#define GRBL_VERSION_BUILD "20191004"
|
||||
|
||||
//#include <sdkconfig.h>
|
||||
#include <Arduino.h>
|
||||
@@ -86,7 +86,6 @@
|
||||
#endif
|
||||
|
||||
#ifdef USE_TRINAMIC
|
||||
#include "grbl_trinamic.h"
|
||||
//#include "TMCStepper.h" // https://github.com/teemuatlut/TMCStepper
|
||||
#include "grbl_trinamic.h"
|
||||
#endif
|
||||
|
||||
|
@@ -239,9 +239,17 @@ void limits_go_home(uint8_t cycle_mask)
|
||||
set_axis_position = 0;
|
||||
#else
|
||||
if ( bit_istrue(settings.homing_dir_mask,bit(idx)) ) {
|
||||
set_axis_position = lround((settings.max_travel[idx]+settings.homing_pulloff)*settings.steps_per_mm[idx]);
|
||||
#ifdef HOMING_FORCE_POSITIVE_SPACE
|
||||
set_axis_position = 0; //lround(settings.homing_pulloff*settings.steps_per_mm[idx]);
|
||||
#else
|
||||
set_axis_position = lround((settings.max_travel[idx]+settings.homing_pulloff)*settings.steps_per_mm[idx]);
|
||||
#endif
|
||||
} else {
|
||||
set_axis_position = lround(-settings.homing_pulloff*settings.steps_per_mm[idx]);
|
||||
#ifdef HOMING_FORCE_POSITIVE_SPACE
|
||||
set_axis_position = lround((-settings.max_travel[idx]-settings.homing_pulloff)*settings.steps_per_mm[idx]);
|
||||
#else
|
||||
set_axis_position = lround(-settings.homing_pulloff*settings.steps_per_mm[idx]);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
grbl_trinamic.cpp - Support for Trinamic Stepper Drivers SPI Mode
|
||||
using the TMCStepper library
|
||||
|
||||
Part of Grbl_ESP32
|
||||
Part of Grbl_ESP32
|
||||
|
||||
Copyright (c) 2019 Barton Dring for Buildlog.net LLC
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Grbl. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "grbl.h"
|
||||
|
||||
#ifdef USE_TRINAMIC
|
||||
|
||||
// TODO try to use the #define ## method to clean this up
|
||||
//#define DRIVER(driver, axis) driver##Stepper = TRINAMIC_axis## = driver##Stepper(axis##_CS_PIN, axis##_RSENSE);
|
||||
@@ -30,9 +30,6 @@
|
||||
#ifdef X_DRIVER_TMC2130
|
||||
TMC2130Stepper TRINAMIC_X = TMC2130Stepper(X_CS_PIN, X_RSENSE);
|
||||
#endif
|
||||
#ifdef X_DRIVER_TMC2208
|
||||
TMC2208Stepper TRINAMIC_X = TMC2208Stepper(X_CS_PIN, X_RSENSE);
|
||||
#endif
|
||||
#ifdef X_DRIVER_TMC2209
|
||||
TMC2209Stepper TRINAMIC_X = TMC2209Stepper(X_CS_PIN, X_RSENSE);
|
||||
#endif
|
||||
@@ -45,9 +42,6 @@
|
||||
#ifdef Y_DRIVER_TMC2130
|
||||
TMC2130Stepper TRINAMIC_Y = TMC2130Stepper(Y_CS_PIN, Y_RSENSE);
|
||||
#endif
|
||||
#ifdef Y_DRIVER_TMC2208
|
||||
TMC2208Stepper TRINAMIC_Y = TMC2208Stepper(Y_CS_PIN, Y_RSENSE);
|
||||
#endif
|
||||
#ifdef Y_DRIVER_TMC2209
|
||||
TMC2209Stepper TRINAMIC_Y = TMC2209Stepper(Y_CS_PIN, Y_RSENSE);
|
||||
#endif
|
||||
@@ -60,9 +54,6 @@
|
||||
#ifdef Z_DRIVER_TMC2130
|
||||
TMC2130Stepper TRINAMIC_Z = TMC2130Stepper(Z_CS_PIN, Z_RSENSE);
|
||||
#endif
|
||||
#ifdef Z_DRIVER_TMC2208
|
||||
TMC2208Stepper TRINAMIC_Z = TMC2208Stepper(Z_CS_PIN, Z_RSENSE);
|
||||
#endif
|
||||
#ifdef Z_DRIVER_TMC2209
|
||||
TMC2209Stepper TRINAMIC_Z = TMC2209Stepper(Z_CS_PIN, Z_RSENSE);
|
||||
#endif
|
||||
@@ -75,9 +66,6 @@
|
||||
#ifdef A_DRIVER_TMC2130
|
||||
TMC2130Stepper TRINAMIC_A = TMC2130Stepper(A_CS_PIN, A_RSENSE);
|
||||
#endif
|
||||
#ifdef A_DRIVER_TMC2208
|
||||
TMC2208Stepper TRINAMIC_A = TMC2208Stepper(A_CS_PIN, A_RSENSE);
|
||||
#endif
|
||||
#ifdef A_DRIVER_TMC2209
|
||||
TMC2209Stepper TRINAMIC_A = TMC2209Stepper(A_CS_PIN, A_RSENSE);
|
||||
#endif
|
||||
@@ -90,9 +78,6 @@
|
||||
#ifdef B_DRIVER_TMC2130
|
||||
TMC2130Stepper TRINAMIC_B = TMC2130Stepper(B_CS_PIN, B_RSENSE);
|
||||
#endif
|
||||
#ifdef B_DRIVER_TMC2208
|
||||
TMC2208Stepper TRINAMIC_B = TMC2208Stepper(B_CS_PIN, B_RSENSE);
|
||||
#endif
|
||||
#ifdef B_DRIVER_TMC2209
|
||||
TMC2209Stepper TRINAMIC_B = TMC2209Stepper(B_CS_PIN, B_RSENSE);
|
||||
#endif
|
||||
@@ -105,9 +90,6 @@
|
||||
#ifdef C_DRIVER_TMC2130
|
||||
TMC2130Stepper TRINAMIC_c = TMC2130Stepper(C_CS_PIN, C_RSENSE);
|
||||
#endif
|
||||
#ifdef C_DRIVER_TMC2208
|
||||
TMC2208Stepper TRINAMIC_C = TMC2208Stepper(C_CS_PIN, C_RSENSE);
|
||||
#endif
|
||||
#ifdef C_DRIVER_TMC2209
|
||||
TMC2209Stepper TRINAMIC_C = TMC2209Stepper(C_CS_PIN, C_RSENSE);
|
||||
#endif
|
||||
@@ -120,7 +102,7 @@
|
||||
|
||||
void Trinamic_Init()
|
||||
{
|
||||
grbl_send(CLIENT_SERIAL, "[MSG:Using TMCStepper Library]\r\n");
|
||||
grbl_sendf(CLIENT_SERIAL, "[MSG:Using TMCStepper Library Ver 0x%06x]\r\n", TMCSTEPPER_VERSION);
|
||||
|
||||
SPI.begin();
|
||||
|
||||
@@ -187,4 +169,6 @@ void Trinamic_Init()
|
||||
#endif
|
||||
|
||||
// TODO ABC Axes
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@@ -22,9 +22,9 @@
|
||||
#define GRBL_TRINAMIC_h
|
||||
|
||||
#include "grbl.h"
|
||||
#include <TMCStepper.h> // https://github.com/teemuatlut/TMCStepper
|
||||
|
||||
#ifdef USE_TRINAMIC
|
||||
#include <TMCStepper.h> // https://github.com/teemuatlut/TMCStepper
|
||||
void Trinamic_Init();
|
||||
#endif
|
||||
|
||||
|
@@ -213,6 +213,14 @@ void mc_dwell(float seconds)
|
||||
// executing the homing cycle. This prevents incorrect buffered plans after homing.
|
||||
void mc_homing_cycle(uint8_t cycle_mask)
|
||||
{
|
||||
|
||||
// This give kinematics a chance to do something before normal homing
|
||||
// if it returns true, the homing is canceled.
|
||||
#ifdef USE_KINEMATICS
|
||||
if (!kinematics_homing(cycle_mask))
|
||||
return;
|
||||
#endif
|
||||
|
||||
// Check and abort homing cycle, if hard limits are already enabled. Helps prevent problems
|
||||
// with machines with limits wired on both ends of travel to one limit pin.
|
||||
// TODO: Move the pin-specific LIMIT_PIN call to limits.c as a function.
|
||||
|
@@ -53,6 +53,20 @@
|
||||
#ifdef CPU_MAP_POLAR_COASTER
|
||||
#ifdef USE_KINEMATICS
|
||||
|
||||
// this get called before homing
|
||||
// return true to complete normal home
|
||||
// return false to exit normal homing
|
||||
bool kinematics_homing(uint8_t cycle_mask)
|
||||
{
|
||||
// cycle mask not used for polar coaster
|
||||
|
||||
// zero the axes that are not homed
|
||||
sys_position[Y_AXIS] = 0.0f;
|
||||
sys_position[Z_AXIS] = 0.0f;
|
||||
|
||||
return true; // finish normal homing cycle
|
||||
}
|
||||
|
||||
/*
|
||||
Apply inverse kinematics for a polar system
|
||||
|
||||
@@ -140,6 +154,8 @@ void inverse_kinematics(float *target, plan_line_data_t *pl_data, float *positio
|
||||
|
||||
mc_line(polar, pl_data);
|
||||
}
|
||||
|
||||
// TO DO don't need a feedrate for rapids
|
||||
}
|
||||
|
||||
|
||||
@@ -193,17 +209,24 @@ void calc_polar(float *target_xyz, float *polar, float last_angle)
|
||||
{
|
||||
float delta_ang; // the difference from the last and next angle
|
||||
|
||||
target_xyz[X_AXIS] *= -1.0; // compensate for Polar Coaster's radial axis being mirrored (right side) from normal 0deg
|
||||
//grbl_sendf(CLIENT_SERIAL, "calc polar: x...%4.2f y...%4.2f\r\n", target_xyz[X_AXIS], target_xyz[Y_AXIS]);
|
||||
|
||||
// determine the new polar values
|
||||
polar[POLAR_AXIS] = atan2(target_xyz[Y_AXIS], target_xyz[X_AXIS]) * 180.0 / M_PI;
|
||||
//target_xyz[X_AXIS] *= -1.0; // compensate for Polar Coaster's radial axis being mirrored (right side) from normal 0deg
|
||||
|
||||
// no negative angles...we want the absolute angle not -90, use 270
|
||||
if (polar[POLAR_AXIS] < 0.0) {
|
||||
polar[POLAR_AXIS] = 360.0 + polar[POLAR_AXIS];
|
||||
}
|
||||
|
||||
polar[RADIUS_AXIS] = hypot_f(target_xyz[X_AXIS], target_xyz[Y_AXIS]);
|
||||
|
||||
if (polar[RADIUS_AXIS] == 0) {
|
||||
polar[POLAR_AXIS] = last_angle; // don't care about angle at center
|
||||
}
|
||||
else {
|
||||
polar[POLAR_AXIS] = atan2(target_xyz[Y_AXIS], target_xyz[X_AXIS]) * 180.0 / M_PI;
|
||||
// no negative angles...we want the absolute angle not -90, use 270
|
||||
if (polar[POLAR_AXIS] < 0.0) {
|
||||
polar[POLAR_AXIS] = 360.0 + polar[POLAR_AXIS];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
polar[Z_AXIS] = target_xyz[Z_AXIS]; // Z is unchanged
|
||||
|
||||
|
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "grbl.h"
|
||||
|
||||
bool kinematics_homing(uint8_t cycle_mask);
|
||||
void inverse_kinematics(float *target, plan_line_data_t *pl_data, float *position);
|
||||
void calc_polar(float *target_xyz, float *polar, float last_angle);
|
||||
void user_defined_macro(uint8_t index);
|
||||
|
@@ -542,9 +542,9 @@ void report_build_info(char *line, uint8_t client)
|
||||
#ifdef PARKING_ENABLE
|
||||
strcat(build_info,"P");
|
||||
#endif
|
||||
#ifdef HOMING_FORCE_SET_ORIGIN
|
||||
strcat(build_info,"Z");
|
||||
#endif
|
||||
#if (defined(HOMING_FORCE_SET_ORIGIN) || defined(HOMING_FORCE_POSITIVE_SPACE))
|
||||
strcat(build_info,"Z"); // homing MPOS bahavior is not the default behavior
|
||||
#endif
|
||||
#ifdef HOMING_SINGLE_AXIS_COMMANDS
|
||||
strcat(build_info,"H");
|
||||
#endif
|
||||
|
@@ -274,11 +274,9 @@ void IRAM_ATTR onStepperDriverTimer(void *para) // ISR It is time to take a ste
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef VARIABLE_SPINDLE
|
||||
#ifdef VARIABLE_SPINDLE
|
||||
// Set real-time spindle output as segment is loaded, just prior to the first step.
|
||||
if (st_prep_block->is_pwm_rate_adjusted) {
|
||||
spindle_set_speed(st.exec_segment->spindle_pwm);
|
||||
}
|
||||
#endif
|
||||
|
||||
} else {
|
||||
|
@@ -82,8 +82,10 @@ extern uint8_t ganged_mode;
|
||||
void IRAM_ATTR onSteppertimer();
|
||||
void IRAM_ATTR onStepperOffTimer();
|
||||
|
||||
#ifdef USE_RMT_STEPS
|
||||
void initRMT();
|
||||
inline IRAM_ATTR static void stepperRMT_Outputs();
|
||||
#endif
|
||||
|
||||
void stepper_init();
|
||||
|
||||
|
@@ -425,7 +425,11 @@ uint8_t system_check_travel_limits(float *target)
|
||||
}
|
||||
#else
|
||||
// NOTE: max_travel is stored as negative
|
||||
if (target[idx] > 0 || target[idx] < settings.max_travel[idx]) { return(true); }
|
||||
#ifdef HOMING_FORCE_POSITIVE_SPACE
|
||||
if (target[idx] < 0 || target[idx] > -settings.max_travel[idx]) { return(true); }
|
||||
#else
|
||||
if (target[idx] > 0 || target[idx] < settings.max_travel[idx]) { return(true); }
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
return(false);
|
||||
|
Reference in New Issue
Block a user