Added sleep time for move attempt

This commit is contained in:
2022-09-27 11:28:03 +02:00
parent 0894be1f8f
commit 60639923cb

View File

@ -247,7 +247,7 @@ class AttocubeAxis(Adjustable):
# 2. Soft epics limits
def move(self, val, relative=False, wait=True, ignore_limits=True, confirm_move=True, timeout=300.0, pos_check_delay=0.15, target_gnd=None, move_attempts = 5, verbose = False, tolerance=0.3):
def move(self, val, relative=False, wait=True, ignore_limits=True, confirm_move=True, timeout=300.0, pos_check_delay=0.15, target_gnd=None, move_attempts = 5, move_attempt_sleep=4, verbose = False, tolerance=0.3):
"""
moves Attocube drive to position (emulating pyepics Motor class)
@ -259,8 +259,9 @@ class AttocubeAxis(Adjustable):
ignore_limits try move without regard to limits (no epics limits implemented yet) (T/F) [T]
confirm_move try to confirm that move has begun (T/F) [F]
timeout max time for move to complete (in seconds) [300]
pos_check_delay delay before checkig motor in position (in seconds) [0.1]
pos_check_delay delay before checkig motor in position (in seconds) [0.15]
move_attempts how many times should the move be attempted if not in limits (attocube often needs to be poked a few times for the last 1um) [5]
move_attempt_sleep how long to wait before another move poke attept is done (in seconds) [4]
tolerance when to consider target destination reached (in microns) [0.3]
return values:
@ -348,7 +349,7 @@ class AttocubeAxis(Adjustable):
if verbose:
print(f'move attempt: {attempt+1}')
self.pvs.move.put(1, wait=True)
time.sleep(2)
time.sleep(move_attempt_sleep)
if self.is_at_target(tolerance=tolerance):
if verbose:
print(f'Move finished. Had to poke the cube {attempt+1} times to get there though.')