Repository navigation
fix(mount): Parked status, optional RA/DEC off when parked - #323
Conversation
Stopped mounts read Parked, the next slew re-parked, moves from park caught up parked time. Adds RA_DEC_OFF_WHEN_PARKED (OAM/OAE). Assisted by: Claude Opus 5.5
fb25787 to
015f40d
Compare
|
Rebased onto develop with #322 merged (fb25787 → 015f40d; clean three-way merge, no manual resolution needed). Checked the intersections with #322 rather than trusting the auto-merge:
Verified locally before pushing: standard esp32 build, and an CI is running on the rebased branch. 🤖 Posted with Claude Code |
:Q# (or a directional RA stop) mid-park left _slewingToPark/_slewingToHome and STATUS_PARKING set. The stop itself only stops the steppers; the waitUntilAllStopped()/loop() pass then runs the arrival block's "arrived at park position" code at wherever the mount was aborted to, parking it there - with RA_DEC_OFF_WHEN_PARKED also switching the drivers off mid-sky, and a first-leg abort even re-launching the park slew after setHome(false). stopSlewing() now clears the park-slew state when the RA axis is stopped, so an aborted park ends Idle (a full stop also skips catch-up and stays unparked via the existing TRACKING handling). The pre-existing mislabel of an aborted park as "Parked" goes away with it. Found in review of #323; the mid-park :Q# path was untested there. Co-Authored-By: Claude Code <noreply@anthropic.com>
ClutchplateDude
left a comment
There was a problem hiding this comment.
Completed the review of this PR (on top of the rebase onto #322). The core design holds up under deep tracing: bit 0 was free, all STATUS_PARKED consumers updated, atomicity via setStatus()'s own guard, leaveParkedState() ordering ahead of motion on every path we checked (goto, :MX#, manual, drift alignment, Hall homing), and the two park bugs are real and well-measured.
Findings below. The first is already fixed on the branch (cf29867) — it needed a small change in stopSlewing(), described inline. 2–4 are follow-up material, none blocking.
cf29867 made loop()'s own setHome() cancel the park: it never got to Parked. A stop in the second leg, or of DEC alone, now cancels the park as well. Assisted by: Claude Fable 5.2
|
Thanks for the rebase and the review. The mid-park
Fix (pushed as 395fc9d):
Tested with the fix:
Two things I left alone: a single-direction stop ( |
|
Confirmed —
Agreed on the two leave-alones: the single-direction first-leg stop matching goto-abort semantics is consistent, and goto-during-park not canceling is pre-existing behavior worth its own issue rather than scope creep here. The three follow-ups as later PRs too. This is merge-ready from our side. 🤖 Posted with Claude Code Guess my Claude models are not smart enough :-) |
Problem
STATUS_PARKEDwas0, so:GX#reported "Parked" whenever no status flag was set. A mountwith tracking stopped (
:MT0#, or tracking off after a stop) read "Parked" although it was notat the park position.
Two park bugs showed up while testing:
the "already at park position" branch left
_slewingToParkset. The next slew to finish(a goto, a stopped goto, a
:MXmove) ran the "arrived at park" code again and parked themount, which cleared all status flags, tracking included.
startSlewingToHome()sets_compensateForTrackerOff.The catch-up is skipped while parking, and nothing cleared the flag. A move straight from park
then caught up the entire parked time on RA. Measured: parked 40 s, then
:MXr1000#→TRK +10142 steps (= 43 s × 235.6 steps/s on an OAE). Parked overnight, that is hours of RA.
Change
STATUS_PARKEDis now a real flag (bit 0). It is set only on arrival at the park position(
enterParkedState()) and cleared bysetStatusFlag(), or byleaveParkedState()on pathsthat move RA/DEC without setting a flag first (
startSlewing(), drift alignment).slewStatus()behaves as before for both idle and parked.enterParkedState()clears_slewingToParkand_compensateForTrackerOff(bugs 1 and 2).New option:
RA_DEC_OFF_WHEN_PARKED(default 0)When set to 1 in the local config, the RA and DEC drivers are switched off (EN high) while the
mount is parked, and back on before anything moves. This is for OAM and OAE only: their gearboxes
hold the axes without power, while an OAT would lose its position.
ConfigurationValidation.hpprefuses the option:
OAM/OAE;UART_CONNECTION_TEST_TXRX, because unparking would re-enable a driver that thetest disabled;
RP2040_SHARED_EN_PIN).Behaviour change for clients
A stopped mount no longer reports "Parked". With
TRACK_ON_BOOT 0, a freshly booted mount nowreports "Idle" instead of "Parked".
Testing
OAE board (ESP32),
pio run -e oaeboardv1, LX200 over serial::hP#→ Parked,:hU#→ Tracking,:MT0#→ Idle,:MT1#→ Tracking.:Q#mid-goto, and:MXr1000#/:MXd1000#from park, end in Tracking and no longer park again.The build before the re-park fix failed these.
RA_DEC_OFF_WHEN_PARKED 1: both axes are free when parked and hold againafter unparking or after a move from park.
RA_DEC_OFF_WHEN_PARKED 1builds on the OAE.
🤖 Generated with Claude Code