刘工,我现在用4020控制器控制音圈电机正弦运动,用的PVT模式,每个周期分为40段、TM1000、1Hz。但是从GALILTOOL上看RPA 、RPB曲线,一个周期只有960ms。
程序如下:
BR1,1
SHAB
cycle=10000; 'number of cycles
TM1000; 'sample time
I=0;
PVA=0,0,25.6
PVB=0,0,25.6
BTAB
#A
PVA=1,98,25.6
PVB=31,1241,25.6
PVA=4,194,25.6
PVB=31,1195,25.6
PVA=6,285,25.6
PVB=29,1120,25.6
PVA=8,369,25.6
PVB=27,1017,25.6
PVA=10,444,25.6
PVB=23,889,25.6
PVA=12,508,25.6
PVB=21,739,25.6
PVA=14,560,25.6
PVB=16,571,25.6
PVA=14,598,25.6
PVB=12,388,25.6
PVA=15,621,25.6
PVB=8,197,25.6
PVA=16,628,25.6
PVB=2,0,25.6
PVA=16,621,25.6
PVB=-2,-197,25.6
PVA=15,598,25.6
PVB=-8,-388,25.6
PVA=14,560,25.6
PVB=-12,-571,25.6
PVA=14,508,25.6
PVB=-16,-739,25.6
PVA=12,444,25.6
PVB=-21,-889,25.6
PVA=10,369,25.6
PVB=-23,-1017,25.6
PVA=8,285,25.6
PVB=-27,-1120,25.6
PVA=6,194,25.6
PVB=-29,-1195,25.6
PVA=4,98,25.6
PVB=-31,-1241,25.6
PVA=1,0,25.6
PVB=-31,-1257,25.6
PVA=-1,-98,25.6
PVB=-31,-1241,25.6
PVA=-4,-194,25.6
PVB=-31,-1195,25.6
PVA=-6,-285,25.6
PVB=-29,-1120,25.6
PVA=-8,-369,25.6
PVB=-27,-1017,25.6
PVA=-10,-444,25.6
PVB=-23,-889,25.6
PVA=-12,-508,25.6
PVB=-21,-739,25.6
PVA=-14,-560,25.6
PVB=-16,-571,25.6
PVA=-14,-598,25.6
PVB=-12,-388,25.6
PVA=-15,-621,25.6
PVB=-8,-197,25.6
PVA=-16,-628,25.6
PVB=-2,0,25.6
PVA=-16,-621,25.6
PVB=2,197,25.6
PVA=-15,-598,25.6
PVB=8,388,25.6
PVA=-14,-560,25.6
PVB=12,571,25.6
PVA=-14,-508,25.6
PVB=16,739,25.6
PVA=-12,-444,25.6
PVB=21,889,25.6
PVA=-10,-369,25.6
PVB=23,1017,25.6
PVA=-8,-285,25.6
PVB=27,1120,25.6
PVA=-6,-194,25.6
PVB=29,1195,25.6
PVA=-4,-98,25.6
PVB=31,1241,25.6
PVA=-1,0,25.6
PVB=31,1257,25.6
JS#WAIT
I=I+1
JP#A,I<cycle
EN
#WAIT; 'subroutine to wait for PVT mode to complete
JP#WAIT,_PVA<>255
EN
楼主最近还看过