Skip to content

acamd, slicecamd, sequencerd: correction classes; fine acquisition and the target offset wait for acamd's move - #509

Open
cfremling wants to merge 4 commits into
mainfrom
fix/acam-goal-changes
Open

cfremling wants to merge 4 commits into
mainfrom
fix/acam-goal-changes

Conversation

@cfremling

Copy link
Copy Markdown
Collaborator

Four commits, one per change. They share acamd's goal-change bookkeeping (the same lines in do_acquire and offset_goal), so they are one PR.

  1. acamd: classify guide, fine-acquire and deliberate-offset corrections (exposures taken on the offset star). A deliberate goal offset (offset star to target, put-on-slit, the GUI offset) armed a one-shot allowance that any sent correction cleared. A guide correction in flight when the offset arrived cleared it, the target offset was then refused at the 60" guiding cap, and the whole exposure was taken on the offset star (2026-08-26, 10-06, 10-19). Goal changes now carry a generation and each correction is classified by the goal it was computed against; only the correction that makes a deliberate offset may use ACQUIRE_TCS_MAX_PUTONSLIT_OFFSET.
  2. Fine acquisition waits until acamd reports the goal change made. acamd publishes goalshift_pending; slicecamd settles from the executed move instead of a 3 s timer from the send, which let a correction be measured on pre-move frames and applied twice (2026-08-06, BD+28d4211, exposed 2.6" off the slit). FINE_ACQUIRE_MOVE_TIMEOUT=60.0, FINE_ACQUIRE_SETTLE_FRAMES=0.
  3. slicecamd: fine-acquire correction budget. At most FINE_ACQUIRE_MAX_ADJUSTMENTS=3 corrections per run; the last is sent only if the offset it removes is within FINE_ACQUIRE_RELAXED_FACTOR=2.0 × goal, and the run then converges; otherwise it fails at once instead of correcting until the sequencer's timeout. FINE_ACQUIRE_SETTLE_SEC=1.
  4. sequencerd: expose once acamd has made the target offset, bounded at 30 s (then it exposes anyway, with a warning), instead of a fixed 3 s that could be before the move. OFFSET_SETTLE_SEC=0 (extra wait after the move).

Rebuild (acamd.cfg, slicecamd.cfg and sequencerd.cfg are regenerated), restart acamd, slicecamd and sequencerd.

Tested on sky using branch cf/summit-20261030 on 2026-11-03: 22 deliberate offsets and 34 fine-acquire corrections, none refused at a cap; every fine-acquire correction confirmed by acamd before the settle (no move wait timed out); the budget's last correction decided one run; acamd made the target offset 5.5–9.1 s after it was sent for all 21 offset-star targets, and no exposure was taken on an offset star.

Jira: PAL-171, PAL-166, PAL-182.

🤖 Generated with Claude Code

cfremling and others added 4 commits November 5, 2026 10:29
A deliberate goal offset (the star-to-target offset after fine
acquisition, put-on-slit, the GUI offset) armed a one-shot allowance
that any sent correction cleared. A guide correction whose blocking
pt_offset was in flight when the offset arrived cleared it as it
completed, and the next frame's correction to the new goal was refused
at the guiding cap, so the exposure was taken on the offset star. The
cap selection also required acquire_mode == TARGET_GUIDE, which is a
race of its own.

Goal changes now carry a generation, and each correction is classified
by the goal it was computed from: guide, fine-acquire, or deliberate
offset. Only a deliberate-offset correction may use the larger
ACQUIRE_TCS_MAX_PUTONSLIT_OFFSET cap, and once sent it has made the
change. A correction computed from an older goal can neither use nor
spend a newer goal's allowance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
While ACAM guides, a fine-acquire correction only re-points acamd's
goal; the guide loop applies it at its next executed correction. The
settle was timed from the send, so with short slicecam exposures the
next sample median could be built from pre-move frames and the same
correction applied twice (UT 2026-08-06, BD+28d4211: exposed 2.6 arcsec
off slit).

acamd publishes goalshift_pending: offsetgoal raises it with the goal
change, and the correction that makes the change clears it once sent,
unless a newer change arrived meanwhile; a new acquisition clears it.
slicecamd records the publish times of the latest set and clear
statuses, and do_fineacquire waits until a set status published after
its send is followed by a clear one before settling, so a short-lived
pending state cannot be missed. A stop interrupts the wait; timeout
FINE_ACQUIRE_MOVE_TIMEOUT (default 60 s, 0 disables) proceeds on the
old timer.

FINE_ACQUIRE_SETTLE_FRAMES default 2 -> 0: the wall-clock settle after
the confirmed goal change covers the move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A target that kept landing just outside the goal was corrected again and
again until the sequencer's acquisition timeout. Two slicecamd.cfg keys:

FINE_ACQUIRE_MAX_ADJUSTMENTS=<n> (default 3, 0 = previous behaviour):
at most <n> corrections are commanded in one run, and the <n>-th decides.
It is sent only if the offset it removes is within
FINE_ACQUIRE_RELAXED_FACTOR x goal, and the run converges once that move
has executed and settled; otherwise the run fails at once without
sending it. A correction acamd does not confirm within
FINE_ACQUIRE_MOVE_TIMEOUT also fails a budgeted run. Nothing is sampled
or evaluated once no correction can follow.

FINE_ACQUIRE_RELAXED_FACTOR=<f> (default 2.0, at least 1).

Also: FINE_ACQUIRE_SETTLE_SEC=1 (was 3.0) now that the settle starts when
the move has executed, and the budget's final lock writes the same
"fine acquisition converged" line as every lock, with how it locked
appended.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A target offset sent while ACAM guides only changes acamd's goal; the
guide loop's next correction makes the move. The sequencer exposed a
fixed OFFSET_SETTLE_SEC (3 s) after sending it, which could be before
the telescope had moved. It now waits until acamd's status shows the
goal change raised after the offset was sent and cleared again
(GOALSHIFT_PENDING), bounded at 30 s, after which it exposes anyway
with a warning; a cancel ends the wait. OFFSET_SETTLE_SEC is now an
extra wait after the move and defaults to 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-05T18:56:37.212780Z
We couldn’t complete this review. Comment @codex review to try again.
ffc8355 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

This branch has not been deployed

No deployments
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