cleanup and commission wedge mover
This commit is contained in:
@@ -689,7 +689,7 @@ open forward
|
||||
define(p1_x='L13', p1_y='L14', p1_z='L15')
|
||||
define(scale='L16')
|
||||
|
||||
send 1"fwd_inp(%f) %f %f %f %f\\n",D0,qCX,qCZ,qW,qFY''')
|
||||
//send 1"fwd_inp(%f) %f %f %f %f\\n",D0,qCX,qCZ,qW,qFY''')
|
||||
for i in range(2):
|
||||
#https://stackoverflow.com/questions/3471999/how-do-i-merge-two-lists-into-a-single-list
|
||||
l=[j for i in zip((i,) * param.shape[1], list(param[i])) for j in i]
|
||||
@@ -711,7 +711,7 @@ open forward
|
||||
DX=qCX-p0_x
|
||||
DZ=qCZ-p0_z
|
||||
Y=qFY
|
||||
send 1"fwd_res %f %f %f %f\\n",DX,DZ,W,Y
|
||||
//send 1"fwd_res %f %f %f %f\\n",DX,DZ,W,Y
|
||||
//P1001+=1
|
||||
D0=$000001c2; //B=$2 X=$40 Y=$80 Z=$100 hex(2+int('40',16)+int('80',16)+int('100',16)) -> 0x1c2
|
||||
close
|
||||
@@ -732,10 +732,10 @@ open inverse
|
||||
define(p_x='L16', p_y='L17', p_z='L18')
|
||||
define(sclY='L19')
|
||||
define(scl='L20')
|
||||
if(D0>0)
|
||||
send 1"inv_inp(%f) %f:%f %f:%f %f:%f %f:%f\\n",D0,DX,vDX,DZ,vDZ,W,vW,Y,vY
|
||||
else
|
||||
send 1"inv_inp(%f) %f %f %f %f\\n",D0,DX,DZ,W,Y''')
|
||||
//if(D0>0)
|
||||
// send 1"inv_inp(%f) %f:%f %f:%f %f:%f %f:%f\\n",D0,DX,vDX,DZ,vDZ,W,vW,Y,vY
|
||||
//else
|
||||
// send 1"inv_inp(%f) %f %f %f %f\\n",D0,DX,DZ,W,Y''')
|
||||
for i in range(2):
|
||||
# https://stackoverflow.com/questions/3471999/how-do-i-merge-two-lists-into-a-single-list
|
||||
l = [j for i in zip((i,) * param.shape[1], list(param[i])) for j in i]
|
||||
@@ -770,10 +770,10 @@ open inverse
|
||||
vqW=vW//+((p1_x-p0_x)/(p1_y-p0_y)*vY)*p_z+((p1_z-p0_z)/(p1_y-p0_y)*vY*p_x
|
||||
''')
|
||||
prg.append(" vqW=vqW*%g"%(1000./d2r)) #scale from rad to 1000*deg
|
||||
prg.append(''' send 1"inv_res %f:%f %f:%f %f:%f %f:%f\\n",qCX,vqCX,qCZ,vqCZ,qW,vqW,qFY,vqFY
|
||||
prg.append('''// send 1"inv_res %f:%f %f:%f %f:%f %f:%f\\n",qCX,vqCX,qCZ,vqCZ,qW,vqW,qFY,vqFY
|
||||
}
|
||||
else
|
||||
send 1"inv_res %f %f %f %f\\n",qCX,qCZ,qW,qFY
|
||||
//else
|
||||
// send 1"inv_res %f %f %f %f\\n",qCX,qCZ,qW,qFY
|
||||
//P1002+=1
|
||||
close
|
||||
''')
|
||||
@@ -880,9 +880,11 @@ close
|
||||
prg.append(' Gather.Enable=2')
|
||||
prg.append(' Coord[1].AltFeedRate=0') # allow maximum speed
|
||||
prg.append(' Coord[1].SegMoveTime=0') #to calculate every 1 ms the inverse kinematics
|
||||
prg.append(' P2000=0')
|
||||
for i in range(pt.shape[0]):
|
||||
prg.append(' X%g Z%g B%g Y%g' % tuple(pt[i, :]))
|
||||
prg.append(' dwell 100')
|
||||
#prg.append(' P2000=%d'%(i,))
|
||||
prg.append(' dwell 10')
|
||||
prg.append(' Gather.Enable=0')
|
||||
|
||||
# ******** mode 1 ********
|
||||
@@ -1096,8 +1098,8 @@ Examples:'''+''.join(map(lambda s:cmd+s, exampleCmd))+'\n '
|
||||
hs.calcParam()
|
||||
#hs.param[0]=(15,2,0,3,0)#(z_i, y_i, x_i, r_i,phi_i)
|
||||
#hs.param[1]=(15,4,0,3,0)#(z_i, y_i, x_i, r_i,phi_i)
|
||||
#hs.param[0]=(-100, 10,0,50,0)#(z_i, y_i, x_i, r_i,phi_i)
|
||||
#hs.param[1]=(-100,-10,0,70,0)#(z_i, y_i, x_i, r_i,phi_i)
|
||||
hs.param[0]=(-100, 100,0,50,0)#(z_i, y_i, x_i, r_i,phi_i)
|
||||
hs.param[1]=(-100,-100,0,70,0)#(z_i, y_i, x_i, r_i,phi_i)
|
||||
|
||||
hs.test_coord_trf()
|
||||
#hs.interactive_cx_cz_w_fy()
|
||||
@@ -1107,7 +1109,7 @@ Examples:'''+''.join(map(lambda s:cmd+s, exampleCmd))+'\n '
|
||||
#0:1 config simulated motors
|
||||
#1:2 config real motors
|
||||
#2:4 config coord trf
|
||||
mode=6#6#5#4#0
|
||||
mode=6#5#4#0
|
||||
os.chdir(os.path.join(os.path.dirname(__file__),'../cfg'))
|
||||
if mode&1:
|
||||
hs.download(file='sim_8_motors.cfg')
|
||||
@@ -1123,7 +1125,7 @@ Examples:'''+''.join(map(lambda s:cmd+s, exampleCmd))+'\n '
|
||||
hs.download(['enable plc 0',])
|
||||
time.sleep(.5)
|
||||
hs.download(['#1..7j/',])
|
||||
time.sleep(.5)
|
||||
time.sleep(.5)
|
||||
|
||||
#hs.gen_prog(mode=-1)
|
||||
#hs.gen_prog(mode=0,cntHor=1,cntVert=3,wRng=(120000,120000))
|
||||
@@ -1135,8 +1137,12 @@ Examples:'''+''.join(map(lambda s:cmd+s, exampleCmd))+'\n '
|
||||
#hs.gen_prog(mode=1,cntHor=1,cntVert=5,wRng=(0,360000))
|
||||
#hs.gen_prog(mode=1,cntHor=1,cntVert=5,hRng=(-.3,.3),wRng=(0,360000),smt=1)
|
||||
#hs.gen_prog(mode=1,cntHor=7,cntVert=2,hRng=(-3,3),wRng=(120000,120000),smt=0)
|
||||
hs.gen_prog(mode=1,cntHor=3,cntVert=6,hRng=(-5,5),wRng=(00,120000),smt=0,pt2pt_time=10)
|
||||
#hs.gen_prog(mode=1, cntHor=1, cntVert=2, wRng=(0, 360000), smt=0)
|
||||
#hs.gen_prog(mode=1,cntHor=3,cntVert=6,hRng=(-5,5),wRng=(00,120000),smt=0,pt2pt_time=10)
|
||||
#hs.gen_prog(mode=0,cntHor=3,cntVert=10,hRng=(-5,5),wRng=(0,120000))
|
||||
#hs.gen_prog(mode=0,cntHor=3,cntVert=25,hRng=(-5,5),wRng=(0,120000))
|
||||
hs.gen_prog(mode=1,cntHor=3,cntVert=25,hRng=(-5,5),wRng=(0,120000),smt=0,pt2pt_time=300)
|
||||
#hs.gen_prog(mode=1,cntHor=3,cntVert=20,hRng=(-5,5),wRng=(0,1200),smt=0,pt2pt_time=200)
|
||||
#hs.gen_prog(mode=1, cntHor=2, cntVert=2, wRng=(0, 360000), smt=0)
|
||||
#hs.gen_prog(mode=1)
|
||||
#hs.gen_prog(mode=1,pt2pt_time=100,cnt=1,cntVert=35,cntHor=7,hRng=(-.3,.3),wRng=(0,360000*3),yRng=(6.2,2.3))
|
||||
#hs.gen_prog(mode=1,pt2pt_time=100,cnt=1,cntVert=10,cntHor=3,hRng=(-30,30),wRng=(0,36000),yRng=(-50,-100))
|
||||
|
||||
Reference in New Issue
Block a user