Commit 15d187eb authored by bliss administrator's avatar bliss administrator
Browse files

Commit to move to linohlsson2

parent fa4dce85
Metadata-Version: 1.1
Name: id19
Version: 0.1.0
Summary: ID19 software & configuration
Home-page: https://gitlab.esrf.fr/ID19/id19
Author: BCU Team
Author-email: bliss@esrf.fr
License: GNU General Public License v3
Description-Content-Type: UNKNOWN
Description: ============
ID19 project
============
[![build status](https://gitlab.esrf.fr/ID19/id19/badges/master/build.svg)](http://ID19.gitlab-pages.esrf.fr/ID19)
[![coverage report](https://gitlab.esrf.fr/ID19/id19/badges/master/coverage.svg)](http://ID19.gitlab-pages.esrf.fr/id19/htmlcov)
ID19 software & configuration
Latest documentation from master can be found [here](http://ID19.gitlab-pages.esrf.fr/id19)
Keywords: id19
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
LICENSE
MANIFEST.in
README.rst
setup.cfg
docs/Makefile
docs/conf.py
docs/index.rst
docs/readme.rst
docs/usage.rst
id19/__init__.py
id19/calibration_tests.py
id19.egg-info/PKG-INFO
id19.egg-info/SOURCES.txt
id19.egg-info/dependency_links.txt
id19.egg-info/not-zip-safe
id19.egg-info/requires.txt
id19.egg-info/top_level.txt
tests/__init__.py
tests/conftest.py
tests/test_id19.py
tests/test_configuration/motors/__init__.yml
tests/test_configuration/motors/mockup.yml
tests/test_configuration/sessions/__init__.yml
\ No newline at end of file
No preview for this file type
from bliss.common.standard import *
from bliss.common.axis import *
from bliss.common.cleanup import *
from bliss.setup_globals import *
import sys
import time
import random
def init_sx():
......@@ -10,6 +13,7 @@ def init_sx():
######### LIMIT -
print("Moving to hard limit -")
startm = time.time()
sx.hw_limit(-1,wait=False)
......@@ -19,13 +23,15 @@ def init_sx():
_status = sx.state()
while _status == "MOVING":
_status = sx.state()
sys.stdout.write('.')
sys.stdout.write('x')
sys.stdout.flush()
gevent.sleep(1)
print(".\n")
print("lim- found !\n")
print("x Time to found lim-: "+str(time.time()-startm))
# hardware synchronization
sx.sync_hard()
......@@ -44,13 +50,15 @@ def init_sx():
_status = sx.state()
while _status == "MOVING":
_status = sx.state()
sys.stdout.write('.')
sys.stdout.write('x')
sys.stdout.flush()
gevent.sleep(1)
print(".\n")
print("lim+ found !\n")
print("x Time to found lim+: "+str(time.time()-startm))
# hardware synchronization
sx.sync_hard()
......@@ -72,6 +80,8 @@ def init_sx():
print("reseting sx limits to hard limits +/- 0.05\n")
sx.limits(low_limit=-slp,high_limit=slp)
print("x Time end: "+str(time.time()-startm))
# search for SY pos and neg limits and reset dial to 0 in the middle of them.
def init_sy():
......@@ -79,6 +89,7 @@ def init_sy():
######### LIMIT -
print("Moving to hard limit -")
startm = time.time()
sy.hw_limit(-1,wait=False)
......@@ -88,13 +99,15 @@ def init_sy():
_status = sy.state()
while _status == "MOVING":
_status = sy.state()
sys.stdout.write('.')
sys.stdout.write('y')
sys.stdout.flush()
gevent.sleep(1)
print(".\n")
print("lim- found !\n")
print("y Time to found lim-: "+str(time.time()-startm))
# hardware synchronization
sy.sync_hard()
......@@ -113,13 +126,15 @@ def init_sy():
_status = sy.state()
while _status == "MOVING":
_status = sy.state()
sys.stdout.write('.')
sys.stdout.write('y')
sys.stdout.flush()
gevent.sleep(1)
print(".\n")
print("lim+ found !\n")
print("y Time to found lim+: "+str(time.time()-startm))
# hardware synchronization
sy.sync_hard()
......@@ -141,6 +156,8 @@ def init_sy():
print("reseting sy limits to hard limits +/- 0.05\n")
sy.limits(low_limit=-slp,high_limit=slp)
print("y Time end: "+str(time.time()-startm))
# search for YROT pos and neg limits and reset dial to 0 in the middle of them.
......@@ -302,5 +319,25 @@ def init_hr_z0():
def calib_motors(*argv):
cal = [gevent.spawn(arg) for arg in argv]
gevent.joinall(cal)
with error_cleanup(sx,sy,yrot,z0,sz):
cal = [gevent.spawn(arg) for arg in argv]
gevent.joinall(cal)
def test_stability():
"""
This is an inifite test to try to reproduce
a problem seen 7/1 2019 when one motor (sy) went crazy
The code called was calib_motors(init_sx, init_sy)
"""
# let this go on until Ctrl-C
i = 0
while True:
i = i + 1
# first move motors sx snd sy very little , but random
# Note that in order to have about the same time to get 0
# we need to move sy much closer
mvr(sy,-10.0)
mvr(sx,-1.0*random.randrange(10,90)*0.01)
mvr(sy,-1.0*random.randrange(10,90)*0.01)
calib_motors(init_sx, init_sy)
print("----- Loop "+str(i)+" ---------")
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