Skip to content

Commit

Permalink
Merge pull request #4207 from AnHardt/AllenKey2
Browse files Browse the repository at this point in the history
Clean up, simplify and generalize the Allen-key-probe code.
  • Loading branch information
thinkyhead authored Jul 6, 2016
2 parents 90d8bb5 + 16c83d2 commit cb17871
Show file tree
Hide file tree
Showing 8 changed files with 289 additions and 218 deletions.
4 changes: 4 additions & 0 deletions Marlin/Conditionals.h
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,10 @@

#define HAS_BED_PROBE (PROBE_SELECTED && PROBE_PIN_CONFIGURED)

#if ENABLED(Z_PROBE_ALLEN_KEY)
#define PROBE_IS_TRIGGERED_WHEN_STOWED_TEST
#endif

/**
* Bed Probe dependencies
*/
Expand Down
442 changes: 231 additions & 211 deletions Marlin/Marlin_main.cpp

Large diffs are not rendered by default.

11 changes: 4 additions & 7 deletions Marlin/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,14 +425,11 @@
#endif

/**
* Allen Key Z probe requires Delta and Auto Bed Leveling grid
* Allen Key
* Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
*/
#if ENABLED(Z_PROBE_ALLEN_KEY)
#if !ENABLED(DELTA)
#error "Z_PROBE_ALLEN_KEY is only usable with DELTA."
#elif ENABLED(MESH_BED_LEVELING) || (ENABLED(AUTO_BED_LEVELING_FEATURE) && !ENABLED(AUTO_BED_LEVELING_GRID))
#error "Z_PROBE_ALLEN_KEY can only use AUTO_BED_LEVELING_GRID leveling."
#endif
#if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY"
#endif

/**
Expand Down
10 changes: 10 additions & 0 deletions Marlin/example_configurations/delta/biv2.5/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0
#define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE XY_PROBE_SPEED

#define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75
#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75
#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
#define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED

#define Z_PROBE_ALLEN_KEY_DEPLOY_3_X 45.00 // Move right to trigger deploy pin
#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y -125.00
#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z 100.0
Expand All @@ -538,6 +543,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0
#define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED

#define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0
#define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0
#define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z
#define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED

#endif // Z_PROBE_ALLEN_KEY

// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
Expand Down
10 changes: 10 additions & 0 deletions Marlin/example_configurations/delta/generic/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0
#define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10

#define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75
#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75
#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
#define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED

#define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position
#define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0
#define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0
Expand All @@ -532,6 +537,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
#define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0
#define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED

#define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0
#define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0
#define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z
#define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED

#endif // Z_PROBE_ALLEN_KEY

// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
Expand Down
10 changes: 10 additions & 0 deletions Marlin/example_configurations/delta/kossel_mini/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0
#define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED/10)

#define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75
#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75
#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
#define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED

#define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20
// Move the probe into position
#define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0
Expand All @@ -535,6 +540,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH)
#define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED/2)

#define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0
#define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0
#define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z
#define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED

#endif // Z_PROBE_ALLEN_KEY

// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
Expand Down
10 changes: 10 additions & 0 deletions Marlin/example_configurations/delta/kossel_pro/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z Z_PROBE_ALLEN_KEY_DEPLOY_1_Z
#define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE XY_PROBE_SPEED

#define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75
#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75
#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
#define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED

#define Z_PROBE_ALLEN_KEY_DEPLOY_3_X 45.00 // Move right to trigger deploy pin
#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y -125.00
#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
Expand All @@ -529,6 +534,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0
#define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED

#define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0
#define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0
#define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z
#define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED

#endif // Z_PROBE_ALLEN_KEY

// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
Expand Down
10 changes: 10 additions & 0 deletions Marlin/example_configurations/delta/kossel_xl/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0
//#define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10

//#define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75
//#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75
//#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
//#define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED

//#define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position
//#define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0
//#define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0
Expand All @@ -530,6 +535,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//#define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0
//#define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED

//#define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0
//#define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0
//#define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z
//#define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED

#endif // Z_PROBE_ALLEN_KEY

// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
Expand Down

0 comments on commit cb17871

Please sign in to comment.