Skip to content

Commit

Permalink
Merge pull request #363 from vshekar/retry-mount-if-dewar-not-in-posi…
Browse files Browse the repository at this point in the history
…tion

Retry mount during auto collection
  • Loading branch information
vshekar authored Mar 8, 2024
2 parents ddaaa4d + af95c0f commit 5a3feed
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions embl_robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def preMount(self, gov_robot, puckPos, pinPos, sampID, **kwargs):
rotCP = beamline_lib.motorPosFromDescriptor("dewarRot")
logger.info("dewar target,CP")
logger.info("%s %s" % (rotMotTarget,rotCP))
if (abs(rotMotTarget-rotCP)>1):
if (abs(rotMotTarget-rotCP)>0.01):
logger.info("rot dewar")
try:
if (init == 0):
Expand Down Expand Up @@ -300,13 +300,18 @@ def mount(self, gov_robot, puckPos,pinPos,sampID,**kwargs):
daq_macros.disableMount()
daq_lib.gui_message(e_s + ". FATAL ROBOT ERROR - CALL STAFF! robotOff() executed.")
return MOUNT_FAILURE
if (e_s.find("tilted") != -1 or e_s.find("Load Sample Failed") != -1):
if (e_s.find("tilted") != -1 or e_s.find("Load Sample Failed") != -1 or e_s.find("Fail to calculate Pin Position") != -1):
if (getBlConfig("queueCollect") == 0):
daq_lib.gui_message(e_s + ". Try mounting again")
return MOUNT_FAILURE
else:
if (retryMountCount == 0):
retryMountCount+=1
if e_s.find("Fail to calculate Pin Position") != -1:
# This error happens when the dewar has not rotated to the correct position
# If it happens, try running the premount again
logger.info('Trying premount')
self.preMount(gov_robot, puckPos, pinPos, sampID, init=1)
mountStat = self.mount(gov_robot, puckPos,pinPos,sampID, **kwargs)
if (mountStat == MOUNT_STEP_SUCCESSFUL):
retryMountCount = 0
Expand Down

0 comments on commit 5a3feed

Please sign in to comment.