Skip to content

Re-seed the PID after lid-open and other Hold pauses - #25

Merged
CamSoper merged 1 commit into
mainfrom
camsoper/funny-darwin-6w5brt
Oct 27, 2026
Merged

CamSoper merged 1 commit into
mainfrom
camsoper/funny-darwin-6w5brt

Conversation

@CamSoper

Copy link
Copy Markdown
Owner

Problem

Hold skips the PID while the lid is open, but the PID's last timestamp stayed put. The first update after the lid closed computed dt over the whole lid-open gap (up to LidMonitor's 3-minute latch) and folded error * gap into the integral. With the grill still ~20F low that is roughly +0.33 duty on the next cycle: an overfeed right as the lid closes, which is the overshoot the old comment claimed couldn't happen.

Fix

  • SmokerPid.Pause() marks the state for re-seeding, reusing the existing NaN re-seed path. The next update keeps the integral, re-seeds time and temperature, and integrates nothing.
  • The seed pass now returns P plus the held integral instead of P alone.
  • Hold calls Pause() on every path that skips the PID: lid open, reignition, igniter diversion, and max setpoint.
  • ModeLoop pauses the PID in every non-Hold mode so entering Hold later doesn't integrate across time spent elsewhere.
  • Stale "freezes the PID" comments corrected.

Tests

Two new tests in SmokerPidTests using FakeTimeProvider: one checks that a 180s pause doesn't add to the integral on the first update back (and that the next update integrates exactly one interval), the other checks the integral is preserved across the re-seed. dotnet test Inferno.Tests passes (78/78).


Generated by Claude Code

Hold skips the PID while the lid is open, but the PID's last timestamp
stayed put, so the first update after the lid closed computed dt over
the whole lid-open gap (up to LidMonitor's 3-minute latch) and folded
error * gap into the integral. With the grill still ~20F low that is
roughly +0.33 duty on the next cycle: an overfeed right as the lid
closes, the overshoot the old comment said couldn't happen.

SmokerPid.Pause() marks the state for re-seeding, reusing the existing
NaN re-seed path: the next update keeps the integral, re-seeds time and
temperature, and integrates nothing. The seed pass now returns P plus
the held integral instead of P alone. Hold pauses on every path that
skips the PID (lid open, reignition, igniter diversion, max setpoint),
and ModeLoop pauses it in every non-Hold mode so entering Hold later
doesn't integrate across the time spent elsewhere. Comments fixed.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RR4Mzohe6jCncc5GYSqzQU
@pulumi

pulumi Bot commented Oct 27, 2026

Copy link
Copy Markdown

🚀 The Update (preview) for CamSoper-org/inferno-deploy/main (at d0dd8cc) was successful.

Resource Changes

    Name         Type                         Operation
~   copy-api     command:remote:CopyToRemote  update
+-  restart-api  command:remote:Command       replaced
+-  publish-api  command:local:Command        replaced

@CamSoper
CamSoper marked this pull request as ready for review October 27, 2026 22:49
@CamSoper
CamSoper merged commit 8b58aff into main Oct 27, 2026
3 checks passed
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.

2 participants