Optimize mount from same segment
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
wago=ch.psi.pshell.modbus.ModbusTCP|tell6s-wago:502|||
|
||||
wago=ch.psi.pshell.modbus.ModbusTCP|tell10s-wago:502|||
|
||||
led_ok_1=ch.psi.pshell.modbus.DigitalInput|wago 0||1000|
|
||||
led_ok_2=ch.psi.pshell.modbus.DigitalInput|wago 1||1000|
|
||||
led_ok_3=ch.psi.pshell.modbus.DigitalInput|wago 2||1000|
|
||||
@@ -24,8 +24,8 @@ release_psys_safety=ch.psi.pshell.modbus.DigitalOutput|wago 1|||
|
||||
#spare_do_3=ch.psi.pshell.modbus.DigitalOutput|wago 4|||
|
||||
gripper_dryer=ch.psi.pshell.modbus.DigitalOutput|wago 5|||
|
||||
smc_sup_det=ch.psi.pshell.modbus.DigitalOutput|wago 6|||
|
||||
valve_1=ch.psi.pshell.modbus.DigitalOutput|wago 7|||
|
||||
valve_2=ch.psi.pshell.modbus.DigitalOutput|wago 8|||
|
||||
valve_1=ch.psi.pshell.modbus.DigitalOutput|wago 8|||
|
||||
valve_2=ch.psi.pshell.modbus.DigitalOutput|wago 7|||
|
||||
valve_3=ch.psi.pshell.modbus.DigitalOutput|wago 9|||
|
||||
valve_4=ch.psi.pshell.modbus.DigitalOutput|wago 10|||
|
||||
dewar_level=ch.psi.pshell.modbus.ReadonlyProcessVariable|wago 0||10000|
|
||||
@@ -40,3 +40,4 @@ led_ctrl_1=ch.psi.pshell.modbus.ProcessVariable|wago 0|||
|
||||
led_ctrl_2=ch.psi.pshell.modbus.ProcessVariable|wago 1|||
|
||||
led_ctrl_3=ch.psi.pshell.modbus.ProcessVariable|wago 2|||
|
||||
smc_current=ch.psi.pshell.modbus.ProcessVariable|wago 3|||
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#Tue Jan 21 16:44:18 CET 2020
|
||||
dry_mount_counter=2
|
||||
mounted_sample_position=X16
|
||||
#Wed Mar 04 13:44:38 CET 2020
|
||||
dry_mount_counter=6
|
||||
mounted_sample_position=A25
|
||||
room_temperature_enabled=false
|
||||
pin_offset=0.0
|
||||
puck_types=true
|
||||
imaging_enabled=false
|
||||
dry_timestamp=1.569403361248E9
|
||||
dry_timestamp=1.583324556612E9
|
||||
roi_h=1000
|
||||
led_level=0.0
|
||||
beamline_status_enabled=false
|
||||
force_dry_mount_count=8
|
||||
force_dry_mount_count=10
|
||||
roi_y=124
|
||||
barcode_reader_scan_pucks=false
|
||||
cold_position_timeout=3600
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#Tue Jan 21 13:32:17 CET 2020
|
||||
FileSequentialNumber=28
|
||||
#Fri Feb 28 10:25:18 CET 2020
|
||||
FileSequentialNumber=41
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#Thu Jan 09 11:20:58 CET 2020
|
||||
#Wed Mar 04 10:29:38 CET 2020
|
||||
minValue=0.0
|
||||
unit=V
|
||||
offset=0.0
|
||||
maxValue=0.4
|
||||
maxValue=1.0
|
||||
precision=2
|
||||
sign_bit=0
|
||||
scale=3.0E-4
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#Thu Jan 09 11:20:58 CET 2020
|
||||
#Wed Mar 04 10:29:38 CET 2020
|
||||
minValue=0.0
|
||||
unit=V
|
||||
offset=0.0
|
||||
maxValue=0.4
|
||||
maxValue=1.0
|
||||
precision=2
|
||||
sign_bit=0
|
||||
scale=3.0E-4
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#Thu Jan 09 11:20:58 CET 2020
|
||||
#Wed Mar 04 10:29:38 CET 2020
|
||||
minValue=0.0
|
||||
unit=V
|
||||
offset=0.0
|
||||
maxValue=0.4
|
||||
maxValue=1.0
|
||||
precision=2
|
||||
sign_bit=0
|
||||
scale=3.0E-4
|
||||
|
||||
@@ -27,7 +27,7 @@ class RobotSC(RobotTCP):
|
||||
def __init__(self, name, server, timeout = 1000, retries = 1):
|
||||
RobotTCP.__init__(self, name, server, timeout, retries)
|
||||
self.set_tasks(["getDewar", "putDewar", "putGonio", "getGonio", "recover", "moveDewar", "moveCold", "movePark", "moveGonio","moveHeater", "moveScanner","moveHome", "moveAux"])
|
||||
self.set_known_points(["pPark", "pGonioA", "pDewar", "pGonioG", "pScan", "pHeater", "pHeat", "pHeatB", "pLaser","pHelium", "pHome", "pCold", "pAux"])
|
||||
self.set_known_points(["pPark", "pGonioA", "pDewar", "pGonioG", "pScan", "pHeater", "pHeat", "pHeatB", "pLaser","pHelium", "pHome", "pCold", "pAux","p1"])
|
||||
self.setPolling(DEFAULT_ROBOT_POLLING)
|
||||
self.last_command_timestamp = None
|
||||
self.last_command_position = None
|
||||
@@ -54,21 +54,23 @@ class RobotSC(RobotTCP):
|
||||
self.last_command_position = "home"
|
||||
self.last_command_timestamp = time.time()
|
||||
|
||||
def get_dewar(self, segment, puck, sample):
|
||||
def get_dewar(self, segment, puck, sample, mounting_in_same_segment=False):
|
||||
segment = self.toSegmentNumber(segment)
|
||||
self.start_task('getDewar',segment, puck, sample, is_room_temp())
|
||||
self.start_task('getDewar',segment, puck, sample, is_room_temp(), mounting_in_same_segment)
|
||||
self.wait_task_finished(TASK_WAIT_ROBOT_POLLING)
|
||||
self.assert_dewar()
|
||||
if not mounting_in_same_segment:
|
||||
self.assert_dewar()
|
||||
self.last_command_position = "dewar"
|
||||
self.last_command_timestamp = time.time()
|
||||
|
||||
def put_dewar(self, segment, puck, sample):
|
||||
def put_dewar(self, segment, puck, sample, mounting_in_same_segment=False):
|
||||
segment = self.toSegmentNumber(segment)
|
||||
self.assert_dewar()
|
||||
self.start_task('putDewar',segment, puck, sample, is_room_temp())
|
||||
self.start_task('putDewar',segment, puck, sample, is_room_temp(), mounting_in_same_segment)
|
||||
self.wait_task_finished(TASK_WAIT_ROBOT_POLLING)
|
||||
#self.assert_dewar()
|
||||
self.assert_cold()
|
||||
if not mounting_in_same_segment:
|
||||
self.assert_cold()
|
||||
self.last_command_position = "dewar"
|
||||
self.last_command_timestamp = time.time()
|
||||
|
||||
@@ -255,7 +257,10 @@ class RobotSC(RobotTCP):
|
||||
return self.is_in_point("pAux")
|
||||
|
||||
def is_laser(self):
|
||||
return self.is_in_point("pLaser")
|
||||
return self.is_in_point("pLaser")
|
||||
|
||||
def is_p1(self):
|
||||
return self.is_in_point("p1")
|
||||
|
||||
def is_cleared(self):
|
||||
#return self.is_home() or self.is_park() or self.is_dewar() or self.is_dewar_home()
|
||||
@@ -295,7 +300,10 @@ class RobotSC(RobotTCP):
|
||||
self.assert_in_point("pAux")
|
||||
|
||||
def assert_laser(self):
|
||||
self.assert_in_point("pLaser")
|
||||
self.assert_in_point("pLaser")
|
||||
|
||||
def assert_p1(self):
|
||||
self.assert_in_point("p1")
|
||||
|
||||
def assert_cleared(self):
|
||||
if not self.is_cleared():
|
||||
|
||||
@@ -44,6 +44,7 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False)
|
||||
hexiposi.assert_homed()
|
||||
assert_mount_position()
|
||||
do_unmount = False
|
||||
mounting_in_same_segment = False
|
||||
|
||||
try:
|
||||
#ZACH
|
||||
@@ -63,8 +64,13 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False)
|
||||
Controller.getInstance().logEvent("Sample Detection", str(sample_det))
|
||||
if sample_det == True:
|
||||
if auto_unmount and (get_setting("mounted_sample_position") is not None):
|
||||
pos = get_setting("mounted_sample_position")
|
||||
former_segment = pos[0:1]
|
||||
mounting_in_same_segment = (former_segment == segment)
|
||||
if mounting_in_same_segment:
|
||||
print "Mounting from the same segment"
|
||||
#auto_unmount set to true so detection remains enabled
|
||||
unmount(force = True, auto_unmount = True)
|
||||
unmount(force = True, auto_unmount = True, mounting_in_same_segment=mounting_in_same_segment)
|
||||
do_unmount = True
|
||||
else:
|
||||
raise Exception("Pin detected on gonio")
|
||||
@@ -93,10 +99,10 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False)
|
||||
if not force:
|
||||
visual_check_hexiposi(segment)
|
||||
|
||||
if not robot.is_dewar():
|
||||
if (not robot.is_dewar()) and (not mounting_in_same_segment):
|
||||
robot.move_dewar()
|
||||
|
||||
robot.get_dewar(segment, puck, sample)
|
||||
robot.get_dewar(segment, puck, sample, mounting_in_same_segment=mounting_in_same_segment)
|
||||
|
||||
|
||||
if read_dm:
|
||||
|
||||
@@ -5,14 +5,15 @@ import org.apache.commons.math3.geometry.euclidean.threed.Line as Line3D
|
||||
RECOVER_DESC = "mRecovery"
|
||||
RECOVER_TOOL = TOOL_DEFAULT
|
||||
|
||||
known_segments = [ ("pGonioA", "pGonioG", 10), \
|
||||
known_segments = [ ("pGonioA", "pGonioG", 10), \
|
||||
("p1", "pGonioA", 100), \
|
||||
("p1", "pScan", 100), \
|
||||
("pPark", "pScan", 40), \
|
||||
("pHome", "pPark", 60), \
|
||||
("pScan", "pHeater", 50), \
|
||||
("pHome", "pDewar", 10), \
|
||||
("pHeater", "pHeatB", 10), \
|
||||
("pHome", "pAux", 50), \
|
||||
("pScan", "pGonioA", 100), \
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -45,11 +45,10 @@ def set_hexiposi(pos, force = False):
|
||||
"""
|
||||
Set the hexiposi position in remote mode, or wait for it to be set in manual mode
|
||||
"""
|
||||
robot.assert_cleared()
|
||||
if force == False:
|
||||
if hexiposi.position == pos:
|
||||
return
|
||||
|
||||
robot.assert_cleared()
|
||||
if is_manual_mode():
|
||||
set_status("Move Hexiposi to position " + str(pos) + " ...")
|
||||
try:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
def unmount(segment = None, puck = None, sample = None, force=False, auto_unmount = False):
|
||||
def unmount(segment = None, puck = None, sample = None, force=False, auto_unmount = False, mounting_in_same_segment=False):
|
||||
"""
|
||||
"""
|
||||
print "unmount: ", segment, puck, sample, force
|
||||
@@ -95,7 +95,7 @@ def unmount(segment = None, puck = None, sample = None, force=False, auto_unmoun
|
||||
#TODO: Should check if smart magnet detection is off?
|
||||
update_samples_info_sample_unmount(get_puck_name(segment, puck), sample)
|
||||
robot.move_dewar()
|
||||
robot.put_dewar(segment, puck, sample)
|
||||
robot.put_dewar(segment, puck, sample, mounting_in_same_segment=mounting_in_same_segment)
|
||||
set_setting("mounted_sample_position", None)
|
||||
finally:
|
||||
if not auto_unmount:
|
||||
|
||||
Reference in New Issue
Block a user