ABB機器人編程程序解析匯報_第1頁
ABB機器人編程程序解析匯報_第2頁
ABB機器人編程程序解析匯報_第3頁
已閱讀5頁,還剩15頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)

文檔簡介

1、ABB機器人編程1程序解析:1、此程序是典型的ABB機器人官方編程思路與方法,分為主程序,初始化例行程序和軌跡程序2、思路清晰,結(jié)構(gòu)編排明確,方便使用者閱讀。%VERSION"LANGUAGE:ENGLISH%MODULE Mai nM odulePERS tooldata tGripper:=TRUE,0,0,100,1,0,0,0,25,0,0,10,1,0,0,0,0,0,0;PERS wobjdata WobBox:=FALSE,TRUE,"",1,1,1,0,0,0,0,0,0,0,1,0,0,0;CONST robtargetpPoi ntA:=1,1

2、,1,1,1,1,1,-1,0,0,0,9E+09,9E+09,9E+09,9E+09,9E+09,9E+09;CONST robtargetpPoi ntB:=1,1,1,1,1,1,1,-1,0,0,0,9E+09,9E+09,9E+09,9E+09,9E+09,9E+09;CONST robtargetPHome:=1,1,1,1,1,1,1,-1,0,0,0,9E+09,9E+09,9E+09,9E+09,9E+09,9E+09;PERS loaddata load_Empty:=1,0,0,0,1,0,0,0,0,0,0;PERS loaddata load_Box:=20,0,0,

3、0,1,0,0,0,0,0,0;以上是固定的數(shù)據(jù)存放位置。PROC main()主程序,是一個程序的開始rIn itial;Accset 60,60;此部分其實可放入到rlni tial中去,這樣管理起來更方便velset 100,100;此部分其實可放入到rln itial中去,這樣管理起來更方便WHILE TRUE DOrBox;在此指令后插入0.3秒的等待指令,防止CPU過負(fù)荷的情況岀現(xiàn)。ENDWHILEENDPROCPROC rInitial()SetDo DOGrip,0;WaitDI DIGripReleased,1;MoveJ pHome, v300, z50, tGripper

4、;ENDPROCPROC rBox()MoveJ offs(pPo in tA,0,200,500), v1500, z100,tGripper;MoveJ offs(pPo in tA,0,200,0), v1500, z50,tGripper;A:TPErase;IF DIAllowPick=1 THENWaitTime 0;ELSEIF DIAIIowPick=0 THENTPWrite "Sig nal of AllowPick no ready,PIease Check!"GOTO A;ENDIFMoveL pPo in tA,v800, fine, tGripp

5、er;SetDo DOGrip,1;WaitDI DIGripPicked,1;Gripload load_Box;這一句很重要的,設(shè)定機器人的實際負(fù)荷情況,有利于機器人伺服控制的優(yōu)化MoveJ offs(pPointA,0,0,500), v1000, z100, tGripper;MoveJ offs(pPoi ntB,0,0,200), v1000, z50, tGripperWObj:=WobBox;MoveL pPoi ntB, v1000, fine, tGripperWObj:=WobBox;SetDo DOGrip,0;WaitDI DIGripReleased,1;Gripl

6、oad load_Empty;MoveL offs(pPoi ntB,0,200,0), v800, z50, tGripperWObj:=WobBox;MoveJ offs(pPoi ntB,0,200,500), v1500, z100, tGripperWObj:=WobBox;ENDPROCENDMODULEABB機器人編程02程序解析:1、此程序編寫的思路是完全按照比賽題目中的要求的進行,就是按步就班式的2、思路清晰,結(jié)構(gòu)編排明確,方便使用者閱讀。3、有相應(yīng)的寫屏信息提示,方便操作員對機器人運行狀態(tài)的了解。4、有一點小問題,就是缺少初始化的部分。MODULEMai nM oduleC

