Commit da71705b authored by bliss administrator's avatar bliss administrator
Browse files

Correction of motors calibration

parent 9ab519fb
......@@ -168,49 +168,37 @@ def init_mr_yrot():
######### LIMIT -
print("init_yrot --- Moving to hard limit - ")
start = time.time()
mv(yrot,yrot.sign*-999+yrot.offset)
time.sleep(1)
string="init_yrot --- Searching limit - ..."
print(string)
_status = yrot.state
while _status == "MOVING":
_status = yrot.state
print(string)
time.sleep(1)
try:
mv(yrot,yrot.sign*999+yrot.offset)
except:
if 'LIMNEG' in yrot.state or 'LIMPOS' in yrot.state:
print("init_yrot --- lim- found !\n")
# hardware synchronization
yrot.sync_hard()
print("init_yrot --- lim- found !\n")
_myposn = yrot.position
# hardware synchronization
yrot.sync_hard()
_myposn = yrot.position
print("init_yrot --- Hard limit - value: %f" % (_myposn))
print("init_yrot --- Hard limit - value: %f" % (_myposn))
######### LIMIT +
print("init_yrot --- Moving to hard limit + ")
start = time.time()
mv(yrot,yrot.sign*999+yrot.offset)
time.sleep(1)
string="init_yrot --- Searching limit + ..."
print(string)
_status = yrot.state
while _status == "MOVING":
_status = yrot.state
print(string)
time.sleep(1)
try:
mv(yrot,yrot.sign*999+yrot.offset)
except:
if 'LIMNEG' in yrot.state or 'LIMPOS' in yrot.state:
print("init_yrot --- lim+ found !\n")
# hardware synchronization
yrot.sync_hard()
_myposp = yrot.position
print("init_yrot --- Hard limit + value: %f" % (_myposp))
print("init_yrot --- lim+ found !\n")
# hardware synchronization
yrot.sync_hard()
_myposp = yrot.position
print("init_yrot --- Hard limit + value: %f" % (_myposp))
mid = (_myposp - _myposn) / 2.0 + _myposn
......@@ -219,7 +207,7 @@ def init_mr_yrot():
print("init_yrot --- reseting yrot to 0\n")
yrot.dial = 0
#yrot.dial = 0
yrot.position = 0
slp = (_myposp - _myposn) / 2.0 - 0.05
......@@ -312,49 +300,36 @@ def init_mr_sz():
######### LIMIT -
print("init_sz --- Moving to hard limit - ")
start = time.time()
mv(sz,sz.sign*-999+sz.offset)
time.sleep(1)
string="init_sz --- Searching limit - ..."
print(string)
_status = sz.state
while _status == "MOVING":
_status = sz.state
print(string)
time.sleep(1)
print("init_sz --- lim- found !\n")
# hardware synchronization
sz.sync_hard()
try:
mv(sz,sz.sign*-999+sz.offset)
except:
if 'LIMNEG' in sz.state:
print("init_sz --- lim- found !\n")
_myposn = sz.position
# hardware synchronization
sz.sync_hard()
print("init_sz --- Hard limit - value: %f" % (_myposn))
_myposn = sz.position
print("init_sz --- Hard limit - value: %f" % (_myposn))
######### LIMIT +
print("init_sz --- Moving to hard limit + ")
start = time.time()
mv(sz,sz.sign*999+sz.offset)
time.sleep(1)
string="init_sz --- Searching limit + ..."
print(string)
_status = sz.state
while _status == "MOVING":
_status = sz.state
print(string)
time.sleep(1)
try:
mv(sz,sz.sign*999+sz.offset)
except:
if 'LIMPOS' in sz.state:
print("init_sz --- lim+ found !\n")
# hardware synchronization
sz.sync_hard()
_myposp = sz.position
print("init_sz --- Hard limit + value: %f" % (_myposp))
print("init_sz --- lim+ found !\n")
# hardware synchronization
sz.sync_hard()
_myposp = sz.position
print("init_sz --- Hard limit + value: %f" % (_myposp))
mid = (_myposp - _myposn) / 2.0 + _myposn
......@@ -363,7 +338,7 @@ def init_mr_sz():
print("init_sz --- reseting sz to 0\n")
sz.dial = 0
#sz.offset = 0
sz.position = 0
slp = (_myposp - _myposn) / 2.0 - 0.05
......@@ -471,26 +446,23 @@ def init_hr_z0():
else:
print("init_z0 --- Time end: "+str(time.time()-start)+ ' sec')
# search for SROT pos home switch, go to user position and reset dial to 0
# search for SROT pos home switch and reset dial to 0
def init_mr_srot():
srot.dial = 0
srot.position = 0
pos = 172.5
start=time.time()
srot.controller.home_search(srot,1,pos)
print("init_srot --- Searching home...")
srot.home()
srot.sync_hard()
string="init_srot --- Searching home..."
print(string)
srot.controller.home_state(srot)
while "READY" not in srot.state:
srot.controller.home_state(srot)
print(string)
time.sleep(1)
print("init_srot --- moving srot to 0\n")
# move some degrees to free the home switch. Only moving to 0, the home switch will still be active
# and another call to home will end in eternal rotation!
mv(srot,5)
umv(srot,0)
if time.time()-start >= 60:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment