예제 #1
0
파일: tow.py 프로젝트: petebachant/Tow
 def on_goPlatform(self):
     vel = self.ui.velSpinBox.value()
     acc = self.ui.accSpinBox.value()
     acsc.setVelocity(self.hcomm, self.axis, vel)
     acsc.setAcceleration(self.hcomm, self.axis, acc)
     acsc.setDeceleration(self.hcomm, self.axis, acc)
     acsc.setJerk(self.hcomm, self.axis, acc*10)
     acsc.toPoint(self.hcomm, None, self.axis, self.platform)
예제 #2
0
 def autoabort(self):
     """This should stop everything and return carriage and turbine back
     to zero."""
     self.autoaborted = True
     acsc.stopBuffer(self.hc, 19)
     acsc.halt(self.hc, 0)
     acsc.halt(self.hc, 1)
     acsc.halt(self.hc, 4)
     acsc.halt(self.hc, 5)
     acsc.toPoint(self.hc, None, 4, 0.0)
     acsc.setVelocity(self.hc, 5, 0.5)
     acsc.toPoint(self.hc, None, 5, 0.0)
예제 #3
0
 def autoabort(self):
     """This should stop everything and return carriage and turbine back
     to zero."""
     self.autoaborted = True
     acsc.stopBuffer(self.hc, 19)
     acsc.halt(self.hc, 0)
     acsc.halt(self.hc, 1)
     acsc.halt(self.hc, 4)
     acsc.halt(self.hc, 5)
     acsc.toPoint(self.hc, None, 4, 0.0)
     acsc.setVelocity(self.hc, 5, 0.5)
     acsc.toPoint(self.hc, None, 5, 0.0)
예제 #4
0
파일: tow.py 프로젝트: petebachant/Tow
 def on_go(self):
     target = self.ui.posSpinBox.value()
     vel = self.ui.velSpinBox.value()
     acc = self.ui.accSpinBox.value()
     acsc.setVelocity(self.hcomm, self.axis, vel)
     acsc.setAcceleration(self.hcomm, self.axis, acc)
     acsc.setDeceleration(self.hcomm, self.axis, acc)
     acsc.setJerk(self.hcomm, self.axis, acc*10)
     if self.ui.rbRelative.isChecked() == True:
         flags = acsc.AMF_RELATIVE
     else:
         flags = None
     acsc.toPoint(self.hcomm, flags, self.axis, target)
예제 #5
0
            mmc.snapImage()
            image_npy = mmc.getImage()
        proj_32bit_filler = proj_32bit_filler + image_npy
    return proj_32bit_filler


##################
####stage calls###
##################
if load_stages:
    #initiate connection
    hcomm = acsc.openCommEthernetTCP(address="10.0.0.100", port=701)
    if scan_gain:
        acsc.enable(hcomm, 0)  #z
        # acsc.toPoint(hcomm, None,0,110) #YIFU CHECK THIS
        acsc.setVelocity(hcomm, 0, 5)  #velocity in mm/sec
        r_pos_0 = acsc.getRPosition(hcomm, 0)
        f_pos_0 = acsc.getFPosition(hcomm, 0)

    acsc.enable(hcomm, 1)  #theta
    acsc.setVelocity(hcomm, 1, 5)  #velocity in degrees/sec
    r_pos_1 = acsc.getRPosition(hcomm, 1)
    f_pos_1 = acsc.getFPosition(hcomm, 1)
    # acsc.toPoint(hcomm, None,1,0)
    print("z-stage F pos: %f \n z-stage R pos: %f" % (f_pos_0, r_pos_0))
    print("theta-stage F pos: %f \n theta-stage R pos: %f" %
          (f_pos_1, r_pos_1))
    where_i_was = r_pos_0

##################
###camera calls###
예제 #6
0
 def vel(self, velocity):
     """Sets axis velocity."""
     acsc.setVelocity(self.controller.hc, self.axisno, velocity)
