ABB机器人程序实例_第1页
ABB机器人程序实例_第2页
ABB机器人程序实例_第3页
ABB机器人程序实例_第4页
ABB机器人程序实例_第5页
已阅读5页,还剩14页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、MODULE Mai nM oduleCONSTrobtargetpHome:=1525.42,272.18,1873.69,4.42963E-05,0.699969, -0.7141 73,-2.80277E-05,0,-1,- 1,0,9E+09,9E+09,9E+09,9E+09,9E+09,9 E+09;CONSTrobtargetpPrePickMould:=1653.99,272.19,1779.41,5.83312E-05,0.69997, -0.714172,-3.47922E-05,0,-1,- 1,0,9E+09,9E+09,9E+09,9E+09,9 E+09,9E+09

2、;CONSTrobtargetpPrePickClapboard:=2036.17,-741.24,1235.05,0.678651,0.73435 ,-0.0119011,0.00467586, -1,-2,2,0,9E+09,9E+09,9E+09,9E+09,9 E+09,9E+09;CONSTrobtargetpPickMould:=1943.13,173.08,630.89,4.66987E-05,0.699977,-0.7 14166,-3.24109E-05,0,-1,- 1,0,9E+09,9E+09,9E+09,9E+09,9E+0 9,9E+09;CONSTrobtarge

3、tpPickClapboard:=1943.19,173.08,620.72,1.61422E-05,0.699977, -0.714165,-7.62858E-06,0,-1,- 1,0,9E+09,9E+09,9E+09,9E+09,9 E+09,9E+09;CONSTrobtarget pPrePlace:=785.90, -957.40,1722.38,0.00231652,0.0492402,-0.99 8779,-0.00310842,-1,-1,- 1,0,9E+09,9E+09,9E+09,9E+09,9E+09, 9E+09;CONSTrobtargetpPrePlace10

4、:=-277.40,-1202.57,1621.17,0.00183571, -0.0139794, -0.999895,-0.00341408,-2,-1,-2,0,9E+09,9E+09,9E+09,9E+09,9 E+09,9E+09;CONSTrobtargetpPrePlace20:=-491.18,-1082.85,1505.90,0.000663644,0.69408,0. 719887,0.00386364,-2,0,-1,0,9E+09,9E+09,9E+09,9E+09,9E+09 ,9E+09;CONSTrobtargetpPlaceMould:=-92.13,-2580

5、.19,1171.45,0.000771646,0.713144,0 .701007,0.00383692,-2,0,-1,0,9E+09,9E+09,9E+09,9E+09,9E+0 9,9E+09;CONSTrobtargetpPlaceClapboard:=1585.08,1761.04,787.33,0.00645323,-0.00552 996,-0.726358, -0.687263,0,1,-1,0,9E+09,9E+09,9E+09,9E+09,9 E+09,9E+09;CONSTrobtargetpPrePlaceClapboard:=1017.30,955.85,1443.

6、17,1.0621E-05,-0.00 849593,-0.999964,4.01139E-05,0,-1,0,0,9E+09,9E+09,9E+09,9E +09,9E+09,9E+09;CONSTrobtargetpPrePickClapboard10:=2257.17,-841.03,1579.56,0.667517,0.744 57,-0.00360206,0.00487631, -1,-1,2,0,9E+09,9E+09,9E+09,9E+0 9,9E+09,9E+09;CONSTrobtargetpPrePickMould10:=530.24,-1703.27,1762.63,5.

7、07659E-05,0.961 61,0.274421,2.37287E-05, -1,0,0,0,9E+09,9E+09,9E+09,9E+09,9 E+09,9E+09;CONST num nOffs:=100;PERS num n CurOffs:=100;CONST num nLayer:=0;PERS num n CurLayer:=0;CONST num n Thick ness:=40;VAR bool bTimeOut:=FALSE;PERS bool bDryCycle:=FALSE;VAR intnum iDryCycle;VAR intnum iResDryCycle;V

8、AR intnum iVacuum;PERStooldatatGripper:=TRUE,0,0,100,1,0,0,0,88.5,-3.7,-1.4,132.1,1,0,0,0,5.5,17.831,25.067;PROC mai n()rIn itAII;WHILE TRUE DOIF siDryCycle=1 or nCurLayer<1 the nrPickClapboard;ELSErPickMould;ENDIFWaittime 0.2;ENDWHILEENDPROCPROC rPickMould()DIWait diMouldready,1,3,"entrance

9、 Conveyer","ready for pick"DIWait diPlaceReady,1,3,"exit Co nveyer","ready forremove"MoveJ pPrePickMould, v1500, z50, tGripper;IF BitCheck( nCurlayer,1) THENn CurOffs:=nOffs;ELSEn CurOffs:=-nOffs;ENDIFMoveLoffs(pPickMould,0, nCurOffs,100+nCurLayer* nThick ness),v10

10、00,z50, tGripper;MoveLoffs(pPickMould,0, nCurOffs,( nCurLayer-1)* nThick ness), v200, fine,tGripper;GripClose;Decr n CurLayer;MoveLoffs(pPickMould,0, nCurOffs,100+nCurLayer* nThick ness),v200,z50, tGripper;MoveJ pPrePickMould, v1000, z50, tGripper;DIWait diPlaceReady,1,3,"exit Co nveyer",&

11、quot;readyforremove"MoveJ pPrePlace10, v1500, z10, tGripper;MoveL offs(pPlaceMould,0,0,100), v1500, z10, tGripper;MoveL pPlaceMould, v200, fine, tGripper;GripOpe n;MoveL offs(pPlaceMould,0,0,100), v200, z10, tGripper;MoveL pPrePlacelO, v1500, z10, tGripper;MoveJ pPrePickMould, v1500, z10, tGrip

