G29 - Bed Leveling
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)
Enable Compensation
Disable Compensation
Parameters
Probe Mode Parameters
| Parameter | Description | Example |
|---|---|---|
| X | Number of divisions along the X-axis (required) | X3 |
| Y | Number of divisions along the Y-axis (required) | Y3 |
| F | Travel speed for XY/Z positioning moves in units/min (required) | F50 |
| P | Probe speed for Z-axis descent toward the bed in units/min (required) | P5 |
| B | Backoff speed after limit switch trigger in units/min (required) | B10 |
| H | Hover height for Z-axis between probe points (required) | H5 |
| A | Virtual Z DMC axis index, 0-7 corresponding to DMC axes A-H (required) | A4 |
| R | Retraction distance past the limit switch between probe samples (required when S > 1) | R5 |
| S | Number of probe samples per point, averaged (optional, default: 1) | S3 |
Enable/Disable Parameters
| Parameter | Description | Example |
|---|---|---|
| E0 | Disable bed leveling compensation and restore the original Z-axis mapping | G29 E0 |
| E1 | Enable bed leveling compensation using previously stored mesh data | G29 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.
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.
Disable Compensation
Disable bed leveling compensation and restore the original Z-axis mapping.
Re-enable Compensation
Re-enable bed leveling compensation using previously stored mesh data without re-probing.
Typical Bed Leveling Sequence
A common sequence that homes the machine, probes the bed, and begins a print with compensation active.
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.