From 179412d92c50bd09db14920f6867a4c1541c8dd1 Mon Sep 17 00:00:00 2001 From: Marcio Teixeira Date: Wed, 31 Jan 2018 09:32:50 -0700 Subject: [PATCH] Added new Marlin 1.1.8 features to Hibiscus. - Homing now required before moving any axis. - Software endstops now enabled to prevent crashing axes. - Z motors now enabled at startup to hold Z axis. - Controller fan now runs at 1/2 power at startup. - Enabled LIN_ADVANCE with Z factor = 0 so that this can be set by a user. - Disabled LED support on X MAX out of concern that a user may accidently short out their board. --- Marlin/Conditionals_LulzBot.h | 27 ++++++++++++++++++++++----- Marlin/Configuration.h | 8 ++++++-- Marlin/Configuration_adv.h | 6 ++++-- Marlin/Marlin_main.cpp | 7 +++++++ 4 files changed, 39 insertions(+), 9 deletions(-) diff --git a/Marlin/Conditionals_LulzBot.h b/Marlin/Conditionals_LulzBot.h index 1eb59b5ce..02b69361b 100644 --- a/Marlin/Conditionals_LulzBot.h +++ b/Marlin/Conditionals_LulzBot.h @@ -13,7 +13,7 @@ * got disabled. */ -#define LULZBOT_FW_VERSION ".2" // Change this with each update +#define LULZBOT_FW_VERSION ".3" // Change this with each update #if ( \ !defined(LULZBOT_Gladiola_Mini) && \ @@ -117,6 +117,7 @@ #define LULZBOT_USE_32_MICROSTEPS_ON_Z #define LULZBOT_UUID "e5502411-d46d-421d-ba3a-a20126d7930f" #define LULZBOT_MODERN_UI + #define LULZBOT_USE_EXPERIMENTAL_FEATURES #endif #if defined(LULZBOT_Quiver_TAZ7) @@ -135,6 +136,7 @@ #define LULZBOT_PRINTCOUNTER #define LULZBOT_UUID "a952577d-8722-483a-999d-acdc9e772b7b" #define LULZBOT_MODERN_UI + #define LULZBOT_USE_EXPERIMENTAL_FEATURES #endif /****************************** DEBUGGING OPTIONS *******************************/ @@ -205,7 +207,12 @@ /************************* EXPERIMENTAL FEATURES ******************************/ #if defined(LULZBOT_USE_EXPERIMENTAL_FEATURES) - #define LULZBOT_USE_STATUS_LED + //#define LULZBOT_USE_STATUS_LED + + // Enable linear advance, but leave K at zero so + // it is not used unless the user requests it. + #define LULZBOT_LIN_ADVANCE + #define LULZBOT_LIN_ADVANCE_K 0 #endif /******************** MOTHERBOARD AND PIN CONFIGURATION ***********************/ @@ -352,6 +359,10 @@ #define LULZBOT_AFTER_Z_HOME_ACTION #endif +#if !defined(LULZBOT_USE_MAX_ENDSTOPS) + #define LULZBOT_NO_MOTION_BEFORE_HOMING +#endif + /************************ STEPPER INACTIVITY TIMEOUT ****************************/ #if !defined(LULZBOT_USE_MAX_ENDSTOPS) @@ -360,8 +371,10 @@ #if defined(LULZBOT_USE_Z_BELT) #define LULZBOT_DISABLE_INACTIVE_Z false + #define LULZBOT_ENABLE_Z_MOTOR_ON_STARTUP enable_Z(); #else #define LULZBOT_DISABLE_INACTIVE_Z true + #define LULZBOT_ENABLE_Z_MOTOR_ON_STARTUP #endif /*********************** AUTOLEVELING / BED PROBE *******************************/ @@ -976,7 +989,8 @@ #define LULZBOT_USE_CONTROLLER_FAN #if defined(LULZBOT_IS_MINI) && defined(LULZBOT_USE_EINSYRAMBO) // The TMC drivers need a bit more cooling. - #define LULZBOT_CONTROLLERFAN_SPEED 255 + #define LULZBOT_CONTROLLERFAN_SPEED 255 + #define LULZBOT_CONTROLLERFAN_SPEED_WHEN_ONLY_Z_ACTIVE 120 #elif defined(LULZBOT_IS_MINI) // The Mini fan runs rather loud at full speed. #define LULZBOT_CONTROLLERFAN_SPEED 120 @@ -1095,8 +1109,11 @@ #define LULZBOT_ENDSTOPS_ALWAYS_ON_DEFAULT #define LULZBOT_ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED -// Workaround for bug in Marlin 1.1.5 where motion is stopped a X or Y = 0 -#define LULZBOT_MIN_SOFTWARE_ENDSTOPS_DISABLED +// Workaround for bug in Marlin 1.1.5 where motion is stopped a X or Y = 0, +// On the Hibiscus, enable software endstops +#if defined(LULZBOT_USE_Z_BELT) + #define LULZBOT_MIN_SOFTWARE_ENDSTOPS +#endif // The RAMBO does not support interrupts on all pins // so leave the ENDSTOP_INTERRUPTS_FEATURE disabled diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 630e45301..deeea866c 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -794,7 +794,9 @@ // @section homing -//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed +#if defined(LULZBOT_NO_MOTION_BEFORE_HOMING) +#define NO_MOTION_BEFORE_HOMING LULZBOT_NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed +#endif #define Z_HOMING_HEIGHT LULZBOT_Z_HOMING_HEIGHT // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. @@ -829,7 +831,9 @@ */ // Min software endstops curtail movement below minimum coordinate bounds -//#define MIN_SOFTWARE_ENDSTOPS LULZBOT_MIN_SOFTWARE_ENDSTOPS_DISABLED +#if defined(LULZBOT_MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOPS LULZBOT_MIN_SOFTWARE_ENDSTOPS +#endif #if ENABLED(MIN_SOFTWARE_ENDSTOPS) #define MIN_SOFTWARE_ENDSTOP_X #define MIN_SOFTWARE_ENDSTOP_Y diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index fd013bf1a..ece0f252c 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -688,10 +688,12 @@ * K=0 means advance disabled. * See Marlin documentation for calibration instructions. */ -//#define LIN_ADVANCE +#if defined(LULZBOT_LIN_ADVANCE) +#define LIN_ADVANCE LULZBOT_LIN_ADVANCE +#endif #if ENABLED(LIN_ADVANCE) - #define LIN_ADVANCE_K 75 + #define LIN_ADVANCE_K LULZBOT_LIN_ADVANCE_K /** * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally. diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 270ed6130..29c04b2ee 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -13751,6 +13751,11 @@ void prepare_move_to_destination() { // allows digital or PWM fan output to be used (see M42 handling) WRITE(CONTROLLER_FAN_PIN, speed); + #if defined(LULZBOT_CONTROLLERFAN_SPEED_WHEN_ONLY_Z_ACTIVE) + if(X_ENABLE_READ != X_ENABLE_ON && Y_ENABLE_READ != Y_ENABLE_ON) + analogWrite(CONTROLLER_FAN_PIN, speed ? LULZBOT_CONTROLLERFAN_SPEED_WHEN_ONLY_Z_ACTIVE : 0); + else + #endif analogWrite(CONTROLLER_FAN_PIN, speed); } } @@ -14674,6 +14679,8 @@ void setup() { delay(1000); WRITE(LCD_PINS_RS, HIGH); #endif + + LULZBOT_ENABLE_Z_MOTOR_ON_STARTUP } /**