8730763008_2663df7782_z.jpg

Hardware requirements:

You will need a probe switch attached to the machine's actuator, or a bed able to trigger an end stop input when the hotend touches it. A point detection is best as the actual position is important for probing. (proximity probes are suboptimal as they do not detect the point position).

NOTE A probe is NOT an endstop and therefore cannot be used to Home the Z axis. You need a Z endstop to use G28 to home the Z axis. Below are some instructions on how you can set the bed Z height using a probe (G30).

Configuration

Add the following to the config file :

gamma_min_endstop            nc                 # normally 1.28. Change to nc to prevent conflict, not needed on Azteeg X5

zprobe.enable                true               # set to true to enable a zprobe
zprobe.probe_pin             1.28!^             # pin probe is attached to if NC remove the !, Azteeg X5 this is 1.29
zprobe.slow_feedrate         5                  # mm/sec probe feed rate
#zprobe.debounce_ms          1                  # set if noisy
zprobe.fast_feedrate         100                # move feedrate
zprobe.probe_height          5                  # how much above bed to start probe NB only needed for G32 on delta
zprobe.return_feedrate       0                  # feedrate after a probe, default 0 is double of slow_feedrate (mm/s)

NOTE the slow_feedrate is the speed the probe moves down to find the bed, it returns (probe up) at 2*slow_feedrate or return_feedrate. fast_feedrate is only used for any XY moves done during probing.

G30 will probe from the current position until it hits the bed and the probe triggers, it will report the distance traveled then return to where it started.

G30 Znnn will probe until it hits the bed then sets Z to nnn, this can be used to set the nozzle height if nnn is the probes Z offset from the nozzle in the Z direction. NOTE this is NOT supported for deltas, use on Cartesians only.

G30 Fxxx will run the probe at xxx mm/min overriding the slow_feedrate.

G38.2 and G38.3 are also implemented as documented here

If there are multiple levelling strategies selected the Pn parameter will select which one to send leveling codes to, 0 being the first defined one, 1 the second and so on. eg G29 P1 will send G29 to the second defined levelling strategy.

There are several M670 parameters that can set different settings for zprobe overriding the config settings, these are all saved with M500

M670 S0.50 K2.00 R2.5 Set Probe feedrates slow/fast/return (mm/sec)
M670 Z200.00 Set Probe max_z (mm)
M670 H2.00 Set Probe height (mm)
M670 I1 Temporarily invert the sense of the probe pin (Not saved with M500)

Leveling strategies

If a leveling-strategy.xxx.enable is set to true this enables one of the bed leveling strategies described below.

All options

Option Example value Explanation
zprobe.enable false Set to true to enable the Z-probe module. This is used to scan surfaces, and to calibrate parameters and compensate for non-planar surfaces.
zprobe.probe_pin 1.28!^ Pin the probe is connected to.
zprobe.slow_feedrate 5 Speed in millimetres/second at which the probe seeks a surface.
zprobe.fast_feedrate 100 Speed in millimetres/second at which the probe does fast moves.
zprobe.return_feedrate 50 Speed in millimetres/second at which the probe does the return after a probe.
zprobe.debounce_ms 1 Debounce the probe pin over this number of millisceconds. Set to 1 or 2 if your probe is too noisy and gives false readings.
zprobe.probe_height 5 Distance above the bed at which the probing is started, once the bed's height is known.

Leveling strategy options

