Caution
- Always dry-run or simulate commands before sending motion to hardware.
- Keep the beam off (
--movement-onlyor dummy backend) until you trust the job. - You are responsible for all outcomes. Third-party laser software and firmware can behave unexpectedly; monitor every job and have an e-stop within reach.
Experimental Python tooling to plan and execute dovetail joints on a laser with a stepper-based rotary jig. It computes tail and pin geometry, turns plans into motion commands, and can simulate or emit Ruida RD jobs. This is pre-production software: verify every move before powering a laser.
- Computes deterministic tail and pin layouts with kerf and clearance handling.
- Builds command sequences for tails (flat) and pins (rotary flanks with Z offsets).
- Sends Ruida UDP jobs or uses dummy backends for safe dry runs.
- Simulates jobs in pygame, including rotary and Z movement playback.
- Includes helper tools for rotary zeroing, midpoint finding, and RD inspection.
- Pre-production: expect rough edges and check all moves before firing the laser.
- Always run a dry-run and simulator pass first; keep beam off until verified.
- Use
--movement-onlyor--resetfor first hardware shakedowns.
- Python 3.11+.
- Optional:
pygamefor the simulator. - Optional:
RPi.GPIOfor real rotary GPIO (Raspberry Pi). - Ruida controller required only for live cutting.
cp example-config.toml config.toml
python -m laserdove.main --config config.toml --mode both --dry-run
python -m laserdove.main --config config.toml --simulate
# Safe Ruida output without firing
python -m laserdove.main --config config.toml --mode tails --save-rd-dir rd_out --movement-onlysource .venv/bin/activate
pip install -e .
# Dev/lint/tests
pip install -e ".[dev]"
# Simulator (optional)
pip install pygameEntry points:
python -m laserdove.main(recommended)python -m laserdove.cli
Common commands:
python -m laserdove.main --config config.toml --mode tails --dry-run
python -m laserdove.main --config config.toml --simulate
python -m laserdove.main --config config.toml --simulate --simulate-rd-dir rd_out
python -m laserdove.main --config config.toml --resetRun python -m laserdove.main --help for the full CLI.
Use example-config.toml as the reference and copy it to config.toml.
Key notes:
joint.thickness_mmsets both tail and socket depth.joint.kerf_mmapplies to both boards unlesskerf_tail_mmorkerf_pin_mmoverrides are set.jig.axis_to_fence_mmplusjoint.thickness_mmdefines the top surface radius. If unset, the code falls back to 30.0mm with a warning.machine.z_zero_tail_mmandmachine.z_zero_pin_mmdefine the baseline Z offsets for each board.machine.pre_cut_warmup_scontrols pre-cut air assist and inline fan warmup.backend.simulate_rd_dirlets the simulator replay saved.rdjobs when--simulateis used.
Config sections:
[joint]: geometry inputs (length, tails, angle, kerf, clearance, thickness).[jig]: rotary geometry (axis_to_fence_mm, rotation zero, rotation speed).[machine]: speeds, powers, Z zeros, air assist, inline fan, warmup, Z direction.[backend]: hardware targets and GPIO pins (dummy vs Ruida/real rotary, host/port, RD save dir).
CLI flags override TOML values.
config.pyparses TOML and CLI intoRunConfig.geometry.pycomputes tail spacing and kerf offsets (pure math).planner_tail.pyandplanner_pin.pyemitCommandsequences.hardware/implements dummy backends, Ruida UDP transport, RD job building, and rotary drivers.pygame_simulator.pyprovides the visual simulator (split acrosssim_viewer_*).
Flow: config -> geometry -> planner -> commands -> simulator or hardware backends.
python -m tools.rotary_zero --interactivefor rotary zeroing with step nudges and saved zero.python -m tools.edge_midpointto compute the board edge midpoint and optional edge length update.python -m tools.rd_parser path/to.rdto inspect saved RD files.python -m tools.ruida_status_probe --host <ruida-ip>to poll controller status bits.python -m tools.z_movement_suiteto exercise Z motion commands safely.
make format
make lint
make testNotes:
- Tests live under
tests/. - Avoid importing from
reference/; it is background material only.
Pin flanks rotate to rotation_zero_deg plus or minus the dovetail angle so the pin widens toward the bottom of the mounted board. This helps reduce burning on the narrow faces.
- Save RD jobs with
--save-rd-dirand inspect withtools/rd_parser.py. - Replay RD jobs in the simulator with
--simulate --simulate-rd-dir rd_out. - Use
--movement-onlyfor travel-only validation on real hardware.
This software is experimental and provided without any warranty or responsibility for damage or injury. Verify every setting, monitor your laser at all times, and proceed only if you accept full responsibility.
