Most modern printers automatically set the Z offset during autoleveling. Unfortunately, this feature is not supported on older printers, such as the Snapmaker 2.0. To address this, I decided to use a limit switch to automatically set the Z offset, making autoleveling fully automatic with no manual intervention.
Concept
Since the Snapmaker firmware and hardware do not support adding a Z probe, I had to get creative. The printer has no connections for a Z probe, so I connected the switch to the autoleveling probe pins and used bed probing commands to probe the switch. In my testing, I found that the standard G30 command does not work, as it only probes within the printing area. Fortunately, G38.2 does not have this problem, although it is not officially supported by Snapmaker (but it seems to work fine).
3D Model
I have made a simple stl to mount the switch to the A350.
https://www.thingiverse.com/thing:7285940
Initial setup
The Z offset has to be set up once and must be reset if you change to a new printbed.
To set the Z offset
(Clean the nozzle first if you have a nozzle cleaner)
-
Set absolute Positioning (G90)
-
Move the nozzle over the limit switch (G0 X339)
-
Move it down until it triggers the switch G38.2 F100 Z0
-
Record the Z height. (M114) - switch_Z
-
Move the nozzle over the center of the bed G0 X160 Y176
-
Set the Z offset the way you normally do
-
Record the Z height (M114) - bed_Z
-
Calculate the Reference Height (switch_Z - bed_Z)
To run autoleveling, run these G-code commands
M190 S{bed temp} ; Heat Bed & Wait
G1029 P{Grid Size} ; Set Grid Size 3, 9, or 11
G1029 S ; Save Grid
G1029 A ; Run Auto Level
G90 ; absolute Positioning
G0 X339 Z15 ; Move above the z offset switch
G38.2 F100 Z0 ; probe
G0 X160 Y176 ; move over center of bed
G91 ; relative positioning
G0 Z-{Reference Height} F200 ; move z by negative reference height
G1029 S ; save autolevel
M140 S0 ; turn off bed heater
G90 ; absolute Positioning
If you use octoprint you can paste the above G-code into a custom control to run with a single button press
Assembly
The limit switch must have its C and NO pins connected to the same pins as the autoleveling probe (they both get connected at the same time).
Use two M2x12 bolts and nuts to attach the limit switch to the mount, and any two screws included with the printer to attach the mount to the linear rail.
Demo Videos