Option Example value Explanation
leveling-strategy.three-point-leveling.enable true Set to true to enable the leveling strategy that probes three points to define a plane and then keeps the Z parallel to that plane. This is useful if your Z plate/bed is not perfectly aligned with your XY gantry
leveling-strategy.three-point-leveling.point1 100.0,0.0 The first probe point (X, Y)
leveling-strategy.three-point-leveling.point2 200.0,200.0 The second probe point (X, Y)
leveling-strategy.three-point-leveling.point3 0.0,200.0 The third probe point (X, Y)
leveling-strategy.three-point-leveling.home_first true Home the X and Y axes before probing
leveling-strategy.three-point-leveling.tolerance 0.03 The probe tolerance in millimetres, anything less that this will be ignored, default is 0.03mm
leveling-strategy.three-point-leveling.probe_offsets 0,0,0 The probe offset from nozzle, must be X,Y,Z (Z should always be 0), default is no offset. This is used if your nozzle is not exactly at the same position as where your tool would be.
leveling-strategy.three-point-leveling.save_plane false Set to true to allow the bed plane to be saved with M500, default is false
leveling-strategy.delta-calibration.enable true Set to true to enable the delta calibration levelling strategy. This uses the probe to figure out the plane's tilt and arm's radius in a delta machine
leveling-strategy.delta-calibration.radius 100 Radius at which to probe the three points
leveling-strategy.delta-calibration.initial_height 10 the initial height above the bed we stop the initial move down after home to find the bed. This should be a height that is enough that the probe will not hit the bed and is an offset from gamma_max (can be set to 0 if gamma_max takes into account the probe offset)

Delta calibration

NOTE

This calibrates the endstops and delta radius only, it is designed to be run once and done, no need to run it before each print. Just run it and save the results. It does not set the Z height, that can be done in several different ways as described later.

Make sure the the config has delta_homing true set and that gamma_max is set to about 20-30mm shorter than the distance to the bed, otherwise it will crash into the bed at high speed.

Also in the config set :

leveling-strategy.delta-calibration.enable   true            # basic delta calibration
leveling-strategy.delta-calibration.radius   100             # the probe radius
#the initial height above the bed we stop the intial move down after home to find the bed
#this should be a height that is enough that the probe will not hit the bed and is an offset from gamma_max (can be set to 0 if gamma_max takes into account the probe offset)
leveling-strategy.delta-calibration.initial_height 10 # height above bed to stop initial move

Radius

Note that leveling-strategy.delta-calibration.radius should optimally be set such that the probe points are on the circumference of a circle that is equidistant from the center of the bed to the towers.

This minimizes the affect one endstop has on the others when adjusted.

This will usually put the probe points close to the edge of the glass bed.

Calibration routine

Issuing the G32 command will run the full calibration sequence automatically.

It will cycle several times to converge on a good result.

If the result is good use M500 to save the M666 settings.

What will happen is it will home the probe down to find the bed, then home again then move down to 5mm above the bed (or whatever you set zprobe.probe_height to).

Then it will probe the three towers at the specified leveling-strategy.delta-calibration.radius from the center, and will print out the results, it will set the endstop trims and home, this will repeat 3-4 times, each time the difference between the three probes should get smaller, once it has completed 4 probes or the difference is under 0.03mm it will home one last time then probe the three points to confirm the calibration, then probe the center.

It will also adjust the delta radius (M665 Rnnn) to get the center the same height as the outside points.

Use

These are the different ways to use the calibration routine : 

G29 will probe the seven points on your bed, you can use this to see how well the bed is leveled.
G29.1 will probe the seven points on your bed,and output the data that can be fed into some offline least errors scripts to adjust tower offsets
G32 Does the full calibration sequence, endstop and delta radius
G32 R0 Will only do delta radius calibration
G32 E0 Will only do endstop calibration
G32 I0.02 Will set the target to within 0.02mm
G32 K0 Will keep the current endstop trim settings and check them, without K the trims are cleared to zero and a full calibration is performed
G32 J110.0 will set the probe radius to 110.0 mm for this session

Z height

