《KUKA程序提示》由会员分享,可在线阅读,更多相关《KUKA程序提示(7页珍藏版)》请在金锄头文库上搜索。
1、.长安项目KUKA程序解析 2015.08.29 1. Cell.src为主程序,与PLC通讯调用其他子程序。正常工作前,应先手动回到Home位,选定cell.src,再将模式切换为EXTAUTO。2. t.src为回home 位程序,自编。3. TREATMENT_PIECE.src 为工件型号处理程序,里面有TREATMENT_PIECE和TREATMENT_PIECE2,意思是有2种类型的工件,目前我们生产的只用第一种,TREATMENT_PIECE2暂时可以不考虑,如果以后工件换型要用到就稍加调整,步骤与TREATMENT_PIECE功能一样。下面PICK_UP和PICK_UP2同理。
2、4. 工件型号处理调用程序,调用顺序如下:&ACCESS RVO1&REL 16&PARAM EDITMASK = *&PARAM TEMPLATE = C:KRCRoboterTemplatevorgabeDEF TREATMENT_PIECE( ) ;FOLD INI;%PE ;FOLD BASISTECH INI GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS=TRUE DO IR_STOPM ( ) INTERRUPT ON 3 BAS (#INITMOV,0 ) ;ENDFOLD (BASISTECH INI);FOLD SPOTTECH INIUSER
3、SPOT(#INIT);ENDFOLD (SPOTTECH INI);FOLD GRIPPERTECH INIUSER_GRP(0,DUMMY,DUMMY,GDEFAULT);ENDFOLD (GRIPPERTECH INI) ;FOLD USER INI ;Make your modifications here ;ENDFOLD (USER INI);ENDFOLD (INI)$OUT183=FALSE /循环开始$OUT182=FALSE /放料工件为0$OUT179=FALSE /IFW位置为0$OUT180=FALSE /面罩位置为0$OUT181=FALSE /吹洗位置为0$OUT
4、184=FALSE /机械手夹爪工件为0PICK_UP() /抓料程序SCROLL_DOWN() /抖料程序IFW_TANK() /IFW冲洗程序PIN_POINT() /面罩冲洗程序BLOWING() /吹洗程序DEPOSIT() /放料程序END第一步:PICK_UP.src 机械手抓料程序&ACCESS RVP1&REL 87&PARAM EDITMASK = *&PARAM TEMPLATE = C:KRCRoboterTemplatevorgabe&PARAM DISKPATH = KRC:R1DEF PICK_UP( ) /定义程序名;FOLD INI /定义变量;%PE ;FOL
5、D BASISTECH INI GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS=TRUE DO IR_STOPM ( ) INTERRUPT ON 3 BAS (#INITMOV,0 ) ;ENDFOLD (BASISTECH INI);FOLD SPOTTECH INIUSERSPOT(#INIT);ENDFOLD (SPOTTECH INI);FOLD GRIPPERTECH INIUSER_GRP(0,DUMMY,DUMMY,GDEFAULT);ENDFOLD (GRIPPERTECH INI) ;FOLD USER INI ;Make your modif
6、ications here ;ENDFOLD (USER INI);ENDFOLD (INI);FOLD PTP HOME Vel= 100 % DEFAULT /回到home点;%PE%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:HOME, 3:, 5:100, 7:DEFAULT$BWDSTART = FALSEPDAT_ACT=PDEFAULTFDAT_ACT=FHOMEBAS (#PTP_PARAMS,100 )$H_POS=XHOMEPTP XHOME;ENDFOLD$OUT183=FALSE /循环开始$OUT182=FALSE /工件放料位为0$O
7、UT179=FALSE /IFW位置为0$OUT180=FALSE /面罩位置为0$OUT181=FALSE /吹洗位置为0$OUT184=FALSE /夹爪为0;FOLD SET GRP 1 State=OPN CONT at START Delay=0 ms /夹爪打开;%PE%R 8.3.1,%MKUKATPGRP,%CGRP,%VGRP,%P 2:1, 4:1, 5:#YES, 6:GDAT0, 8:0, 10:0TRIGGER WHEN DISTANCE=0 DELAY=0 DO H50(GRP_APO,1,1,GCONT) PRIO=-1;ENDFOLD;VADO SOTTO AL
8、 PEZZO AL CARICO;GO UNDER PART LOAD /进入工件加载;FOLD LIN P1 Vel=0.1 m/s CPDAT1 Tool1 Base0 /关键点:工件下面位置1,每次修改的第一个主要位置;%PE%R 8.3.31,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P1, 3:, 5:0.1, 7:CPDAT1$BWDSTART=FALSELDAT_ACT=LCPDAT1FDAT_ACT=FP1BAS(#CP_PARAMS,0.1)LIN XP1 ;ENDFOLD;FOLD LIN P5 Vel=0.1 m/s CPDAT4 To
9、ol1 Base0 /位置1到位后上升进入定位销位置2;%PE%R 8.3.31,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P5, 3:, 5:0.1, 7:CPDAT4$BWDSTART=FALSELDAT_ACT=LCPDAT4FDAT_ACT=FP5BAS(#CP_PARAMS,0.1)LIN XP5 ;ENDFOLD;FOLD SET GRP 1 State=CLO CONT at START Delay=0 ms /夹爪夹紧;%PE%R 8.3.1,%MKUKATPGRP,%CGRP,%VGRP,%P 2:1, 4:2, 5:#YES, 6:GDA
10、T1, 8:0, 10:0TRIGGER WHEN DISTANCE=0 DELAY=0 DO H50(GRP_APO,1,2,GCONT) PRIO=-1;ENDFOLD;FOLD LIN P6 Vel=0.1 m/s CPDAT5 Tool1 Base0 /位置2顶起来后驶出位置3;%PE%R 8.3.31,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P6, 3:, 5:0.1, 7:CPDAT5$BWDSTART=FALSELDAT_ACT=LCPDAT5FDAT_ACT=FP6BAS(#CP_PARAMS,0.1)LIN XP6 ;ENDFOLD;ES
11、CO DAI RULLI;GO OUT BY ROLLER /驶出轨道;FOLD LIN P3 Vel=0.09 m/s CPDAT3 Tool1 Base0 /驶出位置,不用改;%PE%R 8.3.31,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P3, 3:, 5:0.09, 7:CPDAT3$BWDSTART=FALSELDAT_ACT=LCPDAT3FDAT_ACT=FP3BAS(#CP_PARAMS,0.09)LIN XP3 ;ENDFOLD$OUT184=TRUE /机器人抓料位置为1;FOLD PTP P4 Vel=100 % PDAT2 Too
12、l1 Base0 /驶出位置,不用改;%PE%R 8.3.31,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P4, 3:, 5:100, 7:PDAT2$BWDSTART=FALSEPDAT_ACT=PPDAT2FDAT_ACT=FP4BAS(#PTP_PARAMS,100)PTP XP4 ;ENDFOLDEND第二步:SCROLL_DOWN.src 抖料位置程序&ACCESS RVP1&REL 54&PARAM EDITMASK = *&PARAM TEMPLATE = C:KRCRoboterTemplatevorgabe&PARAM DISKPATH =
13、 KRC:R1DEF SCROLL_DOWN( ) /这步精度不高最简单,只要不撞合适就行。;FOLD INI;%PE ;FOLD BASISTECH INI GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS=TRUE DO IR_STOPM ( ) INTERRUPT ON 3 BAS (#INITMOV,0 ) ;ENDFOLD (BASISTECH INI);FOLD SPOTTECH INIUSERSPOT(#INIT);ENDFOLD (SPOTTECH INI);FOLD GRIPPERTECH INIUSER_GRP(0,DUMMY,DUMMY,GDEFAULT);ENDFOLD (GRIPPERTECH INI) ;FOLD USER INI ;Make your modifications here ;ENDFOLD (USER INI);ENDFOLD (INI);VADO SU SCROLLO PEZZO;GO TO SCROLL DOWN;FOLD PTP P1 CONT Vel=100 % PDAT1 Tool1 Base0;%PE%R 8.3.31,%MKUKATPBASIS,%CMOVE,%