mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-30 17:49:56 +02:00
Homing cycle defaults (#624)
* Changed to add homing cycle defaults There needs to be a way to set the homing cycle defaults in a machine definition. There will likely be a better way to do this in the future. * Update 10vSpindle.cpp Had wrong error message
This commit is contained in:
@@ -118,6 +118,30 @@
|
||||
# define DEFAULT_HOMING_SQUARED_AXES 0
|
||||
#endif
|
||||
|
||||
#ifndef DEFAULT_HOMING_CYCLE_0
|
||||
# define DEFAULT_HOMING_CYCLE_0 bit(Z_AXIS)
|
||||
#endif
|
||||
|
||||
#ifndef DEFAULT_HOMING_CYCLE_1
|
||||
# define DEFAULT_HOMING_CYCLE_1 (bit(X_AXIS) | bit(Y_AXIS))
|
||||
#endif
|
||||
|
||||
#ifndef DEFAULT_HOMING_CYCLE_2
|
||||
# define DEFAULT_HOMING_CYCLE_2 0
|
||||
#endif
|
||||
|
||||
#ifndef DEFAULT_HOMING_CYCLE_3
|
||||
# define DEFAULT_HOMING_CYCLE_3 0
|
||||
#endif
|
||||
|
||||
#ifndef DEFAULT_HOMING_CYCLE_4
|
||||
# define DEFAULT_HOMING_CYCLE_4 0
|
||||
#endif
|
||||
|
||||
#ifndef DEFAULT_HOMING_CYCLE_5
|
||||
# define DEFAULT_HOMING_CYCLE_5 0
|
||||
#endif
|
||||
|
||||
// ======== SPINDLE STUFF ====================
|
||||
#ifndef SPINDLE_TYPE
|
||||
# define SPINDLE_TYPE SpindleType::NONE
|
||||
|
@@ -23,7 +23,7 @@
|
||||
// Grbl versioning system
|
||||
|
||||
const char* const GRBL_VERSION = "1.3a";
|
||||
const char* const GRBL_VERSION_BUILD = "20200929";
|
||||
const char* const GRBL_VERSION_BUILD = "20201001";
|
||||
|
||||
//#include <sdkconfig.h>
|
||||
#include <Arduino.h>
|
||||
|
@@ -26,16 +26,6 @@
|
||||
|
||||
#define N_AXIS 3
|
||||
|
||||
#ifdef HOMING_CYCLE_0
|
||||
#undef HOMING_CYCLE_0
|
||||
#endif
|
||||
#define HOMING_CYCLE_0 bit(Z_AXIS) // Z first
|
||||
|
||||
#ifdef HOMING_CYCLE_1
|
||||
#undef HOMING_CYCLE_1
|
||||
#endif
|
||||
#define HOMING_CYCLE_1 (bit(X_AXIS)|bit(Y_AXIS))
|
||||
|
||||
// === Special Features
|
||||
|
||||
// I2S (steppers & other output-only pins)
|
||||
@@ -110,27 +100,27 @@ Socket #5
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
// 4x Input Module in Socket #1
|
||||
// https://github.com/bdring/6-Pack_CNC_Controller/wiki/4x-Switch-Input-module
|
||||
#define X_LIMIT_PIN GPIO_NUM_33
|
||||
#define Y_LIMIT_PIN GPIO_NUM_32
|
||||
#define Z_LIMIT_PIN GPIO_NUM_35
|
||||
*/
|
||||
|
||||
// 4x Input Module in Socket #2
|
||||
// https://github.com/bdring/6-Pack_CNC_Controller/wiki/4x-Switch-Input-module
|
||||
#define X_LIMIT_PIN GPIO_NUM_2
|
||||
#define Y_LIMIT_PIN GPIO_NUM_25
|
||||
#define Z_LIMIT_PIN GPIO_NUM_39
|
||||
|
||||
// 4x Input Module in Socket #3
|
||||
// https://github.com/bdring/6-Pack_CNC_Controller/wiki/4x-Switch-Input-module
|
||||
#define CONTROL_CYCLE_START_PIN GPIO_NUM_26
|
||||
#define CONTROL_FEED_HOLD_PIN GPIO_NUM_4
|
||||
#define CONTROL_RESET_PIN GPIO_NUM_16
|
||||
#define CONTROL_SAFETY_DOOR_PIN GPIO_NUM_27
|
||||
//#define INVERT_CONTROL_PIN_MASK B0000
|
||||
// // 4x Input Module in Socket #2
|
||||
// // https://github.com/bdring/6-Pack_CNC_Controller/wiki/4x-Switch-Input-module
|
||||
// #define X_LIMIT_PIN GPIO_NUM_2
|
||||
// #define Y_LIMIT_PIN GPIO_NUM_25
|
||||
// #define Z_LIMIT_PIN GPIO_NUM_39
|
||||
|
||||
// // 4x Input Module in Socket #3
|
||||
// // https://github.com/bdring/6-Pack_CNC_Controller/wiki/4x-Switch-Input-module
|
||||
// #define CONTROL_CYCLE_START_PIN GPIO_NUM_26
|
||||
// #define CONTROL_FEED_HOLD_PIN GPIO_NUM_4
|
||||
// #define CONTROL_RESET_PIN GPIO_NUM_16
|
||||
// #define CONTROL_SAFETY_DOOR_PIN GPIO_NUM_27
|
||||
// //#define INVERT_CONTROL_PIN_MASK B0000
|
||||
|
||||
|
||||
// ================= Setting Defaults ==========================
|
||||
|
@@ -54,6 +54,9 @@
|
||||
#define SPINDLE_TYPE SpindleType::NONE
|
||||
|
||||
// defaults
|
||||
#define DEFAULT_HOMING_CYCLE_0 bit(Y_AXIS)
|
||||
#define DEFAULT_HOMING_CYCLE_1 bit(X_AXIS)
|
||||
|
||||
#define DEFAULT_STEP_PULSE_MICROSECONDS 3
|
||||
#define DEFAULT_STEPPER_IDLE_LOCK_TIME 255 // stay on
|
||||
|
||||
|
@@ -37,6 +37,15 @@
|
||||
|
||||
#define MACHINE_NAME "Test Drive - Demo Only No I/O!"
|
||||
|
||||
// This cannot use homing because there are no switches
|
||||
#ifdef DEFAULT_HOMING_CYCLE_0
|
||||
#undef DEFAULT_HOMING_CYCLE_0
|
||||
#endif
|
||||
|
||||
#ifdef DEFAULT_HOMING_CYCLE_1
|
||||
#undef DEFAULT_HOMING_CYCLE_1
|
||||
#endif
|
||||
|
||||
#define SPINDLE_TYPE SpindleType::NONE
|
||||
|
||||
#ifdef USE_RMT_STEPS
|
||||
|
@@ -375,9 +375,10 @@ void make_settings() {
|
||||
spindle_type = new EnumSetting(NULL, EXTENDED, WG, NULL, "Spindle/Type", static_cast<int8_t>(SPINDLE_TYPE), &spindleTypes);
|
||||
stallguard_debug_mask = new AxisMaskSetting(EXTENDED, WG, NULL, "Report/StallGuard", 0, checkStallguardDebugMask);
|
||||
|
||||
const char* homing_names[] = { "Homing/Cycle0", "Homing/Cycle1", "Homing/Cycle2",
|
||||
"Homing/Cycle3", "Homing/Cycle4", "Homing/Cycle5" };
|
||||
for (uint8_t i = 0; i < MAX_N_AXIS; i++) {
|
||||
homing_cycle[i] = new AxisMaskSetting(EXTENDED, WG, NULL, homing_names[i], 0);
|
||||
}
|
||||
homing_cycle[0] = new AxisMaskSetting(EXTENDED, WG, NULL, "Homing/Cycle0", DEFAULT_HOMING_CYCLE_0);
|
||||
homing_cycle[1] = new AxisMaskSetting(EXTENDED, WG, NULL, "Homing/Cycle1", DEFAULT_HOMING_CYCLE_1);
|
||||
homing_cycle[2] = new AxisMaskSetting(EXTENDED, WG, NULL, "Homing/Cycle2", DEFAULT_HOMING_CYCLE_2);
|
||||
homing_cycle[3] = new AxisMaskSetting(EXTENDED, WG, NULL, "Homing/Cycle3", DEFAULT_HOMING_CYCLE_3);
|
||||
homing_cycle[4] = new AxisMaskSetting(EXTENDED, WG, NULL, "Homing/Cycle4", DEFAULT_HOMING_CYCLE_4);
|
||||
homing_cycle[5] = new AxisMaskSetting(EXTENDED, WG, NULL, "Homing/Cycle5", DEFAULT_HOMING_CYCLE_5);
|
||||
}
|
||||
|
@@ -44,7 +44,7 @@ namespace Spindles {
|
||||
#endif
|
||||
|
||||
if (_output_pin == UNDEFINED_PIN) {
|
||||
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Warning: BESC output pin not defined");
|
||||
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Warning: Spindle output pin not defined");
|
||||
return; // We cannot continue without the output pin
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user