migrate from EPICS 3.14.12 to 7.0.7

This commit is contained in:
2023-07-12 10:32:11 +02:00
parent 7d2cfaf209
commit 472a6fb7fc
8 changed files with 224 additions and 115 deletions

View File

@@ -21,6 +21,8 @@ open plc PLC_Homing
Motor[1].FatalFeLimit=2000
L12=Motor[1].JogSpeed
Motor[1].JogSpeed=1
L13=Motor[1].pEncLoss
Motor[1].pEncLoss=0
L20=Motor[2].MaxDac
Motor[2].MaxDac=500
@@ -28,6 +30,8 @@ open plc PLC_Homing
Motor[2].FatalFeLimit=2000
L22=Motor[2].JogSpeed
Motor[2].JogSpeed=1
L23=Motor[2].pEncLoss
Motor[2].pEncLoss=0
Motor[1].PhaseFindingStep=1
@@ -119,9 +123,12 @@ N1: //ENDPLC
Motor[1].MaxDac=L10
Motor[1].FatalFeLimit=L11
Motor[1].JogSpeed=L12
Motor[1].pEncLoss=L13
Motor[2].MaxDac=L20
Motor[2].FatalFeLimit=L21
Motor[2].JogSpeed=L22
Motor[2].pEncLoss=L23
send 1"homeing done\n"
disable plc PLC_Homing

View File

