Jarfil's Blog

BLTouch doesn’t fix it all

G29 P1 bed leveling

So you got a BLTouch or some 3DTouch working, and you’re wondering why things aren’t printing like they should. It was supposed to automatically compensate any bed irregularities, wasn’t it?

Chances are you did nothing wrong, but your printer is. Don’t worry, you can fix it, or just work around it.

How BLTouch works

Automated bed leveling correction works by finding the difference between two data points:

  1. Z axis home position
  2. Z height that triggers the probe

By probing the Z height of several points around the bed, it’s possible to calculate a rough estimate of its shape, and compensate for it during printing.

Material

Optional:

Also used:

Repeatability

The key to a good bed leveling, is repeatability, or how to get the same measurement for the same thing every time, over and over, hundreds of times, thousands of times. Every time the probe touches the bed in the same spot, the firmware needs to think it’s at the same Z height, and it needs to match the same nozzle Z position. Otherwise, you’re getting Z axis creep.

Note that measures don’t need to be reproducible, your bed and sensor can be as misaligned as you like, it just needs to give the same value every time.

Check for Z axis creep

The simplest check is:

home Z
for 1 to 100
 probe point
if last point != 0 then
 alert("Z axis creep!")

In Marling GCODE, that would be:

G28 ; home X Y Z
G29 P0 ; zero mesh data
; for 1 to 100
G29 I1 ; invalidate closest point to the nozzle
G29 P1 C ; probe invalidated point
; end for
G29 T ; output topology

You should expect a repeatability error of:

(BLtouch VS 3Dtouch 3D Printer bed leveling sensor match up, on YouTube)

Desired error level for a 0.20 mm nozzle:

Examples of Z axis creep

Automatic bed leveling through LCD (Automatic bed leveling through LCD)

After homing Z, probing started at the lower left corner, then kept going up and in diagonals to the lower right. Maximum height measured at top right corner.

G29 P1 bed leveling (G29 P1 bed leveling)

After homing Z in the middle of the bed, probing started in kind of a spiral. Maximum height at the outside of the bed.

Left-to-Right probing (Left-to-Right probing)

Custom “left to right” probe in an S pattern: probe 10x10 left to right.

Right-to-Left probing (Right-to-Left probing)

Custom “right to left” probe in an S pattern: probe 10x10 right to left.

Averaging it out

Maximum error per point after leveling 4 times in a row (Maximum error at each point after leveling 4 times)

After repeating the same “center to outside” measurement 4 times in a row, calculated an average, then extracted maximum distance from average for every point.

Points probed last, show the largest variability. Which means that averaging the measurements won’t be enough.

Why it happens

Every point probe actually consists of several moves:

That is 4 times that any inaccuracy in the Z axis can introduce an error. For 8x8 = 64 points, that’s 256 moves, which even with 0.001 mm Z axis creep per point, means a 0.256 mm error for the last point, which skews all the measurements.

Effectively, you need less than 0.0001 mm average error per Z move to achieve 0.025 mm precision over 256 moves.

Fixing it

In an ideal world, every time the firmware requests a Z height of 0, the print head should go to the same place.

This means the following need to be calibrated:

In practice, there is just so far these can be taken without increasing costs and rebuilding the whole printer, so we need the next best thing: deal with it.

Brute force, or “Center-to-Center”

Since we can’t fully trust the calibration, or the averaging of measurements, let’s go back to the basics:

That can be done with:

home XY
foreach point
 home Z
 go to point
 probe point
repeat a few times for good measure
take an average
if there is too much measurement error
 try to fix some of the hardware
 repeat from the beginning

Custom “center to center” probe, pattern irrelevant:

This takes a while, but each point is probed relative to whatever G28 Z thinks zero means. Since it does the Z homing at the same spot (center of the bed), the error effectively gets reset for every point, so the average ends up being under 0.02 mm.

Final correction mesh (Final correction mesh)

The final mesh looks much more realistic for a rubber magnetic bed that’s moved slightly off-center.

Fixing the borders

By default, the firmware’s G29 P1 doesn’t probe the outermost points. These can be filled with G29 P3, but as they say “garbage in, garbage out”, so a poor measurement will lead to an even worse mesh.

Some alternative strategies would be:

Verifying the mesh

(TO BE CONTINUED)

ToDo

…so this turned out to be a somewhat longer write-up, and it’s still missing several things, but I’m tired now.