Back to Supported G-Codes

G29 - Bed Leveling

DMC File Mode: Not Supported
Streaming Mode: Supported

Description

The G29 command performs automatic bed leveling by probing a grid of points across the bed surface, measuring Z-height offsets, and enabling real-time compensation during printing. It operates in three modes: probe (default), enable, and disable.

During probing, the machine traverses a grid in a serpentine pattern, touching the bed at each point to measure the surface topology. The measured offsets are stored on the DMC controller and used by an interpolation thread to adjust Z-height in real time. After probing completes, compensation is automatically enabled.

Syntax

Probe Mode (default)

G29 X<divisions> Y<divisions> F<speed> P<speed> B<speed> H<height> A<axis> [S<samples> R<distance>]

Enable Compensation

G29 E1

Disable Compensation

G29 E0

Parameters

Probe Mode Parameters

ParameterDescriptionExample
XNumber of divisions along the X-axis (required)X3
YNumber of divisions along the Y-axis (required)Y3
FTravel speed for XY/Z positioning moves in units/min (required)F50
PProbe speed for Z-axis descent toward the bed in units/min (required)P5
BBackoff speed after limit switch trigger in units/min (required)B10
HHover height for Z-axis between probe points (required)H5
AVirtual Z DMC axis index, 0-7 corresponding to DMC axes A-H (required)A4
RRetraction distance past the limit switch between probe samples (required when S > 1)R5
SNumber of probe samples per point, averaged (optional, default: 1)S3

Enable/Disable Parameters

ParameterDescriptionExample
E0Disable bed leveling compensation and restore the original Z-axis mappingG29 E0
E1Enable bed leveling compensation using previously stored mesh dataG29 E1

Examples

Probe a 4x4 Grid

Probe a 4x4 grid (16 points) across the bed using DMC axis E (index 4) as the virtual Z axis.

G29 X3 Y3 F50 P5 B10 H5 A4 R5

Probe with Multiple Samples

Probe a 3x3 grid (9 points) with 3 samples per point for improved accuracy. Each point's Z value is the average of the 3 measurements.

G29 X2 Y2 F50 P5 B10 H5 A4 R5 S3

Disable Compensation

Disable bed leveling compensation and restore the original Z-axis mapping.

G29 E0

Re-enable Compensation

Re-enable bed leveling compensation using previously stored mesh data without re-probing.

G29 E1

Typical Bed Leveling Sequence

A common sequence that homes the machine, probes the bed, and begins a print with compensation active.

G21 ; Set units to millimeters
G90 ; Set absolute positioning
G28 ; Home all axes
G29 X3 Y3 F50 P5 B10 H5 A4 R5 ; Probe 4x4 grid
G1 X10 Y10 Z0.3 F1500 ; Begin first layer

Notes

  • Probing automatically enables bed leveling compensation upon completion. A separate G29 E1 is not required after probing.
  • X, Y, and Z axes must be configured before running a probe cycle.
  • The A parameter specifies which DMC axis (0=A through 7=H) to use as the virtual Z for compensation. This axis must not conflict with other configured axes.
  • The probe grid uses a serpentine traversal pattern (alternating left-to-right and right-to-left rows) for efficient travel.
  • When taking multiple samples (S > 1), the Z-axis retracts after each sample until the limit switch disengages, then continues retracting by the distance specified by R before probing again.
  • All speed parameters (F, P, B) are specified in units per minute, consistent with standard G-code feedrate conventions.
  • After probing completes, the Z-axis is automatically remapped to the virtual Z axis for real-time compensation.
  • Using G29 E1 requires that mesh data has been previously stored on the controller.