1.5 KiB
1.5 KiB
Architecture
Runtime split
Host controller — Python on RPi/PC
Responsibilities:
- operator workflow and manual-mode UI integration;
- state machine orchestration;
- controller-job intake validation;
- geometry gate;
- setpoint command stream;
- telemetry capture;
- logs, manifests, hashes, status file;
- slow watchdogs and data export.
Teensy firmware — C++ on Teensy 4.x
Responsibilities:
- inner loop around ~1 kHz;
- KWR75B-CAN F/T receive path;
- encoder acquisition;
- force PID output;
- table/spindle/actuator command outputs;
- fast safety checks;
- heartbeat supervision;
- telemetry frames at >=100 Hz;
- ACK/NACK and event/fault frames.
State machine
Current accepted state names:
IDLE
JOB_LOADED
READY
RUNNING
PAUSED
ABORTING
COMPLETED
ABORTED
FAULTED
MANUAL
Important rules:
FAULTEDexits only through explicit operator reset.JOB_LOADED -> READYrequires operator acknowledge.IDLE -> MANUALis allowed only with no job loaded.- Illegal transitions are errors and events, never silent ignores.
- Manual mode uses the same safety/interlocks as job mode.
Manual mode sequence
- Machine starts in
IDLE. - Operator opens Manual Mode.
- Host enforces the geometric gate.
- Host sends
MANUAL_STARTto Teensy. - Teensy ACKs or NACKs with a machine-readable reason.
- Host sends live
SETPOINTupdates. - Teensy emits telemetry and events.
- Operator stops; host sends
MANUAL_STOP. - Host writes manual-session log and artifacts.