#voron #voroncascade #cnc #electronics #configuration #flexihal #linuxcnc #remora #vfd
# Overview
Every setting the electrical design in [[Voron Cascade Electronics Wiring]] (Rev O) depends on, in one place: the physical ones (jumpers, DIP switches, trimmers, parameters on the VFD keypad) and the software ones (Remora pin names, LinuxCNC HAL and INI, vfdmod, the post-processor, the Pi). Each section is a checklist; tick it off as the bay is commissioned. The *why* lives in the wiring note; the driver-level detail (DIP tables, cable colours, grblHAL bench settings) lives in [[Electronics]].
==**Rev O HAL: run in LinuxCNC's simulator, not yet on the machine.** The file built from this note loads in LinuxCNC 2.9.10, and the E-stop chain, the power-present gate, the door, the buttons and the lamps behave as described ([[#Simulator run (2026-11-13)]], last run 2026-11-15). Three independent reviews have looked at this design and none has passed it. The third, on 2026-11-15, was answered with one design change and one accepted limit, both Erik's decisions that day, and with them the revision became Rev O. **The change:** the door no longer cuts drive power. It acts through LinuxCNC only, and only while the spindle is commanded on: the spindle's run command drops, the program is aborted, and the machine stays on and homed. With the spindle off the door does nothing, so jogging and probing with it open work. **The limit:** if the FlexiHAL ever answers the Pi but ignores its commands, the E-stop button is the stop. The link stop and the firmware's timeout are a backstop for that fault, not a guarantee (the paragraph on the accepted limit, below the HAL, has the detail). The door change has not been reviewed. The simulator stands in for the FlexiHAL with a model written from the firmware source, so input polarities, real timing and the board itself are still for the bench: part C of [[Voron Cascade Bench Checks]]. The wiring note is still on hold: the FlexiHAL's Aux pull-up resistors have to come off before K2 can sit on `AUX0` at 24 V (decided 2026-11-14), and the spindle's nameplate is still to come; the VFD's is in (`H100-1.5C2-1B`, the 110 V unit, read 2026-11-14).==
Reference design: Expatria FlexiHAL running Remora, Raspberry Pi 5 running LinuxCNC (QtDragon HD), StepperOnline CL57Y-V20 closed-loop drivers, G-Penny H100 VFD over Modbus RTU from the Pi UART through the FlexiHAL's isolated RS485 port.
# Configuration
## Power supplies — set before anything is connected
| Supply | Setting | Why |
|---|---|---|
| PSU2 SDR-120-24 | Output trimmer to **24.0 V** exactly | FlexiHAL input is rated 12–24 V. The 27 V Zener across it (D16, behind the board's 1 A fuse) is not a clamp to rely on (review HW-08). Never above 24.0 V |
| PSU1 NDR-480-48 | Output trimmer to **48.0 V** | CL57Y-V20 ceiling is 50 V; the NDR adjusts 48–55 V. Two output pairs: U2 + U3 share one with twin-wire ferrules, U4 the other |
| PSU3 MDR-60-5 | Output to **~5.15 V measured at the Pi under load** (range 5–6 V) | Bare-wire USB-C cable drops ~0.1–0.2 V at 3 A; the Pi wants ≥4.75 V at the connector |
All three: FG → XT1-PE. 24 V 0 V and 48 V −V each bonded once to PE; **5 V −V stays floating**.
## CL57Y-V20 drivers (all three) — DIP and selector
| Switch | Setting | Meaning |
|---|---|---|
| 5V/24V logic selector | **5 V** | FlexiHAL drives 5 V RS-422 pairs |
| SW1 | OFF | PU/DR (pulse + direction) mode |
| SW2 | OFF | Direction (flip if an axis runs backwards, or invert in HAL) |
| SW3 | **OFF** | Closed loop (ON = open loop on the V2.0) |
| SW4 | OFF | ALM normally open — matches the FlexiHAL AL− expectation |
| SW5–SW8 | **ON OFF ON ON** | 1600 pulses/rev |
Terminals: PU±/DR± from the FlexiHAL IDC; **MF± unconnected** (MF driven = motor freed); **ALM± unconnected** for now (optional later: ALM+ → pin 8 AL−, ALM− → pin 7 GD). Current is automatic. Full table and cable colours: [[Electronics#DIP switch cheat sheet (CL57Y-V20)]].
## FlexiHAL jumpers and headers
| Jumper / header | Setting | Why |
|---|---|---|
| Isolation-bypass headers (offset pins near USB-C / P18) | **NOT fitted** | The Pi's 5 V header pins feed `+5V_MCU`; machine side and MCU side stay isolated |
| P19, Pi UART ↔ MCU UART (2×3 header) | **fitted** in the default position | Connects the Pi's UART 0 (GPIO 14 / 15) to the MCU for flashing Remora. The RS485 port does not go through it: that is the Pi's UART 2 on GPIO 4 / 5, wired straight to the isolated transceiver |
| P17 Aux power select | **main 24 V input** (default) | Aux0 (K2), Aux1 and Aux2 (the yellow and green top-box lamps, each through 4.7 kΩ) switch 24 V |
| Aux pull-ups R56, R77, R81, R82 (1 kΩ, 0603) | **removed** ==(rework pending)== | On the A7 board each sits across an Aux output's load and dissipates 0.58 W with the output on at 24 V (review HW-01; 1.00 kΩ measured on all four, 2026-11-14). R70, R66, R76 and R73 beside them are the gate pull-downs and stay |
| HALT XOR jumper | **non-default** position | Rung 5 is a single NC loop (the E-stop's NC2 alone). Verify: HALT LED off with the E-stop released; if it is lit, the jumper is wrong |
| Spindle PWM config (P7) / P6 / P16 | default (0–10 V, onboard 12 V, ground tied) | Analog spindle output is unused (VFD is Modbus) |
| USB-C | empty | No PC; the Pi talks over SPI through the header |
Inputs: all machine-side inputs are 3-wire G/S/V with **V = the board's own 12 V**; the PL-08N2 endstops are powered from V, never from 24 V. Inputs used beyond the three limits: `Halt` (E-stop NC2), `Door` (K5 NC; since 2026-11-15 this input is all the door does), `Bend` (KM1's NC aux, open = power present), `Pause` (SB2 FEED HOLD), `Start` (SB4 CYCLE START), `Aend` (SB5 AIR), TOOL / PROBE. Outputs used: `Aux0` → K2, `Aux1` → H2 lamp, `Aux2` → H4 lamp, `Mist` → K4. Spare: `Aux3`, `Flood`, `Spindle`, the A/B stepper headers, the uFlexiNET slot — no screw-terminal input is left over.
## Remora firmware — pin map (`TARGET_FLEXIHAL/board_config.h`)
Nothing to edit; this is what the stock Expatria build exposes and what the HAL below refers to.
| HAL pin | STM32 | Wired to |
|---|---|---|
| `flexi.joint.0/1/2` step/dir | PA3/PC2, PC1/PC0, PB8/PC15 | X / Y / Z IDC headers → CL57Y PU/DR |
| `flexi.input.X_LIMIT` / `Y_LIMIT` / `Z_LIMIT` | PA5 / PB9 / PC13 | SQ1 / SQ2 / SQ3 (NPN NC inductive) |
| `flexi.input.HALT` | PB12 | E-stop NC2 (SB0), a single NC loop |
| `flexi.input.DOOR` | PC4 | K5 11-12 NC, common at 0 V (door open or F1 blown = asserted; with the whole 24 V rail down the input has no supply and reads false); the KW10s themselves only drive K5 |
| `flexi.input.PROBE` | PB7 | SQ4 tool setter (TOOL) / SP1 3D probe (PROBE), XOR'd |
| `flexi.input.B_LIMIT` | PC14 | KM1 21-22 NC aux: open = power present (`.not` → `motion.enable`; the plain pin → `halui.joint.N.unhome`) |
| `flexi.input.FEED_HOLD` (firmware `FD_HLD`) | PC8 | SB2 yellow FEED HOLD, NO (top-panel box) |
| `flexi.input.CYCLE_START` (firmware `CYC_START`) | PC11 | SB4 green CYCLE START, NO (top-panel box) |
| `flexi.input.A_LIMIT` | PB6 | SB5 blue AIR, NO (front panel) — the `Aend` terminal, free on a single-Y machine |
| `flexi.output.AUX0` | PB13 | K2 (E-stop latch OK → KM1 chain) |
| `flexi.output.AUX1` | PB0 | H2 yellow lamp (paused), via R2 |
| `flexi.output.AUX2` | PA4 | H4 green lamp (steady running, flashing paused), via R4 |
| `flexi.output.AUX3` | PA6 | spare (AUX button lamp) |
| `flexi.output.MIST` | PA7 | K4 → Y1 air blast |
| `flexi.output.COOLANT` | PC9 | spare (Flood); the sample HAL still switches it on M8 |
| `flexi.output.STEP_EN` / `STEP_EN_Z` | PA13 / PA14 | nothing wired (CL57Y MF open); the sample HAL still drives them from the joint enables |
| Spindle PWM | PA8 | unused |
HAL pin names come from the LinuxCNC component (`LinuxCNC/Components/Flexi/flexi.h`), which calls the two button inputs `FEED_HOLD` and `CYCLE_START`; the firmware's `board_config.h` labels the same pins `FD_HLD` and `CYC_START`.
## LinuxCNC — INI (`remora-flexi.ini`, from Expatria's `ConfigSamples/flexi-hal`)
```ini
[DISPLAY]
DISPLAY = qtvcp -f qtdragon_hd
[KINS]
# the sample is XYZY (ganged Y); the Cascade has a single Y
KINEMATICS = trivkins coordinates=XYZ
JOINTS = 3
[TRAJ]
COORDINATES = XYZ
# the sample has 1; with 0 LinuxCNC refuses a program or MDI move until every joint is homed
NO_FORCE_HOMING = 0
# [JOINT_0], [JOINT_1] and [JOINT_2] are three separate sections: make these changes in each,
# and delete [JOINT_3]
[JOINT_0]
# 1600 pulses/rev ÷ 4 mm lead, 1:1 HTD-3M belt; the sample has 200
SCALE = 400
# un-home on an on-screen E-stop or machine-off. An E-stop-button or KM1 trip is covered
# by the power-lost line in the HAL, not by this key (simulator run, finding 1)
VOLATILE_HOME = 1
# MIN_LIMIT, MAX_LIMIT, HOME_*, MAX_VELOCITY and MAX_ACCELERATION here and in the matching
# [AXIS_*] sections are the sample's, for a 1300 mm machine: replace them before the first homing move.
# 400 pulses/mm caps the firmware at 300 mm/s (120 kHz); the sample's 350 mm/s joint limit is above that.
[HAL]
HALFILE = remora-flexi.hal
POSTGUI_HALFILE = postgui_call_list.hal
# already in the sample; the buttons and lamps go through it
HALUI = halui
```
==Travel limits, homing velocities and axis accelerations are machine-tuning, not electrical, but the sample's values are for a much larger machine: replace them before the first homing move. The three sensors are wired as home switches only; nothing in this configuration makes them hard limits. LinuxCNC's INI format has no trailing comments (a `;` or `#` after a value becomes part of the value), so comments go on their own lines as above.==
## LinuxCNC — HAL (`remora-flexi.hal`): keep, change, add
Already correct in the sample (keep):
```hal
# homing on the NC inductive endstops
net x-home joint.0.home-sw-in <= flexi.input.X_LIMIT.not
net y-home joint.1.home-sw-in <= flexi.input.Y_LIMIT.not
net z-home joint.2.home-sw-in <= flexi.input.Z_LIMIT.not
# probe / tool setter
net probe_input motion.probe-input <= flexi.input.PROBE
# air blast on M7 / M9
net mist flexi.output.MIST <= iocontrol.0.coolant-mist
```
Change (most of it dates from Rev M; the two simulator fixes are of 2026-11-13, the three changes from the second review of 2026-11-14, and the link moved onto the latch that evening):
- The sample is `XYZY` with joint 3 as a second Y — delete the `# Joint 3 setup` block and its `A_LIMIT` home net (single-Y Cascade). That frees `flexi.input.A_LIMIT` (the `Aend` terminal) for the AIR button.
- **Components and thread order.** Replace the sample's `loadrt and2`, `loadrt toggle` and `loadrt toggle2nist` lines and its whole `addf` block with:
```hal
# --- components (the sample's kinematics, motion, flexi, not and estop_latch lines stay)
loadrt and2 names=estop_ok_and,km1_in_and,km1_drop_and,km1_stuck_and,door_hold_and,resume_and,flash_and,air_and,air_on_and,air_off_and # was run_and,step_and
loadrt or2 names=estop_or,km1_or,fault_or,link_or,door_inh_or,start_lamp_or
loadrt dbounce names=km1_drop_db,start_db,air_db
loadrt flipflop names=km1_seen_in,start_arm,air_arm,air_was_on
loadrt oneshot names=reset_win,door_edge,start_edge,air_edge
loadrt timedelay names=spi_hold,door_td
loadrt siggen names=blink
# delete: loadrt toggle names=hold_button_toggle
# loadrt toggle2nist names=hold_toggle,paused_toggle
# net program-is-paused hold_toggle.is-on <= halui.program.is-paused
# --- threads. Order matters (review SW-11): the inputs are read, the faults are worked out,
# and the latch sees them in the same cycle, before the outputs are written.
# reset_win, link_or and spi_hold come first: the link has to be enabled in the cycle in which the reset edge arrives
addf reset_win servo-thread
addf link_or servo-thread
addf spi_hold servo-thread
addf flexi.read servo-thread
addf km1_in_and servo-thread
addf km1_seen_in servo-thread
addf km1_drop_and servo-thread
addf km1_drop_db servo-thread
addf km1_stuck_and servo-thread
addf km1_or servo-thread
addf door_hold_and servo-thread
addf door_inh_or servo-thread
addf door_edge servo-thread
addf door_td servo-thread
addf estop_ok_and servo-thread
addf estop_or servo-thread
addf fault_or servo-thread
addf estop_latch servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf flexi.update-freq servo-thread
addf flexi.write servo-thread
addf stepen_not servo-thread
addf stepen_z_not servo-thread
addf start_db servo-thread
addf air_db servo-thread
addf start_arm servo-thread
addf air_arm servo-thread
addf air_was_on servo-thread
addf start_edge servo-thread
addf air_edge servo-thread
addf resume_and servo-thread
addf air_and servo-thread
addf air_on_and servo-thread
addf air_off_and servo-thread
addf flash_and servo-thread
addf start_lamp_or servo-thread
addf blink.update servo-thread
```
- **E-stop chain.** Replace the sample's `# estop loopback` block with:
```hal
# the link runs while the latch is OK and for 0.5 s after it trips, whatever tripped it, so that the stop reaches
# the board and KM1's drop is read back. Then it stops, so that the firmware's timeout can force every output off
# if the board did not take the last write (review N01). A reset click on the screen starts it again for 0.75 s,
# refused or not, so clicks a second apart or less keep it running (review R3-01: an accepted limit, see the text)
setp reset_win.width 0.25
setp spi_hold.on-delay 0
setp spi_hold.off-delay 0.5
net user-enable-out iocontrol.0.user-enable-out => estop_ok_and.in0
net user-request-enable iocontrol.0.user-request-enable => flexi.SPI-reset estop_latch.reset reset_win.in
net reset-window reset_win.out => link_or.in0
net link-wanted link_or.out => spi_hold.in
net spi-enable spi_hold.out => flexi.SPI-enable
net remora-status flexi.SPI-status => estop_ok_and.in1
net estop-ok estop_ok_and.out => estop_latch.ok-in
# HALT trips the latch (rung 5). Since 2026-11-15 the door does not: only its backup does (door-fault, at the end of this block)
net halt-in flexi.input.HALT => estop_or.in0 # or flexi.input.HALT.not: see the polarity note
net door-fault door_td.out => estop_or.in1
net halt-or-door estop_or.out => fault_or.in0
# so does KM1's status (rung 6, next block), on fault_or.in1
net estop-fault_in fault_or.out => estop_latch.fault-in
# the latch's output releases LinuxCNC's E-stop and drives K2 (AUX0, rung 2)
# the latch's output also keeps the link running (link_or.in1)
net estop-status estop_latch.ok-out => iocontrol.0.emc-enable-in flexi.output.AUX0 km1_in_and.in0 link_or.in1
# --- the door (rung 7) acts through LinuxCNC only. While it is open the spindle's run command is held off.
# If the spindle is commanded on while it is held off, the feed stops and LinuxCNC aborts, which clears the
# spindle command, so nothing restarts when the door shuts. If the command is still there 1 s later: E-stop
setp door_edge.width 0.25
setp door_td.on-delay 1.0
setp door_td.off-delay 0
net door-open flexi.input.DOOR => door_inh_or.in0 # or .not: see the polarity note
net spindle-inhibit door_inh_or.out => spindle.0.inhibit door_hold_and.in0
net spindle-commanded spindle.0.on => door_hold_and.in1
net door-hold door_hold_and.out => door_inh_or.in1 motion.feed-inhibit door_edge.in door_td.in
net door-abort door_edge.out => halui.abort
```
- **Drive power present (rung 6).** Add:
```hal
# KM1's NC aux 21-22 on the Bend input: contact open = KM1 in = drive power present
net power-present flexi.input.B_LIMIT.not => motion.enable km1_in_and.in1 km1_stuck_and.in1 # or flexi.input.B_LIMIT: see the polarity note
# the same contact, not inverted: un-home every joint when drive power drops, whatever dropped it
net power-lost flexi.input.B_LIMIT => halui.joint.0.unhome halui.joint.1.unhome halui.joint.2.unhome km1_drop_and.in1 # always the other pin of the pair
# KM1's status against the latch (review S5, N02, EL07). km1_seen_in remembers that KM1 has been in since the last
# reset, and forgets it when the latch trips
net km1-in-ok km1_in_and.out => km1_seen_in.set
net km1-was-in km1_seen_in.out => km1_drop_and.in0
net estop-tripped estop_latch.fault-out => km1_seen_in.reset km1_stuck_and.in0
# KM1 reading "out" after it had been in trips the latch, and K2 then drops. km1_drop_db counts up one a millisecond
# while it reads out and down while it reads in, and trips at 5: it does not need 5 ms unbroken
setp km1_drop_db.delay 5
net km1-out-now km1_drop_and.out => km1_drop_db.in
net km1-dropped km1_drop_db.out => km1_or.in0
# the status contact still reading "in" while the latch is tripped: the reset is refused. This catches a contact that
# has not closed again, whatever the cause. It is not a weld detector (review R3-03)
net km1-stuck km1_stuck_and.out => km1_or.in1
net km1-fault km1_or.out => fault_or.in1
```
- **Buttons and lamps.** Replace the sample's whole `# User buttons` section with:
```hal
# --- program state: one net per halui pin (a pin can sit on only one signal)
net program-is-paused halui.program.is-paused => start_arm.data flash_and.in0 flexi.output.AUX1 # AUX1 = H2, yellow FEED HOLD lamp
net program-is-running halui.program.is-running => start_lamp_or.in0
# --- SB2 FEED HOLD: pause only
net hold-button flexi.input.FEED_HOLD => halui.program.pause
# --- SB4 CYCLE START: one resume per fresh press made while paused
setp start_db.delay 20 # servo periods = 20 ms, for contact bounce
setp start_edge.width 0.25 # seconds, long enough for halui to see it
net start-button flexi.input.CYCLE_START => start_db.in
net start-pressed start_db.out => start_arm.clk start_edge.in
net start-was-paused start_arm.out => resume_and.in0 # was the program paused at the press?
net start-pulse start_edge.out => resume_and.in1
net program-resume resume_and.out => halui.program.resume
# --- H4, green CYCLE START lamp on AUX2: steady while running, flashing while paused
setp blink.frequency 1.5
net blink-clock blink.clock => flash_and.in1
net start-lamp-flash flash_and.out => start_lamp_or.in1
net start-lamp start_lamp_or.out => flexi.output.AUX2
# --- SB5 AIR on the A-limit input: one mist command per fresh press made with the machine on
setp air_db.delay 20
setp air_edge.width 0.25
net air-button flexi.input.A_LIMIT => air_db.in # NO button; or .not: see the polarity note
net air-pressed air_db.out => air_arm.clk air_was_on.clk air_edge.in
net machine-is-on halui.machine.is-on => air_arm.data # was the machine on at the press?
net mist-is-on halui.mist.is-on => air_was_on.data # was the air on at the press?
net air-pulse air_edge.out => air_and.in0
net air-armed air_arm.out => air_and.in1
net air-valid air_and.out => air_on_and.in0 air_off_and.in0
net air-was-off air_was_on.out-not => air_on_and.in1
net air-was-on air_was_on.out => air_off_and.in1
net air-on air_on_and.out => halui.mist.on
net air-off air_off_and.out => halui.mist.off
```
**K2 follows the latch (review S1).** `estop_latch.ok-out` goes true only on a reset edge with the SPI link up, LinuxCNC out of E-stop and no fault, and goes false the moment HALT asserts, KM1 drops out, the link drops, LinuxCNC goes into E-stop or the door's backup fires (the door paragraph below). With `AUX0` on that net, a HALT trip opens K2 in the same servo cycle and K2 stays open until the screen's E-stop reset. Rev L had `AUX0` on `iocontrol.0.user-enable-out`, which LinuxCNC 2.9 leaves true through an external trip (`ioControl.cc` clears it only for an E-stop commanded from the GUI), so in Rev L shutting the door brought power straight back.
**The link after a trip (reviews SW-02, N01, R3-01, R3-02).** `iocontrol.0.user-enable-out` is ANDed with `flexi.SPI-status` into the latch's `ok-in`, so an on-screen E-stop opens K2 through the latch in the same servo cycle, as a HALT or KM1 trip does. The link runs while the latch is OK and for 0.5 s after it trips (`link_or`, `spi_hold`), long enough for the stop to reach the board and for KM1's drop to be read back, and then stops. From then on the firmware's own timeout can force every output off: by the source it enters its reset 0.6 to 0.7 s after the last packet and zeroes its outputs on the next pass of its main loop, 0.1 s later (`main.cpp`, `configuration.h`). A click on the screen's E-stop reset starts the link again in the cycle in which the latch decides (`reset_win`) and keeps it up for 0.75 s, whether or not the reset is accepted. The link is stopped because a link that is up does not prove that the board took the stop. The firmware's watchdog is satisfied by reads alone (`RemoraComms.cpp`), so Rev N as reviewed, which kept the link up for good, would have left K2 and the last step frequency on for as long as writes failed while reads still worked (finding 3 under [[#Simulator run (2026-11-13)]]). The first fix, on the afternoon of 2026-11-14, tied the link to `user-enable-out`. LinuxCNC drops that pin only for its own E-stop, so after an E-stop-button or KM1 trip the link stayed up (finding 4). This is the fourth arrangement: the sample, and Rev M as first written, stopped the link at once, which could cut the stop off (finding 2). While LinuxCNC sits in E-stop the inputs are not read, so `halshow` shows their last values; the screen reset restarts the link, and the inputs are read before the latch looks at them. Machine-off alone leaves the drives powered; the on-screen E-stop is the power-off. On QtDragon HD both are screen buttons: the F1 and F2 keys only switch off.
==**Accepted limit (Erik, 2026-11-15; reviews N01, R3-01, R3-02): a board that answers reads but ignores commands.** Nobody has named a way this can happen, and the HAL is not being changed again to chase it. If it does happen, **the E-stop button is the stop**: while the button is in, K3 and KM1 are out in hardware, whatever the board does. What the HAL adds is a backstop, not a guarantee:==
- ==After a trip of the latch the link stops, and the firmware's timeout lets K2 go about 1.3 s after the trip. In the simulator the axis travelled about 65 mm at 3000 mm/min in that time.==
- ==That holds only if nobody clicks the screen's E-stop reset meanwhile. Each click runs the link for another 0.75 s, refused or not, and reads are enough to keep the firmware's watchdog quiet. Clicks a second apart or less kept the board alive for as long as they went on (finding 5). A refused reset invites exactly that clicking: if a reset is refused, stop clicking and look.==
- ==Until the board lets K2 go, anything that restores KM1's coil circuit brings drive power back with the axis still stepping. In the simulator KM1 pulled in again 0.12 s after a 100 ms interruption of its coil supply began, and 0.4 s after an E-stop-button press when the button was released and POWER ON pressed, and it then stayed in for about a second each time (finding 5).==
- ==Where nothing trips the latch there is no backstop at all. After a feed hold, the end of a program or a door stop, the board runs on at the last speed it was sent, LinuxCNC reports a following error and switches the machine off, and the drives stay powered until the E-stop is pressed.==
==The firmware's timeout is also what opens K2 if LinuxCNC or the Pi dies: measure it on the bench (review SW-02).==
**The door (rung 7; changed 2026-11-15, Erik's decision).** The door switches no longer cut drive power. K5 still follows the door, but its contact is out of KM1's coil circuit, and all the door does is tell LinuxCNC through the `DOOR` input. LinuxCNC acts on it only while the spindle is commanded on (`spindle.0.on`: M3 or M4 active, at any speed). With the spindle off an open door changes nothing: jogging, probing, homing, MDI moves, a program that does not start the spindle, the AIR button, the screen's E-stop reset and POWER ON all work with the door open. With the spindle commanded on, three things happen as soon as the door reads open:
- `spindle.0.inhibit` takes the run command to the VFD away, and the VFD stops the spindle the way its own stop-mode and deceleration settings say;
- `motion.feed-inhibit` stops the feed;
- `halui.abort` aborts the program or the MDI command, which clears the spindle command and switches the air off, as any abort does.
The machine stays on, KM1 stays in and the axes stay homed. Nothing restarts when the door shuts, because the spindle command is gone: shut the door and start the program again from the screen. A spindle start with the door already open goes the same way: the run command never reaches the VFD and the screen shows "Process Aborted".
Two details. The stop holds itself: once the door has read open with the spindle on, `door-hold` keeps the inhibit on until the spindle command has gone, so a "door open" reading of a few milliseconds is enough for a full stop, and shutting the door half-way through does not undo it. And there is a backup: if the spindle is still commanded on 1 s after the stop began (`door_td`), the E-stop latch trips, with everything that follows from any E-stop (KM1 out, axes un-homed). That covers an abort that never arrives. It matters because LinuxCNC ignores both inhibit pins while the spindle override is disabled (`M51 P0`, or `M49`) and during spindle-synchronised moves (`control.c`); the abort still works then. The simulator ran the `M51 P0` case with the abort and without it; it did not run a spindle-synchronised move.
==What the door is and is not. It is a convenience interlock in software. It depends on LinuxCNC, the Pi, the SPI link, the FlexiHAL's `DOOR` input and the Modbus link to the VFD all working, and nothing in hardware stops the spindle or the axes when the door opens. The axes are live with the door open, by design, so the E-stop button is the stop for anything unexpected while reaching in. Still for the bench: the DOOR input's polarity; how long the spindle takes to start slowing (the run command travels over Modbus, at vfdmod's polling rate) and to stop (the VFD's stop mode has to be ramp-to-stop, not coast, and its deceleration time short enough to matter without tripping the VFD on overvoltage); and whether QtDragon's own HAL files use `halui.abort`, `spindle.0.inhibit` or `motion.feed-inhibit`, in which case LinuxCNC refuses the second connection at start-up (the sample's post-GUI files do not use them).==
**Power present (review SW-03, SW-04).** `motion.enable` is LinuxCNC's own input for this. While it is false a machine-on request is refused with "can't enable motion, enable input is false"; if it goes false with the machine on, motion stops and the task drops to machine-off, which also aborts the spindle and the coolant (`command.c`, `control.c`, `emctask.cc`). That path does not un-home the joints by itself, because LinuxCNC applies `VOLATILE_HOME` only when it runs its own E-stop or machine-off command, and the simulator run showed that a hardware trip (the E-stop button, and at that time the door) often goes the same way (finding 1 under [[#Simulator run (2026-11-13)]]). The `power-lost` line closes that gap (approved 2026-11-13): the same contact, not inverted, drives `halui.joint.N.unhome`, so a loss of drive power that lasts until the next reset un-homes all three joints. Since 2026-11-14 every loss lasts that long, because KM1 dropping out trips the latch (next paragraph). The Rev L line that tied this signal to `qtdragon.led-power-present` is gone: the stock screen has no such pin, and the line sat in the main HAL file, which loads before the screen exists.
**KM1's status and the latch (reviews S5, N02, EL07 and R3-03; approved 2026-11-14).** Two more things hang on the same contact. First, KM1 dropping out trips the latch. Once KM1 has read "in" with the latch set (`km1_seen_in`), a reading of "out" faults the latch after about 5 ms and K2 opens. The filter (`km1_drop_db`) counts up one a millisecond while the contact reads "out" and down one while it reads "in", and trips at 5, so the 5 ms need not be unbroken. With K2 open, KM1 stays out until the screen reset, as long as the board takes the write (the accepted limit above). Without this, a dip in the 24 V that dropped KM1 but not K3 let KM1 pull in again by itself when the voltage came back, with no stuck button needed. It also keeps the un-home request standing: `halui` looks at its pins about every 20 ms, so it could have missed a dropout that short. The filter keeps contact bounce at pull-in from tripping the latch. Second, the latch cannot be reset while the contact still reads "in" with the latch tripped. K2 is open then, so KM1 should be out. What this check detects is a status contact that reads "in" at that moment, and nothing more: a contact or wire that no longer conducts, or a KM1 that really has stayed in and whose contact shows it. It is not a weld detector. The data sheet's mirror-contact statement (HMC, p.16) is for the add-on auxiliary blocks, not for the built-in contact used here, so a KM1 with a welded main contact may still read "out" and pass. The contact also runs at 12 V, below the 17 V its data sheet gives as the minimum, and a contact that stops conducting reads as "power present"; this check turns that from a silent fault into a refused reset. It does not make the contact any more reliable. ==If the screen's E-stop reset is refused with the E-stop button out, look at `km1-stuck` in `halshow` and check KM1 21–22 and W25.== A false "out" reading too short to add up to 5 ms does not trip the latch, but it does turn the machine off, because `motion.enable` takes the contact directly.
**One command per press (review SW-06).** Each button goes through a debounce, and then two things happen on its rising edge: a `flipflop` samples the state that decides what the press means (was the program paused; was the machine on; was the air on), and a `oneshot` makes a 0.25 s pulse. The command is the pulse ANDed with the sampled state, so nothing that happens after the press can change it. A held or stuck CYCLE START cannot resume a program that pauses later, a FEED HOLD pressed right after a resume is not undone, and AIR held while the machine comes on does nothing. The pulse is 0.25 s because halui polls its pins every 20 ms and blocks for about 0.1 s while it sends a command (`halui.cc`). The debounce matters as much as the edge: without it, contact bounce on *release* would count as a second press. What a quick second press does depends on the button (reviews N06, R3-06). The `oneshot` is retriggerable and the `flipflop` samples again at every fresh press, so a second press inside the first one's 0.25 s pulse is not simply dropped. On AIR it acts: the second press samples "air on" and raises the other command pin, and in the simulator two presses 0.12, 0.2 and 0.4 s apart each switched the air on and off again. On CYCLE START a second resume can be lost: after resume, FEED HOLD and CYCLE START again inside a quarter of a second, the second press only stretches the pulse, and `halui` acts on a pin's rising edge, so no second resume is sent. Nothing resumes that was not asked for; a lost press is pressed again. FEED HOLD needs neither debounce nor edge, because a pause sent while already paused changes nothing, and it is deliberately not gated: pressed with nothing running it still enters the paused state (yellow lit, green flashing) until CYCLE START clears it. This replaces Rev L's `toggle` → `toggle2nist` chain for AIR, which could be left with a request stuck high if an E-stop landed between the press and the command.
==Polarity note: Remora declares HALT, DOOR, the limits and the button inputs with `invert=true` in `board_config.h`, and the FlexiHAL's HALT XOR hardware sits ahead of the MCU pin. The inputs are only read while the SPI link is up. It comes up on a screen reset and stops 0.5 s after LinuxCNC goes back into E-stop, and a wrong polarity on HALT or `B_LIMIT` makes the latch refuse the reset. A wrong polarity on DOOR shows nowhere until the spindle is started: it would stop the spindle with the door shut and let it run with the door open, so check it here. For this check only, hold the link up by hand: in a terminal run `halcmd unlinkp flexi.SPI-enable` and `halcmd setp flexi.SPI-enable 1`, then click the screen's E-stop reset once, without pressing POWER ON, so KM1 stays out. The link then stays up whether or not the reset is accepted (tried in the simulator). Check each input in `halshow` and pick `.not` where needed so that: `halt-in` is **false** at rest and **true** while the E-stop is pressed; `door-open` is **false** with the door shut and **true** with it open; FEED_HOLD, CYCLE_START and A_LIMIT read **true only while the button is held**; and `power-present` is **false with KM1 out** and **true once KM1 pulls in**. `power-lost` takes the other pin of the `B_LIMIT` pair, so it must always read the opposite of `power-present`. Restart LinuxCNC afterwards. `STEP_EN` nets stay unused.==
The HAL logic has been run in LinuxCNC's simulator ([[#Simulator run (2026-11-13)]]); the bench repeats the same checks on the real board. ==To let CYCLE START also start a loaded program later, add a flipflop that samples `halui.program.is-idle` at the press and an `and2` into `halui.program.run`.==
Optional mist off-delay: the air keeps blowing for a moment after M9. It is an off-delay and nothing more (review SW-10). Its only input is the mist command, so it cannot start the air ahead of the spindle: for a lead, have the post-processor issue M7 and a `G4` dwell before M3. It also holds K4's request for the same time after a machine-off or an abort, so also after a door stop. A trip that drops KM1 still closes the valve at once, because the valve's feed runs through KM1's aux contact (rung 9). If it is used, its last line replaces the sample's `net mist` line; with both in the file, HAL refuses to load a second writer on `flexi.output.MIST`. Loaded in the simulator as written: the valve closed 2.1 s after the command went off, and 0.03 s after an E-stop-button trip.
```hal
loadrt timedelay names=mist_off_delay
addf mist_off_delay servo-thread
setp mist_off_delay.on-delay 0
setp mist_off_delay.off-delay 2.0 # seconds of air after M9
net mist-cmd iocontrol.0.coolant-mist => mist_off_delay.in
net mist mist_off_delay.out => flexi.output.MIST # replaces: net mist flexi.output.MIST <= iocontrol.0.coolant-mist
```
## Simulator run (2026-11-13)
The HAL in this note was run in LinuxCNC itself, in a simulator build, with Erik's approval. Nothing here was run on the machine. There have been four rounds. The first was on 2026-11-13. The second independent review (2026-11-14) found three things wrong with its evidence, as distinct from the HAL: the scripted run counted rows that asserted nothing, the stop measurement could not see the stop, and the board model's timeout was not the firmware's (N03 to N05). The scripts and the model were corrected and everything was run again on 2026-11-14, twice: in the afternoon after the three HAL changes, and in the evening after the link was moved onto the latch (finding 4). The third review (2026-11-15) found that the evening's test of that change had used a single reset click and had looked at KM1 only at the end of each run, and found three smaller faults in the scripts (R3-01, R3-02, R3-04 to R3-06). The fourth round, on 2026-11-15, followed that review and the door change. The figures below are from the fourth round, on the HAL built from this note as it now stands, unless they say otherwise.
**What was run.** LinuxCNC 2.9.10 built from source for a PC (non-realtime `uspace`), with its real task, motion, `iocontrol` and `halui`. A script assembles the HAL file from Expatria's sample and the blocks in this note, applied the way the note says, so the test covers the text as written. Expatria's `flexi` component is used unchanged except for its SPI layer, which is replaced by a model of the board. The model answers like the firmware and holds the last outputs, step frequencies and enable bits it was sent. Its watchdog follows the firmware's main loop (`main.cpp`, `configuration.h`): a pass every 0.1 s, a counter that any packet clears, a reset after more than five missed passes, and the outputs zeroed on the pass after that. It can be told to stop taking writes while still answering reads. K3, the E-stop button, KM1 with drop-out and pull-in delays, the valve, and four faults (KM1's coil losing its supply for a set time, a dead or glitching status contact, a KM1 that stays in, a K4 that stays on) are small HAL circuits around it. The door is one signal into the `DOOR` input and nothing else: it is no longer in KM1's coil circuit in the model, as it no longer is in the wiring. The stop measurements for the on-screen E-stop are latched inside the model in the servo cycle in which `iocontrol.0.user-enable-out` falls and counted in servo cycles, so they do not depend on when a script happens to look. The door test (`door.py`) and the runs with writes dropped (`trips_no_writes.py`) look at their pins about once a millisecond from the event to the end of the run and keep every change, so what they report is the whole sequence and not an end state. Their times are the script's own and good to about 10 ms, because each action the script takes costs it a few milliseconds.
**What passed.** All 82 assertions of the scripted run (`harness.py`) and all 23 of the door test (`door.py`). One further row of the scripted run records a state without judging it and is not counted. The main ones:
| Area | Result |
|---|---|
| Loading | The file loads with every pin, net and function found; the servo thread runs in the order given above; `spindle.0.inhibit`, `motion.feed-inhibit` and `halui.abort` sit on the door's signals |
| Start-up | LinuxCNC comes up in E-stop with the link down and K2 out. The first screen reset brings the link up and K2 in, and holds. Machine-on is refused with "can't enable motion, enable input is false" until POWER ON brings KM1 in |
| Door, spindle off | Opened during a program that does not use the spindle: nothing changes for the second it was watched (program running, K2 and KM1 in, machine on, valve open, home kept), and nothing changes when it shuts. A jog, an MDI move, the AIR button, homing, the screen reset and POWER ON all work with the door open |
| Door, spindle on | The run command to the VFD goes off, the program is aborted, the spindle command is cleared and the air goes off. The machine stays on, K2 and KM1 in, home kept. Shutting the door restarts nothing. M3 with the door open never reaches the VFD |
| Door, backup | With the abort disconnected, the run command still goes off at once, and 1.0 s after the door opened the E-stop latch trips: K2 and KM1 out, joints un-homed. The screen reset is then accepted with the door still open, and a move is refused until the machine is re-homed |
| E-stop button | E-stop state, K2 and KM1 out, joints un-homed, and the link stops about 0.5 s after the trip. The screen reset is refused while the button is in, and the link stops again after it. After release and reset, machine-on waits for POWER ON |
| On-screen E-stop | K2 and KM1 drop and K3 stays latched. 0.3 s later, with the link still up, the board has all ten of its outputs off (K2, mist, both lamps, `STEP_EN` and `STEP_EN_Z` among them), no joint-enable bit and no step frequency. The link stops about 0.5 s after the E-stop, the board's watchdog resets it 0.6 to 0.7 s after that, and the screen reset alone restores the link and power. With K4 held on, the valve still closes |
| Machine-off | K2 and KM1 stay in |
| KM1 dropping by itself | The latch trips: E-stop, K2 out, mist off, joints un-homed. K3 coming back does not bring KM1 back; the screen reset does. The same after an 80 ms dip in KM1's coil supply with K3 and K2 in. A 3 ms false "out" reading does not trip the latch or drop KM1; it turns the machine off |
| KM1's status contact | With a contact that never conducts, or with KM1 held in, the screen reset is refused; it works again once the fault is removed |
| Link to the board lost | E-stop, K2 out, joints un-homed. Nothing restores until the screen reset |
| Writes not taken, reads still answered | 0.3 s after an on-screen E-stop the board still holds K2, mist and the step frequency. It has everything off within 1.6 s of the E-stop, with no reset click in between |
| FEED HOLD, CYCLE START | FEED HOLD never resumes. CYCLE START resumes once per fresh press made while paused, does nothing when idle, and when held does not undo a later FEED HOLD. FEED HOLD with nothing running sets the paused state and lights the yellow lamp, and CYCLE START clears it |
| Lamps | Green steady while running and flashing at 1.5 Hz while paused; yellow lit while paused |
| AIR | M7 and M9 open and close the valve. One change per button press, also during a run. A held button is one change, an 8 ms blip is ignored, and a press with the machine off or held through machine-on does nothing. Two presses 0.12, 0.2 and 0.4 s apart both act |
**The door, watched every millisecond (`door.py`).**
| Case | Runs | Result |
|---|---|---|
| Door open for 2.5 s with the spindle off; a jog, a 20 mm MDI move, AIR and homing tried with it open | 1 | Machine on, K2 and KM1 in and home kept throughout. The jog and the move ran, AIR opened the valve, homing worked |
| Door opened during a program with the spindle on and a 3000 mm/min move, shut again 2 s later | 5 | Run command to the VFD off in the same or the next millisecond. Spindle command cleared after 41 to 57 ms. Axis at rest after 65 to 68 ms. Program idle after 103 to 120 ms. Machine on, KM1 in and home kept throughout; nothing restarted when the door shut |
| Spindle start with the door open: by hand, by MDI, by a program | 3 | The run command never went true; "Process Aborted"; nothing moved; no E-stop |
| A "door open" reading of 5 ms, and of 50 ms, with the spindle on | 2 | A full stop both times, and nothing restarted |
| The abort disconnected | 5 | Run command off at once and the axis at rest after 65 to 68 ms, by the two inhibits. K2 off at the board 1.00 s after the door opened, KM1 out 0.03 s later, joints un-homed. Shutting the door restored nothing |
| Inhibits ignored (`M51 P0` in the program) | 1 | The abort took the run command off after 52 ms and had the axis at rest after 100 ms; the machine stayed on |
| Inhibits ignored and the abort disconnected | 1 | Nothing stopped for 1 s; then the backup E-stop, K2 off at 1.00 s |
| Start-up with the door open throughout; then the E-stop button | 1 | Reset, POWER ON, machine-on and homing all worked; the button stopped everything |
**The repeated experiments.**
| Experiment | Runs | Result |
|---|---|---|
| Trips by the E-stop button and by KM1 alone, with KM1 taking 0 to 300 ms to drop, idle and moving | 20 | E-stop and all three joints un-homed after every one |
| On-screen E-stop during a 3000 mm/min move | 40 | The board's K2 output went off one servo cycle after `user-enable-out` fell, every time. In 38 runs the step frequency was already zero by then, because LinuxCNC stops motion before it drops that pin; in the other 2 it was zero in the same cycle or 2 ms later. Travel after that cycle: 0.05 mm at most. Travel from the script's call to the stop, by step count: 1.1 to 1.6 mm |
| KM1's coil supply interrupted for 32 to 300 ms with K3 and K2 in (KM1 modelled with 30 ms to drop and 20 ms to pull in), idle and moving | 30 | KM1 dropped in all 30 and came back in none, looked at every millisecond for 1.5 s. All ended in E-stop with the joints un-homed |
| The same on-screen E-stop while the board takes no writes | 20 | K2 and the step frequency went off 1.20 to 1.30 s after the stop reached the HAL, by the link stopping and the board's watchdog. The board travelled 59 to 65 mm in that time |
| The same, on the Rev N HAL as reviewed (run 2026-11-14) | 10 | After 3 s K2 was still on, KM1 still in, and the board had stepped 145 to 149 mm and was still going |
| Optional mist off-delay | 5 checks | Air runs on for 2.1 s after M9; an E-stop-button trip closes the valve in 0.03 s |
**The board taking no writes, watched every millisecond (`trips_no_writes.py`).** These runs show what the accepted limit looks like. All were made during a 3000 mm/min move.
| Case | Runs | Result |
|---|---|---|
| On-screen E-stop, no reset click | 2 | K2 off at the board 1.31 to 1.34 s after the E-stop; 66 to 67 mm travelled |
| On-screen E-stop, then a reset click every 0.3, 0.5 or 1.0 s for 5 s | 6 | K2 stayed on until 6.4 to 6.6 s, about 1.5 s after the last click; 320 to 332 mm travelled in the 7 s watched |
| The same with a click every 1.5 s | 2 | K2 off at 1.33 to 1.34 s, before the first click |
| KM1's coil supply interrupted for 100 ms | 4 | KM1 out after 32 to 33 ms and **back in at 0.12 s, with the axis running**. It stayed in for 1.16 to 1.19 s, until the board let K2 go at 1.26 to 1.29 s |
| E-stop button pressed, released after 0.2 s, POWER ON pressed at 0.4 s | 4 | KM1 out after 30 to 33 ms and **back in at 0.40 s**, for 0.83 to 0.93 s, until K2 went off at 1.21 to 1.31 s |
| The same, released after 2.0 s, POWER ON at 2.2 s | 4 | KM1 never came back |
| FEED HOLD, no trip | 4 | Following error and machine-off. After 3 s the board was still stepping (148 to 152 mm), with K2 and KM1 in and the joints still marked homed |
| Door opened during a program with the spindle on | 4 | The run command to the VFD went off within 5 ms; it does not go through the board. The board kept stepping: 196 to 202 mm in the 4 s watched, following error, machine-off, K2 and KM1 in |
| For comparison with writes working: the same button press, and the same door opening | 1 + 1 | Button: K2 off after 7 ms, 1.7 mm. Door: run command off after 4 ms, 2.0 mm, machine left on |
**Withdrawn (review R3-04).** This section used to say that LinuxCNC took 25 to 124 ms from the script's call to the servo cycle in which the E-stop reached the HAL. That figure subtracted the board model's clock, which counts servo cycles, from the script's wall clock, and on a non-realtime PC the two do not keep step. What stands is the step count: the axis travelled 1.1 to 1.6 mm between the script's call and the stop, which at 50 mm/s is 22 to 32 ms. That delay is LinuxCNC's task on a PC, not the HAL, and the Pi's will differ.
**Finding 1 (fixed 2026-11-13): the joints were not reliably un-homed after a hardware trip.** `VOLATILE_HOME = 1` un-homes a joint only when LinuxCNC runs its own E-stop or machine-off command. On a door or E-stop-button trip, as the door then was, two things race: KM1's status reaching `motion.enable`, which disables motion within a servo cycle, and `iocontrol` noticing the E-stop, which it looks for every 100 ms. If motion is already disabled when the E-stop arrives, LinuxCNC skips the un-homing (`emctaskmain.cc`). In 30 simulated trips with the HAL as first written, with KM1 taking 0 to 300 ms to drop, the joints were still marked homed after 18: all 10 in which KM1 dropped by itself, and 8 of the 20 door and E-stop-button trips. An MDI move was then accepted without homing. The `power-lost` line un-homes all three joints whenever KM1's status contact says drive power is gone. Those trips all lasted until a reset; a dropout too short for `halui` to see was not among them (review N02), and the latch trip of 2026-11-14 is what covers it.
**Finding 2 (fixed 2026-11-13, changed again 2026-11-14): an on-screen E-stop stopped the SPI link before the board had been told to stop.** This is how Expatria's sample works, and Rev M as first written kept it: `iocontrol.0.user-enable-out` drives `flexi.SPI-enable`, so the on-screen E-stop silences the link, and the board carries on with the last packet it received until its own timeout. In 1 of 40 on-screen E-stops made during a 3000 mm/min move with that HAL, the link stopped before LinuxCNC had sent the stop, and the board kept stepping at full speed for 0.55 s, 29 mm of travel, with the drives still powered. The fix of 2026-11-13 kept the link up for good and sent the E-stop through the latch. What its test showed was less than this note then said (review N03): the script only started looking after its stop call had returned, 0.09 to 0.17 s after it was made, and found K2 off and the frequency at zero; and its overrun figure compared two numbers that came from the same step count, so it could not have been anything but zero. The later rounds measure inside the board model instead, and the table above has the figures.
**Finding 3 (review N01, changed 2026-11-14, accepted as a limit 2026-11-15): with the link kept up for good, a board that takes no writes holds its last commands indefinitely.** The firmware's watchdog counts any packet, and a read is a packet. The reviewer found this in the source; the simulator confirms it on the Rev N HAL (the table of repeated experiments). No ordinary fault is known that stops writes and leaves reads working, so this was a missing backstop, not an observed failure. The first fix stopped the link 0.5 s after LinuxCNC's own E-stop, which turned out to cover too little (finding 4).
**Finding 4 (found while answering the second review, changed 2026-11-14): the first fix for finding 3 covered only the on-screen E-stop.** It stopped the link 0.5 s after `iocontrol.0.user-enable-out` fell. LinuxCNC drops that pin when it runs its own E-stop, and leaves it true when the E-stop comes from outside (`ioControl.cc`), which is every trip of the latch by the E-stop button or KM1, and at that time by the door. After those the link stayed up, as the afternoon's own results show, and nobody had tested them with writes dropped. With the board taking no writes, 9 runs on that HAL: K2 never went off and the board kept stepping; KM1 came back in when the door was shut again (3 of 3), after a 100 ms interruption of its coil supply (3 of 3), and after the E-stop button was released and POWER ON pressed (3 of 3), each time with LinuxCNC in E-stop and the axis running. The link now follows the latch (`link_or`, `reset_win`), approved by Erik that evening, and the same trips then ended with the board's K2 output off 1.21 to 1.30 s after the trip. This note also said that evening that KM1 stayed out in all 15 of them. That was wrong: finding 5. What the change never covered is a board that takes no writes when nothing trips: after FEED HOLD the board kept stepping, LinuxCNC reported a following error and went to machine-off, and nothing stopped the axis in the 3 s each run watched. Only an E-stop ends that. Tripping the latch on a following error was tried and not adopted: in the simulator the first reset after such a stop was then refused, most likely because the position jump when the link restarts shows as a following error for one cycle.
**Finding 5 (third review, R3-01 and R3-02; reproduced 2026-11-15; accepted as a limit, not fixed).** Two holes in the arrangement of finding 4, both with the board taking no writes. First, reset clicks keep the board alive. Each click restarts the link for 0.75 s, refused or not, and reads are enough for the firmware's watchdog. The test of 2026-11-14 used a single click. With a click every 0.3, 0.5 or 1.0 s, K2 stayed on and the axis kept stepping for as long as the clicks went on. Second, KM1 comes back before the board lets K2 go. The "15 of 15" above came from a script that looked at KM1 once, 3 s after the trip. Looked at every millisecond, KM1 was back in 0.12 s after a 100 ms interruption of its coil supply and stayed in for about 1.2 s; and when the E-stop button was pressed, released after 0.2 s and POWER ON pressed at 0.4 s, it was in again for about 0.9 s. The axis was running each time. On the HAL of 2026-11-14 the same happened when the door was shut again 0.2 s after it opened; the door is out of that circuit now. The reviewer's point on the second hole is correct: software cannot close it. While the board ignores commands, K2 stays in until the firmware's own timeout, so anything that restores KM1's coil circuit in that time restores drive power. Two changes were weighed and not made. Holding the link off after a trip for longer than the firmware's timeout would close the first hole, at the price of refusing every reset for about 2 s after a trip on a healthy machine, and would leave the second as it is. Tripping the latch on a following error broke the first reset when it was tried (finding 4). Erik's decision on 2026-11-15 was to accept the fault as a stated limit and leave the HAL as it is; the wording is in the paragraph on the accepted limit, under the HAL. The reviewer's position is that N01 is not closed, and that stands as his. Withdrawn with this finding: "every trip ends with the board's outputs off about 1.3 s later", "KM1 stayed out, 15 of 15", and "KM1 cannot come back by itself" wherever it was said without the condition that the board takes the write.
**What the first run's numbers were worth (reviews N04 and N05).** Its "53 checks" were 50 assertions, one row that only recorded that the file had loaded, and two rows that recorded a state and were marked passed whatever it was. It did not assert that mist, the lamps and the step enables went off in E-stop, although this note said they did. And its model zeroed the board 0.6 s after the last packet, counted in servo periods: that was the model's assumption, where the source gives 0.7 to 0.8 s.
**What the third review found in the scripts (R3-04 to R3-06).** The latency figure mixed two clocks and is withdrawn (above). The "every output off" assertion left out the board's `STEP_EN`, `STEP_EN_Z` and `SPINDLE_DIR` outputs; it now covers all ten. And this note's statement that two quick presses of AIR count as one was wrong: both act, and the scripted run now asserts it.
**What the simulator does not show.** The board is a model written from the firmware source, not the firmware: the real timeout, what the outputs do when it fires and everything electrical are for the bench. The model's clock is the servo thread, so it cannot show a board carrying on after the host's realtime has stopped. K2's own release time is folded into KM1's. Input polarities were taken as this note writes them. Timing is a PC's, not a Pi's, and not realtime. vfdmod was a stand-in with the same pins and no spindle behind it, so nothing about Modbus was tested, and the door tests show the run command going off and nothing about how the spindle then stops: ramp against coast, and how long it takes, are for the bench. QtDragon and its post-GUI HAL file were not loaded, so a second connection to `halui.abort`, `spindle.0.inhibit` or `motion.feed-inhibit` from the screen's side would not have shown; and homing was immediate, with no switches.
The scripts, the board model and the result files are in `media/cascade-hal-sim/`; its `README.txt` says which file is which.
## Spindle — vfdmod and the H100
HAL: the sample's vfdmod block stays, with one change (review SW-12). The sample loads `vfdmod vfdmod.ini`, which is the Durapulse GS10 profile; only its comment mentions the H100. Change that one filename to `vfdmod_h100-v70.ini` and do not add a second vfdmod or `scale` block. The block then reads:
```hal
loadusr -W vfdmod vfdmod_h100-v70.ini
loadrt scale names=spindle_fb_scale
addf spindle_fb_scale servo-thread
setp spindle_fb_scale.gain 0.016666667 # rpm → rps for QtDragon
net spindle-speed-cmd vfdmod.spindle.rpm-in <= spindle.0.speed-out
net spindle-fb-scale-in vfdmod.spindle.rpm-out => spindle_fb_scale.in
net spindle-speed-fb spindle_fb_scale.out => spindle.0.speed-in
net spindle-at-speed vfdmod.spindle.at-speed => spindle.0.at-speed
net spindle-forward vfdmod.control.run-forward => spindle.0.forward
net spindle-reverse vfdmod.control.run-reverse => spindle.0.reverse
```
The arrows on the last two lines point the wrong way for who writes the signal (`spindle.0.forward` and `.reverse` are LinuxCNC's outputs), in the sample as here. HAL treats arrows as comments, so the lines load and work. The sample also still drives three outputs this design does not use: `STEP_EN` and `STEP_EN_Z` follow the joint enables, with nothing wired to them, and `COOLANT` follows M8, so the spare Flood terminal goes live if a program issues M8. Keep M8 out of the post, or delete the sample's `net flood` line.
`vfdmod_h100-v70.ini` (Expatria sample) — the parts that must match the VFD:
| Key | Sample value | Note |
|---|---|---|
| `SerialDevice` | `/dev/ttyAMA2` | Pi 5 (Pi 4: `/dev/ttyAMA3`). The Pi's UART 2 (GPIO 4 / 5) drives the FlexiHAL RS485 port through the header — no USB adapter |
| `SlaveAddress` | 1 | = H100 `F163` |
| `BaudRate` / `Parity` / `StopBits` | 19200 / N / 1 | = H100 `F164` / `F165` ==(see conflict below)== |
| `MaxSpeedRPM` / `MinSpeedRPM` | 24000 / 6000 | 2-pole, 400 Hz; G-Penny torque collapses below ~6 000 rpm |
| `[Control] Address` | 0x0200, run fwd 0x0002, rev 0x0004, stop 0x0000 | ==conflict== |
| `[SpindleRpmIn] Address` | 0x0201, Multiplier 10 / Divider 60 | 0.1 Hz units ==conflict== |
| `[SpindleRpmOut] Address` | 0x0220, Multiplier 60 / Divider 100 | |
| User params | 0x0222 current, 0x0225 V, 0x0226 °C | |
==**Register conflict to resolve on the bench before trusting either:** [[G-Penny H100 VFD Modbus Integration]] records 38400 8E1, `0x0201` in **0.01 Hz** units, run words 1 / 2 / stop 5 and current at `0x0221`; Expatria's ini says 19200 8N1, **0.1 Hz**, 0x0002 / 0x0004 / 0x0000 and current at `0x0222`. Both claim "H100/V70" — the rebadges differ. Dump the registers with `mbpoll` (scan script in the H100 note), then set one consistent set in the ini *and* in `F163–F165`.==
H100 keypad parameters (from the H100 note; power-cycle after changing):
| Param | Value | Meaning |
|---|---|---|
| `F001` | 2 | Run command from Modbus |
| `F002` | 2 | Frequency command from Modbus |
| `F163` | 1 | Slave address |
| `F164` | match the ini | Baud (3 = 38400 per the H100 note; set to the ini's 19200 if that is kept) |
| `F165` | match the ini | Data format (8E1 vs 8N1) |
| `F169` | ==unresolved== | The H100 note calls it response delay. The review's copy of the H100 manual makes it the decimal position of register `0x0201` (0 = 0.1 Hz, 1 = 0.01 Hz), and the V70 manual calls it protocol selection. Set it from the manual that came with this unit (review V1) |
| `F005` / `F011` | 400 Hz / 100 Hz | Max / min frequency (24 000 / 6 000 rpm) |
| motor nameplate | per the G-Penny label | Rated V / A / poles. The VFD's output is 0–110 V, 12.5 A, so the spindle's plate has to say 110 V |
| accel / decel | a few seconds each | Confirm the parameter numbers in the manual |
| motor current limit | ==≈7–8 A to start with== | Meant to keep spindle + PSUs under the 15 A inlet breaker. Not shown to do so: measure the inlet current (review EL01, [[Voron Cascade Bench Checks]] part E) |
==Not in this table yet (review V2): `F004`, the base frequency, and the rated-voltage setting have to match the spindle's nameplate, and `F153` (restart after a power failure) and `F155` (fault retries) decide whether the spindle can start by itself when KM1 closes again. Since 2026-11-15 the stop mode belongs here too: the door stop takes the run command away and relies on the VFD ramping the spindle down, so it has to be ramp-to-stop and not coast, with a deceleration time the VFD can hold without an overvoltage trip. All of them wait for the nameplates and the unit's own manual ([[Voron Cascade Bench Checks]], parts 1 and E).==
VFD nameplate, read 2026-11-14: G-Penny `H100-1.5C2-1B`, 1.5 kW, input 1PH 110 V 50/60 Hz, output 3PH 0–110 V, 12.5 A, 0–1000 Hz. It is the 110 V unit, and it prints no input current. ==Its output tops out at 110 V, so the rated-voltage setting and the spindle's plate both have to say 110 V. The spindle's plate and the manual's parameter pages are still to come.==
## Post-processor (Fusion 360 / LinuxCNC post)
- Coolant **mist = air blast**: enable mist coolant per operation that should get the blast. M7 opens Y1, M9 closes it; the AIR button (SB5) toggles the same state by hand. Flood (M8) is unassigned — leave it off in the post unless a coolant pump is added.
- Spindle speed range 6 000–24 000 rpm; M3/M5 only (M4 works but there is no reason to reverse).
- No tool-change macro: manual change with `tool-prepare` looped back (sample HAL). Tool setter under the table is `PROBE` — use a G38.2 touch-off routine, not the GUI's "probe" button, until the two inputs' XOR behaviour is proven.
- Air regulator **40–60 psi** for a chip-clearing blast (valve rated 1–180 psi). Y1 and the regulator sit outside the cabinet; the air line through the drag chain is **4 mm OD** (a 6 mm line needs the 15×15 chain).
## Raspberry Pi 5
- `/boot/firmware/config.txt`: `usb_max_current_enable=1` (PSU3 is not a PD supply; without this the Pi limits USB peripherals to 600 mA).
- UART for vfdmod: the RS485 transceiver sits on the Pi's **UART 2, GPIO 4 / 5** (header pins 7 and 29). A Pi 5 exposes it as `/dev/ttyAMA2` once `dtoverlay=uart2-pi5` is in `config.txt` ==(the Flexi-Pi image should already set it; confirm)==. It is not UART 0 on GPIO 14 / 15 — that is the flashing port — so `dtparam=uart0=on` does not enable it. Keep the login console off the serial ports (`raspi-config` → Interface → Serial: login shell **No**).
- Remora flashing from the Pi: the `Tools/` script in remora-flexi-hal drives STM_RESET / BOOT0 through the header; the UART jumpers above must be fitted.
- SPI for Remora is on the header; nothing to configure beyond the Flexi-Pi image.
- Ethernet from the Pi's own port; uFlexiNET is not used under Remora.
## Button and lamp behaviour (what the operator sees)
| Control | Where | Contact | Lamp | Lit when |
|---|---|---|---|---|
| SB0 E-stop (GCX1131) | top panel | NC1 → latch, NC2 → HALT | — | — |
| SB1 white POWER ON (Adafruit 1479) | front panel, right | NO ∥ K3 seal-in | H1 from node L via R1 | K3 latched (armed: releasing the screen's E-stop will bring power up) |
| SB5 blue AIR (Adafruit 1477) | front panel, left | NO → `Aend` → mist on / off, once per press | H5 from K4 14 via R5 | air valve fed (button or M7, with KM1 in) |
| SB4 green CYCLE START (Adafruit 1440) | top-panel box, left | NO → `Start` → resume | H4 from Aux2 via R4 | steady = program running; flashing = paused, press to resume |
| SB2 yellow FEED HOLD (Adafruit 1441) | top-panel box, right | NO → `Pause` → pause | H2 from Aux1 via R2 | program paused (`halui.program.is-paused`) |
| SQ5 / SQ6 door switches (KW10) | working enclosure | COM-NO in series → K5 coil | — | door shut = K5 in; K5 NC → DOOR, which LinuxCNC acts on only while the spindle is on. K5's NO contact is no longer used |
There is no POWER OFF button: the on-screen E-stop is the routine power-off, and the middle front-panel hole (AUX) is plugged. The controls are the screen's buttons — on QtDragon HD the keyboard's F1 and F2 only switch *off* (F1 = E-stop, F2 = machine off). Start-up: Q1 on → SDR/MDR up, Pi boots → **POWER ON** (white lights) → release the **E-stop on the screen** (K2 and KM1 pull in) → **machine on** on the screen → home → run. Machine-on is refused while KM1 is out ("can't enable motion, enable input is false"): press POWER ON first. E-stop pressed: white goes out, the GUI shows estop; release → POWER ON → E-stop reset and machine-on on the screen → re-home. On-screen E-stop: KM1 drops, white stays lit (K3 is still latched) → E-stop reset and machine-on → re-home. Door opened with the spindle off: nothing happens; jog, probe and home with it open as needed. Door opened with the spindle on, or a spindle start with the door open: the spindle is stopped, the program is aborted ("Process Aborted" on the screen) and the air goes off, and the machine stays on and homed → shut the door → start the program again. Every E-stop un-homes the axes (the `power-lost` line), so LinuxCNC refuses a program or an MDI move until they are homed again. During a program: FEED HOLD pauses (yellow lit, green flashing) → CYCLE START resumes (green steady); AIR switches the blast on or off, once per press, whenever the machine is on. Machine-off alone stops motion but leaves the drives and the VFD powered.
## Bench commissioning order
1. PSU trims (above) with nothing downstream connected.
2. FlexiHAL on 24 V only: LEDs; then with the Pi stacked and powered: Remora flashes, `halshow` sees `flexi.*` pins.
3. Rungs 1–7 and 10 on the XT3 strip + rear rail with a lamp in place of the NDR/VFD: POWER ON with the E-stop in → nothing; release → still nothing; POWER ON → K3 holds and the white lamp lights; screen reset → K2 and KM1 pull in; machine-on before POWER ON → refused; on-screen E-stop with the latch set → KM1 drops, white stays lit; door open → K5 drops and DOOR asserts, and KM1 stays in; HALT, DOOR and `power-present` polarity in `halshow`. Then the buttons: FEED_HOLD, CYCLE_START and A_LIMIT each go true in `halshow` while held; with a program running, FEED HOLD pauses (yellow on, green flashing), CYCLE START resumes (green steady), a held CYCLE START does not undo the next FEED HOLD, and AIR switches K4 and the blue lamp once per press.
4. One driver + motor on the bench (the Y bench-jog in [[Electronics]] is the template), then all three; set `SCALE`, prove direction and homing.
5. VFD on the bench: `mbpoll` register dump, settle the ini vs F16x, then vfdmod and a spindle run with the current limit set. Then the door: opened with the spindle running, the spindle ramps down and the screen shows "Process Aborted"; M3 with the door open does not start it.
6. Air blast: M7/M9 from MDI; with K4 held on by hand, pressing the E-stop still closes the valve (rung 9); then the mist off-delay if wanted.
7. Only then into the bay.
# TODO
- ==Resolve the H100 register/serial conflict and record the winning set here and in the H100 note.==
- ==Replace the sample's travel limits, homing velocities and accelerations with the Cascade's before the first homing move, and record them here (review SW-05).==
- ==Record the actual `.not` choices for HALT / DOOR / B_LIMIT and the three button inputs (FEED_HOLD, CYCLE_START, A_LIMIT) once checked in `halshow`.==
- ==The door stop on the bench: DOOR polarity, the time from the door opening to the spindle slowing (vfdmod's polling), the time to standstill, the VFD's stop mode (ramp, not coast; parameter number from the unit's manual), and the backup E-stop with `halui.abort` unlinked ([[Voron Cascade Bench Checks]], part C).==
- ==At the first start with QtDragon: check that the screen's own HAL files do not use `halui.abort`, `spindle.0.inhibit` or `motion.feed-inhibit`.==
- ==Parked for the bench: the firmware has a separate reset input from the Pi (`flexi.PRU-reset`, GPIO 25), which stops its main loop until the board's own watchdog restarts it about 2 s later. It might give a way to switch the board off that does not depend on the board taking a write. Look at it on the real board before designing anything with it.==
- ==Repeat the simulator's checks on the real board ([[Voron Cascade Bench Checks]], part C). The simulator passed them on 2026-11-13 and again, with the corrected scripts, on 2026-11-14 and 2026-11-15, with a model in place of the FlexiHAL; only the bench gives the input polarities, the firmware's real timeout and what the outputs do when it fires.==
- ~~Decide: add the `power-lost` un-home line~~ (approved 2026-11-13: it is in the drive-power block of the HAL)
- ~~Decide: keep the SPI link up through an on-screen E-stop~~ (approved 2026-11-13: it is in the E-stop chain block of the HAL)
- ==Decide after some use whether CYCLE START should also start a loaded program from idle.==
- ~~Find the QtDragon HD HAL pin for the power-present indication~~ (Rev M: the signal gates `motion.enable` instead, and the screen reports a refused machine-on)
- ==Confirm the Pi 5 UART device name on the installed image before trusting `/dev/ttyAMA2`.==
# References
## Related notes
- [[Voron Cascade Electronics Wiring]]: the design these settings implement (Rev O)
- [[Voron Cascade Electronics Layout]]: where everything sits in the bay (Layout J)
- [[Voron Cascade Bench Checks]]: the bench checks and information the 2026-11-12 review calls for
- [[Electronics]]: CL57Y DIP tables, cable colours, bench-jog and grblHAL fallback settings
- [[G-Penny H100 VFD Modbus Integration]]: H100 parameter map and `mbpoll` scan script
- [[Voron Cascade BOM]]
## Sources
- [Expatria Flexi-HAL README](https://github.com/Expatria-Technologies/Flexi-HAL) (jumpers, HALT polarity, RS485, power)
- [remora-flexi-hal](https://github.com/Expatria-Technologies/remora-flexi-hal): `Firmware/.../TARGET_FLEXIHAL/board_config.h`, `LinuxCNC/Components/Flexi/flexi.h` (HAL pin names), `LinuxCNC/ConfigSamples/flexi-hal/remora-flexi.hal`, `remora-flexi.ini`, `vfdmod_h100-v70.ini`
- [Flexi-Pi image](https://github.com/Expatria-Technologies/Flexi-Pi)
- [CL57Y V2.0 manual](https://files.omc-stepperonline.com/CL57Y_V2.0_pulse_stepper_driver_manual_V1.0.pdf)
- [LinuxCNC halui](https://linuxcnc.org/docs/html/gui/halui.html) · [timedelay](https://linuxcnc.org/docs/html/man/man9/timedelay.9.html) · [or2](https://linuxcnc.org/docs/html/man/man9/or2.9.html) · [oneshot](https://linuxcnc.org/docs/2.9/html/man/man9/oneshot.9.html) · [flipflop](https://linuxcnc.org/docs/2.9/html/man/man9/flipflop.9.html) · [dbounce](https://linuxcnc.org/docs/2.9/html/man/man9/dbounce.9.html) · [motion](https://linuxcnc.org/docs/2.9/html/man/man9/motion.9.html) · [siggen](https://linuxcnc.org/docs/html/man/man9/siggen.9.html) · [vfdmod](https://github.com/aekhv/vfdmod)
- [Raspberry Pi config.txt: usb_max_current_enable](https://www.raspberrypi.com/documentation/computers/config_txt.html)
- [LinuxCNC source, branch 2.9](https://github.com/LinuxCNC/linuxcnc/tree/2.9): `src/emc/task/emctaskmain.cc` and `emctask.cc` (when joints are un-homed), `src/emc/iotask/ioControl.cc` (the 100 ms E-stop poll, `user-enable-out`); remora-flexi-hal `Firmware/FirmwareSource/Remora-OS5/main.cpp` and `configuration.h` (the SPI timeout), `modules/stepgen/stepgen.cpp` (the board keeps stepping at the last frequency it was sent)
# Changelog
## 2026-11-10
- Rev K (Layout H): air line 4 mm through the chain, Y1 outside the cabinet, button location flagged open.
- Rev K: terminal references now point at the McMaster 7641K51 strips (XT3:4 / 7 for the door switches); nothing else changed.
- Rev J: DOOR now comes from the K5 door relay's NC contact (not the KW10s directly); rung numbers in the HAL comments, jumper table, button table and commissioning order updated; door-open behaviour added to the operator sequence.
- Created alongside Rev I of the wiring note: PSU trims, CL57Y DIP, FlexiHAL jumpers, Remora pin map, LinuxCNC INI/HAL (keep/change/add), vfdmod + H100 parameters with the register conflict flagged, post-processor conventions, Pi settings, button/lamp behaviour, bench commissioning order.
## 2026-11-11
- Rev L (operator controls): FEED HOLD is pause-only and CYCLE START resume-only, with the green lamp on AUX2 (steady running, flashing paused) and the yellow on AUX1; the AIR button on `A_LIMIT` toggles mist through `toggle2nist`; HALT is the E-stop's NC2 alone. Button / lamp table, operator sequence, pin map, jumper table, commissioning step 3 and TODO updated. HAL pin names corrected to the component's (`FEED_HOLD`, `CYCLE_START`), and two nets that would not have loaded — second signals on `iocontrol.0.user-enable-out` and `halui.program.is-paused` — rewritten onto the sample's existing nets. K2 is described as "out of E-stop", not "machine on".
## 2026-11-12
- Rev L correction, from the LinuxCNC 2.9 source (`toggle2nist.comp`, `emctaskmain.cc`, `halui.cc`): the AIR button now goes through `and2` (machine-on gate) → `toggle` → `toggle2nist`. Wired straight into `toggle2nist` it would have been on-while-held, and a press outside machine-on would have left the request stuck. AIR needs the machine on (F2), not just out of E-stop. FEED HOLD when idle documented. Confirmed in the same pass: `is-running` and `is-paused` are mutually exclusive, pause / resume and coolant commands are accepted in every mode with the machine on, and an E-stop turns mist off.
- Independent review of Rev L received: hold notice added. Documentation errors corrected: the INI example is now loadable (comments on their own lines, separate joint sections) and adds `NO_FORCE_HOMING = 0` and `VOLATILE_HOME = 1` so the re-home rule is enforced; start-up and recovery use the screen's buttons (the F1 / F2 keys only switch off on QtDragon HD); RS485 is the Pi's UART 2 on GPIO 4 / 5 (`dtoverlay=uart2-pi5`), not UART 0; P19 is a 2×3 header and only serves flashing; DOOR cannot assert with the 24 V rail down. The HAL itself is unchanged and waits for Rev M.
- **Rev M HAL**, approved after the review and checked against the LinuxCNC 2.9.10 and remora-flexi-hal sources, not yet run. `AUX0` (K2) moves from `user-enable-out` to the E-stop latch's `ok-out` (S1). `estop_or` and `estop_latch` now run straight after `flexi.read`, with the whole `addf` block spelled out (SW-11). `power-present` comes from KM1's NC aux (`B_LIMIT.not`) and drives `motion.enable`; the `qtdragon.led-power-present` line is gone (SW-03, SW-04). CYCLE START and AIR are debounced and act once per fresh press through `dbounce`, `flipflop` and `oneshot`; `toggle` and `toggle2nist` are no longer used (SW-06). Pin map, button table, operator sequence, commissioning step 3, polarity note and TODO updated.
## 2026-11-13
- Rev M HAL run in LinuxCNC's simulator (2.9.10 built from source; Expatria's `flexi` component with its SPI layer replaced by a model of the board). The file built from this note loads and the 53 scripted checks pass. New [[#Simulator run (2026-11-13)]] section with two findings and a proposed HAL change for each, both waiting for a decision. The banner, the K2 and power-present paragraphs, the INI comment on `VOLATILE_HOME`, the operator sequence and the TODO follow; the scripts and results are in `media/cascade-hal-sim/`.
- Review fixes approved by Erik: the 27 V Zener on the FlexiHAL's input is no longer called a clamp (HW-08); the optional air timer is a mist off-delay that cannot give a spindle lead, renamed `mist_off_delay` (SW-10); the spindle block says which filename changes, and the pin map and that section say that the sample still drives `STEP_EN`, `STEP_EN_Z` and `COOLANT` (SW-12).
- `power-lost` line added to the HAL, approved by Erik: all three joints are un-homed whenever KM1's status contact says drive power is gone (simulator finding 1). The pin map, the INI comment, the power-present paragraph, the polarity note, the simulator section, the operator sequence and the TODO follow. The HAL built from the note was run again with the line in it.
- SPI link kept up through an on-screen E-stop, approved by Erik: `flexi.SPI-enable` is tied true and `iocontrol.0.user-enable-out` feeds the latch through `estop_ok_and` (simulator finding 2). The components, thread and E-stop chain blocks, the K2 paragraph, the polarity note, the banner, the simulator section and the TODO follow. The HAL built from the note as it now stands was run again: 53 of 53 scripted checks, the axes un-homed in 30 of 30 trips, and no overrun in 40 on-screen E-stops during a move.
## 2026-11-14
- FlexiHAL Aux pull-ups: measured on Erik's A7 board (1.00 kΩ on all four Aux outputs) and to be removed. Jumper table and banner updated; K2 stays on `AUX0` and nothing in the HAL changes.
- **Rev N.** The revision letter follows the wiring note, for the second independent review; nothing in the HAL or the INI changes with it. The H100 table now says what is unresolved instead of asserting it: `F169` is not known to be a response delay (review V1), and `F004`, `F153` and `F155` are named as still to be set from the unit's manual (review V2).
- Second independent review (Rev N, 2026-11-14) and the three HAL changes Erik approved from it. The link now stops 0.5 s after LinuxCNC's own E-stop instead of staying up for good (`spi_hold`; N01). KM1 dropping out trips the latch, and the latch cannot be reset while KM1 still reads "in" (`km1_seen_in`, `km1_drop_db` and the gates around them; S5, N02, EL07). The components, thread, E-stop chain and drive-power blocks, the K2 paragraph (now two), a new paragraph on KM1's status, the polarity note and the button paragraph (presses under 0.25 s apart merge; N06) follow.
- Simulator section rewritten. The scripts and the board model were corrected as the review asked (N03 to N05) and everything was run again on the HAL built from this note: 70 of 70 assertions, 30 of 30 trips un-homed, 40 on-screen E-stops with K2 off one servo cycle after the E-stop reached the HAL, 30 KM1 dips with no self-recovery, and the writes-dropped case bounded at about 1.3 s where the Rev N HAL never stopped. What the first run's figures were worth is stated.
- TODO: the travel limits are to be replaced before the first homing move, not after it (SW-05).
- Banner brought up to date with the second review. The H100 motor-current row no longer says that the setting keeps the machine under the inlet breaker (EL01).
- VFD nameplate recorded in the H100 section and the banner: `H100-1.5C2-1B`, 110 V single-phase in, 0–110 V 12.5 A out.
- The SPI link follows the E-stop latch (`link_or`, `reset_win`), approved by Erik. The afternoon's fix stopped the link only after LinuxCNC's own E-stop, which left door, E-stop-button and KM1 trips without the firmware's timeout behind them; found while writing the response for the next review. Components, thread and E-stop chain blocks, the link paragraph, the banner and the simulator section follow: 72 of 72 assertions on the new HAL, all repeated experiments rerun, trips with writes dropped added (15 on the new HAL, 9 on the afternoon's), finding 4 written up, and the case it does not cover stated.
## 2026-11-15
- Third independent review received (of the Rev N package of 2026-11-14). It does not pass Rev N: its first blocker (a board that answers but ignores commands) stays open and it adds two more under the same fault. Both were reproduced in the simulator. Erik's decisions: accept that fault as a stated limit and leave the link logic as it is; make the door act through LinuxCNC only; apply the corrections; go to the bench next, not to a fourth paper review.
- **The door acts through LinuxCNC only, and only while the spindle is commanded on** (Erik's decision; `door_hold_and`, `door_inh_or`, `door_edge`, `door_td`). Opened with the spindle on, it takes the run command away, stops the feed and aborts; if the spindle command is still there 1 s later, the E-stop latch trips. Opened with the spindle off, it does nothing. Components, thread and E-stop chain blocks, a new door paragraph, the K2 paragraph, the polarity note, the pin map, the button table, the operator sequence, commissioning steps 3 and 5 and the TODO follow.
- The accepted limit is written out under the link paragraph. Withdrawn: "every trip ends with the board's outputs off about 1.3 s later", "KM1 stayed out, 15 of 15" and "cannot come back by itself" without its condition (R3-01, R3-02). Three HAL comments reworded to match; no HAL line changed for this.
- Corrections from the third review: the reset check is described as what it detects and not as a weld detector (R3-03); the KM1 filter integrates and does not need 5 ms unbroken; two quick AIR presses both act and only a quick second CYCLE START can be lost (R3-06); the 25 to 124 ms latency figure is withdrawn (R3-04).
- Simulator section brought to the fourth round, on the HAL built from this note: 82 of 82 assertions in the scripted run, which now asserts all ten board outputs off (R3-05); 23 of 23 in the new door test; the repeated experiments rerun; the runs with writes dropped redone with every change recorded from the event to the end of the run. Finding 5 added.
- TODO: door checks for the bench, the QtDragon pin check, and the firmware's separate reset input parked as a bench-phase option.
- **Rev O.** The revision letter follows the wiring note (Erik's decision, the same day). It covers the door change, the accepted limit and the corrections in the entries above; nothing in the HAL or the INI changes with the letter.
- Related notes: the wiring note's letter corrected to Rev O (missed when the letter moved), and the new layout note, [[Voron Cascade Electronics Layout]], added.