This is a proof of concept simulation for a technique to align a 3D printer or other machine with two or more toolheads using measurements of the bed. This assumes both toolheads have a probe, and that the bed mesh can be broadly approximated by a quadratic surface. These assumptions may fail, rendering this technique useless. For instance, this method would not work if the bed and gantry produce a perfectly flat bed mesh, as the algorithm would have nothing to align. Fortunately, many hobby 3D printers seem to have a bed mesh that is a bit saddle shaped. The results of a Monte Carlo simulation of this technique are as follows:
Let the reference surface be represented by:
Let the offset reference surface be represented by:
Let the samples from the reference surface be
Minimize
The notation is a bit informal here, but we assume the bed mesh can be modeled by some offset quadratic function, and attempt to fit the data from a bed mesh for each toolhead
simultaneously to this quadratic as well as the offset between the toolheads. Once this minimization has been completed, we extract
The following example shows a simulated reference bed mesh, a simulated shifted bed mesh (offset by 0.8mm in each axis), a reference fitted surface, a shifted fitted surface, and the residuals between each of these:
The difference between the reference and shifted mesh is tiny compared to the size of the mesh, so these graphs look more or less the same.
I don't like manual calibration, and nozzle probes are quite accurate now. Properly implemented, this would allow for sensorless homing, then toolhead alignment on IDEX or dual gantry printers.

