From cf0157a096f9e91cd82270cb69bad43c9b04ee02 Mon Sep 17 00:00:00 2001 From: menzel Date: Fri, 13 Nov 2026 08:45:31 +0100 Subject: [PATCH 1/4] 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 --- csaxs_bec/devices/smargon/transport/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/csaxs_bec/devices/smargon/transport/base.py b/csaxs_bec/devices/smargon/transport/base.py index 530d42a6..cd017100 100644 --- a/csaxs_bec/devices/smargon/transport/base.py +++ b/csaxs_bec/devices/smargon/transport/base.py @@ -17,6 +17,8 @@ smargopolo runs the kinematics; we drive the *virtual* SmarGon Coordinate System * **SCS** -- the user axes: ``SHX SHY SHZ OMEGA CHI PHI OX OY OZ`` (mm and deg). Settable via ``/targetSCS`` (+ ``/targetSCS_rel``), read via ``/readbackSCS``. + ``OX OY OZ`` are the O-vector (offset) components, a length in mm like ``SH*``; + ``/nudgeOBCS`` shifts the same vector in the beamline frame. * **MCS** -- the raw motor positions ``q1..q6``, read-only via ``/readbackMCS`` (diagnostics only; we never command them directly). * **BCS** -- beamline-frame nudges ``BX BY BZ`` via ``/nudgeBCS`` / ``/nudgeOBCS`` @@ -98,7 +100,7 @@ AXIS_INFO: dict[Axis, AxisLimits] = { Axis.PHI: AxisLimits(egu="deg"), Axis.OX: AxisLimits(egu="mm"), Axis.OY: AxisLimits(egu="mm"), - Axis.OZ: AxisLimits(egu="deg"), + Axis.OZ: AxisLimits(egu="mm"), # O-vector component (mm), not an angle } -- 2.54.0 From 4581609997d964a49df556633db833a8d7370766 Mon Sep 17 00:00:00 2001 From: menzel Date: Fri, 13 Nov 2026 08:45:31 +0100 Subject: [PATCH 2/4] feat(smargon): drivable O-vector motors sgox/sgoy/sgoz 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 --- csaxs_bec/device_configs/smargon.yaml | 32 ++++++++++++- .../device_configs/smargon_sim_session.yaml | 33 ++++++++++++- csaxs_bec/devices/smargon/README.md | 12 ++++- csaxs_bec/devices/smargon/positioner.py | 2 +- tests/tests_devices/test_smargon_device.py | 47 +++++++++++++++++++ 5 files changed, 121 insertions(+), 5 deletions(-) diff --git a/csaxs_bec/device_configs/smargon.yaml b/csaxs_bec/device_configs/smargon.yaml index fe004d1e..1a562bd9 100644 --- a/csaxs_bec/device_configs/smargon.yaml +++ b/csaxs_bec/device_configs/smargon.yaml @@ -6,7 +6,7 @@ # host/port so they share the controller. # # The motor NAME (the top-level key: sgx, sgchi, ...) is yours to choose. The -# `scs_axis` field binds it to the fixed smargopolo axis (SHX/SHY/SHZ/CHI/PHI/OMEGA). +# `scs_axis` field binds it to the fixed smargopolo axis (SHX/SHY/SHZ/CHI/PHI/OMEGA/OX/OY/OZ). # # Referencing is a deliberate operator action: after loading, run once # dev.smargon.reference() # (or dev.sgx.controller.reference()) @@ -75,6 +75,36 @@ sgphi: onFailure: retry readoutPriority: baseline +# --- O-vector (SCS offset vector OX/OY/OZ, mm) ------------------------------------ +# Drivable like any SCS axis and recorded in the baseline. No soft limits by default +# (smargopolo enforces the real ones) -- add `limits: [low, high]` per experiment. +sgox: + description: SmarGon OX (offset vector) + deviceClass: csaxs_bec.devices.smargon.positioner.SmargopoloMotor + deviceConfig: {scs_axis: OX, host: tt-smargopolo, port: 3000, tolerance: 0.001} + deviceTags: [goniometer, smargon] + enabled: true + onFailure: retry + readoutPriority: baseline + +sgoy: + description: SmarGon OY (offset vector) + deviceClass: csaxs_bec.devices.smargon.positioner.SmargopoloMotor + deviceConfig: {scs_axis: OY, host: tt-smargopolo, port: 3000, tolerance: 0.001} + deviceTags: [goniometer, smargon] + enabled: true + onFailure: retry + readoutPriority: baseline + +sgoz: + description: SmarGon OZ (offset vector) + deviceClass: csaxs_bec.devices.smargon.positioner.SmargopoloMotor + deviceConfig: {scs_axis: OZ, host: tt-smargopolo, port: 3000, tolerance: 0.001} + deviceTags: [goniometer, smargon] + enabled: true + onFailure: retry + readoutPriority: baseline + # --- Optional OMEGA rotation drive (only on builds that have it) ------------------- # sgomega: # description: SmarGon OMEGA (rotation drive) diff --git a/csaxs_bec/device_configs/smargon_sim_session.yaml b/csaxs_bec/device_configs/smargon_sim_session.yaml index d04fed72..09be0d87 100644 --- a/csaxs_bec/device_configs/smargon_sim_session.yaml +++ b/csaxs_bec/device_configs/smargon_sim_session.yaml @@ -1,6 +1,7 @@ # Self-contained laptop test session for the SmarGon device (SIMULATION). # -# Per-axis motors (dev.sgx, dev.sgy, dev.sgz, dev.sgchi, dev.sgphi, dev.sgomega) + +# Per-axis motors (dev.sgx, dev.sgy, dev.sgz, dev.sgchi, dev.sgphi, dev.sgox/sgoy/sgoz, +# optional dev.sgomega) + # a `smargon` coordinator, all sharing one simulated controller, plus a sim monitor # so scans record data. No smargopolo server / hardware needed. # @@ -102,6 +103,36 @@ sgphi: onFailure: retry readoutPriority: baseline +# --- O-vector (SCS offset vector OX/OY/OZ, mm) ------------------------------------ +# Drivable like any SCS axis and recorded in the baseline. No soft limits by default +# (smargopolo enforces the real ones) -- add `limits: [low, high]` per experiment. +sgox: + description: SmarGon OX (offset vector, sim) + deviceClass: csaxs_bec.devices.smargon.positioner.SmargopoloMotor + deviceConfig: {scs_axis: OX, simulation: true, gradual_motion: true, tolerance: 0.001} + deviceTags: [goniometer, smargon, simulation] + enabled: true + onFailure: retry + readoutPriority: baseline + +sgoy: + description: SmarGon OY (offset vector, sim) + deviceClass: csaxs_bec.devices.smargon.positioner.SmargopoloMotor + deviceConfig: {scs_axis: OY, simulation: true, gradual_motion: true, tolerance: 0.001} + deviceTags: [goniometer, smargon, simulation] + enabled: true + onFailure: retry + readoutPriority: baseline + +sgoz: + description: SmarGon OZ (offset vector, sim) + deviceClass: csaxs_bec.devices.smargon.positioner.SmargopoloMotor + deviceConfig: {scs_axis: OZ, simulation: true, gradual_motion: true, tolerance: 0.001} + deviceTags: [goniometer, smargon, simulation] + enabled: true + onFailure: retry + readoutPriority: baseline + # sgomega: # description: SmarGon OMEGA (sim) # deviceClass: csaxs_bec.devices.smargon.positioner.SmargopoloMotor diff --git a/csaxs_bec/devices/smargon/README.md b/csaxs_bec/devices/smargon/README.md index ccac97e6..817a5393 100644 --- a/csaxs_bec/devices/smargon/README.md +++ b/csaxs_bec/devices/smargon/README.md @@ -34,8 +34,13 @@ poll-to-tolerance moves), since both wrap a non-EPICS, poll-to-confirm HTTP back - **One motor per axis**, top-level: the YAML key is the BEC name (**you choose it**: `sgx`, `sgchi`, …); a `scs_axis:` field binds it to the fixed smargopolo axis name - (`SHX/SHY/SHZ/CHI/PHI/OMEGA`). OMEGA is optional hardware — add a motor entry only on - builds that have it. + (`SHX/SHY/SHZ/CHI/PHI/OMEGA/OX/OY/OZ`). OMEGA is optional hardware — add a motor entry + only on builds that have it. +- **O-vector motors** `sgox/sgoy/sgoz` drive the SCS offset vector `OX/OY/OZ` (all mm). + They are ordinary motors (`umv`, scans, baseline readout), so the offset is recorded + with every scan. They have no soft limits by default; set `limits` per experiment. + `nudge_beamline(modify_offset=True)` (`/nudgeOBCS`) also changes them; their readback + catches up on the next read. - **`dev.smargon`** — the coordinator: `reference()`, `get_mode()`, `is_ready()`, `wait_until_ready()`, `move_scs(...)`, `nudge_beamline(...)`, `motor_positions()`, `stop_all()`, `transport_info()`, plus read-only `mode`/`rosout` signals. @@ -120,4 +125,7 @@ All run against `FakeTransport` — no hardware or server needed. `rosout` carries the reason), so the abort path is dependable. - **PHI wrap**: the MX-lab reference client wraps PHI to `[-180,180)` before sending. Confirm whether smargopolo wraps server-side, or whether the motor should. +- **O-vector semantics**: confirm what `OX/OY/OZ` represent physically, whether + changing them moves the sample (or only re-expresses `SH*`), sensible travel ranges, + and that `OZ` is in mm (the API example shows `OZ: 300.0`, the example client 180). - *(resolved)* OMEGA is drivable via `/targetSCS` wherever it physically exists. diff --git a/csaxs_bec/devices/smargon/positioner.py b/csaxs_bec/devices/smargon/positioner.py index c48361ea..5fab4bc1 100644 --- a/csaxs_bec/devices/smargon/positioner.py +++ b/csaxs_bec/devices/smargon/positioner.py @@ -1,7 +1,7 @@ """Per-axis SmarGon motor -- a top-level BEC device for one SCS axis. ``SmargopoloMotor`` is an independent ophyd positioner (``Device`` + -``PositionerBase``): each SCS axis (SHX/SHY/SHZ/CHI/PHI/OMEGA) is its own top-level +``PositionerBase``): each SCS axis (SHX/SHY/SHZ/CHI/PHI/OMEGA/OX/OY/OZ) is its own top-level BEC motor, exactly like the ``smaract`` motors. It talks to hardware only through a shared :class:`~csaxs_bec.devices.smargon.controller.SmargopoloController` (singleton per smargopolo server), so ``dev.sgx`` and ``dev.sgchi`` pointing at the same host diff --git a/tests/tests_devices/test_smargon_device.py b/tests/tests_devices/test_smargon_device.py index d05f2fb5..7a3fd832 100644 --- a/tests/tests_devices/test_smargon_device.py +++ b/tests/tests_devices/test_smargon_device.py @@ -266,3 +266,50 @@ def test_monitor_stops_with_the_last_axis_and_can_be_disabled(): off = _motor("sgz", "SHZ", monitor_interval=0) assert off.controller._monitor_thread is None off.destroy() + + +# -- O-vector (OX/OY/OZ) motors ---------------------------------------------- + + +@pytest.mark.parametrize("axis", ["OX", "OY", "OZ"]) +def test_o_vector_axes_are_mm_motors(axis): + m = _motor(f"sgo{axis[1].lower()}", axis) + assert m.egu == "mm" + assert m.limits == (0.0, 0.0) # unbounded unless configured + + +def test_o_vector_initial_readback_and_record(): + sgoz = _motor("sgoz", "OZ") + assert sgoz.position == pytest.approx(180.0) # fake's home O-vector + assert sgoz.read()["sgoz"]["value"] == pytest.approx(180.0) + + +def test_o_vector_move_and_limits(): + coord = _coordinator() + sgox = _motor("sgox", "OX", limits=[-1, 1]) + sgoz = _motor("sgoz", "OZ") + coord.reference() + sgox.move(0.25, wait=True) + sgoz.move(200.0, wait=True) + assert sgox.position == pytest.approx(0.25) + assert sgoz.position == pytest.approx(200.0) + with pytest.raises(LimitError): + sgox.move(5.0) + + +def test_o_vector_move_refused_until_referenced(): + sgoy = _motor("sgoy", "OY") + with pytest.raises(SmargopoloModeError): + sgoy.move(0.1) + + +def test_move_scs_includes_o_vector(): + coord = _coordinator() + sgx = _motor("sgx", "SHX") + sgoy = _motor("sgoy", "OY", limits=[-1, 1]) + coord.reference() + coord.move_scs(SHX=0.1, OY=-0.4, wait=True) + assert sgx.position == pytest.approx(0.1) + assert sgoy.position == pytest.approx(-0.4) + with pytest.raises(LimitError): + coord.move_scs(OY=3.0) -- 2.54.0 From fd90fee19f8e79114238917fbeafe943809b2b19 Mon Sep 17 00:00:00 2001 From: menzel Date: Fri, 13 Nov 2026 16:56:43 +0100 Subject: [PATCH 3/4] 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 --- csaxs_bec/devices/smargon/README.md | 2 + .../devices/smargon/transport/__init__.py | 2 + csaxs_bec/devices/smargon/transport/base.py | 15 ++++++- csaxs_bec/devices/smargon/transport/fake.py | 5 +-- csaxs_bec/devices/smargon/transport/rest.py | 8 +++- tests/tests_devices/test_smargon_device.py | 14 +++++- tests/tests_devices/test_smargon_transport.py | 45 +++++++++++++++++++ 7 files changed, 84 insertions(+), 7 deletions(-) diff --git a/csaxs_bec/devices/smargon/README.md b/csaxs_bec/devices/smargon/README.md index 817a5393..a067bd75 100644 --- a/csaxs_bec/devices/smargon/README.md +++ b/csaxs_bec/devices/smargon/README.md @@ -120,6 +120,8 @@ All run against `FakeTransport` — no hardware or server needed. - **Stop semantics**: no explicit stop endpoint; we retarget axes to their readback ("Follow Target" halt). Confirm this is the intended way to abort a move. + The O-vector (`OX/OY/OZ`) is never retargeted by a stop: its readback fluctuates, + so writing it back would shift the offset on every stop (`STOP_EXCLUDED_AXES`). - **Mid-move fault signal**: we infer faults from `Mode.ERROR`. Confirm an out-of-range / coupled-limit violation reliably drives `/mode` to 99 (and that `rosout` carries the reason), so the abort path is dependable. diff --git a/csaxs_bec/devices/smargon/transport/__init__.py b/csaxs_bec/devices/smargon/transport/__init__.py index 1dd3cf7e..b379a49d 100644 --- a/csaxs_bec/devices/smargon/transport/__init__.py +++ b/csaxs_bec/devices/smargon/transport/__init__.py @@ -14,6 +14,7 @@ from .base import ( BeamlineAxis, Mode, SmargopoloInfo, + STOP_EXCLUDED_AXES, SmargopoloTransport, ) from .errors import ( @@ -36,6 +37,7 @@ __all__ = [ "MOTOR_CHANNELS", "SmargopoloInfo", "SmargopoloTransport", + "STOP_EXCLUDED_AXES", "FakeTransport", "RestTransport", "SmargopoloTransportError", diff --git a/csaxs_bec/devices/smargon/transport/base.py b/csaxs_bec/devices/smargon/transport/base.py index cd017100..c18a3f08 100644 --- a/csaxs_bec/devices/smargon/transport/base.py +++ b/csaxs_bec/devices/smargon/transport/base.py @@ -103,6 +103,17 @@ AXIS_INFO: dict[Axis, AxisLimits] = { Axis.OZ: AxisLimits(egu="mm"), # O-vector component (mm), not an angle } +# Axes a stop never retargets. Stop works by writing the current readback back as +# the target; the O-vector readback fluctuates, so doing that would shift the offset +# on every stop. Stopping only the moving SCS axes is enough to halt the sample. +STOP_EXCLUDED_AXES: frozenset[Axis] = frozenset({Axis.OX, Axis.OY, Axis.OZ}) + + +def axes_to_stop(axes) -> list[Axis]: + """The axes a stop request may retarget: *axes* (or all) minus STOP_EXCLUDED_AXES.""" + chosen = list(Axis) if axes is None else [Axis(a) for a in axes] + return [a for a in chosen if a not in STOP_EXCLUDED_AXES] + @dataclass class SmargopoloInfo: @@ -197,7 +208,9 @@ class SmargopoloTransport(abc.ABC): smargopolo exposes no explicit stop endpoint; in ``Mode.READY`` ("Follow Target") setting the target equal to the current readback brings the axis - to rest. Best-effort: must not raise during teardown. + to rest. Axes in :data:`STOP_EXCLUDED_AXES` (the O-vector) are never + retargeted, even when named explicitly. Best-effort: must not raise during + teardown. """ # -- diagnostics ------------------------------------------------------- diff --git a/csaxs_bec/devices/smargon/transport/fake.py b/csaxs_bec/devices/smargon/transport/fake.py index 7fcc1e40..9889e431 100644 --- a/csaxs_bec/devices/smargon/transport/fake.py +++ b/csaxs_bec/devices/smargon/transport/fake.py @@ -29,6 +29,7 @@ from .base import ( Mode, SmargopoloInfo, SmargopoloTransport, + axes_to_stop, ) from .errors import SmargopoloModeError @@ -198,9 +199,7 @@ class FakeTransport(SmargopoloTransport): def stop(self, axes: list[Axis] | None = None) -> None: self._record("stop") - chosen = list(axes) if axes is not None else list(Axis) - for axis in chosen: - axis = Axis(axis) + for axis in axes_to_stop(axes): if self._gradual: self._settle(axis) self._targets[axis] = self._positions[axis] diff --git a/csaxs_bec/devices/smargon/transport/rest.py b/csaxs_bec/devices/smargon/transport/rest.py index 507adffc..1df32cb8 100644 --- a/csaxs_bec/devices/smargon/transport/rest.py +++ b/csaxs_bec/devices/smargon/transport/rest.py @@ -28,6 +28,7 @@ from .base import ( Mode, SmargopoloInfo, SmargopoloTransport, + axes_to_stop, ) from .errors import ( SmargopoloCommandError, @@ -167,12 +168,15 @@ class RestTransport(SmargopoloTransport): def stop(self, axes: list[Axis] | None = None) -> None: # Retarget the chosen axes to their current readback: in "Follow Target" - # mode this halts them. Best-effort -- never raise. + # mode this halts them. The O-vector is never retargeted (see + # STOP_EXCLUDED_AXES). Best-effort -- never raise. + chosen = axes_to_stop(axes) + if not chosen: + return try: positions = self.get_positions() except Exception: # pylint: disable=broad-except return - chosen = list(axes) if axes is not None else list(positions) targets = {a: positions[a] for a in chosen if a in positions} if not targets: return diff --git a/tests/tests_devices/test_smargon_device.py b/tests/tests_devices/test_smargon_device.py index 7a3fd832..6ee9fce1 100644 --- a/tests/tests_devices/test_smargon_device.py +++ b/tests/tests_devices/test_smargon_device.py @@ -7,7 +7,7 @@ import pytest from ophyd.utils import LimitError, ReadOnlyError from csaxs_bec.devices.smargon import SmarGon, SmargopoloController, SmargopoloMotor -from csaxs_bec.devices.smargon.transport import FakeTransport, Mode +from csaxs_bec.devices.smargon.transport import Axis, FakeTransport, Mode from csaxs_bec.devices.smargon.transport.errors import SmargopoloCommandError, SmargopoloModeError @@ -313,3 +313,15 @@ def test_move_scs_includes_o_vector(): assert sgoy.position == pytest.approx(-0.4) with pytest.raises(LimitError): coord.move_scs(OY=3.0) + + +def test_stop_all_and_o_motor_stop_leave_o_vector_untouched(): + coord = _coordinator() + sgox = _motor("sgox", "OX") + coord.reference() + transport = coord.controller.transport + transport._targets[Axis.OX] = 2.0 + coord.stop_all() + sgox.stop() + assert transport._targets[Axis.OX] == pytest.approx(2.0) + assert sgox.motor_is_moving.get() == 0 diff --git a/tests/tests_devices/test_smargon_transport.py b/tests/tests_devices/test_smargon_transport.py index 8aba62c6..02723ec2 100644 --- a/tests/tests_devices/test_smargon_transport.py +++ b/tests/tests_devices/test_smargon_transport.py @@ -80,3 +80,48 @@ def test_gradual_motion_advances_over_time(): assert t.get_position(Axis.SHX) == pytest.approx(50.0) clock["t"] = 5.0 assert t.get_position(Axis.SHX) == pytest.approx(100.0) + + +# -- stop leaves the O-vector alone ----------------------------------------- + + +class _RecordingRest: + """A RestTransport with HTTP replaced: canned readback, PUTs recorded.""" + + def __new__(cls): + from csaxs_bec.devices.smargon.transport import RestTransport + + t = RestTransport.__new__(RestTransport) + t.puts = [] + readback = {a.value: float(i) for i, a in enumerate(Axis)} + t._get = lambda resource: dict(readback) + t._put = lambda resource, params: t.puts.append((resource, dict(params))) or {} + return t + + +def test_rest_stop_all_never_writes_o_vector(): + t = _RecordingRest() + t.stop(None) + [(resource, params)] = t.puts + assert resource == "targetSCS" + assert not {"OX", "OY", "OZ"} & set(params) + assert {"SHX", "SHY", "SHZ", "CHI", "PHI"} <= set(params) + + +def test_rest_stop_of_o_axis_sends_nothing(): + t = _RecordingRest() + t.stop([Axis.OX, Axis.OZ]) + assert t.puts == [] + + +def test_rest_stop_mixed_axes_keeps_only_non_o(): + t = _RecordingRest() + t.stop([Axis.SHX, Axis.OY]) + assert t.puts == [("targetSCS", {"SHX": float(list(Axis).index(Axis.SHX))})] + + +def test_fake_stop_all_leaves_o_targets(transport): + transport.set_mode(Mode.REFERENCING) + transport._targets[Axis.OX] = 1.5 # pending O target, readback still 0 + transport.stop(None) + assert transport._targets[Axis.OX] == pytest.approx(1.5) -- 2.54.0 From 9a765b52fe6343a93cabcce2b436054e9d87ad8a Mon Sep 17 00:00:00 2001 From: menzel Date: Fri, 13 Nov 2026 17:03:20 +0100 Subject: [PATCH 4/4] config(smargon): O-motor entries as used at the beamline (limits [-2, 2]) Match the sgox/sgoy/sgoz entries committed on x12sa-bec-001 (43b2e18), so merging fixes/sastt_beamtime into main later does not conflict here. Co-Authored-By: Claude Opus 5.5 --- csaxs_bec/device_configs/smargon.yaml | 17 ++++++++--------- csaxs_bec/devices/smargon/README.md | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/csaxs_bec/device_configs/smargon.yaml b/csaxs_bec/device_configs/smargon.yaml index 1a562bd9..a7c9bcb0 100644 --- a/csaxs_bec/device_configs/smargon.yaml +++ b/csaxs_bec/device_configs/smargon.yaml @@ -75,36 +75,35 @@ sgphi: onFailure: retry readoutPriority: baseline -# --- O-vector (SCS offset vector OX/OY/OZ, mm) ------------------------------------ -# Drivable like any SCS axis and recorded in the baseline. No soft limits by default -# (smargopolo enforces the real ones) -- add `limits: [low, high]` per experiment. sgox: - description: SmarGon OX (offset vector) + description: SmarGon OX deviceClass: csaxs_bec.devices.smargon.positioner.SmargopoloMotor - deviceConfig: {scs_axis: OX, host: tt-smargopolo, port: 3000, tolerance: 0.001} + deviceConfig: {scs_axis: OX, host: tt-smargopolo, port: 3000, limits: [-2, 2], tolerance: 0.001} deviceTags: [goniometer, smargon] enabled: true onFailure: retry readoutPriority: baseline sgoy: - description: SmarGon OY (offset vector) + description: SmarGon OY deviceClass: csaxs_bec.devices.smargon.positioner.SmargopoloMotor - deviceConfig: {scs_axis: OY, host: tt-smargopolo, port: 3000, tolerance: 0.001} + deviceConfig: {scs_axis: OY, host: tt-smargopolo, port: 3000, limits: [-2, 2], tolerance: 0.001} deviceTags: [goniometer, smargon] enabled: true onFailure: retry readoutPriority: baseline sgoz: - description: SmarGon OZ (offset vector) + description: SmarGon OZ deviceClass: csaxs_bec.devices.smargon.positioner.SmargopoloMotor - deviceConfig: {scs_axis: OZ, host: tt-smargopolo, port: 3000, tolerance: 0.001} + deviceConfig: {scs_axis: OZ, host: tt-smargopolo, port: 3000, limits: [-2, 2], tolerance: 0.001} deviceTags: [goniometer, smargon] enabled: true onFailure: retry readoutPriority: baseline + + # --- Optional OMEGA rotation drive (only on builds that have it) ------------------- # sgomega: # description: SmarGon OMEGA (rotation drive) diff --git a/csaxs_bec/devices/smargon/README.md b/csaxs_bec/devices/smargon/README.md index a067bd75..0037b993 100644 --- a/csaxs_bec/devices/smargon/README.md +++ b/csaxs_bec/devices/smargon/README.md @@ -38,7 +38,7 @@ poll-to-tolerance moves), since both wrap a non-EPICS, poll-to-confirm HTTP back only on builds that have it. - **O-vector motors** `sgox/sgoy/sgoz` drive the SCS offset vector `OX/OY/OZ` (all mm). They are ordinary motors (`umv`, scans, baseline readout), so the offset is recorded - with every scan. They have no soft limits by default; set `limits` per experiment. + with every scan. The beamline config gives them `limits: [-2, 2]`; adjust per experiment. `nudge_beamline(modify_offset=True)` (`/nudgeOBCS`) also changes them; their readback catches up on the next read. - **`dev.smargon`** — the coordinator: `reference()`, `get_mode()`, `is_ready()`, -- 2.54.0