Skip to content

feat(firmware): show amber on a watchdog trip or heater fault - #83

Merged
CameronBrooks11 merged 1 commit into
mainfrom
feat/amber-hold
Nov 1, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
feat/amber-hold

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Requires bread-slice-core 0.2.0 (^0.2.0 in platformio.ini and slice.yaml) and uses its new Hold state: the status LED shows amber while a command-watchdog trip or a latched heater fault holds the heaters off, the same hold term relayControlLogic() and checkHeaterFaults() use. Red still wins over amber. The e-stop input keeps the internal pull-up.

test_status_led_hold runs the real 0.2.0 StatusLed with frame capture: running is green; a trip and a latched over-temperature each show amber, including after an e-stop over them is released; an e-stop over either shows red; clearing returns to green. Gen1 drives no LED. Each check fails under a mutation aimed at it: the fault term dropped, the watchdog term dropped, amber winning over red, main's original line, and a hold that stays after clearing.

Host suite: 56 runs, 696 ok, 0 failed, 0 skipped (676 before). Flash +40 B on gen2, +2 B on gen1.

The amber (red 50, green 16) has not been seen on a board yet; that is a step for the next bench session.

The status LED stayed green while a command-watchdog trip or a latched
heater fault held the heaters off, so a held Slice looked like a running
one. updateStatusLed() now takes its state from
bsc::StatusLed::stateFor(), with the same hold term the control loop
uses (commandWatchdog.tripped() || heaterFaults != 0): amber on a hold,
red while the e-stop is held, green once the hold is cleared.

I bumped bread-slice-core to ^0.2.0 in platformio.ini and slice.yaml for
the Hold state. The e-stop input keeps the internal pull-up.

test_status_led_hold covers a trip, a fault, an e-stop over each, the
release while each stays latched, and each clear. The amber is worked
from the WS2812B datasheet and has not been seen on a board.

Flash/RAM against main (8de10b3): gen2 Nano 23998 -> 24038 B / 921 ->
922 B, gen2 Nano Every 25467 -> 25507 B / 999 -> 1000 B, gen1 Nano
22868 -> 22870 B / 907 -> 908 B, gen1 Nano Every 24355 -> 24357 B /
987 -> 988 B.
@CameronBrooks11
CameronBrooks11 merged commit a251158 into main Nov 1, 2026
10 checks passed
@CameronBrooks11
CameronBrooks11 deleted the feat/amber-hold branch November 1, 2026 02:56
CameronBrooks11 added a commit to feastorg/Slice_DCMT that referenced this pull request Nov 1, 2026
Requires bread-slice-core 0.2.0 (`^0.2.0` in platformio.ini and
slice.yaml) and uses its new `Hold` state: the status LED shows amber
while a command-watchdog trip or a latched stall fault (#97) holds the
motors, the same hold `motorControlLogic()` applies minus the e-stop.
Red still wins over amber. The e-stop input keeps the internal pull-up.
This is the same change as feastorg/Slice_RLHT#83.

`test_status_led_hold` runs the real 0.2.0 `StatusLed` with frame
capture: running is green; a trip and a stall fault each show amber,
including after an e-stop over them is released; an e-stop over either
shows red; clearing returns to green. Gen1 drives no LED. Each check
fails under a mutation aimed at it: the watchdog term dropped, the fault
term dropped, amber winning over red, main's original line, and a hold
that stays after clearing.

Host suite: 80 runs, 818 ok, 0 failed, 2 skipped (the speed-freeze test
on the Nano envs, as on main). Flash +42 B on gen2 (+14 B of that from
the core bump), +2 B on gen1.

The amber (red 50, green 16) has not been seen on a board yet; that is a
step for the next bench session.
CameronBrooks11 added a commit that referenced this pull request Nov 1, 2026
Adds the 2026-11-01 bench record, on `main` at `a251158`, gen2 Nano.

- R1a, the watchdog trip: status LED amber, red with the e-stop, amber
after the release, green after the clear. Verifies #83.
- R2, PID timing: the derivative adds 21 ms per 0.25 C reading step, not
about 64 ms, and on-time changes once per reading. Verifies #76.
- R3: `tcsel 2 2` is refused with reason 6 while heater 1 runs, and is
applied at setpoint 0 and in open loop. Verifies #77.
- F4, the 30 C test build: latched after readings of 30.3 C and 30.8 C.
LED amber, red, amber; cleared at 27.3 C.
- R4, the #81 bisect: bad GET_STATE replies per 300 s.

  | Build | Bad replies |
  | --- | --- |
  | C0, today's main | 187 |
  | V-IDLE, the main loop stripped out | 0 |
  | V-NOMASK, only `main.cpp`'s `noInterrupts()` windows removed | 0 |
  | V-PAD, every window kept but the loop slowed by 300 us a pass | 0 |
  | main again, closing control | 175 |

How often the loop masks interrupts causes the cut-short replies. The
record includes the patch that builds the variants.

Of the cut-short replies, 13 of 187 in C0 passed the CRC as an all-0xFF
payload, against the 1 in 256 that feastorg/CRUMBS#130 assumes.
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