You will need to set the z height after calibration using one of the several methods available mentioned here [http://smoothieware.org/delta]

Offsets

There are NO probe offsets for delta calibration, so the probe should be within 10-20mm of the nozzle. This is by design as the calibration works solely on relative positions.

To be clear : there are no offsets in Smoothie, and they would not be useful as calibration is relative. This can be confusing to Marlin users. Just use it and you'll see.

If you are getting the Calibration failed to complete error it usually means you need to increase the
leveling-strategy.delta-calibration.initial_height config setting to a bigger value, try 10 or 20 or bigger.
With the recent version it should move fast to just above the bed then move to the bed slowly, if it hits the bed on the first fast move then you need to set initial-height bigger.

See http://minow.blogspot.com/ for more details of calibrating a delta.


Delta Grid Compensation

NOTE now supports square beds on cartesian machines.

Probes delta_grid.size points in X and Y (total probes size * size) and stores the relative offsets from the 0,0 Z height.
When enabled every move will calculate the Z offset based on interpolating the height offset within the grids nearest 4 points.
Should be used in conjunction with the delta calibration strategy above. First calibrate with G32 then if needed do G31 to set the grid compensation.
NOTE The delta-grid.radius specified should be at least as big as the largest X,Y position likely to be moved to. It gets very inaccurate if you try to print outside of the radius you specified.

NOTE G31 is the probe command on this not G32.

Configuration

The strategy must be enabled in the config as well as zprobe.

leveling-strategy.delta-grid.enable         true

The radius of the bed must be specified with…

leveling-strategy.delta-grid.radius        50

this needs to be at least as big as the maximum printing radius as moves outside of this will not be compensated for correctly

The size of the grid can be set with…

leveling-strategy.delta-grid.size        7

this is the X and Y size of the grid, it must be an odd number, the default is 7 which is 49 probe points

leveling-strategy.delta-grid.do_home         true

must be set on a Delta printer (although it should default to true).

If you are not using all 3 endstops (or prefer to home manually before G32):

leveling-strategy.delta-grid.do_home        false

Note: You are responsible to make sure that (0,0) is in a repeatable location if do_home = false.

Optionally probe offsets from the nozzle or tool head can be defined with…

leveling-strategy.delta-grid.probe_offsets  0,0,0  # probe offsets x,y,z  (Z should always be 0)

they may also be set with M565 X0 Y0 Z0. NOTE setting probe offsets on a delta will make the grid less effective the further the probe is from the head, this is especially true if you are using it to correct geometry errors, as they depend on the actuator position not the head position. So having a probe offset from the head will try to compensate for errors which are offset from where the head actually is. There is no easy way to overcome this other than have the probe as close to the nozzle as possible.

If the saved grid is to be loaded on boot then this must be set in the config…

leveling-strategy.delta-grid.save        true

Then when M500 is issued it will save M375 which will cause the grid to be loaded on boot. The default is to not autoload the grid on boot. NOTE the grid size and the radius is saved in the file, and restored when it is loaded with M375. If the grid size is different from the one in config it will NOT load. If the radius is different, then the radius will be set to whatever was saved overriding the one set in config.

Optionally an initial_height can be set that tell the initial probe where to stop the fast decent before it probes, this should be around 5-10mm above the bed

leveling-strategy.delta-grid.initial_height  10

Use on Cartesian printers

Delta-grid can also be used with cartesian printers. However, there's a few things that need to be done for this to work. First, configure alpha_min and beta_min/max such that 0,0 is in the center of the printbed. If the print area is the same length in X/Y, radius can still be used (it's the maximum X/Y coordinate from 0,0 that is reachable).
NOTE Even though you have set the Machine coordinates to 0,0 in the middle of the bed you can still have the workspace coordinate system have 0,0 at the bottom, left (or wherever you want). To do this, after homing jog to where you want 0,0 to be and issue G92 X0 Y0, or G10 L20 P0 X0 Y0, then M500 to save this. (to save G92 you have to set a config save_g92 true)

You do need to set mm_per_line_segment.

mm_per_line_segment 1 # necessary for cartesians using delta-grid
leveling-strategy.delta-grid.is_square        true

If the bed is rectangular, use the following options to set the maximum absolute distance from 0,0 in X and Y.

leveling-strategy.delta-grid.max_x        75
leveling-strategy.delta-grid.max_y        50

Usage

