8-Factor Delta Calibration Upgrade (print centering issues)?



  • Hello,

    Just overcame a really weird issue that ended up being due to 8 factor calibration. Wanted to post the details here so 1) anyone with the problem could find the solution here, and 2) Hoping this input can improve the 8 factor calibration options or provide some upgrades.

    Details:
    The printer has an adjustable-angled bed that I know is good to within ~0.2 degrees (using multiple levels / digital gravity levels). Running the bed mapping without calibration I can see a movement of ~0.4mm gradually sloping down the y-axis. The bed is very flat - clearly this is a bed tilting issue. The end-stops are adjustable and I locked them in using a fixed caliper - I'm fairly confident they are within ~0.010" true to the theoretical bed plane.

    I decided to run the calibration with 8-factors to compensate for the tilting. When the calibration ran - I got great results (~0.05mm deviation), but the corrections in M665 and M666 didn't look how I'd expect them to.

    Fast forward a month or two of successful printing, I decided to take a stab at why my prints were off-center. (~20mm in +x and 10mm in -y). Having a dual extruder, I thought it was the tool offsets, but when I started adjusting them, it just made no sense.

    I did a bit of debugging and found that after I home, with the extruder in the very center, it claimed that it was at ~20mm off in X and ~10mm off in Y, which matched the same offsets I observed on the print bed itself after a print. It still printed flat and stuck, so the solution is 'valid' from a flatness perspective, just with a huge offset away from the bed. Switching to a 6-factor solution gave me the same deviation (~0.05), but the offset went to about 0 and the print centered on the bed. For whatever reason, this led me to believe that the 8-factor solution is a local-minimum instead of a global solution, with the side-effect of offsetting the prints.

    Numerical Methods:
    My numerical methods background thinks that there's a better way to solve the calibration sequence. I'd recommend one of two solutions:

    1 ) Bed Tilt Transformations

    • This concept would perform the bed tilt adjustments first, then use the standard 6-factor sequence after the best fit for the bed tilt.
    • Use LSS regression to calculate a quaternion transformation about the X-axis and then the Y-Axis. Alternately, just transform the measurements with the matrix transformation and evaluate the deviation to find the appropriate angle. If anyone wants to take a stab at this in the firmware, feel free to message me for help with the math.
    • With nearly any printer using a 'flat' bed, the tilt angles are going to be the highest contributor to any offset in calibration. By eliminating them first (externally from the 6-factor), you correct the most significant physical error of the system and the 6-actor would more likely fall into the correct 'global' calibration solution rather than a local minimum currently observed.

    2 ) Monte-Carlo Weighted Calibration (possibly a UI implementation from the CSV bed probe data?)

    • Although not as likely to perform as flawlessly as the above solution every time, I would recommend this addition as a more generalized solution for future calibration upgrades. The main benefit is that this would sample all possible solutions, not just settling on localize (incorrect) solution as seen above. This would be best for more of a restrained system that doesn't change much and doesn't require calibration before every print.
    • This solution would take a large number of sample points across the bed (say >64). That data would be passed to the WebUI to digest and run the calibration sequence. (this should be processor intensive)
    • A set of random variables would be generated for each of the calibration variables within expected bounds. Each set of variables would be evaluated for the overall error against the calibration points. The sequence would run a specific number or runs, or stop when the user determined they were satisfied with the best run. The resulting parameters for the calibration would be displayed and/or pushed to the Duet in GCode.
    • Refinement Monte-Carlos could automatically pick the best point, reduce the random variable bounds by 90%, then continue to run around the best solution.
    • Lastly, weights could be added to the calculation to emphasize values that the user is most confident in (say bed angle between 0 and 0.5 degrees).
    • The Monte-Carlo method could technically be implemented on the Duet itself, but it would be difficult, and memory/processor intensive. Solution 1 would be a better stand-alone upgrade on the Duet.

    3 ) Genetic Algorithms? (ok, not really)

    • Technically, the best, most robust solution in this area would be a genetic algorithm. But to reasonably accomplish this I'd need to use MATLAB as most programing languages don't have libraries capable of accomplishing this without a lot of custom code. Not really practical for a product-wide deployment and not worth the development time.

    Thoughts? I might want to take a stab at the Monte-Carlo solution in the WebUI if I can find the time. I'd be really interested to see how the results compare to the standard calculation algorithms. Right now I'm just pushing forward with the 6-factor and adjust out the angled tilt mechanically.



  • I am not certain but I believe the tilt adjustments the firmware makes is to the tower tilts NOT THE BED DC will have to confirm this mind.



  • @Dougal1957 said in 8-Factor Delta Calibration Upgrade (print centering issues)?:

    I am not certain but I believe the tilt adjustments the firmware makes is to the tower tilts NOT THE BED DC will have to confirm this mind.

    FYI: From the calibration page:

    Bed should be at right angles to the towers in both X and Y directions
    Actually, this isn't essential, because RepRapFirmware can compensate for bed tilt. Unfortunately, auto calibration can't easily distinguish between bed tilt and differences in tower separation. One approach to getting the bed level is to mount it on 3 equal-length spacers attached to the lower horizontal frame. If you are using metal corners, the horizontal frame should be at right angles to the towers. If you do need to make any adjustment, you can stack washers or shims on top of one or two of the spacers.