7、ONSTrobtargetPHOME:=1149.87,13.55,451.35,0.729477,0.0748599,0.679603,0.01997 65,0,0,0,1,9E+09,9E+09,9E+09,9E+09,9E+09,9E+09;C0NSTrobtargetPA:=250.14,-652.34,650.90,0.429093,0.468557,-0.496153,0.591749,- 1,0,-2,1,9E+09,9E+09,9E+09,9E+09,9E+09,9E+09;CONSTrobtargetP20:=250.14,-652.35,828.56,0.429091,0.

8、468538,-0.496163,0.591756, -1,0,-3,1,9E+09,9E+09,9E+09,9E+09,9E+09,9E+09;CONSTrobtargetP30:=695.24,18.14,826.55,0.0377066,-0.677588,0.0913591,-0.728771, 0,0,-2,1,9E+09,9E+09,9E+09,9E+09,9E+09,9E+09;CONSTrobtargetP40:=1227.51,18.14,826.55,0.0377092,-0.677583,0.0913642,-0.728774 ,0,0,-3,1,9E+09,9E+09,

9、9E+09,9E+09,9E+09,9E+09;CONSTrobtargetPB:=1227.52,18.15,424.02,0.0377092,-0.677591,0.0913577,-0.728767,0,0,-2,1,9E+09,9E+09,9E+09,9E+09,9E+09,9E+09;PROCma in()在主程序里,過于臃腫,將具體功能盡量細(xì)分到例行程序TPErase;MoveJPHOME,v1000,z50,tool0;Open Gripper;WaitTime5;WHILEtrueDOIFPLC=1THENTPErase;TPWrite"Warni ng! Begi

10、n to move the new staff."WaitTime1;ClkResetclock1;ClkStartclock1;MovFromAtoB;ClkStopclock1;reg1:=ClkRead(clock1);TPErase;TPWrite"Goods han dli ng in place, it take (time in seco nd): "Num:=reg1;運行時間的顯示W(wǎng)aitTime5;ELSETPErase;TPWrite"Waiti ng for new goods."運行狀態(tài)的提醒WaitDIPLC,1;E

11、NDIFENDWHILEENDPROCPROCOpe nGripper()將對夾具的控制做在一個例行程序里,方便管理SetGO;ResetGI;ENDPROCPROCCloseGripper()將對夾具的控制做在一個例行程序里,方便管理SetG1;ResetG0;ENDPROCPROCMovFromAtoB()MoveJP30,v1000,z50,tool0;MoveJP20,v1000,z50,tool0;MoveLPA,v50,fi ne,tool0;WaitTime1;CloseGripper;WaitTime1;MoveJP20,v50,z50,tool0;MoveJP30,v1000

12、,z50,tool0;MoveJP40,v1000,z50,tool0;MoveLPB,v50,fi ne,tool0;WaitTimel;Open Gripper;WaitTimel;MoveLP40,v50,z50,tool0;MoveJP30,v1000,z50,tool0;MoveJPHOME,v1000,z50,tool0;ENDPROCENDMODULEABB機器人編程03程序解析:1、此程序是典型的ABB機器人官方編程思路與方法,分為主程序,初始化例行程序和軌跡程序。2、思路清晰,結(jié)構(gòu)編排明確,方便使用者閱讀。3、但有點要注意的初始化例行程序只在開始時,執(zhí)行一次,正常運行時,不再

13、執(zhí)行。但此程序是每個循環(huán)都會進行一次初始化,是有點問題的。PROC mai n()InitAll;此初始化程序應(yīng)與循環(huán)執(zhí)行的程序隔離開,使用WHILE指令Circle;WaitTime 0.5;ENDPROCPROC In itAll()Reset Do_fix On;WaitDI'O nConfJ'On;ConfL'On;VelSet 80, 1000;AccSet 70,70;MoveJ PHome, v150, fine, Tool0WObj:=Wobj2;RETURN;ENDPROCPROC Circle()MoveJ Home, v60, z0, Tool0W