G29 test probes in a grid pattern within the radius producing a map of offsets, this can be imported into a graphing program to visualize the bed (NOTE if delta calibration is also enabled then this is executed with G29 P1). optional parameters In sets the number of points to the value n, Jn sets the radius for this probe.
G29.1 test probes in a spiral pattern within the radius producing a map of offsets, this can be imported into a graphing program to visualize the bed heights (NOTE if delta calibration is also enabled then this is executed with G29 P1). optional parameters In sets the number of points to the value n, Jn sets the radius for this probe.
G31 probes the grid and turns the compensation on, this will remain in effect until reset or M561/M370 optional parameters Jn sets the radius for this probe.
M370 clears the grid and turns off compensation (NOTE you must home after this)
M374 Save grid to /sd/delta.grid
M374.1 delete /sd/delta.grid
M375 Load the grid from /sd/delta.grid and enable compensation (NOTE you must home after this)
M375.1 display the current grid
M561 clears the grid and turns off compensation (NOTE you must home after this)
M565 defines the probe offsets from the nozzle or tool head
M500 saves the probe points
M503 displays the current settings

Three point platform compensation for Cartesians

Also incorrectly called bed leveling.

DO NOT USE ON DELTAS

It just won't work. Use the delta-specific strategy above.

the following third party user guide is helpful : 

However note it is NOT recommended to automate the probe sequence in your gcode as suggested in that post.

3-point.svg

Summary

Probes three user specified points on the bed and determines the plane of the bed relative to the probe.

As the head moves in X and Y it will adjust Z to keep the head tram with the bed.

NOTE The probe does not set the bed height, the probes find the relative level of the bed based on the first probe point, so after you have defined the bed plane with G32, you then set the bed height at the first probe point and use M206 or M306 to set the homing offset. Once saved you do not need to do zprobe or bed height again. In this case it is best to have a Z endstop as well as the ZProbe. the Z endstop is used to set the bed height after the probe.
This is different to other Firmware and is deliberate. This allows people to use temporary Z probes and not have a permanent z probe or know the exact Z offset of the probe in relation to the nozzle. In addition the z component of the .probe_offsets should always be zero.

Configuration

The strategy must be enabled in the config as well as zprobe.

leveling-strategy.three-point-leveling.enable         true

Three probe points must be defined, these are best if they are the three points of an equilateral triangle, as far apart as possible.
They can be defined in the config file as:-

leveling-strategy.three-point-leveling.point1         100.0,0.0   # the first probe point (x,y)
leveling-strategy.three-point-leveling.point2         200.0,200.0 # the second probe point (x,y)
leveling-strategy.three-point-leveling.point3         0.0,200.0   # the third probe point (x,y)

Or they may be defined (and saved with M500) using M557 P0 X30 Y40.5 where P is 0,1,2

Probe offsets from the nozzle or tool head can be defined with :

leveling-strategy.three-point-leveling.probe_offsets  0,0,0  # probe offsets x,y,z (Z should always be 0)

They may also be set with M565 X0 Y0 Z0

To force homing in X and Y before G32 does the probe the following can be set in config, this is the default

leveling-strategy.three-point-leveling.home_first    true   # disable by setting to false

The probe tolerance can be set using the config

leveling-strategy.three-point-leveling.tolerance   0.03    # the probe tolerance in mm, default is 0.03mm

You can save the bed plane so it can be used again without probing again presuming the bed stays flat etc. to do this you must enable the feature

leveling-strategy.three-point-leveling.save_plane   true    #

For this to be effective you must do your Z home to the first probe point defined when creating the plane. Set the Z height to zero at the first probe point,
then the bed plane should be relative from that point on. You save it with M500, although it will not display with M503 as it is not a user settable function.

A nice guide is here. http://reprapme.com/2015/07/z-probing/ although use of an automatic probe deploy is entirely optional, and running a probe every print is also not the recommended way to use this, it is preferable to probe once and save the results, no more probes are required unless something changes on your bed.

Usage

The machine must be homed in X and Y before running the probe.
If you need to set the bed height after probing you must set the height at the first probe point, and save it with homing offsets. (M206 or M306)

G29 probes the three probe points and reports the Z at each point, if a plane is active it will be used to level the probe.
G32 Probes the three probe points and defines the bed plane, this will remain in effect until reset or M561
G31 Reports the status
M557 Defines the probe points
M561 Clears the plane and the bed leveling is disabled until G32 is run again (NOTE you must home after this)
M565 Defines the probe offsets from the nozzle or tool head
M500 Saves the probe points and the probe offsets
M503 Displays the current settings