@@ -8,24 +8,26 @@
//#5: homeoffset: -47956.2759182
!encoder_ssi(enc=1,numBits=18,posSf=-5625./4096)
//!motor(mot=1,dirCur=1000,JogSpeed=40,servoSf=256./9.,Pos2Sf=0,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!motor(mot=1,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=65477.)
!motor(mot=1,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=10,FatalFeLimit=1000,HomeOffset=65477.,FaultMode=0)
!encoder_ssi(enc=2,numBits=18,posSf=-5625./4096)
//!motor(mot=2,dirCur=1000,JogSpeed=40,servoSf=256./9.,Pos2Sf=0,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!motor(mot=2,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=-154370.)
!motor(mot=2,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=10,FatalFeLimit=1000,HomeOffset=-154370.,FaultMode=0)
!encoder_ssi(enc=3,numBits=18,posSf=-5625./4096)
//!motor(mot=3,dirCur=1000,JogSpeed=40,servoSf=256./9.,Pos2Sf=0,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!motor(mot=3,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=-5248.)
!motor(mot=3,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=10,FatalFeLimit=1000,HomeOffset=-5248.,FaultMode=0)
!encoder_ssi(enc=4,numBits=18,posSf=-5625./4096)
//!motor(mot=4,dirCur=1000,JogSpeed=40,servoSf=256./9.,Pos2Sf=0,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!motor(mot=4,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=-46620.)
!motor(mot=4,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=10,FatalFeLimit=1000,HomeOffset=-46620.,FaultMode=0)
!encoder_ssi(enc=5,numBits=18,posSf=-5625./4096)
//!motor(mot=5,dirCur=1000,JogSpeed=40,servoSf=256./9.,Pos2Sf=0,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!motor(mot=5,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=93168.)
!motor(mot=5,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=10,FatalFeLimit=1000,HomeOffset=93168.,FaultMode=0)
Motor[1].Servo.BreakPosErr=0
Motor[2].Servo.BreakPosErr=0
Motor[3].Servo.BreakPosErr=0
Motor[4].Servo.BreakPosErr=0
Motor[5].Servo.BreakPosErr=0
// PKP266D14BA2 1.4A 1.8deb/step
//!encoder_sim(enc=6)
@@ -38,64 +40,37 @@
!encoder_sim(enc=6,posSf=2000./102400)
!motor(mot=6,dirCur=1400,servoSf=102400./2000,invDir=False,JogSpeed=2,InPosBand=1,FatalFeLimit=1000,HomeOffset=0.)
define(SP_RelBrk='15',SP_LockBrk='16')
// ---------- Custom Motion Programs ----------
// break configuration
// at the beginning brakes were handeled with 'custom motion', but this has been removed,
// as it was possible to cofigure simple brake handling with the motor on a better approach
// s.a. following implementation
// ~/Documents/prj/SwissFEL/epics_ioc_modules/PBPG/cfg/motEnc-PBPG050.cfg
//!holding_current template not needed. The brake stuff below turns off the amplifiers
// brake
// PowerBrick[0].GpioData[0].16 is GPIO-OUT[1]
!cm_prem_post(ax=1,prem=15,post=16) //generates subprog 10,11,12,13
!cm_prem_post(ax=2,prem=15,post=16) //generates subprog 20,21,22,23
!cm_prem_post(ax=3,prem=15,post=16) //generates subprog 30,31,32,33
!cm_prem_post(ax=4,prem=15,post=16) //generates subprog 40,41,42,43
!cm_prem_post(ax=5,prem=15,post=16) //generates subprog 40,41,42,43
Motor[1].pBrakeOut = PowerBrick[0].GpioData[0].a // put proper reference to gpio here !!!
Motor[1].BrakeOutBit = 16
Motor[1].BrakeOffDelay = 100 // delay in ms before the brake is released after motion was triggered
Motor[1].BrakeOnDelay = 100 // delay in ms before the amplifier is disabled after motion has stopped
!cm_prem_post(ax='X',axid=9,prem=15,post=16) //generates subprog 90,91,92,93
!cm_prem_post(ax='Y',axid=10,prem=15,post=16) //generates subprog 100,101,102,103
!cm_prem_post(ax='U',axid=11,prem=15,post=16) //generates subprog 110,111,112,113
!cm_prem_post(ax='V',axid=12,prem=15,post=16) //generates subprog 120,121,122,123
!cm_prem_post(ax='W',axid=13,prem=15,post=16) //generates subprog 120,121,122,123
Motor[2].pBrakeOut = PowerBrick[0].GpioData[0].a // put proper reference to gpio here !!!
Motor[2].BrakeOutBit = 17
Motor[2].BrakeOffDelay = 100 // delay in ms before the brake is released after motion was triggered
Motor[2].BrakeOnDelay = 100 // delay in ms before the amplifier is disabled after motion has stopped
// ---------- PREM POST Programs ----------
//prem
open subprog SP_RelBrk
define(EndTime='L1'); // Local variable
Motor[1].IdCmd=1000;Motor[1].InPosBand=2
Motor[2].IdCmd=1000;Motor[2].InPosBand=2
Motor[3].IdCmd=1000;Motor[3].InPosBand=2
Motor[4].IdCmd=1000;Motor[4].InPosBand=2
Motor[5].IdCmd=1000;Motor[5].InPosBand=2
PowerBrick[0].GpioData[0].16.5=$1f
//send 1"wait\n"
//EndTime = Sys.Time + .1; // time + 10 sec.
//while (EndTime > Sys.Time){}
//send 1"wait done\n"
close
//post
open subprog SP_LockBrk
define(EndTime='L1'); // Local variable
//wait until all motors are in pos
EndTime = Sys.Time + 10; // time + 10 sec.
//send 1"wait."
while (EndTime > Sys.Time)
{
if(Coord[1].InPos)
{
//send 1"inPos\n"
break
}
//if(Motor[1].InPos && Motor[2].InPos&& Motor[3].InPos&& Motor[4].InPos&& Motor[5].InPos)
// break
//send 1"."
}
//send 1"done\n"
Motor[1].IdCmd=0;Motor[1].InPosBand=50
Motor[2].IdCmd=0;Motor[2].InPosBand=50
Motor[3].IdCmd=0;Motor[3].InPosBand=50
Motor[4].IdCmd=0;Motor[4].InPosBand=50
Motor[5].IdCmd=0;Motor[5].InPosBand=50
PowerBrick[0].GpioData[0].16.5=$0
close
Motor[3].pBrakeOut = PowerBrick[0].GpioData[0].a // put proper reference to gpio here !!!
Motor[3].BrakeOutBit = 18
Motor[3].BrakeOffDelay = 100 // delay in ms before the brake is released after motion was triggered
Motor[3].BrakeOnDelay = 100 // delay in ms before the amplifier is disabled after motion has stopped
Motor[4].pBrakeOut = PowerBrick[0].GpioData[0].a // put proper reference to gpio here !!!
Motor[4].BrakeOutBit = 19
Motor[4].BrakeOffDelay = 100 // delay in ms before the brake is released after motion was triggered
Motor[4].BrakeOnDelay = 100 // delay in ms before the amplifier is disabled after motion has stopped
Motor[5].pBrakeOut = PowerBrick[0].GpioData[0].a // put proper reference to gpio here !!!
Motor[5].BrakeOutBit = 20
Motor[5].BrakeOffDelay = 100 // delay in ms before the brake is released after motion was triggered
Motor[5].BrakeOnDelay = 100 // delay in ms before the amplifier is disabled after motion has stopped

View File

@@ -26,15 +26,6 @@ Coord[1].AltFeedRate=1000
Coord[1].Tm=-10000 //1000um/FeedTime -> 1mm/sec
Coord[1].FeedTime=1000 //default value 1000um
//motor current off (as cpxcall 16)
Motor[1].IdCmd=0;Motor[1].InPosBand=10
Motor[2].IdCmd=0;Motor[2].InPosBand=10
Motor[3].IdCmd=0;Motor[3].InPosBand=10
Motor[4].IdCmd=0;Motor[4].InPosBand=10
Motor[5].IdCmd=0;Motor[5].InPosBand=10
//#1..5hmz
//#1..5j/
&1
//initialization code
@@ -60,8 +51,9 @@ close // plc 1
enable plc 1
#1..5dkill
//motor 1..5 use custom code to kill motor and use brake
//motor 1..5 use break setup to kill motor
!holding_current(m6=[0,700])