I had my printer printing fine when using the stock trigger switch as I used it to print the green bracket you see in the picture.

Photo of probe atached to hotend

My problem now is when I do a print with the sensor, it moves to 0,0 position. However in this position the sensor is hanging off the bed hence there is nothing for it detect so it crashes into the bed.

As far as I can tell the nozzle is homing in the right place.

How do I tell Marlin the new minimum position it needs to be in so it doesn't crash into the bed?

  • $\begingroup$ It does not matter if the probe is not above the bed during printing as long it is above the bed during auto leveling. This can be done by proper settings in your firmware configuration, no hardware changes are necessary. $\endgroup$ – 0scar Jul 11 '19 at 20:47

There are at least 2 options to address the problem that you have:

  1. Adjust end-stops so that in 0,0 position Z-sensor would still hang above the printing table. This would reduce printing surface but allow perfect calibration
  2. Mount extra metal plate at the table mount where it would not bump into printer parts and remain reachable for the sensor (perhaps with sensor relocation) when positioned at 0,0. This option requires extra space within table movement boundaries but saves printing surface.
  • 1
    $\begingroup$ These solutions are totally unnecessary as it is easily fixed in the firmware. Only during levelling the probe needs to be above the bed, it is perfectly fine to have the sensor off the bed during printing. $\endgroup$ – 0scar Jul 5 '19 at 22:06

It is not a problem that the sensor is not above the build plate during printing as long as it is above the build plate during the auto bed levelling sequence.

Homing does not necessarily need to be the (0,0) coordinate. Usually, a printer homes on the endstop switches, from that coordinate an offset is defined in the firmware to move to the origin. This implies that (depending on the position of the sensor), the sensor may be outside the bed area when the nozzle is at the origin (0, 0)). Therefore, similarly, you need to tell the printer the location of the Z sensor with respect to the nozzle position in order for the printer to keep the sensor on the bed when levelling by setting boundaries for the sensor to reach.

E.g. for Marlin firmware the offset from homing to the bed origin is defined for an Anet A8 by:

#define X_MIN_POS -33
#define Y_MIN_POS -10

The values you should use need to correspond to the actual offset from the homing point to the origin of the bed (0,0).

When using an auto bed leveling sensor like you are using you should consider this remark:

If using a Probe for Z Homing, enable Z_SAFE_HOMING also!

Un-comment the proper line in the configuration file to read:


This will make the printer aware of the sensor, and home Z in the middle of the bed (default behavior, but can be changed), so that your sensor is never off the bed when probing the bed for Z homing.

Furthermore, you need to set the offset values of the center of your sensor to the nozzle center:

 *   Z Probe to nozzle (X,Y) offset, relative to (0, 0).
 *   X and Y offsets must be integers.
 *   In the following example the X and Y offsets are both positive:
 *      +-- BACK ---+
 *      |           |
 *    L |    (+) P  | R <-- probe (20,20)
 *    E |           | I
 *    F | (-) N (+) | G <-- nozzle (10,10)
 *    T |           | H
 *      |    (-)    | T
 *      |           |
 *      O-- FRONT --+
 *    (0,0)
#define X_PROBE_OFFSET_FROM_EXTRUDER XXX   // X offset: -left  +right  [of the nozzle]
#define Y_PROBE_OFFSET_FROM_EXTRUDER YYY   // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0   // Z offset: -below +above  [the nozzle]

Where XXX and YYY are your actual values.

And set the boundary of the probing section:

// Set the boundaries for probing (where the probe can reach).

Note that the values should match your bed size!


// The Z probe minimum outer margin (to validate G29 parameters).
#define MIN_PROBE_EDGE 10

Details on setting the boundaries of the bed to keep the sensor on the bed is described in question "How to set Z-probe boundary limits in firmware when using automatic bed leveling?".


If using marlin firmware center your prints.

In my case...

#define NOZZLE_X          8
#define NOZZLE_Y          -56

Then, set the Z-Probe offset from nozzle. In my case the Z-Probe is 50mm behind the hotend.

#define SENSOR_LEFT        0
#define SENSOR_RIGHT       0
#define SENSOR_FRONT       0
#define SENSOR_BEHIND      50

Finally set the bed extra movement. As you see i added the 50mm's at the back of the bed.

#define XTRA_BED_LEFT     0  // Distance nozzle can move towards the left past X = 0
#define XTRA_BED_RIGHT    0  // Distance nozzle can move towards the right past X = 200
#define XTRA_BED_FRONT    0  // Distance bed can move towards the front past Y = 200 (Y=280 for large bed)
#define XTRA_BED_BACK     50  // Distance bed can move towards the back past Y = 0

This way once auto leveling, the probe starts with (0,0) and the hotend is 50 mm's in front and out of the bed.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.