rt movement possible. added slew rate limiter querry to rt communication

This commit is contained in:
Holler Mirko
2024-09-27 13:54:47 +02:00
committed by wakonig_k
parent d2e4a8c703
commit af2a2df55f
2 changed files with 18 additions and 7 deletions

View File

@@ -47,6 +47,7 @@ class RtFlomniController(Controller):
"read_ssi_interferometer",
"laser_tracker_check_signalstrength",
"laser_tracker_check_enabled",
"is_axis_moving",
]
def __init__(

View File

@@ -100,10 +100,10 @@ class RtOMNYController(Controller):
self._min_scan_buffer_reached = False
self.switchbox_socket = socket.socket()
def is_axis_moving(self, axis_Id) -> bool:
# this checks that axis is on target
axis_is_on_target = bool(float(self.socket_put_and_receive("o")))
return not axis_is_on_target
# def is_axis_moving(self, axis_Id) -> bool:
# # this checks that axis is on target
# axis_is_on_target = bool(float(self.socket_put_and_receive("o")))
# return not axis_is_on_target
@threadlocked
def stop_all_axes(self):
@@ -149,7 +149,12 @@ class RtOMNYController(Controller):
"ssi_5": status_and_ssi_values[5],
}
def slew_rate_limiters_on_target(self) -> bool:
ret = int(float(self.socket_put_and_receive("y").strip()))
if ret == 1:
return True
return False
def feedback_is_running(self) -> bool:
self.feedback_get_status_and_ssi()
interferometer_feedback_not_running = int(self.ssi["feedback_error"])
@@ -164,6 +169,12 @@ class RtOMNYController(Controller):
self.move_to_zero()
if not self.slew_rate_limiters_on_target():
print("Please wait, slew rate limiters not on target.")
logger.info("Please wait, slew rate limiters not on target.")
while not self.slew_rate_limiters_on_target():
time.sleep(0.05)
self.clear_trajectory_generator()
self.laser_tracker_on()
@@ -837,8 +848,7 @@ class RtOMNYMotor(Device, PositionerBase):
self.user_setpoint.put(position, wait=False)
def move_and_finish():
# while not self.controller.slew_rate_limiters_on_target() and not self._stopped:
while not self._stopped:
while not self.controller.slew_rate_limiters_on_target() and not self._stopped:
print("motor is moving")
val = self.readback.read()
self._run_subs(sub_type=self.SUB_READBACK, value=val, timestamp=time.time())