towards recabeling and reconfiguring all Powerbricks and Smaracts devices
Here all IOCs were started without any hardware. So in the next steps the hardware must be tested.
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
//#2-> +1. X + .5Y + 0.01A
|
||||
//#3-> + .5X +1. Y + 0.01A
|
||||
|
||||
#1-> A
|
||||
#1-> Y
|
||||
#2-> X
|
||||
#3-> Y
|
||||
#3-> A
|
||||
|
||||
Coord[1].AltFeedRate=0
|
||||
Coord[1].Tm=1 //1ms time
|
||||
@@ -17,31 +17,12 @@ Coord[1].Ts=0
|
||||
//Parker: Continous Force 4N -> assume 1kg load -> acceleration=a=F/m=4m/s^2
|
||||
//do not use time to accelerate but acceleration
|
||||
//4m/s^2=4um/(ms)^2 Motor units=um -> JogTa= -1ms^2/4mu -2.5-> 4m/s^2 -25->0.4m/s^2
|
||||
Motor[1].JogTs=0
|
||||
Motor[1].JogTa=-2.5
|
||||
Motor[2].JogTs=0
|
||||
Motor[2].JogTa=-2.5
|
||||
Motor[3].JogTs=0
|
||||
Motor[3].JogTa=-2.5
|
||||
|
||||
|
||||
Motor[1].MaxSpeed=360
|
||||
Motor[1].MaxSpeed=50
|
||||
Motor[2].MaxSpeed=50
|
||||
Motor[3].MaxSpeed=50
|
||||
|
||||
open prog 1
|
||||
//this uses jogspeed
|
||||
rapid abs
|
||||
X(10000) Y(0) A(0)
|
||||
X(0) Y(10000) A(0)
|
||||
X(0) Y(0) A(36000)
|
||||
X(0) Y(0) A(0)
|
||||
close
|
||||
|
||||
open prog 2
|
||||
//this uses Coord[1].Tm and limits with MaxSpeed
|
||||
linear abs
|
||||
X(10000) Y(0) A(0)
|
||||
X(0) Y(10000) A(0)
|
||||
X(0) Y(0) A(0)
|
||||
X(0) Y(0) A(36000)
|
||||
X(0) Y(0) A(0)
|
||||
close
|
||||
Motor[3].MaxSpeed=360
|
||||
78
cfg/MX1_home.cfg
Normal file
78
cfg/MX1_home.cfg
Normal file
@@ -0,0 +1,78 @@
|
||||
define(PLC_Homing='1')
|
||||
define(statusHoming='P100')
|
||||
statusHoming=0
|
||||
|
||||
//statusHoming:
|
||||
// 1: M1 phased
|
||||
// 2: M2 phased
|
||||
// 4: M1 homed
|
||||
// 8: M2 homed
|
||||
// 16: M1 neg limit
|
||||
// 32: M2 neg limit
|
||||
// 64: homing done
|
||||
// 128: homing failed
|
||||
|
||||
|
||||
open plc PLC_Homing
|
||||
define(timer='L1')
|
||||
statusHoming=0
|
||||
L10=Motor[1].MaxDac
|
||||
Motor[1].MaxDac=500
|
||||
L11=Motor[1].FatalFeLimit
|
||||
Motor[1].FatalFeLimit=2000
|
||||
L12=Motor[1].JogSpeed
|
||||
Motor[1].JogSpeed=1
|
||||
|
||||
L20=Motor[2].MaxDac
|
||||
Motor[2].MaxDac=500
|
||||
L21=Motor[2].FatalFeLimit
|
||||
Motor[2].FatalFeLimit=2000
|
||||
L22=Motor[2].JogSpeed
|
||||
Motor[2].JogSpeed=1
|
||||
|
||||
|
||||
Motor[1].PhaseFindingStep=1
|
||||
Motor[2].PhaseFindingStep=1
|
||||
timer = Sys.RunTime + 1;while (Sys.RunTime < timer){} //wait 1 sec
|
||||
|
||||
Motor[1].HomeVel=2
|
||||
Motor[2].HomeVel=2
|
||||
|
||||
home1
|
||||
home2
|
||||
timer = Sys.RunTime + 1;while (Sys.RunTime < timer){} //wait 1 sec
|
||||
statusHoming|=1
|
||||
while(1)
|
||||
{
|
||||
if(Motor[1].FeFatal && (statusHoming&2)==0)
|
||||
{
|
||||
statusHoming=statusHoming|2
|
||||
Motor[1].HomeVel=-Motor[1].HomeVel
|
||||
home1
|
||||
}
|
||||
if(Motor[2].HomeInProgress==0 && (statusHoming&4)==0)
|
||||
{
|
||||
statusHoming=statusHoming|4
|
||||
Motor[2].HomeVel=-Motor[2].HomeVel
|
||||
home2
|
||||
}
|
||||
if(Motor[1].HomeInProgress==0 && Motor[1].HomeInProgress==0)
|
||||
{
|
||||
statusHoming=statusHoming|8
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Motor[1].PhasePos=560 // 555 581 593 558
|
||||
Motor[2].PhasePos=1540 //1549 1531 1543 1537
|
||||
|
||||
|
||||
Motor[1].MaxDac=L10
|
||||
Motor[1].FatalFeLimit=L11
|
||||
Motor[1].JogSpeed=L12
|
||||
Motor[2].MaxDac=L20
|
||||
Motor[2].FatalFeLimit=L21
|
||||
Motor[2].JogSpeed=L22
|
||||
|
||||
disable plc PLC_Homing
|
||||
close
|
||||
@@ -17,31 +17,52 @@
|
||||
// x einraster == -> x-N and x-S poles =2*x poles -> 1 rev = x*2048 ustep=phase_step
|
||||
// changing the polarity from S-N-S (one pole cycle) are 2048 phase_step. phase_step is also called ustep
|
||||
|
||||
//Mot 1: Rotation stage LS Mecapion MDM-DC06DNC0H 32 poles = 1 rev = 16*2048=32768 phase_step
|
||||
//Enc 1: Rotation stage LS Mecapion 1 rev = 1048576 enc_steps
|
||||
//Mot 1: Stage Y Parker MX80L D11 25mm one pole cycle = 13mm = 2048 phase_step
|
||||
//Enc 1: Stage Y Parker MX80L D11 inc_enc 20nm one pole cycle = 13mm = 650000 enc_step (20nm/enc_step)
|
||||
|
||||
//Mot 2: Stage Y Parker MX80L D11 25mm one pole cycle = 13mm = 2048 phase_step
|
||||
//Enc 2: Stage Y Parker MX80L D11 inc_enc 20nm one pole cycle = 13mm = 650000 enc_step (20nm/enc_step)
|
||||
//Mot 2: Stage X Parker MX80L D11 25mm one pole cycle = 13mm = 2048 phase_step
|
||||
//Enc 2: Stage X Parker MX80L D11 inc_enc 20nm one pole cycle = 13mm = 650000 enc_step (20nm/enc_step)
|
||||
|
||||
//Mot 3: Stage X Parker MX80L D11 25mm one pole cycle = 13mm = 2048 phase_step
|
||||
//Enc 3: Stage X Parker MX80L D11 inc_enc 20nm one pole cycle = 13mm = 650000 enc_step (20nm/enc_step)
|
||||
//Mot 3: Rotation stage LS Mecapion MDM-DC06DNC0H 32 poles = 1 rev = 16*2048=32768 phase_step
|
||||
//Enc 3: Rotation stage LS Mecapion 1 rev = 1048576 enc_steps
|
||||
|
||||
//Mot/Enc 4: camera base plate X
|
||||
// OBSOLETE: Enc 4: Interferometer 1
|
||||
//Mot 4: Stage X Stada Stepper 670mA 200 poles 1 rev = 100*2048 phase_step (2 stepper motor)
|
||||
//Enc 4: Renishaw absolute BiSS
|
||||
|
||||
//Mot/Enc 5: camera base plate Y
|
||||
// OBSOLETE Enc 5: Interferometer 2
|
||||
//Mot 5: Stage Y Stada Stepper 670mA 200 poles 1 rev = 100*2048 phase_step (2 stepper motor)
|
||||
//Enc 5: Renishaw absolute BiSS
|
||||
|
||||
//Mot 6: Backlight 2.3A
|
||||
//Enc 6: Interferometer Y
|
||||
|
||||
//Mot 7: Stada Stepper: 670mA 200 poles 1 rev = 100*2048 phase_step (2 stepper motor)
|
||||
//Enc 7: Renishaw absolute BiSS
|
||||
//Enc 7: Interferometer X
|
||||
|
||||
//Mot 8: Stada Stepper: 670mA 200 poles 1 rev = 100*2048 phase_step (2 stepper motor)
|
||||
//Enc 8: Renishaw absolute BiSS
|
||||
//Stage Y Parker MX80L
|
||||
//--------------------
|
||||
//Motor[1].pPhaseEnc -> PowerBrick[0].Chan[1].PhaseCapt.a
|
||||
// 1 el_step = 13mm = 2048 phase_step = 166400000 PhaseCapt =256*650000 (256=scaling of encTable)
|
||||
// -> PhasePosSf=(2048*el_cycle)/(256*enc_step) = 8*el_cycle/enc_step =2048*1/(256*650000)=8*1/650000=1./81250=1.23077e-05
|
||||
//2048 phase_step =166400000 PhaseCapt -> PhasePosSf = 2048/166400000= 2048./(256*650000)
|
||||
//use um as motor unit
|
||||
!encoder_sim(enc=1,tbl=9,mot=9,posSf=13000./2048)
|
||||
!encoder_inc(enc=1,tbl=1,mot=1,posSf=13000./650000)
|
||||
//!motor_servo(mot=1,ctrl='ServoCtrl',Kp=20,Kvfb=1000,Ki=0.07,Kvff=1000,Kaff=4000,MaxInt=1000)
|
||||
//!motor_servo(mot=1,ctrl='ServoCtrl',Kp=20,Kvfb=220,Ki=0.02,Kvff=240,Kaff=1500,MaxInt=1000)
|
||||
!motor_servo(mot=1,ctrl='ServoCtrl',Kp=25,Kvfb=400,Ki=0.02,Kvff=350,Kaff=5000,MaxInt=1000)
|
||||
!motor(mot=1,dirCur=0,contCur=800,peakCur=2400,timeAtPeak=1,IiGain=1,IpfGain=0,IpbGain=2,JogSpeed=10.,numPhase=3,invDir=True,servo=None,PhasePosSf=1./81250,PhaseFindingDac=100,PhaseFindingTime=50,SlipGain=0,AdvGain=0,PwmSf=10000,FatalFeLimit=200,WarnFeLimit=100,InPosBand=2,homing='enc-index')
|
||||
|
||||
|
||||
//Stage X Parker MX80L (top stage, mounted on Y stage)
|
||||
//----------------------------------------------------
|
||||
//Motor[2].pPhaseEnc -> PowerBrick[0].Chan[1].PhaseCapt.a
|
||||
// 1 el_step = 13mm = 2048 phase_step = 166400000 PhaseCapt =256*650000 (256=scaling of encTable)
|
||||
// -> PhasePosSf=(2048*el_cycle)/(256*enc_step) = 8*el_cycle/enc_step =2048*1/(256*650000)=8*1/650000=1./81250=1.23077e-05
|
||||
//2048 phase_step =166400000 PhaseCapt -> PhasePosSf = 2048/166400000= 2048./(256*650000)
|
||||
|
||||
!encoder_sim(enc=2,tbl=10,mot=10,posSf=13000./2048)
|
||||
!encoder_inc(enc=2,tbl=2,mot=2,posSf=13000./650000)
|
||||
!motor_servo(mot=2,ctrl='ServoCtrl',Kp=20,Kvfb=220,Ki=0.02,Kvff=240,Kaff=1500,MaxInt=1000)
|
||||
//PhaseFreq=20000,PhasePerServo=1 -> Kvfb=220*4 Ki/=4,Kvff*=4,Kaff*=4*4
|
||||
!motor(mot=2,dirCur=0,contCur=800,peakCur=2400,timeAtPeak=1,IiGain=1,IpfGain=0,IpbGain=2,JogSpeed=10.,numPhase=3,invDir=True,servo=None,PhasePosSf=1./81250,PhaseFindingDac=100,PhaseFindingTime=50,SlipGain=0,AdvGain=0,PwmSf=10000,FatalFeLimit=200,WarnFeLimit=100,InPosBand=2,homing='enc-index')
|
||||
|
||||
|
||||
//rot stage
|
||||
@@ -53,92 +74,33 @@
|
||||
// -> PhasePosSf is calculated as follows: (2048*pole_cycle)/(256*enc_step) = 8*pole_cycle/enc_step
|
||||
//PhasePosSf = (2048*pole_cycle)/(SerialEncDataA)=8*16/1048576=1/32
|
||||
|
||||
!encoder_sim(enc=1,tbl=9,mot=9,posSf=360000./32768)
|
||||
!encoder_biss(enc=1,tbl=1,mot=1,numBits=20,posSf=360000./1048576)
|
||||
Motor[1].pPhaseEnc=Acc84B[0].Chan[0].SerialEncDataA.a
|
||||
//Motor[1].pAbsPhasePos=Acc84B[0].Chan[0].SerialEncDataA.a
|
||||
|
||||
!motor_servo(mot=1,ctrl='ServoCtrl',Kp=0.8,Kvfb=20,Ki=0.001,Kvff=40,Kaff=0,MaxInt=1000)
|
||||
!motor(mot=1,dirCur=0,contCur=1000,peakCur=2000,timeAtPeak=1,IiGain=1.5,IpfGain=0,IpbGain=3,JogSpeed=180.,numPhase=3,invDir=True,servo=None,PhasePosSf=1./8192,PhaseFindingDac=100,PhaseFindingTime=50,SlipGain=0,AdvGain=0,PwmSf=10000,FatalFeLimit=3000,WarnFeLimit=1000,InPosBand=10, HomeOffset=228987)
|
||||
|
||||
|
||||
//Stage Y Parker MX80L
|
||||
//--------------------
|
||||
//Motor[2].pPhaseEnc -> PowerBrick[0].Chan[1].PhaseCapt.a
|
||||
// 1 el_step = 13mm = 2048 phase_step = 166400000 PhaseCapt =256*650000 (256=scaling of encTable)
|
||||
// -> PhasePosSf=(2048*el_cycle)/(256*enc_step) = 8*el_cycle/enc_step =2048*1/(256*650000)=8*1/650000=1./81250=1.23077e-05
|
||||
//2048 phase_step =166400000 PhaseCapt -> PhasePosSf = 2048/166400000= 2048./(256*650000)
|
||||
//use um as motor unit
|
||||
!encoder_sim(enc=2,tbl=10,mot=10,posSf=13000./2048)
|
||||
!encoder_inc(enc=2,tbl=2,mot=2,posSf=13000./650000)
|
||||
//!motor_servo(mot=2,ctrl='ServoCtrl',Kp=20,Kvfb=1000,Ki=0.07,Kvff=1000,Kaff=4000,MaxInt=1000)
|
||||
//!motor_servo(mot=2,ctrl='ServoCtrl',Kp=20,Kvfb=220,Ki=0.02,Kvff=240,Kaff=1500,MaxInt=1000)
|
||||
!motor_servo(mot=2,ctrl='ServoCtrl',Kp=25,Kvfb=400,Ki=0.02,Kvff=350,Kaff=5000,MaxInt=1000)
|
||||
!motor(mot=2,dirCur=0,contCur=800,peakCur=2400,timeAtPeak=1,IiGain=1,IpfGain=0,IpbGain=2,JogSpeed=10.,numPhase=3,invDir=True,servo=None,PhasePosSf=1./81250,PhaseFindingDac=100,PhaseFindingTime=50,SlipGain=0,AdvGain=0,PwmSf=10000,FatalFeLimit=200,WarnFeLimit=100,InPosBand=2,homing='enc-index')
|
||||
|
||||
|
||||
//Stage X Parker MX80L (top stage, mounted on Y stage)
|
||||
//----------------------------------------------------
|
||||
//Motor[3].pPhaseEnc -> PowerBrick[0].Chan[1].PhaseCapt.a
|
||||
// 1 el_step = 13mm = 2048 phase_step = 166400000 PhaseCapt =256*650000 (256=scaling of encTable)
|
||||
// -> PhasePosSf=(2048*el_cycle)/(256*enc_step) = 8*el_cycle/enc_step =2048*1/(256*650000)=8*1/650000=1./81250=1.23077e-05
|
||||
//2048 phase_step =166400000 PhaseCapt -> PhasePosSf = 2048/166400000= 2048./(256*650000)
|
||||
|
||||
!encoder_sim(enc=3,tbl=11,mot=11,posSf=13000./2048)
|
||||
!encoder_inc(enc=3,tbl=3,mot=3,posSf=13000./650000)
|
||||
!motor_servo(mot=3,ctrl='ServoCtrl',Kp=20,Kvfb=220,Ki=0.02,Kvff=240,Kaff=1500,MaxInt=1000)
|
||||
//PhaseFreq=20000,PhasePerServo=1 -> Kvfb=220*4 Ki/=4,Kvff*=4,Kaff*=4*4
|
||||
!motor(mot=3,dirCur=0,contCur=800,peakCur=2400,timeAtPeak=1,IiGain=1,IpfGain=0,IpbGain=2,JogSpeed=10.,numPhase=3,invDir=True,servo=None,PhasePosSf=1./81250,PhaseFindingDac=100,PhaseFindingTime=50,SlipGain=0,AdvGain=0,PwmSf=10000,FatalFeLimit=200,WarnFeLimit=100,InPosBand=2,homing='enc-index')
|
||||
|
||||
//Interferometer 1,2
|
||||
//------------------
|
||||
//!encoder_inc(enc=4,tbl=4,mot=4)# ,posSf=13000./650000)
|
||||
//!encoder_inc(enc=5,tbl=5,mot=5)# ,posSf=13000./650000)
|
||||
|
||||
//camera base plate X,Y
|
||||
//---------------------
|
||||
|
||||
//102400000 ustep 200000 encCnt = 10mm = 10000um
|
||||
//posSf = userUnits/encoder_steps = 10000/200000 =1./20
|
||||
//servoSf=motor_u_steps/userUnits = 102400000/10000 = 10240./1
|
||||
!encoder_inc(enc=4,posSf=1./20)
|
||||
!motor(mot=4,dirCur=250,JogSpeed=.3,invDir=0,servoSf=10240.,InPosBand=1,HomeOffset=0)
|
||||
Motor[4].Pos2Sf=0 // Pos2Sf set to 0 to avoid programming leak values
|
||||
|
||||
//-51200000 ustep = -200000 encCnt == 10mm =10000 um
|
||||
//posSf = userUnits/encoder_steps = 10000/-200000 =1/-20.
|
||||
//servoSf=motor_u_steps/userUnits = -51200000/10000 = -5120./1
|
||||
!encoder_inc(enc=5,posSf=1./20)
|
||||
!motor(mot=5,dirCur=250,JogSpeed=.3,invDir=0,servoSf=5120.,InPosBand=1,HomeOffset=0)
|
||||
Motor[5].Pos2Sf=0 // Pos2Sf set to 0 to avoid programming leak values
|
||||
|
||||
|
||||
//Backlight
|
||||
//---------
|
||||
//#6j=0 //down
|
||||
//#6j=-31000 //up
|
||||
!encoder_sim(enc=6)
|
||||
!motor(mot=6,dirCur=1800,JogSpeed=40,invDir=False)
|
||||
!encoder_sim(enc=3,tbl=11,mot=11,posSf=360000./32768)
|
||||
!encoder_biss(enc=3,tbl=3,mot=3,numBits=20,posSf=360000./1048576)
|
||||
Motor[3].pPhaseEnc=Acc84B[0].Chan[0].SerialEncDataA.a
|
||||
!motor_servo(mot=3,ctrl='ServoCtrl',Kp=0.8,Kvfb=20,Ki=0.001,Kvff=40,Kaff=0,MaxInt=1000)
|
||||
!motor(mot=3,dirCur=0,contCur=1000,peakCur=2000,timeAtPeak=1,IiGain=1.5,IpfGain=0,IpbGain=3,JogSpeed=180.,numPhase=3,invDir=True,servo=None,PhasePosSf=1./8192,PhaseFindingDac=100,PhaseFindingTime=50,SlipGain=0,AdvGain=0,PwmSf=10000,FatalFeLimit=3000,WarnFeLimit=1000,InPosBand=10, HomeOffset=228987)
|
||||
|
||||
|
||||
//Stada stage
|
||||
//----------------------------------------------------
|
||||
//-----------
|
||||
//512000 ustep == 50000 encCnt == 2500um
|
||||
//posSf = userUnits/encoder_steps
|
||||
//servoSf=motor_u_steps/userUnits
|
||||
|
||||
!encoder_biss(enc=7,numBits=32,posSf=1./20)
|
||||
!encoder_biss(enc=8,numBits=32,posSf=1./20)
|
||||
!motor(mot=7,current=200,JogSpeed=0.5,invDir=1,servoSf=204.8,InPosBand=1,HomeOffset=39278)
|
||||
!motor(mot=8,current=200,JogSpeed=0.5,invDir=1,servoSf=204.8,InPosBand=1,HomeOffset=39736)
|
||||
!encoder_biss(enc=4,numBits=32,posSf=1./20)
|
||||
!encoder_biss(enc=5,numBits=32,posSf=1./20)
|
||||
!motor(mot=4,current=200,JogSpeed=0.5,invDir=1,servoSf=204.8,InPosBand=1,HomeOffset=39278)
|
||||
!motor(mot=5,current=200,JogSpeed=0.5,invDir=1,servoSf=204.8,InPosBand=1,HomeOffset=39736)
|
||||
|
||||
//turn off servon and inpos below ... user units (here 1um)
|
||||
//Motor[7].InPosBand=1;Motor[7].Servo.BreakPosErr=Motor[7].InPosBand
|
||||
//Motor[8].InPosBand=1;Motor[8].Servo.BreakPosErr=Motor[8].InPosBand
|
||||
|
||||
#1,7,8hmz
|
||||
//Interferometer 1,2
|
||||
//------------------
|
||||
!encoder_inc(enc=6,tbl=6,mot=6)# ,posSf=13000./650000)
|
||||
!encoder_inc(enc=7,tbl=7,mot=7)# ,posSf=13000./650000)
|
||||
|
||||
#3,4,5hmz
|
||||
|
||||
//holding current
|
||||
!holding_current(m4=[0,240],m5=[0,240],m6=[1400,1800],m7=[0,200],m8=[0,200])
|
||||
!holding_current(m4=[0,240],m5=[0,240])
|
||||
|
||||
|
||||
27
cfg/MX2_coordTrf.cfg
Normal file
27
cfg/MX2_coordTrf.cfg
Normal file
@@ -0,0 +1,27 @@
|
||||
// ---------- Coordinate System/Transformation ----------
|
||||
|
||||
//These values influence the speed of axis X,Y,Z and also A,B
|
||||
Coord[1].Ta=100
|
||||
Coord[1].Td=100
|
||||
Coord[1].AltFeedRate=1000
|
||||
Coord[1].Tm=-1000 //1000um/FeedTime -> 1mm/sec
|
||||
Coord[1].FeedTime=1000 //default value 1000um
|
||||
|
||||
|
||||
//Coordinate Transformation
|
||||
&1
|
||||
#1-> -1.X -10.Y +0.5A +5.B
|
||||
#2-> +1.X -10.Y -0.5A +5.B //motor 2 has opposite direction
|
||||
#3-> -1.X -10.Y -0.5A -5.B
|
||||
#4-> +1.X -10.Y +0.5A -5.B //motor 4 has opposite direction
|
||||
|
||||
//PITCH YAW are not exposed directly, because these would need
|
||||
//inverse and forward kinematics due to the angle functions
|
||||
|
||||
Motor[1].MaxSpeed=Motor[1].JogSpeed
|
||||
Motor[2].MaxSpeed=Motor[2].JogSpeed
|
||||
Motor[3].MaxSpeed=Motor[3].JogSpeed
|
||||
Motor[4].MaxSpeed=Motor[4].JogSpeed
|
||||
|
||||
|
||||
|
||||
70
cfg/MX2_home.cfg
Normal file
70
cfg/MX2_home.cfg
Normal file
@@ -0,0 +1,70 @@
|
||||
define(PLC_Homing='1')
|
||||
|
||||
//Homing:
|
||||
//Move all motors left bottom
|
||||
//move 1mm up
|
||||
//move both mottors at same time
|
||||
|
||||
//move to limit switch, gather data, move to other limit switch, gather stop. move back to first limit switch
|
||||
//motID :P0 : Motor Number
|
||||
//direction :P1 : Motion direction to first limit switch: -1 -> #1j- ,+1 -> #1j+
|
||||
//status :P100: local status
|
||||
//timer :P101: local timer
|
||||
|
||||
open plc PLC_Homing
|
||||
define(motID='L0',direction='P1',status='P100',timer='P101')
|
||||
jog-1; jog-2; jog-3; jog-4;
|
||||
Motor[1].HomeVel=0.5
|
||||
Motor[2].HomeVel=0.5
|
||||
Motor[3].HomeVel=0.5
|
||||
Motor[4].HomeVel=0.5
|
||||
status=10
|
||||
while(1)
|
||||
{
|
||||
if((Motor[1].MinusLimit==1 || Motor[1].FeFatal==1)){
|
||||
if((Motor[2].MinusLimit==1 || Motor[2].FeFatal==1)){
|
||||
if((Motor[3].MinusLimit==1 || Motor[3].FeFatal==1)){
|
||||
if((Motor[4].MinusLimit==1 || Motor[4].FeFatal==1)){
|
||||
status=11
|
||||
break
|
||||
}}}}
|
||||
}
|
||||
timer = Sys.RunTime + 2
|
||||
status=100
|
||||
while (Sys.RunTime < timer){} //wait 2 sec
|
||||
status=101
|
||||
jog1:1000; jog2:1000; jog3:1000; jog4:1000;
|
||||
timer = Sys.RunTime + 2
|
||||
status=200
|
||||
while (Sys.RunTime < timer){} //wait 2 sec
|
||||
status=201
|
||||
while(1)
|
||||
{
|
||||
if(Motor[1].DesVelZero==1 && Motor[2].DesVelZero==1 && Motor[3].DesVelZero==1 && Motor[4].DesVelZero==1)
|
||||
{
|
||||
status=12
|
||||
break
|
||||
}
|
||||
}
|
||||
timer = Sys.RunTime + 2
|
||||
while (Sys.RunTime < timer){}
|
||||
home 1; home 2; home 3; home 4
|
||||
status=13
|
||||
while(1) //wait homing index found done
|
||||
{
|
||||
if(Motor[1].HomeComplete==1 && Motor[2].HomeComplete==1 && Motor[3].HomeComplete==1 && Motor[4].HomeComplete==1)
|
||||
{
|
||||
status=14
|
||||
break
|
||||
}
|
||||
}
|
||||
while(1) //wait moving to zero position done
|
||||
{
|
||||
if(Motor[1].DesVelZero==1 && Motor[2].DesVelZero==1 && Motor[3].DesVelZero==1 && Motor[4].DesVelZero==1)
|
||||
{
|
||||
status=15
|
||||
break
|
||||
}
|
||||
}
|
||||
disable plc PLC_Homing
|
||||
close
|
||||
25
cfg/MX2_setup.cfg
Normal file
25
cfg/MX2_setup.cfg
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
//Wedge Movers
|
||||
--------------
|
||||
!encoder_inc(enc=1,posSf=1./20)
|
||||
!motor(mot=1,current=120,JogSpeed=1,HomeVel=.5,servoSf=12.28878*20,homing='enc-index',invDir=True,HomeOffset=2855,InPosBand=1)
|
||||
|
||||
!encoder_inc(enc=2,posSf=1./20)
|
||||
!motor(mot=2,current=120,JogSpeed=1,HomeVel=.5,servoSf=12.28878*20,homing='enc-index',invDir=True,HomeOffset=2844,InPosBand=1)
|
||||
|
||||
!encoder_inc(enc=3,posSf=1./20)
|
||||
!motor(mot=3,current=120,JogSpeed=1,HomeVel=.5,servoSf=12.28878*20,homing='enc-index',invDir=True,HomeOffset=204,InPosBand=1)
|
||||
|
||||
!encoder_inc(enc=4,posSf=1./20)
|
||||
!motor(mot=4,current=120,JogSpeed=1,HomeVel=.5,servoSf=12.28878*20,homing='enc-index',invDir=True,HomeOffset=2094,InPosBand=1)
|
||||
|
||||
|
||||
//Backlight
|
||||
//---------
|
||||
//#5j=0 //down #5j=-31000 //up
|
||||
!encoder_sim(enc=5)
|
||||
!motor(mot=5,dirCur=1800,JogSpeed=40,invDir=False)
|
||||
|
||||
|
||||
!holding_current(m5=[1400,1800])
|
||||
22
cfg/MX3_setup.cfg
Normal file
22
cfg/MX3_setup.cfg
Normal file
@@ -0,0 +1,22 @@
|
||||
//5 simulated cam movers
|
||||
|
||||
|
||||
!encoder_sim(enc=1,tbl=1,mot=1)
|
||||
!motor(mot=1,dirCur=0,contCur=100,peakCur=100,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True)
|
||||
Motor[1].pLimits=0;Motor[1].AmpFaultLevel=0;Motor[1].pAmpEnable=0;Motor[1].pAmpFault=0
|
||||
|
||||
!encoder_sim(enc=2,tbl=2,mot=2)
|
||||
!motor(mot=2,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True)
|
||||
Motor[2].pLimits=0;Motor[2].AmpFaultLevel=0;Motor[2].pAmpEnable=0;Motor[2].pAmpFault=0
|
||||
|
||||
!encoder_sim(enc=3,tbl=3,mot=3)
|
||||
!motor(mot=3,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True)
|
||||
Motor[3].pLimits=0;Motor[3].AmpFaultLevel=0;Motor[3].pAmpEnable=0;Motor[3].pAmpFault=0
|
||||
|
||||
!encoder_sim(enc=4,tbl=4,mot=4)
|
||||
!motor(mot=4,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True)
|
||||
Motor[4].pLimits=0;Motor[4].AmpFaultLevel=0;Motor[4].pAmpEnable=0;Motor[4].pAmpFault=0
|
||||
|
||||
!encoder_sim(enc=5,tbl=5,mot=5)
|
||||
!motor(mot=5,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True)
|
||||
Motor[5].pLimits=0;Motor[5].AmpFaultLevel=0;Motor[5].pAmpEnable=0;Motor[5].pAmpFault=0
|
||||
@@ -5,6 +5,6 @@
|
||||
//!common(PhaseFreq=20000,PhasePerServo=1)
|
||||
//!common(PhaseFreq=40000)
|
||||
|
||||
!torqueCtrl()
|
||||
!init()
|
||||
!coordTrf()
|
||||
!MX1_setup()
|
||||
!MX1_home()
|
||||
!MX1_coordTrf()
|
||||
4
cfg/SAR-EXPMX2.cfg
Normal file
4
cfg/SAR-EXPMX2.cfg
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
!MX2_setup()
|
||||
!MX2_home()
|
||||
!MX2_coordTrf()
|
||||
4
cfg/SAR-EXPMX3.cfg
Normal file
4
cfg/SAR-EXPMX3.cfg
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
!MX3_setup()
|
||||
//!MX3_home()
|
||||
//!MX3_coordTrf()
|
||||
72
cfg/init.cfg
72
cfg/init.cfg
@@ -1,72 +0,0 @@
|
||||
define(PLC_Homing='1')
|
||||
|
||||
open subprog 12
|
||||
enable plc PLC_Homing
|
||||
close
|
||||
|
||||
open plc PLC_Homing
|
||||
define(status='P100',timer='P101')
|
||||
|
||||
L20=Motor[2].MaxDac
|
||||
Motor[2].MaxDac=500
|
||||
L21=Motor[2].FatalFeLimit
|
||||
Motor[2].FatalFeLimit=2000
|
||||
L22=Motor[2].JogSpeed
|
||||
Motor[2].JogSpeed=1
|
||||
|
||||
L30=Motor[3].MaxDac
|
||||
Motor[3].MaxDac=500
|
||||
L31=Motor[3].FatalFeLimit
|
||||
Motor[3].FatalFeLimit=2000
|
||||
L32=Motor[3].JogSpeed
|
||||
Motor[3].JogSpeed=1
|
||||
|
||||
|
||||
Motor[2].PhaseFindingStep=1
|
||||
Motor[3].PhaseFindingStep=1
|
||||
timer = Sys.RunTime + 1;while (Sys.RunTime < timer){} //wait 1 sec
|
||||
|
||||
Motor[2].HomeVel=2
|
||||
Motor[3].HomeVel=2
|
||||
|
||||
P200=Motor[2].HomeInProgress
|
||||
home2
|
||||
home3
|
||||
timer = Sys.RunTime + 1;while (Sys.RunTime < timer){} //wait 1 sec
|
||||
P201=Motor[2].HomeInProgress
|
||||
|
||||
status=1
|
||||
while(1)
|
||||
{
|
||||
if(Motor[2].FeFatal && (status&2)==0)
|
||||
{
|
||||
status=status|2
|
||||
Motor[2].HomeVel=-Motor[2].HomeVel
|
||||
home2
|
||||
}
|
||||
if(Motor[3].HomeInProgress==0 && (status&4)==0)
|
||||
{
|
||||
status=status|4
|
||||
Motor[3].HomeVel=-Motor[3].HomeVel
|
||||
home3
|
||||
}
|
||||
if(Motor[2].HomeInProgress==0 && Motor[3].HomeInProgress==0)
|
||||
{
|
||||
status=status|8
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Motor[2].PhasePos=560 // 555 581 593 558
|
||||
Motor[3].PhasePos=1540 //1549 1531 1543 1537
|
||||
|
||||
|
||||
Motor[2].MaxDac=L20
|
||||
Motor[2].FatalFeLimit=L21
|
||||
Motor[2].JogSpeed=L22
|
||||
Motor[3].MaxDac=L30
|
||||
Motor[3].FatalFeLimit=L31
|
||||
Motor[3].JogSpeed=L32
|
||||
|
||||
disable plc PLC_Homing
|
||||
close
|
||||
Reference in New Issue
Block a user