Fixes/sastt beamtime #361

Merged
holler merged 12 commits from fixes/sastt_beamtime into main 2026-11-23 17:02:55 +01:00
Member
No description provided.
holler added 11 commits 2026-11-23 16:58:09 +01:00
fix(saxs-widget): drop removed theme_update kwarg
CI for csaxs_bec / test (push) Successful in 3m36s
81a7318457
bec_widgets removed the theme_update kwarg from BECWidget (3fb35882);
every BECWidget now follows theme changes. Passing it fell through to
QWidget.__init__ and raised "'theme_update' is not a Qt property or a
signal", so the SAXS widget could not be opened.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M8zoDzRrboFFDabqB9bLNZ
fix(a3200): recover from lost connections to the A3200 controller
CI for csaxs_bec / test (push) Successful in 8m59s
f51ac30a99
The controller connection was opened once and never re-opened: after the
peer stopped answering, every command failed (TimeoutError, then
BrokenPipeError once the kernel gave up) until a config reload.

- drop the connection on send/receive errors, reply timeouts and
  out-of-step replies; the next command opens a new one (a deliberate
  off() is respected)
- retry repeatable operations (status reads, PSO window, DATAACQ arm/off,
  array readout, ENABLE/ABORT/RAMP ...) over fresh connections for up to
  comm_recovery_timeout (60 s)
- a MOVEABS whose delivery is unknown is only resent if the axis is
  neither moving nor at the target
- the move watcher finishes the move status on errors instead of dying
  and leaving it pending
- socket read timeouts no longer bypass the reply timeout and the stale
  rx buffer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M8zoDzRrboFFDabqB9bLNZ
With `modulo`, requested positions are taken modulo this value and the
axis always moves the shortest way (350 -> 10 moves +20, not -340). The
readback is shown wrapped into [-modulo/2, modulo/2) while the raw
smargopolo position may grow freely.

sgphi uses `modulo: 360` instead of `limits: [-180, 180]` in smargon.yaml
and smargon_sim_session.yaml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M8zoDzRrboFFDabqB9bLNZ
config: SAXS tensor tomography beamtime setup with Aerotech stages
CI for csaxs_bec / test (push) Successful in 3m58s
15a8773c95
- main.yaml: load xeye, sastt (sastt_aerotech) and smargon; lamni off
- sastt_aerotech.yaml: add cam_sample (IDS camera, camera_id 1, transposed)
- bl_detectors.yaml: use the Eiger 9M (distance 6975.225, beam centre
  [1149.71, 1450.89]) instead of the Eiger 1.5M

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M8zoDzRrboFFDabqB9bLNZ
After a collection that ends with a broker error (e.g. "Missing packets in
data collection; reduce frame rate"), JFJoch's /wait_till_done answers
HTTP 500 with that message on every call although the broker is already
Idle. wait_for_idle() then always returned False, so on_complete spun
(logging one error per call) until _wait_for_on_complete and raised a
TimeoutError. The missing-packet tolerance was never reached, and the scan
failed even with raise_on_missing_packets=False (S00985, 2026-11-11, with
10/10 images written).

Now a failing wait_for_idle is followed by a broker-state check: if the
broker is Idle, the usual message and frame-count checks decide the
outcome. While it is still busy, the loop waits 0.2 s between attempts
instead of retrying immediately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous fix only covered on_complete. At the beamline the scan with
packet loss then completed (S00998), but the next one failed in on_stage
(S00999): on_stage calls wait_for_idle() with raise_on_timeout=True, and
/wait_till_done keeps answering HTTP 500 "Missing packets in data
collection; reduce frame rate" until the next collection starts, although
the broker is Idle.

wait_for_idle() now checks the broker state when /wait_till_done raises a
ServiceException and returns True if it is Idle. This covers every caller
(on_stage, on_complete, initialise). The broker message stays available
through jfj_status, so on_complete still applies the missing-packet policy
and the image-count check. on_complete no longer needs its own state
check; it keeps the 0.2 s pause between failed attempts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OX/OY/OZ are components of the SCS offset vector, which /nudgeOBCS shifts
in mm along the beamline axes; the API example reports OZ: 300.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(smargon): drivable O-vector motors sgox/sgoy/sgoz
CI for csaxs_bec / test (push) Successful in 4m2s
7c00a9918e
Add SmargopoloMotor entries for OX/OY/OZ to the beamline and sim configs
(baseline readout, no default soft limits), document them, and test
single-axis moves, limits, the READY gate and move_scs with O axes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stop halts axes by writing their current readback back as the target. The
O-vector readback fluctuates, so stop_all (and BEC's stop on sgox/sgoy/sgoz)
shifted the offset by a random amount on every stop. Exclude OX/OY/OZ from
stop in both transports; stopping an O motor now only ends BEC's wait.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use the sgox/sgoy/sgoz entries as committed locally on x12sa-bec-001
(limits [-2, 2]) so production can drop its local commit and pull.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(smargon): stop only the moving axes on Ctrl-C and scan abort
CI for csaxs_bec / test (push) Successful in 4m5s
CI for csaxs_bec / test (pull_request) Successful in 4m2s
4259268100
smargopolo has no stop endpoint; an axis is halted by setting its target
to its readback. Stopping a motor retargeted its axis even when idle, and
the coordinator's on_stop retargeted all SCS axes on every scan abort, so
readback noise and kinematics round-off accumulated in the targets of idle
axes.

The controller now tracks the absolute moves commanded by BEC until they
finish. stop_moving() retargets only those axes whose readback is not yet
within tolerance of the target, in one request; all other targets stay
untouched and nothing is sent if no axis moves. The O-vector is still
never retargeted (STOP_EXCLUDED_AXES); a stop only ends BEC's wait for it.
Motor stop() and the coordinator's on_stop use stop_moving(); an axis
halted via the coordinator now ends its move status immediately instead
of timing out. stop_all() still retargets every non-O axis as an explicit
command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M8zoDzRrboFFDabqB9bLNZ
holler added 1 commit 2026-11-23 16:58:22 +01:00
Merge branch 'main' into fixes/sastt_beamtime
CI for csaxs_bec / test (push) Successful in 4m19s
CI for csaxs_bec / test (pull_request) Successful in 4m21s
7249f104dc
holler merged commit 5ea5bd864f into main 2026-11-23 17:02:55 +01:00
holler deleted branch fixes/sastt_beamtime 2026-11-23 17:02:55 +01:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bec/csaxs_bec#361