From d6a9400bd6573fe3edb1998d1cab92d287376995 Mon Sep 17 00:00:00 2001 From: bdring Date: Fri, 2 Oct 2020 14:18:23 -0500 Subject: [PATCH] WIP --- Grbl_Esp32/src/Config.h | 4 ++-- Grbl_Esp32/src/Limits.cpp | 4 ++-- .../src/Machines/tapster_pro_6P_trinamic.h | 17 +++++++++++------ Grbl_Esp32/src/MotionControl.cpp | 7 ++++++- platformio.ini | 1 + 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/Grbl_Esp32/src/Config.h b/Grbl_Esp32/src/Config.h index 205db46e..0287aaa7 100644 --- a/Grbl_Esp32/src/Config.h +++ b/Grbl_Esp32/src/Config.h @@ -96,11 +96,11 @@ const int MAX_N_AXIS = 6; //#define CONNECT_TO_SSID "your SSID" //#define SSID_PASSWORD "your SSID password" //CONFIGURE_EYECATCH_BEGIN (DO NOT MODIFY THIS LINE) -#define ENABLE_BLUETOOTH // enable bluetooth +//#define ENABLE_BLUETOOTH // enable bluetooth #define ENABLE_SD_CARD // enable use of SD Card to run jobs -#define ENABLE_WIFI //enable wifi +//#define ENABLE_WIFI //enable wifi #if defined(ENABLE_WIFI) || defined(ENABLE_BLUETOOTH) # define WIFI_OR_BLUETOOTH diff --git a/Grbl_Esp32/src/Limits.cpp b/Grbl_Esp32/src/Limits.cpp index e3539fee..5bec9542 100644 --- a/Grbl_Esp32/src/Limits.cpp +++ b/Grbl_Esp32/src/Limits.cpp @@ -175,7 +175,7 @@ void limits_go_home(uint8_t cycle_mask) { sys.homing_axis_lock = axislock; // Perform homing cycle. Planner buffer should be empty, as required to initiate the homing cycle. pl_data->feed_rate = homing_rate; // Set current homing rate. - plan_buffer_line(target, pl_data); // Bypass mc_line(). Directly plan homing motion. + plan_buffer_line(target, pl_data); // Bypass mcline(). Directly plan homing motion. sys.step_control = STEP_CONTROL_EXECUTE_SYS_MOTION; // Set to execute homing motion and clear existing flags. st_prep_buffer(); // Prep and fill segment buffer from newly planned block. st_wake_up(); // Initiate motion @@ -392,7 +392,7 @@ uint8_t limits_get_state() { return pinMask; } -// Performs a soft limit check. Called from mc_line() only. Assumes the machine has been homed, +// Performs a soft limit check. Called from mcline() only. Assumes the machine has been homed, // the workspace volume is in all negative space, and the system is in normal operation. // NOTE: Used by jogging to limit travel within soft-limit volume. void limits_soft_check(float* target) { diff --git a/Grbl_Esp32/src/Machines/tapster_pro_6P_trinamic.h b/Grbl_Esp32/src/Machines/tapster_pro_6P_trinamic.h index 32700d0b..1c474d15 100644 --- a/Grbl_Esp32/src/Machines/tapster_pro_6P_trinamic.h +++ b/Grbl_Esp32/src/Machines/tapster_pro_6P_trinamic.h @@ -19,7 +19,6 @@ */ #define MACHINE_NAME "Tapster Pro Delta 6P Trinamic" - #define CUSTOM_CODE_FILENAME "Custom/parallel_delta.cpp" /* // enable these special machine functions to be called from the main program @@ -108,11 +107,17 @@ #define Z_CS_PIN I2SO(11) #define Z_RSENSE X_RSENSE -// 4x Switch input module on CNC I/O module Socket #1 +// // 4x Switch input module on CNC I/O module 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 Switch input module on CNC I/O module Socket #2 // 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 +#define X_LIMIT_PIN GPIO_NUM_2 +#define Y_LIMIT_PIN GPIO_NUM_25 +#define Z_LIMIT_PIN GPIO_NUM_39 //Example Quad MOSFET module on socket #5 // https://github.com/bdring/6-Pack_CNC_Controller/wiki/Quad-MOSFET-Module @@ -154,7 +159,7 @@ #define DEFAULT_HOMING_DIR_MASK (bit(X_AXIS) | bit(Y_AXIS) | bit(Z_AXIS)) // all axes home negative #define DEFAULT_HOMING_ENABLE 1 #define DEFAULT_INVERT_LIMIT_PINS 0 -#define DEFAULT_HOMING_CYCLE_0 #define DEFAULT_HOMING_CYCLE_0 (bit(X_AXIS) | bit(Y_AXIS) | bit(Y_AXIS)) +#define DEFAULT_HOMING_CYCLE_0 (bit(X_AXIS) | bit(Y_AXIS) | bit(Z_AXIS)) #define DEFAULT_HOMING_CYCLE_1 0 // override this one in defaults.h // The machine homes up and above center. MPos is the axis angle in radians diff --git a/Grbl_Esp32/src/MotionControl.cpp b/Grbl_Esp32/src/MotionControl.cpp index 8ee2ad07..672b0393 100644 --- a/Grbl_Esp32/src/MotionControl.cpp +++ b/Grbl_Esp32/src/MotionControl.cpp @@ -35,6 +35,7 @@ SquaringMode ganged_mode = SquaringMode::Dual; // this allows kinematics to be used. void mc_line_kins(float* target, plan_line_data_t* pl_data, float* position) { + grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "mc_line_kins"); #ifndef USE_KINEMATICS mc_line(target, pl_data); #else // else use kinematics @@ -52,6 +53,9 @@ void mc_line_kins(float* target, plan_line_data_t* pl_data, float* position) { void mc_line(float* target, plan_line_data_t* pl_data) { // If enabled, check for soft limit violations. Placed here all line motions are picked up // from everywhere in Grbl. + throw "foo"; + + grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "mc_line"); if (soft_limits->get()) { // NOTE: Block jog state. Jogging is a special case and soft limits are handled independently. if (sys.state != State::Jog) { @@ -384,7 +388,8 @@ GCUpdatePos mc_probe_cycle(float* target, plan_line_data_t* pl_data, uint8_t par return GCUpdatePos::None; // Nothing else to do but bail. } // Setup and queue probing motion. Auto cycle-start should not start the cycle. - mc_line(target, pl_data); + grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Found"); + mc_line_kins(target, pl_data, gc_state.position); // Activate the probing state monitor in the stepper module. sys_probe_state = PROBE_ACTIVE; // Perform probing cycle. Wait here until probe is triggered or motion completes. diff --git a/platformio.ini b/platformio.ini index c7f14c90..f50c2b3c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -28,6 +28,7 @@ build_flags = -DCORE_DEBUG_LEVEL=0 -Wno-unused-variable -Wno-unused-function + -O0 [env] lib_deps =