12、per;PulseDO'PLe ngth:=2, doMouldPlaceOK;ENDPROCPROC rPickClapboard()DIWait diMouldready,1,3,"entrance Conveyer","ready forpick"MoveL offs(pPickClapboard,0,0,100), v1000, z50, tGripper;MoveL pPickClapboard, v200, fine, tGripper;GripClose;MoveL offs(pPickClapboard,0,0,100) ,v20

13、0, z50, tGripper;MoveL offs(pPickClapboard,0,0,500) ,v1000, z50, tGripper;MoveL pPrePlaceClapboard, v1000, z10, tGripper;DIWait diClapboardReady, 1, 3, "exit Conveyer", "readyfor remove"MoveL offs(pPlaceClapboard,-700,-200,250), v1000, z10,tGripper;MoveL offs(pPlaceClapboard,00,-

14、10,100), v1000, z10,tGripper;MoveL pPIaceClapboard, v100, fine, tGripper;GripOpe n;MoveL offs(pPlaceClapboard,0,-50,100), v1000,z10,tGripper;MoveL offs(pPlaceClapboard,-700,-200,250), v1000, z10, tGripper;MoveL pPrePlaceClapboard, v1000, z10, tGripper;PulseDO'PLe ngth:=1.O, doClapboardPickOK;Mov

15、eJ pHome, v1500, fine, tGripper;PulseDO'PLe ngth:=1.O, doU nStackOk;WaitTime 2;DIWait diMouldready,0,3,"exit Con veyer","ready forremove"n CurLayer:=nLayer;ENDPROCPROC rIn itAll()IF diVacuum 1=0 THENWaitTime 1;ELSEErrWrite "The Rob1 gripper error! " ,"The gripp

16、er isnot opened!"RL2:="Check the gripper signal postion ."RL3:=" open the gripper manually and take away the part from gripper."Stop;Exit;ENDIFrMoveHome;n CurLayer:=nLayer;IDelete iVacuum;CONNECT iVacuum WITH tLostPart;ISignalDI diVacuum1, 1, iVacuum;ISleep iVacuum;ENDPROCRO

17、C GripClose()SetDO doVacuum,1;SetDO doBlow,0;WaitU ntildiVacuum 仁 1MaxTime:=10TimeFlag:=bTimeOut;IF bTimeOut THENErrWrite "Rob Gripper Sig nal error ! " ,"Fatal error inGripper"RL2:="Check the gripper signal postion ."RL3:=" change a new sen sor ."Stop;ENDIFWa

18、ittime 0.5;IWatch iVacuum;ENDPROCPROC GripOpen()ISleep iVacuum;SetDO doVacuum,0;PulseDO PLe ngth:=2.0, doBlow;WaitU ntildiVacuum1=0MaxTime:=5TimeFlag:=bTimeOut;IF bTimeOut THENErrWrite "Rob Gripper Sig nal error ! " ,"Fatal error in Gripper"RL2:="Check the gripper signal pos

19、tion ."RL3:=" change a new sen sor ."Stop;ENDIFWaittime 0.5;ENDPROCPROC rMoveHome()VAR stri ng HomeOffset;CONST num Min X:=-500;CONST num MaxX:=500;CONST num MinY :=-500;CONST num Max Y:=500;CONST num Min Z:=500;CONST num MaxZ:=1200;VAR robtarget ActualPos;VelSet 100,500;AccSet 70, 70

20、;IF bCurre ntPos(pHome,tGripper,50)=TRUE THENM oveJ pHome,v500,fi ne,tGripperWObj:=wobj0;ENDIFIF bCurre ntPos(pPrePickMould,tGripper,50wobj:=Wobj0)=TRUE THENM oveJ pHome,v500,fi ne,tGripperWObj:=wobj0;ENDIFIFbCurre ntPos(pPrePickClapboard,tGripper,100wobj:=Wobj0)=TRUE THENM oveJ pHome,v500,fi ne,tGr

21、ipperWObj:=wobj0;ENDIFIF bCurre ntPos(pPreplace,tGripper,100wobj:=Wobj0)=TRUE THENM oveJ pHome,v500,fi ne,tGripperWObj:=wobjO;ENDIFIF bCurre ntPos(pHome,tGripper,100)=FALSE THEN! If no known positi on is found, check if the robot is in a specified! window and move him to the first position in the pr

22、ogram ActualPos:=CRobT(Tool:=tGripperWObj:=wobj0);IF ActualPos.trans.xvMinX OR ActualPos.trans.x>MaxXOR ActualPos.trans.yvMinY OR ActualPos.trans.y>MaxY ORActualPos.tra ns.zvMi nZ OR ActualPos.tra ns.z>MaxZ THENHomeOffset:=""IF ActualPos.tra ns.xvMi nX THENHomeOffset:=HomeOffset+&

23、quot;X :"+NumToStr(Mi nX-ActualPos.tra ns.x,0)+""ELSEIF ActualPos.tra ns.x>MaxX THENHomeOffset:=HomeOffset+"X :"+NumToStr(MaxX-ActualPos.tra ns.x,0)+""ELSEHomeOffset:=HomeOffset+"X : OK "ENDIFIF ActualPos.tra ns.yvMi nY THENHomeOffset:=HomeOffset+"

24、;Y :"+NumToStr(MinY-ActualPos.trans. y,0)+""ELSEIF ActualPos.tra ns.y>MaxY THENHomeOffset:=HomeOffset+"Y :"+NumToStr(MaxY-ActualPos.trans .y,0)+""ELSEHomeOffset:=HomeOffset+"Y : OK "ENDIFIF ActualPos.tra ns.zvMi nZ THENHomeOffset:=HomeOffset+"Z :"+NumToStr(MinZ-ActualPos

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论