14、Obj:=Wobj2;waitDI;work;reset waitDIMoveJ Home, v150, fine, ToolOWObj:=Wobj2;ENDPROCPROC fixope n()Set Do_fixope n;ENDPROCPROC fixclose()Reset Do_fixclose;ENDPROCPROC Work()MOVEJ AO v150, z10, ToolOWObj:=Wobj2;fixope n;waittime 2;MOVEL A1 v30, fin e,Tool0WObj:=Wobj2;fixclose;waittime 2;MOVEJ B0 v150,

15、 z10, Tool0WObj:=Wobj2;MOVEj B1 v30, fin e,ToolOWObj:=Wobj2;fixope n;waittime 2;MoveJ PHome, v150, fine, ToolOWObj:=Wobj2;ENDPROCABB機器人編程04程序解析:1、此程序是典型的ABB機器人官方編程思路與方法。2、思路清晰,結(jié)構(gòu)編排明確,方便使用者閱讀。,這個好處在于可以在手動狀3、 此程序有一個亮點,就是有一個回等待點的例行程序rMoveHome態(tài)下,就能方便的回到機器人的等待位置。4、有足夠的寫屏信息,很好地提示運行狀態(tài)。PROC Mai n()rln itial

16、;rMoveHome;While True DoVelset 100,3000;AccSet 70, 70;rpickworkpiece;rplaceworkpiece;en dwhileproc rpickworkpiece;if workpiece=falseMoveJ pickup, v2000, z5, too10;A:TPErase;為PLC發(fā)來拾取信號)IF DI10_pickup=1 THEN(pickupWaitTime 0;ELSEIF DI10_pickup=0 THENTPWrite "PLC-pickup sig nal no ready."GOTO

17、 A;ENDIFMoveJ Offs(pickup,0,0,300), v500, z200, too10;SetDo DO10_pickup1,1;wait time 1;workpiece=tureen difen dprocproc rplaceworkpiece;if workpiece=tureMoveJ placemiddle, v2000, z5, too10;MoveJ placeworkpiece, v2000, z5, too10;MoveJ 0ffs(placeworkpiece,0,0,300), v500, z200, too10;SetDo D010_pickup1

18、,0;A:TPErase;IF DI10_pickon=1 THEN(pickon為 PLC 檢測已放好信號)WaitTime 0;ELSEIF DI10_pickup=0 THENTPWrite "PLC-pickON signal no ready."GOTO A;workpiece=falseENDIFen dprocPROC rInitial()TpReadFk nInput,"ls the pack_machine ready","","","","No",&quo

19、t;Yes"(機器是否準(zhǔn)備好)If nln put=4 ThenbReady:=False;stop;ElseIF nln put=5 the nbReady:=True;ENDIFbFirstPickBoard:=True;TpReadFk nInput,"Do you want to place workpiece","","","","No","Yes"(機器人抓頭是否工件)If nln put=4 Thenworkpiece:=False;ElseIF nl

20、n put=5 the nworkpiece:=True;ENDPROCPROC rMoveHome()( 定義原點)此例行程序可以方便地回到等待位置MoveJ pHome, v500, z50, tGripper;ENDPROCABB機器人編程05程序解析:1、此程序是典型的ABB機器人官方編程思路與方法。2、思路清晰,結(jié)構(gòu)編排明確,方便使用者閱讀。3、此程序共分了 3個程序模塊,清楚地將不同用途的語句分開,方便閱讀,這種編程在進行一些復(fù) 雜系統(tǒng)的編程是非常有用的。4、 里面編程中運用了很多編程技巧,節(jié)省了機器人示教的時間,如使用OFFS功能。5、在寫屏信息提示方面也非常豐富。6、此程序非常

21、適合大家的參考與提高。7、有一個小問題,缺少搬運重要的負(fù)荷重量設(shè)定數(shù)據(jù)。MODULE Data此模塊專門用于存放程序數(shù)據(jù)的!targetCONST jointtarget home_pos := 0, 0, 0, 0, 90, 0, 9E9, 9E9, 9E9, 9E9, 9E9, 9E9;CONST jointtarget delta_pos := 2, 2, 2, 2, 2, 2, 9E9, 9E9, 9E9, 9E9, 9E9, 9E9;CONST joi nttarget jhome := 0, 0, 0, 0, 90, 0, 9E9, 9E9, 9E9, 9E9, 9E9, 9E9;

22、PERS robtargetroFetch:=2000,0,233.483269239532,0,0,1,0,0,0,0,0,9E9,9E9,9E9,9E9,9E9,9E9;PERS robtargetroDeFetch:=2000,1000,233.483269239532,0,0,1,0,0,0,0,0,9E9,9E9,9E9,9E9,9E9,9E9;VAR wzstati onary home;VAR shapedata join t_space;VAR num nu_in home;VAR bool flag1:=FALSE;ENDMODULE%VERSION: 1LANGUAGE:

23、ENGLISH%MODULE CalibData此模塊用于存放需要設(shè)定的程序數(shù)據(jù)TASK PERS tooldata Tooldata_1:=TRUE,0,0,1000,1,0,0,0,1,0,0,1,1,0,0,0,0,0,0;TASK PERS wobjdata Workobject_1:=FALSE,TRUE,"",0,0,0,1,0,0,0,0,0,0,1,0,0,0;MODULE Mai nM odulePROC mai n()CheckHome;CheckGriper;Producti on;ENDPROCPROC CheckHome()IF DOutput(d

24、o_i nhome) = 1 THENnu_in home := 1;ELSEnu_in home :=0;ENDIFTEST n u_i nhomeCASE 0 :GoHome;CASE 1 :RETURN;DEFAULT :TPWrite "error"Stop;ENDTESTENDPROCPROC CheckGriper()IF di_griperclosed = 1 THENCon trolGriper;ELSERETURN;ENDIFENDPROCPROC Productio n()WHILE TRUE DOWait Un til di_plc=1;MoveL O

25、ffs(roFetch,0,0,500),v1000,z100,Tooldata_1WObj:=Workobject_1;利用 OFFS 此功能,減少示教MoveL roFetch,v1000,fi ne,Tooldata_1WObj:=Workobject_1;CloseGriper;MoveL Offs(roFetch,0,0,500),v1000,z100,Tooldata_1WObj:=Workobject_1;MoveL Offs(roDeFetch,0,0,500),v1000,z100,Tooldata_1WObj:=Workobject_1;MoveL roDeFetch,v1

26、000,fi ne,Tooldata_1WObj:=Workobject_1;Open Griper;MoveL Offs(roDeFetch,O,O,5OO),v1OOO,z1OO,Tooldata_1WObj:=Workobject_1;ENDPROCPROC CloseGriper()flag1:=FALSE;Reset do_ope ngriper;Set do_closegriper;WaitDI di_griperclosed, 1MaxTime:=3TimeFlag:=flag1;WHILE flag仁TRUE DOTPWrite"CANN'T CLOSE GR

27、IPER"StopNoRega in;ENDWHILEENDPROCPROC Ope nGriper()flag1:=FALSE;Set do_ope ngriper;Reset do_closegriper;WaitDI di_griperope nd, 1MaxTime:=3TimeFlag:=flag1;WHILE flag仁TRUE DOTPWrite"CANN'T OPEN GRIPER"StopNoRega in;ENDWHILEENDPROCPROC DEF_Z on e()對機器人是否在等待位進行檢測 WZHomeJo in tDef ln side, join t_space, home_pos, delta_pos;WZDOSet'Stat, homel nside, joi nt_space, do_i nhome, 1;!RETURN;ENDPROCPROC GoHome()VAR btnres an swer;VAR string

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論