<p>You have not stated the version of Marlin you are using. I will assume we are discussing the latest Marlin 1.1 RC8.</p>

<p>There is no longer any <em>Z_PROBE_DEPLOY_HEIGHT</em> but in earlier Marlin versions it did not function as you think; it was used to signify the amount of Z travel to execute prior to Z probe deployement. This is to ensure available space for servo-mounted, sled, or other types of "stowed" probes.  This was not a limit to the Z travel, but the amount of Z travel to always execute before begining homing.  If a printer without <em>Z_MAX_ENDSTOP</em> is left at maximum travel position, using non-zero <em>Z_PROBE_DEPLOY_HEIGHT</em> could crash a bot into the Z maximum end position.</p>

<p>In these previous versions of Marlin, the homing height was computed by a combination of the above constant adding and subtracting to/from some others, which has since been replaced by the simpler and singular <em>Z_HOMEING_HEIGHT</em> (which works indpendant from the new <em>Z_CLEARANCE_DEPLOY_PROBE</em>):</p>

<pre><code>//#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing
(G28) for Z clearance above the bed, clamps, ...

#define Z_CLEARANCE_DEPLOY_PROBE   10 // Z Clearance for Deploy/Stow
</code></pre>

<p>The absolute value of the maximum bed positions are used in Marlin as sanity check to ensure no axis moves greater than this amount in one movement in either positive or negative direction:</p>

<pre><code>#define Z_MAX_POS 200
</code></pre>

<p>If your probe does not function correctly, no ficticious <em>Z_MIN_WHILE_PROBING</em> will prevent a faulty probe from causing a head crash into the bed, so it is not implemented, allowing the <em>Z_MAX_POS</em> sanity check to prevent the Z axis stepper from continuing to run indefinitely during a fauly probe condition.</p>

<p>If your <em>Z_MIN_WHILE_PROBING</em> were implemented, if the printer were powered off (or Marlin crashed, etc) with the head at any Z distance greater than <em>Z_MIN_WHILE_PROBING</em> there would be no mechanism to begin a print on the next poweron, since Marlin will never move in the negative Z axis except during G28 probing and after probing completes successfully.  The only way to recover in this case would be for someone to continually attempt to both home the printer then power-cycle, moving the head <em>Z_MIN_WHILE_PROBING</em> closer to the bed each iteration. This would be an unacceptable user exerience.</p>

<p>Further, if <em>Z_MIN_WHILE_PROBING</em> were implemented, the only percieved safety measure it would add is that during probe failure, the Z stepper would crash into the bed and continue to run for only <em>Z_MIN_WHILE_PROBING</em> stepper rotations instead of <em>Z_MAX_POS</em> rotations.  Regardless, the bed would be impacted so there is hardly any additonal safety added and a stepper driver should not overheat or cause any more damage (other than what was already done to the bed) in a single <em>Z_MAX_POS</em> length of rotations.</p>

<p>For more piece of mind during homing, you may use the <em>Z_MIN_PROBE_ENDSTOP</em> feature with a normally-closed limit switch wired to an available pin on your control board:</p>

<pre><code>// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
//#define Z_MIN_PROBE_ENDSTOP
</code></pre>

<p>Then use the <em>Z_MIN_WHILE_PROBING</em> feature to move the head above the <em>Z_MIN_PROBE_ENDSTOP</em> home position to perform probing.  This will ensure that the printer will crash for only <em>Z_PROBE_OFFSET_FROM_EXTRUDER</em> Z stepper rotations if the probe malfunctions:</p>

<pre><code>#define Z_PROBE_OFFSET_FROM_EXTRUDER 0   // Z offset: -below +above  [the nozzle]
</code></pre>

<p>In summary, to prevent the head from crashing into the bed, you must ensure your Z probe is functioning correctly :)</p>

CC BY-SA 3.0
2017-04-18T15:39:04.747Z
2017-04-18T15:39:04.747Z
Dave Johnson
<p>Question: Can a "ZMin-while-probing" be set? 
Meaning a minimum Z height the printer bed can move to, while Z Probing. </p>

<p>Purpose: For safety reasons should the probe switch not fire for some reason.</p>

<p>--</p>

<p>in Marlin Configuration.h, I see you can set the height of the Z Axis before deploying the ZProbe:</p>

<p><code>#define Z_PROBE_DEPLOY_HEIGHT 35</code></p>

<p>In the context of this question, this is effectively a "ZMax-while-probing", i.e the lowest possible the print bed will be before Z Probing commences.</p>

<p>I am looking for a "ZMin-while-probing" equivalent.  The reason for this is just an added safety check - I know that if the probe switch doesn't fire by Z&lt;=25, then it is not going to, and with this particular printer configuration, that would result in the Z Probe being driven into the printer bed.</p>