Example use :
(This only works if you have a Z endstop as well as a probe).

    G28 (Home XYZ)
    Move Z up to about 30mm and attach probe
    G32
    remove probe.
    M500 (to save probe results)
    G28 (Home XYZ)
    Move to the Probe P0 point (first probe point)
    jog down to touch the plate
    M306 Z0
    M500 (to save homing offset)
    G28
    Move to 0,0 check Z height
    Move to P0 check z height ditto for P1 and P2

ZGrid level compensation for Morgans (or multipoint bilinear bed leveling)

This has been removed from edge, use Delta grid instead. It is still available in Reprap Morgans fork of Smoothie

NOTE It is fully functional and tested on Morgan machines only.

NOTE this does not work on Deltas (use DeltaGrid) and is not well tested on Cartesians.

Summary

Probes a grid of user specified number of points on the bed and populates a data array of offsets to be used with a bilinear offset calculation.

As the head moves in X and Y it will adjust Z to keep the head tracking the bed surface.

Configuration

The strategy must be enabled in the config as well as zprobe.

leveling-strategy.ZGrid-leveling.enable         true

The bed size limits must be defined, in order for the module to calculate the calibration points

leveling-strategy.ZGrid-leveling.bed_x           200
leveling-strategy.ZGrid-leveling.bed_y           200

Also ensure that the max Z is defined and valid for the machine (Gamma end stop section)

gamma_max                                    200              #

The number of divisions for X and Y should be defined

leveling-strategy.ZGrid-leveling.rows           7          # X divisions (Default 5)
leveling-strategy.ZGrid-leveling.cols           9          # Y divisions (Default 5)

The probe offset should be defined, default to zero offset

leveling-strategy.ZGrid-leveling.probe_offsets  0,0,16.3

slow feedrate can be defined for probe speed

leveling-strategy.ZGrid-leveling.slow_feedrate  100

Usage

The machine will home automatically when running the probe.
The machine will then position the head in the center of the defined space for probe attachment (if required)
When ready, trigger the probe manually to start the probe run.

G32 Probes the probe points and defines the bed ZGrid, this will remain in effect until reset or M370
G31 Reports the status and displays grid data
M370 clears the ZGrid and the bed leveling is disabled until G32 is run again
M370 X7 Y9 Overrides config grid size and allocates a new grid size of 7x9 and clears as above
M371 Moves the head to the next calibration position without saving for manual calibration
M372 Moves the head to the next calibration position after saving the current probe point to memory - manual calibration
M373 Completes manual calibration and enables the Z compensation grid
M374 Saves the grid to a file on the SD card (ZGrid). This file contains the grid size, and Z-offset so that the system can recall the exact position. Ensure that the M306 Z calibration is performed before saving the grid.
M375 Recall the saved grid file from the SD card
M565 Defines the probe offsets from the nozzle or tool head
M500 Saves the probe offsets
M503 Displays the current settings

ZGrid file

The Zgrid file is a simple list of offsets prefaced by the Z probe length and the XY probe count. The order is identical to the probing order.

Example:

In the file below, P100 refers to the number of probe points to sample.
The two 10s are the number of rows and columns (X, Y), and the floating point number is the Z home offset.
The rest of the values are the probing offsets (calculated as the travel distance - the home offset). Higher values indicate that the probe moved less before triggering (so the bed at that point is higher), smaller values mean bed is lower.
P100 10 10 20.100
1.725
0.663
0.413
0.725
0.625
0.513
0.375
0.263

1.025
0.875
0.956

Tuning gamma_max

Configuring Z height

After homing, the machine knows it is at X position 0, Y position 0, and Z maximum position.

Because of this, it will read the configuration option gamma_max and set the current Z position to that value.

So after homing, the Z position is set to gamma_max.

This means that if your hotend is 300mm above your bed after homing, and you set gamma_max to 300, after homing, you can just tell the machine to go to Z position 0, and it will go to the bed's height.

To find the right value for gamma_max do one of the following :

Finding gamma_max manually

First home the machine

G28

Then set the current Z position to 0

G92 Z0

