Skip to content

Commit e1bd869

Browse files
committed
Fix for smargon combined moves with current slow-smargon workaround
1 parent 35e6eed commit e1bd869

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

src/dodal/devices/smargon.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from dodal.common.maths import AngleWithPhase
1818
from dodal.devices.motors import XYZOmegaStage
1919
from dodal.devices.util.epics_util import SetWhenEnabled
20-
20+
from dodal.log import LOGGER
2121

2222
class StubPosition(Enum):
2323
CURRENT_AS_CENTER = 0
@@ -123,6 +123,29 @@ async def set(self, value: CombinedMove):
123123
axes will move at the same time. The put callbacks on the axes themselves will
124124
only come back after the motion on that axis finished.
125125
"""
126+
127+
#Sticky Y motor on i03 - try to move chi before the other motors to see if this helps
128+
# issues.
129+
# Nb smargon motors also appear to be ignoring max velocity during combined moves
130+
LOGGER.info("Unwrapping target values...")
131+
for motor_name, new_setpoint in value.items():
132+
if new_setpoint is not None and isinstance(new_setpoint, int | float):
133+
mapped_value = await self._get_target_value(
134+
motor_name, new_setpoint
135+
)
136+
LOGGER.info(f"Unwrapped {motor_name} {new_setpoint} -> {mapped_value}")
137+
value[motor_name] = mapped_value
138+
139+
LOGGER.info("Doing smargon move...")
140+
if "chi" in value.keys() and value["chi"] is not None:
141+
LOGGER.info("Doing chi.set")
142+
await self.chi.set(value["chi"])
143+
LOGGER.info("Chi move done")
144+
else:
145+
LOGGER.info("Chi not moving in this smargon move")
146+
if "omega" in value.keys() and value["omega"] is not None:
147+
LOGGER.info("Doing omega set")
148+
await self.omega.set(value["omega"])
126149
await self.defer_move.set(DeferMoves.ON)
127150
# TODO Hotfix required here until https://github.com/DiamondLightSource/dodal/issues/1998
128151
# is implemented in separate PR

0 commit comments

Comments
 (0)