SFELPHOTON-1650:shapepath.py: stop-and-go struggeled with sync for first 3 measurements
This commit is contained in:
@@ -960,6 +960,9 @@ class ShapePath(MotionBase):
|
||||
twait_=round((tmove+twait)/fel_per)*fel_per-tmove
|
||||
if twait!=twait_:
|
||||
_log.warning(f'adjust twait({twait}) to {twait_} to match multiple of fel-cycles')
|
||||
# syncPlc:
|
||||
# Sys.Udata[0] 0->1 'fast counter: counter up ech pluse from 0 to pt2tp_felpulse
|
||||
# Sys.Udata[0] 0->1 'slow counter: increments by one after 'pt2tp_felpulse' pulses
|
||||
syncPlc=f'''\
|
||||
close all buffers
|
||||
disable plc 2
|
||||
@@ -981,6 +984,15 @@ enable plc 2
|
||||
if comm: comm.gpascii.send_block(syncPlc, verb&0x08)
|
||||
prg+=f'''\
|
||||
//mode 5: grid pvt motion
|
||||
//Sys.Udata[0] fast counter
|
||||
//Sys.Udata[1] slow counter
|
||||
//Sys.Udata[2] last slow counter value
|
||||
while(Coord[1].DesTimeBase==0){{}}
|
||||
Sys.Udata[0]=0 // resets fast counter
|
||||
Sys.Udata[1]=0 // resets slow counter
|
||||
Sys.Udata[2]=0
|
||||
while(Sys.Udata[2]==Sys.Udata[1]){{}} //initial wait
|
||||
Sys.Udata[2]=Sys.Udata[1] //save last slow counter value
|
||||
pvt{tmove} abs
|
||||
L1=0 //slow loop x
|
||||
L0=0 //fast loop y
|
||||
|
||||
@@ -212,16 +212,131 @@ open prog 3
|
||||
X10Y10
|
||||
Gather.Enable=0
|
||||
close
|
||||
```
|
||||
|
||||
## similar to stop and go motion
|
||||
```
|
||||
open prog 3
|
||||
Coord[1].DesTimeBase=Sys.ServoPeriod
|
||||
linearabs
|
||||
X-1Y-1
|
||||
dwell100
|
||||
Coord[1].TimeBaseSlew=1
|
||||
Coord[1].DesTimeBase=0
|
||||
Coord[1].Q[0]=-3 // simulate motion ready
|
||||
dwell100
|
||||
Coord[1].Q[10]=1 // simulate acquisition start
|
||||
dwell100
|
||||
//Sys.Udata[0] fast counter
|
||||
//Sys.Udata[1] slow counter
|
||||
//Sys.Udata[2] last slow counter value
|
||||
Sys.Udata[0]=0 // resets fast counter
|
||||
Sys.Udata[1]=0 // resets slow counter
|
||||
Sys.Udata[2]=0
|
||||
while(Sys.Udata[2]==Sys.Udata[1]){} //initial wait
|
||||
Sys.Udata[2]=Sys.Udata[1] //save last slow counter value
|
||||
pvt10abs
|
||||
L1=0
|
||||
L0=0
|
||||
while(L1<8){
|
||||
X(0+L1*1):0Y(0+L0*1):0
|
||||
while(Sys.Udata[2]==Sys.Udata[1]){}
|
||||
Sys.Udata[2]=Sys.Udata[1]
|
||||
L0+=1
|
||||
while(L0<6-1){
|
||||
X(0+L1*1):0Y(0+L0*1):0
|
||||
while(Sys.Udata[2]==Sys.Udata[1]){}
|
||||
Sys.Udata[2]=Sys.Udata[1]
|
||||
L0+=1
|
||||
}
|
||||
if(L1>=8-1){
|
||||
break
|
||||
}
|
||||
X(0+L1*1):0Y(0+L0*1):0
|
||||
while(Sys.Udata[2]==Sys.Udata[1]){}
|
||||
Sys.Udata[2]=Sys.Udata[1]
|
||||
L1+=1
|
||||
X(0+L1*1):0Y(0+L0*1):0
|
||||
while(Sys.Udata[2]==Sys.Udata[1]){}
|
||||
Sys.Udata[2]=Sys.Udata[1]
|
||||
L0-=1
|
||||
while(L0>=1)
|
||||
{
|
||||
X(0+L1*1):0Y(0+L0*1):0
|
||||
while(Sys.Udata[2]==Sys.Udata[1]){}
|
||||
Sys.Udata[2]=Sys.Udata[1]
|
||||
L0-=1
|
||||
}
|
||||
if(L1>=8-1){
|
||||
break
|
||||
}
|
||||
X(0+L1*1):0Y(0+L0*1):0
|
||||
while(Sys.Udata[2]==Sys.Udata[1]){}
|
||||
Sys.Udata[2]=Sys.Udata[1]
|
||||
L1+=1
|
||||
X(0+L1*1):0Y(0+L0*1):0
|
||||
while(Sys.Udata[2]==Sys.Udata[1]){}
|
||||
Sys.Udata[2]=Sys.Udata[1]
|
||||
L0+=1
|
||||
}
|
||||
X(0+L1*1):0Y(0+L0*1):0
|
||||
while(Sys.Udata[2]==Sys.Udata[1]){}
|
||||
Sys.Udata[2]=Sys.Udata[1]
|
||||
dwell100
|
||||
Gather.Enable=0
|
||||
close
|
||||
|
||||
// >=20 -> how many fel pulses to wait (orig was 2)
|
||||
disable plc 2
|
||||
open plc 2
|
||||
Sys.Udata[0]=0
|
||||
Sys.Udata[1]=0
|
||||
while(1) {
|
||||
while (Gate3[1].Chan[1].UserFlag==0){}
|
||||
Sys.Udata[0]=Sys.Udata[0]+1
|
||||
if (Sys.Udata[0]>=20) {
|
||||
Sys.Udata[1]=Sys.Udata[1]+1
|
||||
Sys.Udata[0]=0
|
||||
}
|
||||
while (Gate3[1].Chan[1].UserFlag==1){}
|
||||
}
|
||||
close
|
||||
enable plc 2 // resets counter at some beginning
|
||||
|
||||
Sys.Udata[1]=0
|
||||
Gather.Enable=1 // else triggerSync stops if value is 0
|
||||
Coord[1].Q[0]=0 // simulate motion not ready (!=-3)
|
||||
LD_LIBRARY_PATH=/opt/ppmac/libppmac/ /tmp/triggerSync 11 10 0 # trigger all 10 ms, sim start real frame triggers, with sync, verbose
|
||||
PBGatherPlot -r2 --ssh_tunnel -p 'exec:"&1b3r",disp:2,scl:{pos1:[1,0,0],pos2:[1,0,0],Chan0.UserFlag:[1,1],Chan1.UserFlag:[2,1],DesTimeBase:[100,0]},time:10,acq_per:1,motId:[1,2],address:"Sys.ServoCount,Gate3[1].Chan[0].UserFlag,Gate3[1].Chan[1].UserFlag,Motor[1].MoveTimer,Coord[1].DesTimeBase,Motor[{motId[0]}].ActPos,Motor[{motId[0]}].DesPos,Motor[{motId[1]}].ActPos,Motor[{motId[1]}].DesPos,Sys.Udata[0],Sys.Udata[1]"'
|
||||
|
||||
|
||||
>>>>>>>>> SwissMx code does not work: <<<<<<<<<<<<<<<<<
|
||||
Gather.Enable=1 // else triggerSync stops if value is 0
|
||||
root@:/opt/ppmac# LD_LIBRARY_PATH=/opt/ppmac/libppmac/ /tmp/triggerSync 9 10 0 # trigger all 10 ms, sim start real frame triggers, with sync, verbose
|
||||
zamofing_t@ganymede:~$ PBGatherPlot -r2 --ssh_tunnel -p 'exec:"&1b2r",disp:2,scl:{pos1:[1,0,0],pos2:[1,0,0],Chan0.UserFlag:[1,1],Chan1.UserFlag:[2,1],DesTimeBase:[100,0]},time:10,acq_per:1,motId:[1,2],address:"Sys.ServoCount,Gate3[1].Chan[0].UserFl
|
||||
ag,Gate3[1].Chan[1].UserFlag,Motor[1].MoveTimer,Coord[1].DesTimeBase,Motor[{motId[0]}].ActPos,Motor[{motId[0]}].DesPos,Motor
|
||||
[{motId[1]}].ActPos,Motor[{motId[1]}].DesPos,Sys.Udata[0],Sys.Udata[1]"'
|
||||
|
||||
->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
exec
|
||||
|
||||
|
||||
> list prog2
|
||||
Coord[1].DesTimeBase=Sys.ServoPeriod
|
||||
linearabs
|
||||
X-1Y-1
|
||||
dwell10
|
||||
Coord[1].TimeBaseSlew=1
|
||||
Coord[1].DesTimeBase=0
|
||||
Coord[1].Q[0]=-3
|
||||
while(Coord[1].DesTimeBase==0){}
|
||||
Sys.Udata[0]=0
|
||||
Sys.Udata[1]=0
|
||||
Sys.Udata[2]=0
|
||||
while(Sys.Udata[2]==Sys.Udata[1]){}
|
||||
Sys.Udata[2]=Sys.Udata[1]
|
||||
pvt10abs
|
||||
L1=0
|
||||
L0=0
|
||||
while(L1<8)
|
||||
{
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user