Skip to content

Commit 1ba6cef

Browse files
committed
update gcodes
1 parent 515f23f commit 1ba6cef

File tree

6 files changed

+296
-46
lines changed

6 files changed

+296
-46
lines changed

views/gcode/G029-ubl.md

Lines changed: 183 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,68 @@ long:
1414
- The Unified Bed Leveling System (UBL) provides a comprehensive set of resources to produce the best bed leveling results possible.
1515
- See the full [Unified Bed Leveling](/docs/features/unified_bed_leveling.html) documentation for more details. (Examples below.)
1616

17-
notes: Requires `AUTO_BED_LEVELING_UBL`.
17+
notes: |
18+
Requires `AUTO_BED_LEVELING_UBL`.
19+
20+
### Release Notes:
21+
22+
- It's highly recommended to enable EEPROM. With EEPROM storage enabled, UBL is limited to
23+
3-Point (`G29 P0 T`) and Grid (`G29 P0 G`) Leveling.
24+
25+
- When you do a `G28` and then a `G29 P1` to automatically build your first mesh, you'll notice
26+
that UBL probes increasingly far from the starting location. (The starting location defaults to
27+
the center of the bed.) Other grid leveling systems start in the corner and probe in a zigzag.
28+
UBL's pattern is better for Delta machines, allowing for the center of the Mesh to be populated
29+
(and edited) more quickly. You can then do a small test print to check the mesh early in the process.
30+
You don't need to populate the entire mesh to use it. You don't want to spend a lot of time generating
31+
a mesh only to realize that the the resolution or `M851 Z` probe offset is off. UBL mesh generation
32+
gathers points closest the nozzle unless you specify an (X,Y) coordinate pair.
33+
34+
- UBL requires a decent amount of EEPROM to store its mesh data. And it takes some effort
35+
to get this Mesh data correct for a given machine. To keep this data from being destroyed when the
36+
EEPROM version changes the Mesh data is stored at the high end of the EEPROM. (Happily, no developers
37+
seem to mind.)
38+
39+
- This system is built around Edward Patel's "Mesh Bed Leveling" system. A big "Thanks!" to him and to the
40+
creators of 3-Point and Grid Based leveling. Combining their contributions we now have the functionality
41+
and features of all three systems combined.
1842
1943
parameters:
2044
-
2145
tag: A
2246
optional: true
23-
description: Activate Unified Bed Leveling (i.e., `M420 S1`)
47+
description: |
48+
**Activate**
49+
Unified Bed Leveling (i.e., `M420 S1`)
2450
values:
2551
-
2652
type: bool
2753
-
2854
tag: B
2955
optional: true
30-
description: Business Card mode (`P2` only)
56+
description: |
57+
**Business Card** mode (`P2` only)
58+
- Use the 'Business Card' mode of the Manual Probe subsystem with `P2`.
59+
- In this mode of `G29 P2`, use a shim that the nozzle can grab onto as it is lowered.
60+
In principle, the nozzle-bed distance is the same when the same resistance is felt in
61+
the shim. You can omit the numerical value on first invocation of `G29 P2 B` to measure
62+
shim thickness. Subsequent use of `B` will apply the previously-measured thickness by default.
63+
- Note: A non-compressible Spark Gap feeler gauge is recommended over a business card.
3164
values:
3265
-
3366
type: bool
3467
-
3568
tag: C
3669
optional: true
37-
description: Continue (`P1`), Current (`P2`), Constant (`P3`,`Q2`)
70+
description: |
71+
- `G29 P1 C` Continue:
72+
Continues the generation of a partially-constructed Mesh without invalidating
73+
previous measurements.
74+
- `G29 P2 C` Constant: specifies a Constant and tells the Manual Probe subsystem to use the current
75+
location in its search for the closest unmeasured Mesh Point.
76+
- `G29 P3 C` Constant: specifies the Constant for the fill. Otherwise, uses a "reasonable" value.
77+
- `G29 Z C` Current:
78+
Use the Current location (instead of bed center or nearest edge).
3879
values:
3980
-
4081
tag: bool/float
@@ -56,89 +97,188 @@ parameters:
5697
-
5798
tag: F
5899
optional: true
59-
description: Fade height. (UBL only! For others use `M420 Z`)
100+
description: |
101+
**Fade** height. (UBL only! For others use `M420 Z`)
102+
103+
Fade the amount of Mesh Based Compensation over a specified height. At the
104+
specified height, no correction is applied and natural printer kenimatics take over. If no
105+
number is specified for the command, 10mm is assumed to be reasonable.
60106
values:
61107
-
62108
unit: linear
63109
type: float
64110
-
65111
tag: H
66112
optional: true
67-
description: Height for Manual Probe raise (`P2` only).
113+
description: |
114+
**Height**:
115+
- `G29 P2 H`: Height for Manual Probe raise (`P2` only).
116+
Specify the Height to raise the nozzle after each manual probe of the bed.
117+
If omitted, the nozzle will raise by `Z_CLEARANCE_BETWEEN_PROBES`.
118+
- `G29 P4 H` : Offset above the mesh height to place the nozzle.
119+
If omitted, `Z_CLEARANCE_BETWEEN_PROBES` will be used.
68120
values:
69121
-
70122
unit: linear
71123
type: float
72124
-
73125
tag: I
74126
optional: true
75-
description: Invalidate this number of mesh points. (No value = 1)
127+
description: |
128+
**Invalidate**
129+
a number of mesh points (default 1).
130+
- Invalidate Mesh Points near the given `X Y` (Default: nozzle position)
131+
- If no `I` value is given, only the point nearest to the given position is invalidated.
132+
Use `T` to produce a map afterward. This command is useful to invalidate a portion of
133+
the Mesh so it can be adjusted using other UBL tools. When attempting to invalidate an
134+
isolated bad mesh point, the `T` option shows the nozzle position in the Mesh with (#).
135+
- You can move the nozzle around and use this feature to select the center of the area
136+
(or cell) to invalidate.
76137
values:
77138
-
78139
type: int
79140
-
80141
tag: J
81142
optional: true
82143
description: |
83-
- With a value (v), do _Square Grid_ probing of v x v points.
84-
- With no value, do _Three Point_ probing - e.g. to adjust a loaded mesh to match slight bed misalignment.
144+
**Grid** (or 3-Point) leveling:
145+
- These options calculate a plane and adjust the existing mesh to the bed tilt.
146+
- If a value is provided, probe a grid with the given number of points, squared.
147+
- With no value, probe 3 points to find the plane of the bed.
85148
values:
86149
-
87150
type: int
88151
-
89152
tag: K
90153
optional: true
91154
description: |
92-
**Kompare**: Subtract the stored mesh with the given index from the current mesh. This operates on the mesh in-memory, so it will probably invalidate the active mesh for purposes of printing.
155+
**Kompare**: Subtract (diff) the stored mesh with the given index from the current mesh. This
156+
operates on the mesh in-memory, so it will probably make the active mesh unsuitable
157+
for printing.
93158
values:
94159
-
95160
unit: index
96161
type: int
97162
-
98163
tag: L
99164
optional: true
100-
description: Load a mesh. If no index is given, load the previously-activated mesh.
165+
description: |
166+
**Load** a mesh. If no index is given, load the previously-activated mesh.
167+
The given mesh index will be used for subsequent Load and Store operations.
101168
values:
102169
-
103170
unit: index
104171
type: int
105172
-
106173
tag: P
107174
optional: true
108-
description: Phase
175+
description: |
176+
**Phase**:
177+
The `P`hase commands are used for the bulk of the work to setup a Mesh. In general, you'll start
178+
by initializing with a `G29 P0` or a `G29 P1` then do further refinement with additional Phases.
179+
180+
109181
values:
110182
-
111183
tag: 0
112184
description: |
113-
**Zero Mesh Data** and turn off the Mesh Compensation System.
185+
**Zero Mesh Data** and turn off the Mesh Compensation System. This reverts the
186+
machine to the same state it was in before UBL Compensation was enabled. Setting
187+
the entire Mesh to Zero is a special case to allow a subsequent `G` or `T`
188+
leveling operation for backward-compatibility.
114189
-
115190
tag: 1
116191
description: |
117-
Invalidate Mesh and do **Automatic Z Probing**.
192+
**Automatic Probing** invalidates the mesh and continues automatic probing using the probe.
193+
- In most cases the probe can't reach all areas that the nozzle can due to the offsets
194+
specified by `X_PROBE_OFFSET_FROM_EXTRUDER` and `Y_PROBE_OFFSET_FROM_EXTRUDER`.
195+
Deltabots can only probe within the area where `DELTA_PROBEABLE_RADIUS` and
196+
`DELTA_PRINTABLE_RADIUS` overlap.
197+
- Unreachable points can be filled in later with the `P2` and `P3` phases.
198+
- Use `C` to leave the previous mesh intact and automatically probe needed points. This allows you
199+
to invalidate parts of the mesh but still use Automatic Probing.
200+
- The `X` and `Y` parameters prioritize where to try and measure points. If omitted, the current
201+
probe position is used.
202+
- Use `T` (Topology) in this phase to report the probing results.
203+
- `P1` will suspend mesh generation if the controller button is held down. Note that you may need
204+
to press and hold the switch for several seconds if moves are underway.
118205
-
119206
tag: 2
120207
description: |
121-
**Probe Areas** of the Mesh that can't be automatically handled.
208+
**Probe Areas** of the mesh that can't be automatically handled.
209+
- Use `H` to set the height between mesh points. If omitted, Z_CLEARANCE_BETWEEN_PROBES is used.
210+
Smaller values will be quicker. Move the nozzle down till it barely touches the bed. Make sure the
211+
nozzle is clean and unobstructed. Use caution and move slowly. This can damage your printer!
212+
(Uses SIZE_OF_LITTLE_RAISE mm if the nozzle is moving less than BIG_RAISE_NOT_NEEDED mm.)
213+
- The `H` value can be negative if the mesh dips in a large area. Press and hold the
214+
controller button to terminate the current Phase 2 command. You can then re-issue `G29 P 2`
215+
with an `H` parameter more suitable for the area you're manually probing. Note that the command
216+
tries to start in a corner of the bed where movement will be predictable. Override the distance
217+
calculation location with the `X` and `Y` parameters. You can print a mesh Map (`G29 T`) to see
218+
where the mesh is invalidated and where the nozzle needs to move to complete the command. Use `C`
219+
to indicate that the search should be based on the current position.
220+
- The `B` parameter for this command is described above. It places the manual probe subsystem into
221+
Business Card mode where the thickness of a business card is measured and then used to accurately
222+
set the nozzle height in all manual probing for the duration of the command. A Business card can
223+
be used, but you'll get better results with a flexible Shim that doesn't compress. This makes it
224+
easier to produce similar amounts of force and get more accurate measurements. Google if you're
225+
not sure how to use a shim.
226+
- The `T` (Map) parameter helps track mesh building progress.
227+
- NOTE: `P2` requires an LCD controller!
122228
-
123229
tag: 3
124230
description: |
125-
**Fill Unpopulated** regions of the Mesh with a fixed value (`C`) or use 'smart fill' to extrapolate from already probed points (`no argument`).
231+
**Fill Unpopulated** regions of the mesh with a fixed value (`C`) or use 'smart fill' to extrapolate
232+
from already probed points (`no argument`).
233+
- With a `C` constant, the closest invalid mesh points to the nozzle will be filled, and then a repeat
234+
count can also be specified with `R`.
235+
- Without `C` it does a **Smart Fill**, which scans the mesh from the edges inward looking for
236+
invalid mesh points. Adjacent points are used to determine the bed slope. If the bed is sloped
237+
upward from the invalid point, it takes the value of the nearest point. If sloped downward, it's
238+
replaced by a value that puts all three points in a line. This version of `G29 P3` is a quick, easy
239+
and (usually) safe way to populate unprobed mesh regions before continuing to `G26` Mesh Validation
240+
Pattern. Note that this populates the mesh with unverified values. Pay attention and use caution.
126241
-
127242
tag: 4
128243
description: |
129-
**Fine Tune** the Mesh. Generally used in the form `G29 P4 Rnn Xxxx Yyyy`.
244+
**Fine Tune** the Mesh. Generally used in the form `G29 P4 Rnn Xxxx Yyyy`.
245+
- This phase requires an LCD Panel. To fine-tune the mesh without a controller, use `G42` and `M421`.
246+
- Phase 4 is meant to be used with `G26` Mesh Validation to fine tune the mesh by direct editing
247+
of Mesh Points. Raise and lower points to fine tune the mesh until it gives consistently reliable
248+
adhesion.
249+
- `P4` moves to the closest Mesh Point (and/or the given `X` `Y`), raises the nozzle above the mesh height
250+
by the given `H` offset (or default Z_CLEARANCE_BETWEEN_PROBES), and waits while the controller is
251+
used to adjust the nozzle height. On click the displayed height is saved in the mesh.
252+
- Start Phase 4 at a specific location with `X` and `Y`. Adjust a specific number of Mesh Points with
253+
the `R` (Repeat) parameter. (If `R` is left out, the whole matrix is assumed.) This command can be
254+
terminated early (e.g., after editing the area of interest) by pressing and holding the encoder button.
255+
- The general form is `G29 P4 [R points] [X position] [Y position]`.
256+
- The `H[offset]`` parameter is useful if a shim is used to fine-tune the mesh. For a 0.4mm shim the
257+
command would be `G29 P4 H0.4`. The nozzle is moved to the shim height, you adjust height to the shim,
258+
and on click the height minus the shim thickness is saved in the mesh.
259+
- _USE WITH CAUTION, as a bad mesh can cause the nozzle to crash into the bed!_
130260
-
131261
tag: 5
132262
description: |
133-
**Find Mean** Mesh Height and Standard Deviation.
263+
**Find Mean** Mesh Height and Standard Deviation.
264+
- Typically, it is easier to use and work with the Mesh if it is Mean-Adjusted. You can specify a `C`
265+
parameter to Correct the Mesh to a 0.00 Mean Height. With a `C` parameter this will automatically
266+
execute a `G29 P6 C[mean height]`.
134267
-
135268
tag: 6
136269
description: |
137-
**Shift Mesh** height by the `C` value.
270+
**Shift Mesh** height by the `C` value.
271+
- The entire Mesh's height is adjusted by the height specified by the `C` parameter. It's useful to be
272+
able to adjust the height of a mesh. It can be used to compensate for a poorly-calibrated probe or other
273+
errors. Ideally, you should have the Mesh adjusted for a Mean Height of 0.00 and the Z-Probe measuring
274+
0.0 at the Z homing position.
138275
-
139276
tag: Q
140277
optional: true
141-
description: Test Pattern
278+
description: |
279+
Test Pattern.
280+
Load the specified Test Pattern to check for correct operation. This command is intended for developers and is
281+
not required for everyday bed leveling.
142282
values:
143283
-
144284
unit: index
@@ -147,16 +287,21 @@ parameters:
147287
tag: R
148288
optional: true
149289
description: |
150-
Repeat count. (Default `GRID_MAX_POINTS_X * GRID_MAX_POINTS_Y`). For example, in Phase 3, `G29 P3 R4 C0`- this will tell the firmware to fill the 4 closest points to the nozzle with a value of `0`. Or, in Phase 4, `G29 P4 R3 X80 Y80` - this will tell the firmware to allow you to tweak 3 points around [80,80].
151-
152-
_Note that the 'R' parameter does not work in Phase 1; the number of points probed automatically is always `GRID_MAX_POINTS_X * GRID_MAX_POINTS_Y`._
290+
Repeat count. (Default `GRID_MAX_POINTS_X * GRID_MAX_POINTS_Y`).
291+
- `P3` Example: `G29 P3 R4 C0` will set the 4 points closest to the nozzle to `0`.
292+
- `P4` Example: `G29 P4 R3 X80 Y80` will allow you to adjust the 3 points closest to X80 Y80.
293+
- This parameter does not apply to Phase 1! `P1` will always attempt to probe the full grid.
153294
values:
154295
-
155296
type: int
156297
-
157298
tag: S
158299
optional: true
159-
description: Store mesh to EEPROM in the given slot. If no slot given, use last-activated. Use `S-1` for GCode output.
300+
description: |
301+
**Save** the mesh to EEPROM in the given slot.
302+
- If no slot number is given, save to the last-activated slot.
303+
- Use `S-1` for G-code output that can be used to restore the mesh anytime.
304+
- Note that this command also saves the current UBL state (enabled or disabled).
160305
values:
161306
-
162307
tag: slot
@@ -165,19 +310,24 @@ parameters:
165310
tag: T
166311
optional: true
167312
description: |
168-
**Topology**: Include a Topology Map in the output. Can be used alone or with several other commands. A map type can also be specified:
313+
**Topology**: Include a Topology Map in the output.
314+
- This parameter can be used alone (`G29 T`) or in combination with most of the other commands.
315+
- This option works with all Phase commands (e.g., `G29 P4 R 5 T X 50 Y100 C-0.1 O`)
316+
- A map type can also be specified:
317+
- `T0`: Human-readable (the default)
318+
- `T1`: Delimited. Suitable to paste into a spreadsheet to obtain a 3D graph of the mesh.
169319
values:
170320
-
171321
tag: 0
172-
description: Human-readable
173322
-
174323
tag: 1
175-
description: Spreadsheet-readable
176324
-
177325
tag: U
178326
optional: true
179327
description: |
180-
**Unlevel**: Probe the outer perimeter to assist physical leveling. (Use with `G29 P1 O`)
328+
**Unlevel**: Probe the outer perimeter to assist bed tramming. (Use with `G29 P1 O`)
329+
- Only used with `G29 P1 T U`. This speeds up the probing of the edge of the bed. This option is
330+
useful when the entire bed doesn't need to be probed because it will be physically adjusted (tramming).
181331
values:
182332
-
183333
type: bool
@@ -200,22 +350,24 @@ parameters:
200350
tag: W
201351
optional: true
202352
description: |
203-
**_What?_**: Displays current Unified Bed Leveling info
353+
**_What?_**: Display valuable UBL data.
204354
values:
205355
-
206356
type: bool
207357
-
208358
tag: X
209359
optional: true
210-
description: X position (otherwise, current X position)
360+
description: |
361+
**X position** for all phases and commands (Default: current X)
211362
values:
212363
-
213364
type: float
214365
unit: linear
215366
-
216367
tag: Y
217368
optional: true
218-
description: Y position (otherwise, current Y position)
369+
description: |
370+
**Y position** for all phases and commands (Default: current Y)
219371
values:
220372
-
221373
type: float

0 commit comments

Comments
 (0)