예제 #7
0
    def initialization(self):

        print "Waiting for Motorized Stage (ACS) Initialization"
        self.hc = acsc.openCommEthernetTCP(address="10.0.0.100",
                                           port=701)  ## craete comminucation

        acsc.runBuffer(self.hc, 0)
        acsc.runBuffer(self.hc, 1)
        acsc.runBuffer(self.hc, 2)
        acsc.runBuffer(self.hc, 4)
        acsc.runBuffer(self.hc, 5)
        acsc.runBuffer(self.hc, 6)

        time.sleep(30)

        ## Homing process

        ## Axis 6
        acsc.waitMotionEnd(self.hc, axis=6)  ## stop at left limit
        if acsc.setFPosition(self.hc, axis=6, fposition=0) != 0:
            print 'Axis 6 (Receiver Z): Homing completed'
        else:
            print 'Axis 6 (Receiver Z): Homing failed'

        ## Axis 0
        acsc.waitMotionEnd(self.hc, axis=0)
        acsc.toPoint(self.hc, flags=acsc.AMF_RELATIVE, axis=0, target=47.5)
        acsc.waitMotionEnd(self.hc, axis=0)
        if acsc.setFPosition(self.hc, axis=0, fposition=0) == 1:
            print 'Axis 0 (Sample X): Homing completed'
        else:
            print 'Axis 0 (Sample X): Homing failed'

        ## Axis 1
        acsc.waitMotionEnd(self.hc, axis=1)
        acsc.toPoint(self.hc, flags=acsc.AMF_RELATIVE, axis=1, target=19.51)
        acsc.waitMotionEnd(self.hc, axis=1)
        if acsc.setFPosition(self.hc, axis=1, fposition=0) == 1:
            print 'Axis 1 (Sample Y): Homing completed'
        else:
            print 'Axis 1 (Sample Y): Homing failed'

        ## Axis 2
        acsc.waitMotionEnd(self.hc, axis=2)  ## stop at left limit
        acsc.toPoint(self.hc, flags=0, axis=2, target=2.8915)
        print 'Axis 2 (Lens array): Homing completed'

        ## Axis 4
        acsc.waitMotionEnd(self.hc, axis=4)  ## stop at left limit
        acsc.toPoint(self.hc, flags=acsc.AMF_RELATIVE, axis=4, target=4.42)
        acsc.waitMotionEnd(self.hc, axis=4)
        if acsc.setFPosition(self.hc, axis=4, fposition=0) == 1:
            print 'Axis 4 (Receiver X): Homing completed'
        else:
            print 'Axis 4 (Receiver X): Homing failed'

        ## Axis5
        acsc.waitMotionEnd(self.hc, axis=5)  ## stop at left limit
        acsc.toPoint(self.hc, flags=acsc.AMF_RELATIVE, axis=5, target=23.8)
        acsc.waitMotionEnd(self.hc, axis=5)
        if acsc.setFPosition(self.hc, axis=5, fposition=0) == 1:
            print 'Axis 5 (Receiver Y): Homing completed'
        else:
            print 'Axis 5 (Receiver Y): Homing failed'

        ## parameter setting
        acsc.setVelocity(self.hc, 0, 30)  ## axis 0 (linear X)
        acsc.setAcceleration(self.hc, 0, 100)
        acsc.setDeceleration(self.hc, 0, 100)
        acsc.setJerk(self.hc, 0, 1000)

        acsc.setVelocity(self.hc, 1, 30)  ## axis1 (linear Y)
        acsc.setAcceleration(self.hc, 1, 100)

        acsc.setDeceleration(self.hc, 1, 100)
        acsc.setJerk(self.hc, 1, 1000)

        acsc.setVelocity(self.hc, 2, 30)  ## axis 2 (revolver)
        acsc.setAcceleration(self.hc, 2, 100)
        acsc.setDeceleration(self.hc, 2, 100)
        acsc.setJerk(self.hc, 2, 1000)

        acsc.setVelocity(self.hc, 4, 30)  ## axis4 (step X)
        acsc.setAcceleration(self.hc, 4, 100)
        acsc.setDeceleration(self.hc, 4, 100)
        acsc.setJerk(self.hc, 4, 1000)

        acsc.setVelocity(self.hc, 5, 30)  ## axis 5 (step Y)
        acsc.setAcceleration(self.hc, 5, 100)
        acsc.setDeceleration(self.hc, 5, 100)
        acsc.setJerk(self.hc, 5, 1000)

        acsc.setVelocity(self.hc, 6, 5)  ## axis 6 (step Z)
        acsc.setAcceleration(self.hc, 6, 50)
        acsc.setDeceleration(self.hc, 6, 50)
        acsc.setJerk(self.hc, 1, 100)
예제 #8
0
 def setVelocity(self, axis, value):
     if not acsc.setVelocity(self.hc, axis, value):
         print "Transaction error: %d\n" % (acsc.getLastError())
예제 #9
0
파일: control.py 프로젝트: theja2289/ACSpy
 def vel(self, velocity):
     """Sets axis velocity."""
     acsc.setVelocity(self.controller.hc, self.axisno, velocity)