diff --git a/src/instruments/newport/newportesp301.py b/src/instruments/newport/newportesp301.py index 0aa05f5d..136d3860 100644 --- a/src/instruments/newport/newportesp301.py +++ b/src/instruments/newport/newportesp301.py @@ -252,6 +252,7 @@ def velocity(self): @velocity.setter def velocity(self, velocity): + velocity = abs(velocity) velocity = float( assume_units(velocity, self._units / (u.s)) .to(self._units / u.s) @@ -868,11 +869,13 @@ def move_to_hardware_limit(self): """ self._newport_cmd("MT", target=self.axis_id) - def move_indefinitely(self): + def move_indefinitely(self, direction: str = "+"): """ - Move until told to stop + Move until told to stop in the direction ("+" or "-") passed. """ - self._newport_cmd("MV", target=self.axis_id) + if direction not in ("+", "-"): + raise ValueError("Direction must be '+' or '-'") + self._newport_cmd(f"MV{direction}", target=self.axis_id) def abort_motion(self): """