Then move the head to the bed, using G0 Z(position) or Pronterface or the web interface.

Once the head is exactly at the bed, issue this command

M114

This will return the position of all axes. The current position of the Z axis is your gamma_max value.

Simply edit the configuration file to set this value, and reset the board.

Alternatively you can use the M665 Z(distance) command to set the value in the config override system, and M500 to save that value to the SD card.

The gamma_max value in the configuration file is ignored if M665 is set and saved.

Next time you home, the machine will know how high above the bed it is.

Simplified manual adjustment method

First home the machine

G28

Then move to the point the machine currently thinks is Z 0

G0 Z0

Then move the head to the bed by jogging, using Pronterface's arrows, the panel or the web interface.

Finally issue the M306 Z0 command which will use the current Z position as a homing offset.

Then save to the SD card with M500.

Next time you home, the machine will know how high above the bed it is.

Finding gamma_max with a probe

If you have some sort of probe attached to your head ( or bellow your bed ), which triggers when the hotend gets close to the bed, then you can use this to find your gamma_max value without manually jogging.

Now there are two different cases here :

  • Either when the probe is triggered, the hotend is exactly at bed level
  • Or, when the probe is triggered, the hotend is above the bed by a given distance, which we will call the z probe offset.

First home the machine

G28

Then ask the probe to go find the bed

G30

This will report the distance travelled by the probe.

Your gamma_max value is that reported distance, plus the z probe offset ( distance between the probe triggering point, and the bed ).

Simply edit the configuration file to set this value, and reset the board.

Alternatively you can use the M665 Z(distance) command to set the value in the config override system, and M500 to save that value to the SD card.

The gamma_max value in the configuration file is ignored if M665 is set and saved.

Next time you home, the machine will know how high above the bed it is.

Automatically finding the bed with a probe

Smoothie allows you to save both the Z height, and the delta calibration data, to the SD card.

This means you do not need to probe every time you start the machine, you only need to do it once, and save the values, which will then stay valid as long as your machine's geometry doesn't change.

This means you can have a removable probe that you only connect and attach to the head at the rare occasions when you need it.

However, if for whatever reason you have a fixed ( or retractable ) probe on your head ( or sensors bellow your bed ), then you might want to automatically probe at the beginning of each print.

To do so, simply change your slicing program's "beginning of file" G-code sequence, and replace

G28

with :

G28
G30 Znnn

When nnn is the distance between your probe's triggering point, and the bed.

The G30 Znnn command moves the head until the probe triggers, then sets the current Z height to nnn

So for example if your probe triggers when the hotend is 5mm above the bed, do G30 Z5, and if your probe triggers exactly when the hotend touches the bed, do G30 Z0.

External resources

Using FSRs and proximity detectors as a probe

A message about FSRs and other non contact probes

If you use these and do not get a good calibration result, look closely at the probe repeatability on different parts of the bed, before you blame Smoothie.

FSRs need to be mounted in a very particular way so they do not trigger by vibration, and do not need too much force before triggering. Proximity probes tend to give different results depending on where they are on the bed, different densities of the underlying metal and less metal at the edges affects this, making the calibration results less than optimal.

Setting up FSRs to work reliably is tricky…

To use FSR's with the smoothieboard an aux board is needed to interface the FSR's to the smoothieboard's endstop input. Smoothieware will accept this input as if it was a simple mechanical switch.

JohnSL (Github) has created such a board. It is available via TriD Printing & UltiBots. See John's blog post about the board. This board is powered from the endstop pins.

The Deltabot group is where most discussion on using FSR's is located.
Topics to look for are:

  • Alternative boards like the arduino mini.
  • WingWong's trinket derived design.
  • Mounting of FSR's

BLTouch

Smoothieboard_BLTouch123.jpg
Command BLTouch status
M280 S3.0 Push-pin down
M280 S7.0 Push-pin up
M280 S10.6 Alarm release
M280 S8.4 Self-test
M280 S5.5 ZMin test mode (for M119)

Inductive proximity probes

Note : those probes are generally much less reliable than a simple mechanical switch. However, if it is what you own, here is a video about them :