From b84d3c940a30850c54bb13ddbbe5a21f4912a0a7 Mon Sep 17 00:00:00 2001 From: Martin Rice Date: Sun, 12 Feb 2017 15:57:15 -0500 Subject: [PATCH] added support for rack & pinion Z probe (Z_RACK_PINION) Added support for compiling with Z_RACK_PINION for machines like Wilson2 which have a Z probe mounted to a pinion that is deployed by the movement of the X axis. Changed the auto bedleveling default limits to be based on the bed size instead of absolute values (configuration.h). --- Marlin/Conditionals_LCD.h | 4 ++-- Marlin/Configuration.h | 23 ++++++++++++++++++++--- Marlin/Marlin_main.cpp | 4 ++++ Marlin/SanityCheck.h | 11 ++++++++--- 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/Marlin/Conditionals_LCD.h b/Marlin/Conditionals_LCD.h index 630e94ca4cc5..8ed94ec6a939 100644 --- a/Marlin/Conditionals_LCD.h +++ b/Marlin/Conditionals_LCD.h @@ -370,8 +370,8 @@ /** * Set a flag for any enabled probe */ - #define PROBE_SELECTED (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED)) - + #define PROBE_SELECTED (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED) || ENABLED(Z_RACK_PINION)) + /** * Clear probe pin settings when no probe is selected */ diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index afaa2c6288f7..76395602cd6a 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -562,6 +562,18 @@ //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. +// Enable if you have the Rack & Pinion style bed probe (i.e. Wilson II) +//#define Z_RACK_PINION + +#ifdef Z_RACK_PINION +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN +#define Z_CLEARANCE_DEPLOY_PROBE 10 +#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // Probe on: -left +right +#define Y_PROBE_OFFSET_FROM_EXTRUDER 45 // Probe on: -front +behind +#define Z_PROBE_OFFSET_FROM_EXTRUDER -11 // -below (always!) +#define Z_SAFE_HOMING // home with probe in middle of bed not on the edge +#endif + // Z Probe to nozzle (X,Y) offset, relative to (0, 0). // X and Y offsets must be integers. // @@ -725,6 +737,10 @@ #define Y_MAX_POS 200 #define Z_MAX_POS 200 +#ifdef Z_RACK_PINION +#define X_MIN_POS 10 +#endif + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. @@ -812,9 +828,9 @@ // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 15 - #define RIGHT_PROBE_BED_POSITION 170 - #define FRONT_PROBE_BED_POSITION 20 - #define BACK_PROBE_BED_POSITION 170 + #define RIGHT_PROBE_BED_POSITION (X_MAX_POS-30) + #define FRONT_PROBE_BED_POSITION (20+Y_PROBE_OFFSET_FROM_EXTRUDER) + #define BACK_PROBE_BED_POSITION (Y_MAX_POS-30) // The Z probe minimum outer margin (to validate G29 parameters). #define MIN_PROBE_EDGE 10 @@ -891,6 +907,7 @@ #define HOMING_FEEDRATE_XY (50*60) #define HOMING_FEEDRATE_Z (4*60) + //============================================================================= //============================= Additional Features =========================== //============================================================================= diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 10580d2dd611..f0fb5095b3fd 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2050,6 +2050,10 @@ static void clean_up_after_endstop_or_probe_move() { deploy ? run_deploy_moves_script() : run_stow_moves_script(); + #elif ENABLED(Z_RACK_PINION) + + do_blocking_move_to_x(deploy? 0:X_MAX_POS); + #endif #ifdef _TRIGGERED_WHEN_STOWED_TEST diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 561329ef80ee..127e4623a1cf 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -429,8 +429,13 @@ #else #define COUNT_PROBE_6 COUNT_PROBE_5 #endif - #if COUNT_PROBE_6 > 1 - #error "Please enable only one probe: FIX_MOUNTED_PROBE, Z Servo, BLTOUCH, Z_PROBE_ALLEN_KEY, or Z_PROBE_SLED." + #if ENABLED(Z_RACK_PINION) + #define COUNT_PROBE_7 INCREMENT(COUNT_PROBE_6) + #else + #define COUNT_PROBE_7 COUNT_PROBE_6 + #endif + #if COUNT_PROBE_7 > 1 + #error "Please enable only one probe: FIX_MOUNTED_PROBE, Z Servo, BLTOUCH, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z_RACK_PINION." #endif /** @@ -491,7 +496,7 @@ * Require some kind of probe for bed leveling and probe testing */ #if HAS_ABL - #error "Auto Bed Leveling requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." + #error "Auto Bed Leveling requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, FIX_MOUNTED_PROBE, or Z_RACK_PINION." #elif ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." #endif