Add bidirectional raster scan X-offset calibration #312
Merged
Conversation
Fixed-corner mechanical/firmware skew between left-to-right and right-to-left raster passes misaligns alternate scan rows on some machines, regardless of speed (a different case from the timing-delay skew LightBurn's speed table addresses). - Adds a bidir_x_offset_mm param to the Rasterizer producer (UI control + serialization), per engrave step rather than a single machine-wide value, since different jobs may want different corrections, and this may need to vary by speed in the future - Adds BidirScanOffsetTransformer, which shifts each right-to-left raster pass along X by that offset during gcode generation, preserving per-pixel power values for variable-power (photo) engraving - Tests the producer -> settings -> transformer wiring end-to-end, not just each piece in isolation
- Doubles the auto-calculated overscan distance for individual test blocks, so backlash settling happens outside the visible engrave area rather than muddying whatever parameter the grid is testing - Adds Optimize to the default transformers, but disabled: its nearest-neighbor travel reordering has no concept of cell boundaries and was interleaving lines from different cells instead of engraving each one fully before moving to the next. Left toggleable rather than removed, so it's easy to compare with/without
Extends the material test grid so users can calibrate bidir_x_offset_mm empirically: columns vary speed, rows vary offset. raygeo's generate_material_test_grid already supports grid_mode="Speed vs Offset" plus min_offset/max_offset (including scaling power with speed so darkness stays comparable across a row) -- this just plumbs an offset_range param through the producer, its preview, and the step settings widget.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #307
Adds a bidir_x_offset_mm parameter to the Rasterizer producer plus a BidirScanOffsetTransformer, so a fixed mechanical or firing delay skew between left-to-right and right-to-left raster passes (visible as banding, especially on photo engraves) can be corrected directly instead of losing half your engraving speed to disabling bidirectional scanning. Also extends the Material Test Grid with a "Speed vs Offset" mode so the value can be calibrated empirically, using raygeo 1.21.1's native support for it.
Changes
Checks
pixi run test (5298 passed, 174 deselected)
pixi run lint (clean; 2 pre-existing, unrelated pyright errors on sys._MEIPASS in app.py/worker_init.py (probably macos specific))
pixi install (default environment solves against raygeo 1.21.1)
pixi run rayforge (launches, loads machine config, initializes addons - no crash)