Fixes/sastt beamtime #361

Merged
holler merged 12 commits from fixes/sastt_beamtime into main 2026-11-23 17:02:55 +01:00
12 Commits
Author SHA1 Message Date
holler 7249f104dc 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
2026-11-23 16:58:21 +01:00
x12saandClaude Opus 5.5 4259268100 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
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
2026-11-16 16:06:32 +01:00
menzelandClaude Opus 5.5 f8003b773e config(smargon): take the beamline's O-motor entries (x12sa 43b2e18)
CI for csaxs_bec / test (push) Successful in 4m8s
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>
2026-11-13 16:59:52 +01:00
menzelandClaude Opus 5.5 4976b9ccba fix(smargon): stop never retargets the O-vector (OX/OY/OZ)
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>
2026-11-13 16:56:44 +01:00
menzelandClaude Opus 5.5 7c00a9918e feat(smargon): drivable O-vector motors sgox/sgoy/sgoz
CI for csaxs_bec / test (push) Successful in 4m2s
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>
2026-11-13 09:20:23 +01:00
menzelandClaude Opus 5.5 3f76dfaef1 fix(smargon): OZ is an O-vector length in mm, not deg
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>
2026-11-13 09:20:23 +01:00
menzelandClaude Opus 5.5 3a3c52093b fix(jfj-client): treat wait_till_done HTTP 500 as idle when the broker is Idle
CI for csaxs_bec / test (push) Successful in 3m47s
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>
2026-11-11 10:06:46 +01:00
menzelandClaude Opus 5.5 09d201b470 fix(eiger): finish on_complete when JFJoch is Idle but wait_till_done errors
CI for csaxs_bec / test (push) Successful in 3m42s
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>
2026-11-11 09:55:52 +01:00
x12saandClaude Opus 5.5 15a8773c95 config: SAXS tensor tomography beamtime setup with Aerotech stages
CI for csaxs_bec / test (push) Successful in 3m58s
- 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
2026-11-07 20:11:55 +01:00
x12saandClaude Opus 5.5 2fbd2756b0 feat(smargon): modulo option for endless rotation axes; use it for PHI
CI for csaxs_bec / test (push) Successful in 3m43s
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
2026-11-07 20:10:52 +01:00
x12saandClaude Opus 5.5 f51ac30a99 fix(a3200): recover from lost connections to the A3200 controller
CI for csaxs_bec / test (push) Successful in 8m59s
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
2026-11-07 20:08:29 +01:00
x12saandClaude Opus 5.5 81a7318457 fix(saxs-widget): drop removed theme_update kwarg
CI for csaxs_bec / test (push) Successful in 3m36s
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
2026-11-07 14:01:26 +01:00