Repository navigation
fix(pb_heater): approach cap stalled the chamber below setpoint since v1.1.16 - #103
Merged
Merged
Conversation
…old below setpoint
Since v1.1.16 the chamber controller could not hold setpoint -- it stalled
~2 C low ("gets to 64, can't reach 65"). Root cause is the approach cap in
pb_heater_pid.h, which limited SSR duty by chamber distance-to-target (40%
within 2 C, 70% within 5 C). That clamped the STEADY-STATE hold, creating a
stable attractor at target-2 C for any enclosure whose hold duty exceeds the
cap, and integral_max = output_max - proportional prevented the integrator
from compensating. It also throttled the element below its safe capability,
adding SSR duty-modulation (wear) the prior bang-bang firmware did not have.
Bench-validated on an enclosed U1 (65 C target, bed 100 C):
v1.1.18 (bug): chamber 62.9 C, SSR 12/min, duty capped 0.40-0.70
v1.1.15 (good): chamber 64.3 C, SSR 2.3/min (element-foldback limited)
this fix: chamber 64.3 C, SSR 4.4/min, approach cap released at hold
The element (PTC) foldback in pb_heater.c is the correct near-target limiter
(a real thermal/safety limit); the chamber-error cap ceilinged the wrong
variable.
Changes:
- Replace the chamber-error cap with a rate-gated SOFT anti-overshoot
(pb_heater_pid_approach_soft_cap): full authority unless within 3 C of
target AND genuinely climbing (>0.06 C/s), so a settled/oscillating hold is
never clamped while a fast approach on a low-loss enclosure still gets
overshoot damping. The gate rate is EMA-filtered (alpha 0.20) to reject the
~0.1 C NTC quantization ticks that otherwise spike the one-sample rate to
~0.2 C/s and flicker the cap through the hold (bench: 27% -> 8% of samples).
- Widen the SSR time-proportioning window 10 s -> 30 s and add a 2 s minimum
on/off dwell, cutting steady-state SSR switching (12/min -> ~4/min).
- Report the applied soft cap via state->last_approach_cap telemetry.
Fixed safety cutoffs (105 C PTC / 85 C chamber / 70 C target) are untouched.
The already-exposed fb_cut advanced setting (default 102 C) remains the
per-enclosure element-headroom knob: raising it to 103 C let the same rig
reach a full 65 C hold with the element still ~90 C at steady state.
Host tests updated for the soft cap, EMA quantization rejection, the 30 s
window + dwell, and a settled hold reaching full authority.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012B9YKQ5yUenkyDUqdbn6HP
Release notes for the v1.1.19-rc1 prerelease; the release workflow pulls this section into the GitHub Release. Content only — no code change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012B9YKQ5yUenkyDUqdbn6HP
…hold # Conflicts: # CHANGELOG.md
plastikman
added a commit
that referenced
this pull request
Sep 23, 2026
Consolidates rc1/rc2 into the 1.1.19 release: selectable Bang-Bang/PID chamber control (#95), configurable hostname, the approach-cap hold fix (#103), and follow-the-filament material detection (#65). Both follow-the- filament and heater-method tested good on hardware. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since v1.1.16 the chamber controller can't hold setpoint — it stalls ~2 °C low ("gets to 64, can't reach 65"). v1.1.15 held.
Root cause: the approach cap in
pb_heater_pid.hlimited SSR duty by chamber distance-to-target (40% within 2 °C, 70% within 5 °C). That clamped the steady-state hold, creating a stable attractor attarget − 2 °Cfor any enclosure whose hold duty exceeds the cap, andintegral_max = output_max − proportionalstopped the integrator from compensating. It also throttled the element below its safe capability, adding SSR duty-modulation (wear) the prior bang-bang firmware never had — the concern Justin raised about frequent SSR trips.The element (PTC) foldback already in
pb_heater.cis the correct near-target limiter (a real thermal/safety limit). The chamber-error cap ceilinged the wrong variable.Fix
pb_heater_pid_approach_soft_cap): full authority unless within 3 °C of target and genuinely climbing (>0.06 °C/s), so a settled/oscillating hold is never clamped, while a fast approach on a low-loss enclosure still gets overshoot damping.integral_maxfrees up at hold.state->last_approach_captelemetry (DragonSniff//diagstill see when damping is active).Fixed safety cutoffs (105 °C PTC / 85 °C chamber / 70 °C target) untouched. All DragonBreath-side — no
dc_pidchange.Bench validation (enclosed U1, 65 °C target, bed 100 °C)
The fix recovers v1.1.15's reach exactly and cuts SSR switching ~63% vs the bug. Raising the already-exposed
fb_cutadvanced setting 102 → 103 °C then reached and held a full 65.0 °C on the same rig, with the element still ~90 °C at steady state (huge margin to the 105 °C cutoff) — sofb_cutis the per-enclosure element-headroom knob for lossy setups.Tests
Host suite (
tests/pb_heater_pid_host_test.c) rewritten to cover the soft cap, EMA quantization-spike rejection, the 30 s window + dwell, a settled hold reaching full authority, and fast-approach damping. All four heater/policy host suites pass; firmware builds (esp32c3).Follow-ups (not in this PR)
fb_cutalready covers the highest-impact knob.🤖 Generated with Claude Code
https://claude.ai/code/session_012B9YKQ5yUenkyDUqdbn6HP