# Switch nozzle contact probe auto leveling with Marlin 2.0

I have a Robo R1+ which uses the nozzle contacting the glass print bed to level the printer. When the print head strikes the bed the Z-min endstops open signaling that the bed is touched.

I recently upgraded from an Arduino to an SKR 1.3 running Marlin 2.0 and have been trying to make the printer auto level. However all the examples I can find involve a probe. I'm not even sure what this kind of autoleveling is called.

Is there a way to configure Marlin 2.0 to perform this kind of autoleveling. And if so what lines should I comment and un-comment?

Basically, you are also using a probe, the nozzle is the probe. So this is very similar to an auto levelling setup using a capacitive or inductive sensor, the difference is that your M851 nozzle to probe distance is zero, and may receive a positive value to slightly raise it to get a sheet of paper in between the nozzle and printing surface.

Please note that below only changes for levelling are addressed, not other specifics in Marlin 2.x for the Robo R1+!

First you define the nozzle offset in Configuration.h, which is exactly at the nozzle, so X and Y (and Z) are zero.

#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 }


You can also set:

define NOZZLE_AS_PROBE


Furthermore, you need to define a levelling method in the same configuration file:

//#define AUTO_BED_LEVELING_3POINT
//#define AUTO_BED_LEVELING_LINEAR
#define AUTO_BED_LEVELING_BILINEAR
//#define AUTO_BED_LEVELING_UBL
//#define MESH_BED_LEVELING


For safety, we usually home Z at the center of the printing surface:

#define Z_SAFE_HOMING


Also be sure the following statement is active:

#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN


Next, you need to define the boundaries of the "probe", which is exactly where the nozzle may come (apart from a small safety offset at all edges called MIN_PROBE_EDGE); how you do that is described in question "How to set Z-probe boundary limits in firmware when using automatic bed leveling?", in Marlin 2.x this needs to be set in Configuration_adv.h:

#if PROBE_SELECTED && !IS_KINEMATIC
#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE
#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE
#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE
#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE
#endif

• Thanks oscar. Once I get a CAD project out of the way I'll test that out. Very clear. – henradrie Feb 21 '20 at 2:55
• The Robo r1+ uses an inverted z axis limit switch. When the signal is true the axis moves and turns to false when the limit is reached. The endstop switch needs to be inverted too, but the software will warn you if you need to change it. – henradrie Mar 1 '20 at 0:55