Repository navigation
v2.8.0 — manual homing, StallGuard opt-in, friendly Motion Tuning - #36
Merged
Merged
Conversation
…rming
StallGuard only reports while TSTEP <= TCOOLTHRS, and TSTEP is inversely
proportional to velocity. Measured on VAL3000 hardware (microsteps=8), within
1% from Speed 3000 to 9000 under real curtain load:
TSTEP ~= 374000 / Speed
So the shipped default TCOOLTHRS=100 arms only above Speed ~3740. Below that
StallGuard is switched off entirely -- no error, no log line, nothing in the UI
-- and sensorless homing simply never completes. A customer reaches that state
just by dragging the Speed slider down for a quieter curtain. It is also what
made a bench unit at Speed 1500 look broken while the same firmware worked at
9000.
Two changes:
* recompute_tcoolthrs derives TCOOLTHRS = 748000 / Speed, on boot and whenever
Speed changes. 2x cruise TSTEP arms from half of cruise speed upward at any
Speed, preserving the deliberate low-velocity cutoff (SG_RESULT is unreliable
when slow -- that is what TCOOLTHRS is for) while guaranteeing it engages at
all. Hooked via !extend on num_speed, which APPENDS, so core still stores
global_speed and pushes the speed to the driver first; verified against the
resolved config.
* A "StallGuard" diagnostic text_sensor reporting Armed / Below threshold /
Ready (stopped) / "Never arms at this Speed". The last is diagnosed from the
configured Speed rather than live TSTEP, so a misconfiguration is visible
while the curtain is standing still instead of being discovered when homing
silently fails. "Below threshold" during acceleration is normal and expected.
Verified on the installed curtain unit over OTA: at Speed 9000 TCOOLTHRS
auto-derives to 83 (was a hand-set 100); setting Speed 1500 moves it to 498,
which is the configuration that was previously dead.
Gates: 1 entity added (StallGuard, diagnostic), 0 removed. Behaviour diff shows
only on_boot 400, num_speed set_action (appended, core actions intact), and the
two new bodies. Compiles clean.
Does not change SGTHRS, which depends on installed load and remains manual --
that is the calibration wizard, still to come.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…otion Tuning Make the Ropener usable without StallGuard tuning, and hide the hard parts. Homing (safety-critical): - Default homing is now manual via the existing Start-Stop button. It drives closed at Speed 3000 (home_start), and a second press at the closed end sets home (home_finish). No chip stall is required. - 60 s abort timeout (home_timeout -> home_abort) protects against an accidental press: it stops and holds at the current position WITHOUT setting a new zero. - Button-1 x7 gesture rerouted to home_start. StallGuard demoted to opt-in: - New "StallGuard Enabled" switch, default OFF. on_stall is gated on it, so a shipped unit never reacts to a chip stall unless a power user turns it on. - StallGuard indicator reports "Disabled" when the switch is off. UI reorg for the average user: - Motion Tuning moved directly under Setup (new group_tuning at weight 22). - Friendly "Motor Current" (mA) in Motion Tuning drives IRUN via the driver's own mA<->register conversion; raw IRUN register moved to advanced. - Speed preset select (Slow/Medium/Fast = 1500/5000/9000) in Motion Tuning; raw Speed slider moved to advanced. - StallGuard group (raw SGTHRS/TCOOLTHRS/IRUN/Speed, SG_RESULT, TSTEP) moved to the very bottom as "StallGuard (experimental)". Builds on the Tier1 TCOOLTHRS-from-Speed derivation. Supersedes PR #35. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2 tasks
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.
Summary
Makes the Ropener usable without StallGuard tuning and hides the hard parts behind an advanced group. Supersedes #35 (includes its Tier1 TCOOLTHRS-from-Speed commit).
Homing (safety-critical)
home_start); a second press at the closed end sets home (home_finish). No chip stall required.home_timeout→home_abort) guards against an accidental press — stops and holds at the current position without setting a new zero.home_start.StallGuard demoted to opt-in
on_stallis gated on it, so a shipped unit never reacts to a chip stall unless a power user opts in.UI reorg
group_tuning, weight 22).Verification
esphome configvalid; entity + behavioral regression gates clean.🤖 Generated with Claude Code