Related codes: M420
Description
Automatic (Linear) Bed Leveling probes the bed in a grid and enables bed leveling compensation using a matrix to compensate for bed tilt, applying a “least-squares” approximation.
The printer must be homed with G28 before G29
.
Automatic Probing
Using an electronic probe Marlin can probe the entire grid with a single G29
command. See parameter descriptions and examples below for details.
Manual Probing
Click for Details
Auto Bed Leveling now includes a PROBE_MANUALLY
option for systems lacking a probe.
PROBE_MANUALLY
adds these parameters to G29
:
-
Q
: Query leveling andG29
state -
A
: Abort current leveling procedure
To do manual probing simply repeat G29
until the procedure is complete.
The first G29
accepts the same parameters , shown in the Usage section below. The exact parameters available will depend on which style of bed leveling is enabled. (Note: UBL parameters are not covered on this page unless they coincide. See the G29 for UBL page for a full list of its options.)
Before probing the bed:
- Use
G29 Q
to get the current status. IfG29
isn’t idle, abort withG29 A
. - Use
M420 V
to view leveling data. You can sendM420 S1
to use the existing data.
To probe the bed using G-code:
- Use
G29
to move to the first point for Z adjustment. - Adjust Z so a piece of paper can just pass under the nozzle.
- Use
G29
to save the Z value and move to the next point. - Repeat steps 3-4 until completed.
- Use M500 to save the leveling data to EEPROM, if desired.
To probe the bed using your LCD controller: (Requires LCD_BED_LEVELING
)
- Select the
Level Bed
sub-menu, then chooseLevel Bed
(notCancel
). - Wait for
Homing XYZ
to complete. - When
Click to Begin
appears, press the controller button to move to the first point. - Use the controller wheel to adjust Z so that a piece of paper can just pass under the nozzle.
- Press the controller button to save the Z value and move to the next point.
- Repeat steps 4-5 until completed.
- Use
Control
>Store memory
to save the mesh to EEPROM, if desired.
Notes
- Any arguments left out of
G29
will use the default values set inConfiguration.h
. - By default
G28
disables bed leveling. FollowG28
withM420 S
to turn leveling on.- With
ENABLE_LEVELING_AFTER_G28
leveling will always be enabled afterG28
. - With
RESTORE_LEVELING_AFTER_G28
leveling is restored to whatever state it was in beforeG28
.
- With
- To save time and machine wear, save your matrix to EEPROM with M500 and in your slicer’s “Starting G-code” replace
G29
withM420 S1
to enable your last-saved matrix.
Usage
G29 [A<bool>] [B<linear>] [C<bool>] [D<bool>] [E<bool>] [F<linear>] [H<linear>] [J<bool>] [L<linear>] [O] [P<int>] [Q<bool>] [R<linear>] [S<rate>] [T<bool>] [V<0-4>] [X<int>] [Y<int>]
Parameters
[A<bool>] | Abort leveling procedure in-progress ( |
[B<linear>] | Set the back limit of the probing grid. |
[C<bool>] | Create a fake grid for testing. ( |
[D<bool>] | Dry-Run mode. Just probe the grid but don’t update the bed leveling data |
[E<bool>] |
|
[F<linear>] | Set the front limit of the probing grid. |
[H<linear>] | Set the square width and height of the area to probe. |
[J<bool>] | Jettison the leveling data stored in SRAM and turn off leveling compensation. Data in EEPROM is not affected. |
[L<linear>] | Set the left limit of the probing grid. |
[O] | Optional. If leveling is already enabled then exit without leveling. (1.1.9) |
[P<int>] | Set the size of the square grid that will be probed - P x P points |
[Q<bool>] | Query the current leveling state ( |
[R<linear>] | Set the right limit of the probing grid. |
[S<rate>] | Set the XY travel speed between probe points. |
[T<bool>] | Generate a Bed Topology Report |
[V<0-4>] | Set the verbose level. Level 2 and up act like ‘T’. |
[X<int>] | Set the number of columns (in X) that will be probed. |
[Y<int>] | Set the number of rows (in Y) that will be probed. |
Examples
Automatic Probing examples
G29
is most commonly used without any arguments. This uses the defaults set in Configuration.h
.
Probe a 5x5 matrix.
Probe a 4x8 matrix from X50
Y50
to X150
Y150
, printing a full report.
Manual Probing example
Each G29
command goes to the next step until the whole procedure is done. The V1
parameter provides a progress report.