<p>Does a setting already exist to create a sanity-check here?</p>

<marlin><z-probe>
Marlin: possible to set ZMin limit when ZProbing?
Mtl Dev
# Marlin: possible to set ZMin limit when ZProbing?

(Asked by: username_0 on 2017-02-13)

Question: Can a "ZMin-while-probing" be set?
Meaning a minimum Z height the printer bed can move to, while Z Probing.

Purpose: For safety reasons should the probe switch not fire for some reason.

--

in Marlin Configuration.h, I see you can set the height of the Z Axis before deploying the ZProbe:

`#define Z_PROBE_DEPLOY_HEIGHT 35`

In the context of this question, this is effectively a "ZMax-while-probing", i.e the lowest possible the print bed will be before Z Probing commences.

I am looking for a "ZMin-while-probing" equivalent. The reason for this is just an added safety check - I know that if the probe switch doesn't fire by Z<=25, then it is not going to, and with this particular printer configuration, that would result in the Z Probe being driven into the printer bed.

Does a setting already exist to create a sanity-check here?

**Tags:** marlin, z-probe


---

## 1 answers

### Answer by username_1 on 2017-04-18. Score: 2

You have not stated the version of Marlin you are using. I will assume we are discussing the latest Marlin 1.1 RC8.

There is no longer any *Z\_PROBE\_DEPLOY\_HEIGHT* but in earlier Marlin versions it did not function as you think; it was used to signify the amount of Z travel to execute prior to Z probe deployement. This is to ensure available space for servo-mounted, sled, or other types of "stowed" probes. This was not a limit to the Z travel, but the amount of Z travel to always execute before begining homing. If a printer without *Z\_MAX\_ENDSTOP* is left at maximum travel position, using non-zero *Z\_PROBE\_DEPLOY\_HEIGHT* could crash a bot into the Z maximum end position.

In these previous versions of Marlin, the homing height was computed by a combination of the above constant adding and subtracting to/from some others, which has since been replaced by the simpler and singular *Z\_HOMEING\_HEIGHT* (which works indpendant from the new *Z\_CLEARANCE\_DEPLOY\_PROBE*):

```
//#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing
(G28) for Z clearance above the bed, clamps, ...

#define Z_CLEARANCE_DEPLOY_PROBE   10 // Z Clearance for Deploy/Stow

```

The absolute value of the maximum bed positions are used in Marlin as sanity check to ensure no axis moves greater than this amount in one movement in either positive or negative direction:

```
#define Z_MAX_POS 200

```

If your probe does not function correctly, no ficticious *Z\_MIN\_WHILE\_PROBING* will prevent a faulty probe from causing a head crash into the bed, so it is not implemented, allowing the *Z\_MAX\_POS* sanity check to prevent the Z axis stepper from continuing to run indefinitely during a fauly probe condition.

If your *Z\_MIN\_WHILE\_PROBING* were implemented, if the printer were powered off (or Marlin crashed, etc) with the head at any Z distance greater than *Z\_MIN\_WHILE\_PROBING* there would be no mechanism to begin a print on the next poweron, since Marlin will never move in the negative Z axis except during G28 probing and after probing completes successfully. The only way to recover in this case would be for someone to continually attempt to both home the printer then power-cycle, moving the head *Z\_MIN\_WHILE\_PROBING* closer to the bed each iteration. This would be an unacceptable user exerience.

Further, if *Z\_MIN\_WHILE\_PROBING* were implemented, the only percieved safety measure it would add is that during probe failure, the Z stepper would crash into the bed and continue to run for only *Z\_MIN\_WHILE\_PROBING* stepper rotations instead of *Z\_MAX\_POS* rotations. Regardless, the bed would be impacted so there is hardly any additonal safety added and a stepper driver should not overheat or cause any more damage (other than what was already done to the bed) in a single *Z\_MAX\_POS* length of rotations.

For more piece of mind during homing, you may use the *Z\_MIN\_PROBE\_ENDSTOP* feature with a normally-closed limit switch wired to an available pin on your control board:

```
// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.
// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing.
//
//#define Z_MIN_PROBE_ENDSTOP

```

Then use the *Z\_MIN\_WHILE\_PROBING* feature to move the head above the *Z\_MIN\_PROBE\_ENDSTOP* home position to perform probing. This will ensure that the printer will crash for only *Z\_PROBE\_OFFSET\_FROM\_EXTRUDER* Z stepper rotations if the probe malfunctions:

```
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0   // Z offset: -below +above  [the nozzle]

```

In summary, to prevent the head from crashing into the bed, you must ensure your Z probe is functioning correctly :)


---

