From 9b1e661220501e27415592d79e68ed57605fa589 Mon Sep 17 00:00:00 2001 From: Riki Date: Tue, 24 Mar 2020 08:17:24 +0700 Subject: [PATCH 01/18] g28 scara --- Marlin/Configuration.h | 33 +++++++++++++++++++++++------ Marlin/src/gcode/calibrate/G28.cpp | 34 ++++++++++++++++++++++++++++-- Marlin/src/module/endstops.cpp | 4 ++++ Marlin/src/module/endstops.h | 1 + Marlin/src/module/planner.h | 16 +++++++------- 5 files changed, 72 insertions(+), 16 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index df99f8b676..5a20bd8d7c 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -61,12 +61,33 @@ // config/examples/delta directory and customize for your machine. // -//=========================================================================== -//============================= SCARA Printer =============================== -//=========================================================================== -// For a SCARA printer start with the configuration files in -// config/examples/SCARA and customize for your machine. +#define MORGAN_SCARA // +#if EITHER(MORGAN_SCARA, MP_SCARA) + // If movement is choppy try lowering this value + #define SCARA_SEGMENTS_PER_SECOND 1000 + // Length of inner and outer support arms. Measure arm lengths precisely. + #define SCARA_LINKAGE_1 430 // (mm) + #define SCARA_LINKAGE_2 230 // (mm) + // SCARA tower offset (position of Tower relative to bed zero position) + // This needs to be reasonably accurate as it defines the printbed position in the SCARA space. + #define SCARA_OFFSET_X 0 // (mm) + #define SCARA_OFFSET_Y 0 // (mm) + #if ENABLED(MORGAN_SCARA) + //#define DEBUG_SCARA_KINEMATICS + //#define SCARA_FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly + // Radius around the center where the arm cannot reach + #define MIDDLE_DEAD_ZONE_R 0 // (mm) + + #define THETA_HOMING_OFFSET 0 // Calculated from Calibration Guide and M360 / M114. See http://reprap.harleystudio.co.za/?page_id=1073 + #define PSI_HOMING_OFFSET 0 // Calculated from Calibration Guide and M364 / M114. See http://reprap.harleystudio.co.za/?page_id=1073 + #elif ENABLED(MP_SCARA) + #define SCARA_OFFSET_THETA1 12 // degrees + #define SCARA_OFFSET_THETA2 131 // degrees + #endif + #define X_POS_HOME_DEGREE -30 //THETA DEGREE AT LIMIT SWITCH + #define Y_POS_HOME_DEGREE 135 //PSI DEGREE AT LIMIT SWITCH +#endif // @section info @@ -777,7 +798,7 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -//#define CLASSIC_JERK +#define CLASSIC_JERK #if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 4603c76967..bf501625bc 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -55,7 +55,37 @@ #include "../../core/debug_out.h" #if ENABLED(QUICK_HOME) - + #if IS_SCARA + extern Planner planner; + static void mWork_Home_EndStop(double A,double B,feedRate_t feedRate){ + float e_tam = 0; + uint8_t extruder = 0; + float mm = 360; + planner.buffer_segment(A, B, delta.c, e_tam, feedRate, extruder, mm); + unsigned long timeBegin = millis(); + while(endstops.checkEndStop()==false){ + if( millis() - timeBegin > 1000){ + timeBegin = millis(); + float x_tam =planner.get_axis_position_degrees(A_AXIS), y_tam=planner.get_axis_position_degrees(B_AXIS); + if ((x_tam == A) && (y_tam == B))break; + } + idle(); + } + endstops.validate_homing_move(); + } + static void mWork_Set_Pos_Frome_angles(double A, double B){ + forward_kinematics_SCARA(A,B); + current_position.set(cartes.x, cartes.y); + sync_plan_position(); + } + static void quick_home_xy() { + mWork_Set_Pos_Frome_angles(0,0); + mWork_Home_EndStop(360.0 * X_HOME_DIR,360.0* X_HOME_DIR,homing_feedrate(X_AXIS)); //Move Y 360 angles and wait endstop + mWork_Set_Pos_Frome_angles(0,0); + mWork_Home_EndStop( 0 , 360.0* Y_HOME_DIR , homing_feedrate(Y_AXIS)); //Move Y 360 angles and wait endstop + mWork_Set_Pos_Frome_angles(X_POS_HOME_DEGREE,Y_POS_HOME_DEGREE); + } + #else static void quick_home_xy() { // Pretend the current position is 0,0 @@ -102,7 +132,7 @@ #endif #endif } - + #endif #endif // QUICK_HOME #if ENABLED(Z_SAFE_HOMING) diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 1c8384cc53..e24ce4a9a5 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -327,6 +327,10 @@ void Endstops::not_homing() { if (trigger_state()) hit_on_purpose(); else kill(GET_TEXT(MSG_LCD_HOMING_FAILED)); } + bool Endstops::checkEndStop(){ + if (trigger_state()) return true; + return false; + } #endif // Enable / disable endstop z-probe checking diff --git a/Marlin/src/module/endstops.h b/Marlin/src/module/endstops.h index 71353abb34..dd7da8cd47 100644 --- a/Marlin/src/module/endstops.h +++ b/Marlin/src/module/endstops.h @@ -144,6 +144,7 @@ class Endstops { #if ENABLED(VALIDATE_HOMING_ENDSTOPS) // If the last move failed to trigger an endstop, call kill static void validate_homing_move(); + static bool checkEndStop(); #else FORCE_INLINE static void validate_homing_move() { hit_on_purpose(); } #endif diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index ae104eb354..51df60383a 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -622,14 +622,6 @@ class Planner { * Add a block to the buffer that just updates the position */ static void buffer_sync_block(); - - #if IS_KINEMATIC - private: - - // Allow do_homing_move to access internal functions, such as buffer_segment. - friend void do_homing_move(const AxisEnum, const float, const feedRate_t); - #endif - /** * Planner::buffer_segment * @@ -648,6 +640,14 @@ class Planner { #endif , const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 ); + #if IS_KINEMATIC + private: + + // Allow do_homing_move to access internal functions, such as buffer_segment. + friend void do_homing_move(const AxisEnum, const float, const feedRate_t); + #endif + + FORCE_INLINE static bool buffer_segment(abce_pos_t &abce #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) From 595ce69a4b3ed1b3a528f7338f8c58aac2963714 Mon Sep 17 00:00:00 2001 From: Riki Date: Tue, 24 Mar 2020 08:26:48 +0700 Subject: [PATCH 02/18] . --- Marlin/src/gcode/calibrate/G28.cpp | 54 +++++++++++++++--------------- Marlin/src/module/planner.h | 16 ++++++++- 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index bf501625bc..2ffa9d71ed 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -56,35 +56,35 @@ #if ENABLED(QUICK_HOME) #if IS_SCARA - extern Planner planner; - static void mWork_Home_EndStop(double A,double B,feedRate_t feedRate){ - float e_tam = 0; - uint8_t extruder = 0; - float mm = 360; - planner.buffer_segment(A, B, delta.c, e_tam, feedRate, extruder, mm); - unsigned long timeBegin = millis(); - while(endstops.checkEndStop()==false){ - if( millis() - timeBegin > 1000){ - timeBegin = millis(); - float x_tam =planner.get_axis_position_degrees(A_AXIS), y_tam=planner.get_axis_position_degrees(B_AXIS); - if ((x_tam == A) && (y_tam == B))break; + extern Planner planner; + static void mWork_Home_EndStop(double _theta,double _psi,feedRate_t feedRate){ + float e_tam = 0; + uint8_t extruder = 0; + float mm = 360; + planner.buffer_segment(_theta, _psi, delta.c, e_tam, feedRate, extruder, mm); + unsigned long timeBegin = millis(); + while(endstops.checkEndStop()==false){ + if( millis() - timeBegin > 1000){ + timeBegin = millis(); + float x_tam =planner.get_axis_position_degrees(A_AXIS), y_tam=planner.get_axis_position_degrees(B_AXIS); + if ((x_tam == _theta) && (y_tam == _psi)) break; + } + idle(); } - idle(); + endstops.validate_homing_move(); + } + static void mWork_Set_Pos_Frome_angles(double _theta, double _psi){ + forward_kinematics_SCARA( _theta, _psi ); + current_position.set(cartes.x, cartes.y); + sync_plan_position(); + } + static void quick_home_xy() { + mWork_Set_Pos_Frome_angles(0,0); + mWork_Home_EndStop(360.0 * X_HOME_DIR,360.0* X_HOME_DIR,homing_feedrate(X_AXIS)); //Move X 360 angles and wait endstop + mWork_Set_Pos_Frome_angles(0,0); + mWork_Home_EndStop( 0 , 360.0* Y_HOME_DIR , homing_feedrate(Y_AXIS)); //Move Y 360 angles and wait endstop + mWork_Set_Pos_Frome_angles(X_POS_HOME_DEGREE,Y_POS_HOME_DEGREE); } - endstops.validate_homing_move(); - } - static void mWork_Set_Pos_Frome_angles(double A, double B){ - forward_kinematics_SCARA(A,B); - current_position.set(cartes.x, cartes.y); - sync_plan_position(); - } - static void quick_home_xy() { - mWork_Set_Pos_Frome_angles(0,0); - mWork_Home_EndStop(360.0 * X_HOME_DIR,360.0* X_HOME_DIR,homing_feedrate(X_AXIS)); //Move Y 360 angles and wait endstop - mWork_Set_Pos_Frome_angles(0,0); - mWork_Home_EndStop( 0 , 360.0* Y_HOME_DIR , homing_feedrate(Y_AXIS)); //Move Y 360 angles and wait endstop - mWork_Set_Pos_Frome_angles(X_POS_HOME_DEGREE,Y_POS_HOME_DEGREE); - } #else static void quick_home_xy() { diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 51df60383a..9500cec6e2 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -633,18 +633,32 @@ class Planner { * fr_mm_s - (target) speed of the move * extruder - target extruder * millimeters - the length of the movement, if known + * */ + #if IS_SCARA //Move Buffer_segment to PUBLIC static bool buffer_segment(const float &a, const float &b, const float &c, const float &e #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) , const xyze_float_t &delta_mm_cart #endif , const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 ); - #if IS_KINEMATIC + #if IS_KINEMATIC + private: + friend void do_homing_move(const AxisEnum, const float, const feedRate_t); + #endif + #else // Marlin default -> Private + #if IS_KINEMATIC private: // Allow do_homing_move to access internal functions, such as buffer_segment. friend void do_homing_move(const AxisEnum, const float, const feedRate_t); + #endif + static bool buffer_segment(const float &a, const float &b, const float &c, const float &e + #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) + , const xyze_float_t &delta_mm_cart + #endif + , const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 + ); #endif From fca68fa08fa79b2af7aac6e926b3146b29275025 Mon Sep 17 00:00:00 2001 From: Riki Date: Tue, 24 Mar 2020 08:30:15 +0700 Subject: [PATCH 03/18] Update G28.cpp --- Marlin/src/gcode/calibrate/G28.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 2ffa9d71ed..d7dcbabc18 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -81,15 +81,15 @@ static void quick_home_xy() { mWork_Set_Pos_Frome_angles(0,0); mWork_Home_EndStop(360.0 * X_HOME_DIR,360.0* X_HOME_DIR,homing_feedrate(X_AXIS)); //Move X 360 angles and wait endstop - mWork_Set_Pos_Frome_angles(0,0); + mWork_Set_Pos_Frome_angles(0,0); mWork_Home_EndStop( 0 , 360.0* Y_HOME_DIR , homing_feedrate(Y_AXIS)); //Move Y 360 angles and wait endstop - mWork_Set_Pos_Frome_angles(X_POS_HOME_DEGREE,Y_POS_HOME_DEGREE); + mWork_Set_Pos_Frome_angles(THETA_DEGREE_AT_HOME,PSI_DEGREE_AT_HOME); // Set Home position } #else static void quick_home_xy() { // Pretend the current position is 0,0 - current_position.set(0.0, 0.0); + current_position.set(0.0, 0.0); // Error with scara. x=0 y=0 -> theta = nul and psi = nul sync_plan_position(); const int x_axis_home_dir = x_home_dir(active_extruder); From 9993f45293125f491e6a3b3669e760b58411ced4 Mon Sep 17 00:00:00 2001 From: Riki Date: Tue, 24 Mar 2020 08:36:03 +0700 Subject: [PATCH 04/18] change name --- Marlin/Configuration.h | 6 +++--- Marlin/src/gcode/calibrate/G28.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 5a20bd8d7c..aa1169a15c 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -61,7 +61,7 @@ // config/examples/delta directory and customize for your machine. // -#define MORGAN_SCARA +//#define MORGAN_SCARA // #if EITHER(MORGAN_SCARA, MP_SCARA) // If movement is choppy try lowering this value @@ -85,8 +85,8 @@ #define SCARA_OFFSET_THETA1 12 // degrees #define SCARA_OFFSET_THETA2 131 // degrees #endif - #define X_POS_HOME_DEGREE -30 //THETA DEGREE AT LIMIT SWITCH - #define Y_POS_HOME_DEGREE 135 //PSI DEGREE AT LIMIT SWITCH + #define THETA_ANGLE_AT_HOME -30 //THETA DEGREE AT LIMIT SWITCH + #define PSI_ANGLE_AT_HOME 135 //PSI DEGREE AT LIMIT SWITCH #endif // @section info diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index d7dcbabc18..bbf467df6f 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -64,7 +64,7 @@ planner.buffer_segment(_theta, _psi, delta.c, e_tam, feedRate, extruder, mm); unsigned long timeBegin = millis(); while(endstops.checkEndStop()==false){ - if( millis() - timeBegin > 1000){ + if( millis() - timeBegin > 1000){ // check timeBegin = millis(); float x_tam =planner.get_axis_position_degrees(A_AXIS), y_tam=planner.get_axis_position_degrees(B_AXIS); if ((x_tam == _theta) && (y_tam == _psi)) break; @@ -83,7 +83,7 @@ mWork_Home_EndStop(360.0 * X_HOME_DIR,360.0* X_HOME_DIR,homing_feedrate(X_AXIS)); //Move X 360 angles and wait endstop mWork_Set_Pos_Frome_angles(0,0); mWork_Home_EndStop( 0 , 360.0* Y_HOME_DIR , homing_feedrate(Y_AXIS)); //Move Y 360 angles and wait endstop - mWork_Set_Pos_Frome_angles(THETA_DEGREE_AT_HOME,PSI_DEGREE_AT_HOME); // Set Home position + mWork_Set_Pos_Frome_angles(THETA_ANGLE_AT_HOME,PSI_ANGLE_AT_HOME); // Set Home position } #else static void quick_home_xy() { From 624d5d3260e3958bc1b5033a7c5a8668abc7db05 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 23 Mar 2020 20:55:36 -0500 Subject: [PATCH 05/18] Update G28.cpp --- Marlin/src/gcode/calibrate/G28.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index bbf467df6f..dd206022f4 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -62,12 +62,14 @@ uint8_t extruder = 0; float mm = 360; planner.buffer_segment(_theta, _psi, delta.c, e_tam, feedRate, extruder, mm); - unsigned long timeBegin = millis(); - while(endstops.checkEndStop()==false){ - if( millis() - timeBegin > 1000){ // check - timeBegin = millis(); - float x_tam =planner.get_axis_position_degrees(A_AXIS), y_tam=planner.get_axis_position_degrees(B_AXIS); - if ((x_tam == _theta) && (y_tam == _psi)) break; + millis_t time_end = millis() + 1000; + while (!endstops.checkEndStop()) { + const millis_t ms = millis(); + if (ELAPSED(ms, time_end) { // check + time_end = ms + 1000; + const float x_tam = planner.get_axis_position_degrees(A_AXIS), + y_tam = planner.get_axis_position_degrees(B_AXIS); + if (NEAR(x_tam, _theta) && NEAR(y_tam, _psi)) break; } idle(); } From 338bef466cc0ca37c78995ec6cd1c440fc72e6c4 Mon Sep 17 00:00:00 2001 From: Riki Date: Tue, 24 Mar 2020 09:11:25 +0700 Subject: [PATCH 06/18] Update G28.cpp --- Marlin/src/gcode/calibrate/G28.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index dd206022f4..a00e255814 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -65,7 +65,7 @@ millis_t time_end = millis() + 1000; while (!endstops.checkEndStop()) { const millis_t ms = millis(); - if (ELAPSED(ms, time_end) { // check + if (ELAPSED(ms, time_end)) { // check time_end = ms + 1000; const float x_tam = planner.get_axis_position_degrees(A_AXIS), y_tam = planner.get_axis_position_degrees(B_AXIS); From 0d07d905ddb73d3856f283eac3e1fa5e21c2fd4e Mon Sep 17 00:00:00 2001 From: Riki Date: Tue, 24 Mar 2020 09:35:06 +0700 Subject: [PATCH 07/18] Update Configuration.h --- Marlin/Configuration.h | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index aa1169a15c..12385fb2f6 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -61,33 +61,12 @@ // config/examples/delta directory and customize for your machine. // -//#define MORGAN_SCARA +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. // -#if EITHER(MORGAN_SCARA, MP_SCARA) - // If movement is choppy try lowering this value - #define SCARA_SEGMENTS_PER_SECOND 1000 - // Length of inner and outer support arms. Measure arm lengths precisely. - #define SCARA_LINKAGE_1 430 // (mm) - #define SCARA_LINKAGE_2 230 // (mm) - // SCARA tower offset (position of Tower relative to bed zero position) - // This needs to be reasonably accurate as it defines the printbed position in the SCARA space. - #define SCARA_OFFSET_X 0 // (mm) - #define SCARA_OFFSET_Y 0 // (mm) - #if ENABLED(MORGAN_SCARA) - //#define DEBUG_SCARA_KINEMATICS - //#define SCARA_FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly - // Radius around the center where the arm cannot reach - #define MIDDLE_DEAD_ZONE_R 0 // (mm) - - #define THETA_HOMING_OFFSET 0 // Calculated from Calibration Guide and M360 / M114. See http://reprap.harleystudio.co.za/?page_id=1073 - #define PSI_HOMING_OFFSET 0 // Calculated from Calibration Guide and M364 / M114. See http://reprap.harleystudio.co.za/?page_id=1073 - #elif ENABLED(MP_SCARA) - #define SCARA_OFFSET_THETA1 12 // degrees - #define SCARA_OFFSET_THETA2 131 // degrees - #endif - #define THETA_ANGLE_AT_HOME -30 //THETA DEGREE AT LIMIT SWITCH - #define PSI_ANGLE_AT_HOME 135 //PSI DEGREE AT LIMIT SWITCH -#endif // @section info From 838e5c715cb099c44c86970617ce23170de1e00b Mon Sep 17 00:00:00 2001 From: Riki Date: Wed, 25 Mar 2020 12:07:50 +0700 Subject: [PATCH 08/18] Update Configuration.h --- Marlin/Configuration.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 12385fb2f6..cadce8a416 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -130,7 +130,6 @@ #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_14_EFB #endif - // Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" From 4e49f429d6065c09716430516f893d51346e8ee4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 7 Jun 2020 23:11:15 -0500 Subject: [PATCH 09/18] Update endstops.cpp --- Marlin/src/module/endstops.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index e24ce4a9a5..f9bdd0e5d7 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -322,15 +322,15 @@ void Endstops::not_homing() { } #if ENABLED(VALIDATE_HOMING_ENDSTOPS) + // If the last move failed to trigger an endstop, call kill void Endstops::validate_homing_move() { if (trigger_state()) hit_on_purpose(); else kill(GET_TEXT(MSG_LCD_HOMING_FAILED)); } - bool Endstops::checkEndStop(){ - if (trigger_state()) return true; - return false; - } + + bool Endstops::checkEndStop() { return trigger_state() != 0; } + #endif // Enable / disable endstop z-probe checking From 882fb963222c743881537e9df64b91cd416cacc0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 7 Jun 2020 23:11:58 -0500 Subject: [PATCH 10/18] Update endstops.cpp --- Marlin/src/module/endstops.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index f9bdd0e5d7..1c8384cc53 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -322,15 +322,11 @@ void Endstops::not_homing() { } #if ENABLED(VALIDATE_HOMING_ENDSTOPS) - // If the last move failed to trigger an endstop, call kill void Endstops::validate_homing_move() { if (trigger_state()) hit_on_purpose(); else kill(GET_TEXT(MSG_LCD_HOMING_FAILED)); } - - bool Endstops::checkEndStop() { return trigger_state() != 0; } - #endif // Enable / disable endstop z-probe checking From ee7e68c0beff4fbcd4c21ebaa1927b7e957ad871 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 7 Jun 2020 23:12:47 -0500 Subject: [PATCH 11/18] Update endstops.h --- Marlin/src/module/endstops.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/module/endstops.h b/Marlin/src/module/endstops.h index dd7da8cd47..4faaedca56 100644 --- a/Marlin/src/module/endstops.h +++ b/Marlin/src/module/endstops.h @@ -144,7 +144,7 @@ class Endstops { #if ENABLED(VALIDATE_HOMING_ENDSTOPS) // If the last move failed to trigger an endstop, call kill static void validate_homing_move(); - static bool checkEndStop(); + FORCE_INLINE static bool checkEndStop() { return trigger_state() != 0; } #else FORCE_INLINE static void validate_homing_move() { hit_on_purpose(); } #endif From 35af7e97f998524d50d3b83450eb099c2bf285e7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 7 Jun 2020 23:26:54 -0500 Subject: [PATCH 12/18] Update planner.h --- Marlin/src/module/planner.h | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 7b0b3f6d3c..24766ae090 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -626,6 +626,7 @@ class Planner { * Add a block to the buffer that just updates the position */ static void buffer_sync_block(); + /** * Planner::buffer_segment * @@ -639,33 +640,21 @@ class Planner { * millimeters - the length of the movement, if known * */ - #if IS_SCARA //Move Buffer_segment to PUBLIC - static bool buffer_segment(const float &a, const float &b, const float &c, const float &e - #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) - , const xyze_float_t &delta_mm_cart - #endif - , const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 - ); - #if IS_KINEMATIC - private: - friend void do_homing_move(const AxisEnum, const float, const feedRate_t); - #endif - #else // Marlin default -> Private - #if IS_KINEMATIC - private: - // Allow do_homing_move to access internal functions, such as buffer_segment. - friend void do_homing_move(const AxisEnum, const float, const feedRate_t); - #endif + TERN_(DELTA, private:) + static bool buffer_segment(const float &a, const float &b, const float &c, const float &e #if HAS_DIST_MM_ARG , const xyze_float_t &cart_dist_mm #endif , const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 ); - #endif + private: + #if IS_KINEMATIC + friend void do_homing_move(const AxisEnum, const float, const feedRate_t); + #endif FORCE_INLINE static bool buffer_segment(abce_pos_t &abce #if HAS_DIST_MM_ARG From d2c1fa3615443b7cbb6e79d25616229d7a6156a9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 7 Jun 2020 23:29:28 -0500 Subject: [PATCH 13/18] Update G28.cpp --- Marlin/src/gcode/calibrate/G28.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 215a2617dc..eb055e1312 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -63,7 +63,7 @@ float mm = 360; planner.buffer_segment(_theta, _psi, delta.c, e_tam, feedRate, extruder, mm); millis_t time_end = millis() + 1000; - while (!endstops.checkEndStop()) { + while (!endstops.any()) { const millis_t ms = millis(); if (ELAPSED(ms, time_end)) { // check time_end = ms + 1000; From a0ed8038c0c4aa9e40bf3e2523f657a5659b9922 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 7 Jun 2020 23:29:44 -0500 Subject: [PATCH 14/18] Update endstops.h --- Marlin/src/module/endstops.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/module/endstops.h b/Marlin/src/module/endstops.h index 4faaedca56..a80deccf46 100644 --- a/Marlin/src/module/endstops.h +++ b/Marlin/src/module/endstops.h @@ -144,7 +144,7 @@ class Endstops { #if ENABLED(VALIDATE_HOMING_ENDSTOPS) // If the last move failed to trigger an endstop, call kill static void validate_homing_move(); - FORCE_INLINE static bool checkEndStop() { return trigger_state() != 0; } + FORCE_INLINE static bool any() { return trigger_state() != 0; } #else FORCE_INLINE static void validate_homing_move() { hit_on_purpose(); } #endif From 0dd9afe006d5111eec7d6c06279dc9bd3e417503 Mon Sep 17 00:00:00 2001 From: Riki Date: Tue, 9 Jun 2020 13:27:34 +0700 Subject: [PATCH 15/18] Update planner.h --- Marlin/src/module/planner.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 24766ae090..6e1f8ef349 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -650,6 +650,7 @@ class Planner { , const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 ); + private: #if IS_KINEMATIC From 06de6599451c30cf9221dab4d9c579b0bc07576e Mon Sep 17 00:00:00 2001 From: NhanPA Date: Wed, 12 Aug 2020 08:38:49 +0700 Subject: [PATCH 16/18] Update G28.cpp --- Marlin/src/gcode/calibrate/G28.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index eb055e1312..f1d6a5c105 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -81,6 +81,7 @@ sync_plan_position(); } static void quick_home_xy() { + endstops.hit_on_purpose(); mWork_Set_Pos_Frome_angles(0,0); mWork_Home_EndStop(360.0 * X_HOME_DIR,360.0* X_HOME_DIR,homing_feedrate(X_AXIS)); //Move X 360 angles and wait endstop mWork_Set_Pos_Frome_angles(0,0); From 08994522d2c8233b371d7951360840052e861a5d Mon Sep 17 00:00:00 2001 From: NhanPA Date: Wed, 12 Aug 2020 10:03:59 +0700 Subject: [PATCH 17/18] Revert "Update G28.cpp" This reverts commit 06de6599451c30cf9221dab4d9c579b0bc07576e. --- Marlin/src/gcode/calibrate/G28.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 7d528e967e..b5cc4ce41e 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -88,7 +88,6 @@ sync_plan_position(); } static void quick_home_xy() { - endstops.hit_on_purpose(); mWork_Set_Pos_Frome_angles(0,0); mWork_Home_EndStop(360.0 * X_HOME_DIR,360.0* X_HOME_DIR,homing_feedrate(X_AXIS)); //Move X 360 angles and wait endstop mWork_Set_Pos_Frome_angles(0,0); From 96a22c3f3ef6e0cdb33a670fd7aec29829460651 Mon Sep 17 00:00:00 2001 From: NhanPA Date: Wed, 12 Aug 2020 10:05:55 +0700 Subject: [PATCH 18/18] Revert "Revert "Update G28.cpp"" This reverts commit 08994522d2c8233b371d7951360840052e861a5d. --- Marlin/src/gcode/calibrate/G28.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index b5cc4ce41e..7d528e967e 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -88,6 +88,7 @@ sync_plan_position(); } static void quick_home_xy() { + endstops.hit_on_purpose(); mWork_Set_Pos_Frome_angles(0,0); mWork_Home_EndStop(360.0 * X_HOME_DIR,360.0* X_HOME_DIR,homing_feedrate(X_AXIS)); //Move X 360 angles and wait endstop mWork_Set_Pos_Frome_angles(0,0);