thinkyhead

G29 - Automatic Bed Leveling

1.0.0-beta calibration Probe the bed and enable leveling compensation. AUTO_BED_LEVELING_(3POINT|LINEAR|BILINEAR)

Probes the bed at 3 or more points and enables bed leveling compensation. The exact procedure and method depends on the type of bed leveling chosen in Configuration.h:

  • AUTO_BED_LEVELING_3POINT probes 3 points and uses a matrix to compensate for bed tilt.
  • AUTO_BED_LEVELING_LINEAR also uses a tilt matrix but probes a grid and applies “least-squares.”
  • AUTO_BED_LEVELING_BILINEAR probes a grid and produces a mesh to adjust Z across the bed.
  • AUTO_BED_LEVELING_UBL provides several probing options. It will have its own GCode page soon.
  • There is also a manual MESH_BED_LEVELING option for setups without a probe.

The printer must be homed with G28 before G29.


Manual Probing

Auto Bed Leveling now includes a PROBE_MANUALLY option for systems lacking a probe.

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.)

PROBE_MANUALLY adds these parameters to G29:

  • Q : Query leveling and G29 state
  • A : Abort current leveling procedure
  • W Write a mesh point. (Ignored during leveling.)
  • X Required X for mesh point
  • Y Required Y for mesh point
  • Z Required Z for mesh point

To probe the bed using GCode:

  1. Use G29 Q to get the current status. If leveling data exists, you can send M420 S1 to use it.
  2. Use G29 to move to the first point for Z adjustment.
  3. Adjust Z so a piece of paper can just pass under the nozzle.
  4. Use G29 to save the Z value and move to the next point.
  5. Repeat steps 3-4 until completed.
  6. Use M500 to save the leveling data to EEPROM, if desired.

To probe the bed using your LCD controller: (Requires LCD_BED_LEVELING)

  1. Select the Level Bed sub-menu, then choose Level Bed (not Cancel).
  2. Wait for Homing XYZ to complete.
  3. When Click to Begin appears, press the controller button to move to the first point.
  4. Use the controller wheel to adjust Z so that a piece of paper can just pass under the nozzle.
  5. Press the controller button to save the Z value and move to the next point.
  6. Repeat steps 4-5 until completed.
  7. Use Control > Store memory to save the mesh to EEPROM, if desired.

Usage

G29 [A<bool>] [B<linear>] [D<flag>] [F<linear>] [J<bool>] [L<linear>] [P<int>] [Q<bool>] [R<linear>] [S<rate>] [T<flag>] [V<1|2|3|4>] [W<bool>] [X<int/float>] [Y<int/float>] [Z<float>]

Argument Description
[A<bool>]

Abort leveling procedure in-progress (PROBE_MANUALLY)

[B<linear>]

Set the back limit of the probing grid (AUTO_BED_LEVELING_LINEAR and AUTO_BED_LEVELING_BILINEAR)

[D<flag>]

Dry-Run mode. Just probe the grid but don’t update the bed leveling data

[F<linear>]

Set the front limit of the probing grid (AUTO_BED_LEVELING_LINEAR and AUTO_BED_LEVELING_BILINEAR)

[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 (AUTO_BED_LEVELING_LINEAR and AUTO_BED_LEVELING_BILINEAR)

[P<int>]

Set the size of the square grid that will be probed - P x P points (AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_UBL)

[Q<bool>]

Query the current leveling state (PROBE_MANUALLY, DEBUG_LEVELING_FEATURE)

[R<linear>]

Set the right limit of the probing grid (AUTO_BED_LEVELING_LINEAR and AUTO_BED_LEVELING_BILINEAR)

[S<rate>]

Set the XY travel speed between probe points (AUTO_BED_LEVELING_LINEAR and AUTO_BED_LEVELING_BILINEAR)

[T<flag>]

Generate a Bed Topology Report (AUTO_BED_LEVELING_LINEAR)

[V<1|2|3|4>]

Set the verbose level

[W<bool>]

Write a mesh Z offset (PROBE_MANUALLY). W requires X, Y, and Z.

[X<int/float>]

Override the X-size of the grid that will be probed (Linear). Specify X when setting a mesh value (PROBE_MANUALLY).

[Y<int/float>]

Override the Y-size of the grid that will be probed (Linear). Specify Y when setting a mesh value (PROBE_MANUALLY).

[Z<float>]

Specify the Z offset when setting a mesh value (PROBE_MANUALLY).

Notes

Any arguments left out of G29 will use the default values set in Configuration.h.

Examples

G29 is most commonly used without any arguments. This uses the parameters set in Configuration.h.

G29 ; execute ABL

Probe a 5x5 matrix:

G29 P5 ; 5x5 matrix

Probe a 4x8 matrix from X50 Y50 to X150 Y150, printing a full report:

G29 X4 Y8 L50 R150 F50 B150 T V4