This commit is contained in:
2024-11-25 09:58:55 +01:00
parent ae7882651e
commit 527fcec7f5
3 changed files with 307 additions and 241 deletions

View File

@@ -1040,27 +1040,27 @@ enable plc 2
{t}=1 // motion pvt time scaling
pvt{pt2pt_time} abs
while(1){{
{x0}+={dx};{y0}+={dy}
//send 1"A:move(%d) X%g:%g Y%g:%g",{n},{ox}+{x0}+{x1}*{px},{dx},{oy}+{y0}+{y1}*{py},{dy}
X({ox}+({x0}+{x1})*{px}):({vx}) Y({oy}+({y0}+{y1})*{py}):({vy})
{x0}+={dx};{y0}+={dy}
if ({t}!=1){{
pvt{pt2pt_time} abs;{t}=1
}}
if ({y0}=={sy}-1){{
if ({dy}==1){{ // (1)
{dx}=1;{dy}=0
{vx}={vsx};{vy}=0
{vx}={vsx}/2;{vy}={vsy}/2
}}else{{
{dx}=0;{dy}=-1// (2)
{vx}=0;{vy}=-{vsy}
{vx}={vsx}/2;{vy}=-{vsy}/2
}}
}}else if ({y0}==1 && {x0}<{sx}-1){{
if ({dy}==-1){{ // (3)
{dx}=1;{dy}=0
{vx}={vsx};{vy}=0
{vx}={vsx}/2;{vy}=-{vsy}/2
}}else{{
{dx}=0;{dy}=1 // (4)
{vx}=0;{vy}={vsy}
{vx}={vsx}/2;{vy}={vsy}/2
}}
}}else if ({y0}==0){{
if ({n}==1 && {x0}==1){{ // (7 or 8)
@@ -1071,7 +1071,7 @@ enable plc 2
}}
else if ({r}%2==1 && {x1}>0){{ //(7 odd)
{x1}-={sx}
{vx}=-{vsx};{vy}=0
{vx}=0;{vy}=0
pvt{pt2pt_time*tmx} abs;{t}={tmx}
}}
else if ({y1}+2*{sy}<={ny}){{ //(8)
@@ -1093,7 +1093,7 @@ enable plc 2
{vx}=0;{vy}={vsy}
}}else{{ // (5)
{dx}=-1;{dy}=0
{vx}=-{vsx};{vy}=0
{vx}=-{vsx}/2;{vy}=-{vsy}/2
}}
}}
}}
@@ -1299,8 +1299,8 @@ if __name__=='__main__':
elif mode==6:
grid={'pos':(-1000, -1200), 'pitch':(120, 120), 'count':(16, 20)}
# section size (in wells)
ssz=(4, 5)
#ssz=(6, 10)
#ssz=(4, 5)
ssz=(6, 10)
#ssz=(2, 5)
#sdelay=ssz[0]*ssz[1] # wait after <swait> section for motion trigger. swait=0:never wait
sp.setup_motion(fnPrg=fn+'.prg',scale=1.,cnt=1,dwell=100,mode=6,grid=grid,ssz=ssz)