Maximal alignment achieved through simulated annealing.
Basically we have a whole bunch of short fragments of the longer, true z-curve, and we don’t know their z-offset displacement. So we jiggle them around and find the parts of them that match. Ones from the low end of the curve get moved to the far left, ones from the high end need to slide to the right, and when this is done, we have just a single underlying true curve.
To test if this works we simply use our new curve (now polynomial fit), to compute new z-positions. We use these new z-positions to calculate tilt and get the estimated bead positions, and we plot the raw bead positions against their widths and see if now they all fall along a common curve.
Note, the higher order correction terms are important for getting a good fit. With A and B = 0 the overall parameter uncertainty is much less (different wx0/gx/zrx won’t imporve the fit), but the overall fit quality is poorer:
Ke approves, this is a better way of calculating the calibration curve and is unique from the current lab approach.