예제 #1
0
#Disable softLimits
ecmcSlitDemoLib.setSoftLowLimt(leftMotor, 0)
ecmcSlitDemoLib.setSoftLowLimt(rightMotor, 0)
ecmcSlitDemoLib.setSoftLowLimt(gapMotor, 0)
ecmcSlitDemoLib.setSoftLowLimt(centerMotor, 0)
ecmcSlitDemoLib.setSoftLowLimt(masterMotor, 0)

ecmcSlitDemoLib.setSoftHighLimt(leftMotor, 0)
ecmcSlitDemoLib.setSoftHighLimt(rightMotor, 0)
ecmcSlitDemoLib.setSoftHighLimt(gapMotor, 0)
ecmcSlitDemoLib.setSoftHighLimt(centerMotor, 0)
ecmcSlitDemoLib.setSoftHighLimt(masterMotor, 0)

#Reset error on all axis
print 'Reset error on all axes.'
ecmcSlitDemoLib.setAxisReset(leftMotor, 1)
ecmcSlitDemoLib.setAxisReset(rightMotor, 1)
ecmcSlitDemoLib.setAxisReset(gapMotor, 1)
ecmcSlitDemoLib.setAxisReset(centerMotor, 1)
ecmcSlitDemoLib.setAxisReset(masterMotor, 1)
time.sleep(0.5)
ecmcSlitDemoLib.setAxisReset(leftMotor, 0)
ecmcSlitDemoLib.setAxisReset(rightMotor, 0)
ecmcSlitDemoLib.setAxisReset(gapMotor, 0)
ecmcSlitDemoLib.setAxisReset(centerMotor, 0)
ecmcSlitDemoLib.setAxisReset(masterMotor, 0)

#ensure internal traj source of all axis
print 'Ensure internal trajectory source on all axes'
ecmcSlitDemoLib.setAxisEnable(leftMotor, 0)
ecmcSlitDemoLib.setAxisEnable(rightMotor, 0)
    maxPos = fromPos

minPos = fromPos
if toPos < minPos:
    minPos = toPos

testPv.put(testNumberBase)

print('Disable amplifier')
ecmcSlitDemoLib.setAxisEnable(motorPvName, 0)
time.sleep(0.2)  #ensure that enabled goes down
error = ecmcSlitDemoLib.getAxisError(motorPvName, 1)

#Reset error on all axis
print('Reset error axes.')
ecmcSlitDemoLib.setAxisReset(motorPvName, 1)
time.sleep(0.2)
ecmcSlitDemoLib.setAxisReset(motorPvName, 0)

print('Enable amplifier')
ecmcSlitDemoLib.setAxisEnable(motorPvName, 1)
time.sleep(0.2)  #ensure that enabled goes down
error = ecmcSlitDemoLib.getAxisError(motorPvName, 1)
counter = 0

timeOut = 50

while counter < testLoops:
    #run gap and center motorPvName to 0

    print('Move axis to position ' + str(fromPos) + ' (cycles = ' +
예제 #3
0
#!/usr/bin/env python

import epics
import os
import sys
import time
import math
import unittest
from ../. import ecmcSlitDemoLib

leftMotor = 'MEBT-EMU:Axis1'
rightMotor = 'MEBT-EMU:Axis2'

#Reset error on all axis
print 'Reset error on all axes.'
ecmcSlitDemoLib.setAxisReset(leftMotor, 1)
ecmcSlitDemoLib.setAxisReset(rightMotor, 1)
time.sleep(0.5)
ecmcSlitDemoLib.setAxisReset(leftMotor, 0)
ecmcSlitDemoLib.setAxisReset(rightMotor, 0)

#ensure of all axis are enable 
print 'Enable Axes'
ecmcSlitDemoLib.setAxisEnable(leftMotor, 1)
ecmcSlitDemoLib.setAxisEnable(rightMotor, 1)
time.sleep(0.5) #ensure that axes are enabled 
error=ecmcSlitDemoLib.getAxisError(leftMotor,1)
error=ecmcSlitDemoLib.getAxisError(rightMotor,1);

y=0
x=0
예제 #4
0
P = 'LEBT-010:ID-Iris:'
Mtr1 = P + 'Axis:Mtr1'
Mtr2 = P + 'Axis:Mtr2'
Mtr3 = P + 'Axis:Mtr3'
Mtr4 = P + 'Axis:Mtr4'
Mtr5 = P + 'Axis:Mtr5'
Mtr6 = P + 'Axis:Mtr6'

gapMotor = P + 'slit_gap'
centerMotor = P + 'slit_center'
HomProcLeft = 2
HomProcRight = 1

#Reset error on all axis
print 'Reset error on all axes.'
ecmcSlitDemoLib.setAxisReset(Mtr1, 1)
ecmcSlitDemoLib.setAxisReset(Mtr2, 1)
ecmcSlitDemoLib.setAxisReset(Mtr3, 1)
ecmcSlitDemoLib.setAxisReset(Mtr4, 1)
ecmcSlitDemoLib.setAxisReset(Mtr5, 1)
ecmcSlitDemoLib.setAxisReset(Mtr6, 1)
ecmcSlitDemoLib.setAxisReset(gapMotor, 1)
ecmcSlitDemoLib.setAxisReset(centerMotor, 1)
time.sleep(0.5)
ecmcSlitDemoLib.setAxisReset(Mtr1, 1)
ecmcSlitDemoLib.setAxisReset(Mtr2, 1)
ecmcSlitDemoLib.setAxisReset(Mtr3, 1)
ecmcSlitDemoLib.setAxisReset(Mtr4, 1)
ecmcSlitDemoLib.setAxisReset(Mtr5, 1)
ecmcSlitDemoLib.setAxisReset(Mtr6, 1)
ecmcSlitDemoLib.setAxisReset(gapMotor, 1)
if toPos < minPos:
    minPos = toPos

#Disable softLimits
print('Set softlimits')
ecmcSlitDemoLib.setSoftLowLimt(motor, minPos - 10)
ecmcSlitDemoLib.setSoftHighLimt(motor, maxPos + 10)

print('Disable amplifier')
ecmcSlitDemoLib.setAxisEnable(motor, 0)
time.sleep(1)  #ensure that enabled goes down
error = ecmcSlitDemoLib.getAxisError(motor, 1)

#Reset error on all axis
print('Reset error axes.')
ecmcSlitDemoLib.setAxisReset(motor, 1)
time.sleep(0.5)
ecmcSlitDemoLib.setAxisReset(motor, 0)

print('Enable amplifier')
ecmcSlitDemoLib.setAxisEnable(motor, 1)
time.sleep(1)  #ensure that enabled goes down
error = ecmcSlitDemoLib.getAxisError(motor, 1)
counter = 0

timeOut = (maxPos - minPos) / velo * 1.5

while 1:
    #run gap and center motor to 0
    print('Move axis to position ' + str(fromPos) + ' (cycles = ' +
          str(counter) + ').')