Skip to content

Add full X/Y/Z calibration from standing-plate coupon scans#22

Merged
jaak0b merged 14 commits into
masterfrom
feature/xyz-calibration
Jul 5, 2026
Merged

Add full X/Y/Z calibration from standing-plate coupon scans#22
jaak0b merged 14 commits into
masterfrom
feature/xyz-calibration

Conversation

@jaak0b

@jaak0b jaak0b commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Extends the tool from XY-only to full X/Y/Z shrinkage and skew calibration. A flatbed scanner only reads a flat face, so the XZ and YZ planes come from the same lattice printed standing on-edge (thick slab, solid base, bicone funnel holes scannable from either face), then laid flat to scan. One parametric OpenSCAD model renders all three pre-oriented plates.

Highlights:

  • Three downloadable plates (calibration_coupon_{xy,xz,yz}.stl); any subset works, the app auto-sorts uploads.
  • Plane auto-identification: 1/2/3 solid diagonal ribs across the bottom-row cells next to the origin marker (XY=1, XZ=2, YZ=3). Additive dark geometry survives stringing, shadow and overextrusion, which killed the earlier drilled-dot code on rough on-edge prints. Unreadable codes refuse (never silently guessed as XY).
  • Reader projects each cell diagonal through the fitted affine and classifies Otsu-binarised line profiles with a reject option (Chow's rule); profile geometry derives from the coupon spec (ribWidthMm, ringOuterDiameterMm), no tuned constants.
  • Threshold polarity and card detection resolved by validating both hypotheses against known geometry (coupon grid / ISO card shape), fixing real scans with bright scanner-lid margins.
  • Multi-plane combine reconciles X/Y/Z across plates; firmware output covers Klipper SET_SKEW XY/XZ/YZ, Marlin M852 I/J/K, RRF M556, plus per-axis scale.
  • Scan page redesigned as a single flow: multi-file drop, duplicate/extra-scan flags, inline results, global firmware picker, reset-skew step.
  • Tests: 104 unit tests over rendered-model fixtures, 7 Playwright e2e including real 35 MP scans of a printed diagonal-marked plate covering the full upload-to-correction flow.

Real-print validation status: XY plate verified on real scans; XZ/YZ physical prints in progress (skew sign to be cross-checked against the CaliLantern).

@jaak0b jaak0b changed the title Replace plane-ID dots with diagonal ribs for reliable plane detection Add full X/Y/Z calibration from standing-plate coupon scans Jul 5, 2026
Co-Authored-By: Claude <noreply@anthropic.com>
@jaak0b jaak0b merged commit cd38294 into master Jul 5, 2026
2 checks passed
@jaak0b jaak0b deleted the feature/xyz-calibration branch July 5, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant