T-01-O-A-搬運壓鑄檢測及入庫仿真工作站機器人程序清單_第1頁
T-01-O-A-搬運壓鑄檢測及入庫仿真工作站機器人程序清單_第2頁
T-01-O-A-搬運壓鑄檢測及入庫仿真工作站機器人程序清單_第3頁
T-01-O-A-搬運壓鑄檢測及入庫仿真工作站機器人程序清單_第4頁
T-01-O-A-搬運壓鑄檢測及入庫仿真工作站機器人程序清單_第5頁
已閱讀5頁,還剩8頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、一、程序清單MODULE Module1 CONST robtarget pHome:=476.257603671,0,487.823041378,0.49999989,0,0.866025467,0,0,0,0,0,9E9,9E9,9E9,9E9,9E9,9E9; !定義初始工作點 CONST robtarget pPickBase:=254.691923959,-406.456321401,122.099725032,0.493741266,0.509221861,0.496098245,-0.500798551,-1,0,-1,1,9E9,9E9,9E9,9E9,9E9,9E9; !定義

2、取工件點 CONST robtarget pPickCover:=96.809609878,-410.558832569,122.643559039,0.493800607,0.509207192,0.498261486,-0.498602536,-1,0,0,1,9E9,9E9,9E9,9E9,9E9,9E9; !定義取工件環(huán)點 CONST robtarget pPlaceInCasting:=396.110507095,-56.918596192,225.595904039,0.70972185,0.000673696,0.704466064,0.004691194,-1,-1,0,1,9

3、E9,9E9,9E9,9E9,9E9,9E9; !定義放置到壓鑄機構(gòu)點 CONST robtarget pPickFromCasting:=399.105225703,-56.829603396,261.949150887,0.706432059,0.004390228,0.707753576,0.004398563,-1,-1,0,1,9E9,9E9,9E9,9E9,9E9,9E9; !定義從壓鑄機構(gòu)取出點 CONST robtarget pPlaceInStore:=138.360272171,502.599223653,312.785607909,0.493944296,-0.50149

4、8613,0.499454926,0.505037573,0,-1,0,1,9E9,9E9,9E9,9E9,9E9,9E9; !定義放置到倉庫基準點 CONST robtarget pChecking:=523.943259806,-57.088150515,473.210150845,0.709598646,0.00075987,0.704590293,0.004658657,-1,-1,0,1,9E9,9E9,9E9,9E9,9E9,9E9; !定義視覺檢測點 CONST robtarget pPushToTrash:=-77.766200016,380.605666682,139.824

5、260826,0.290011937,-0.214895135,0.932571461,0.00486081,1,1,-1,1,9E9,9E9,9E9,9E9,9E9,9E9; !定義放置到垃圾箱點 PERS string CheckedColour:="G" !定義視覺檢測到的顏色 PERS num nCounter:=0; !定義放置到垃圾箱的高度變量 PROC rTeaching() !工作點示教子程序 MoveJ pHome,v1000,fine,Gripper407_1WObj:=wobj0; !初始工作點 MoveJ pPickBase,v1000,fine,G

6、ripper407_1WObj:=wobj0; !取工件點 MoveJ pPickCover,v1000,fine,Gripper407_1WObj:=wobj0; !取工件環(huán)點 MoveJ pPlaceInCasting,v1000,fine,Gripper407_1WObj:=wobj0; !放置到壓鑄機構(gòu)點 MoveJ pPickFromCasting,v1000,fine,Gripper407_1WObj:=wobj0; !從壓鑄機構(gòu)取出點 MoveJ pPlaceInStore,v1000,fine,Gripper407_1WObj:=wobj0; !放置到倉庫基準點 MoveJ p

7、Checking,v1000,fine,Gripper407_1WObj:=wobj0; !視覺檢測點 ENDPROC PROC Initial() !初始化子程序 nCounter:=0; !定義在開始后放置到垃圾箱的最低高度 Reset do_CastClamp; !壓鑄機構(gòu)平行氣夾松開 Reset do_CastXmove; !壓鑄機構(gòu)X方向回原點 Reset do_CastZmove; !壓鑄機構(gòu)Z方向收回 Reset do_TransmitBase; !關(guān)停傳送帶(工件) Reset do_TransmitCover; !關(guān)停傳送帶(工件環(huán)) Reset do_WorkpieceBa

8、se; !送料機構(gòu)(工件)收回 Reset do_WorkpieceCover; !送料機構(gòu)(工件環(huán))收回 Reset do_Gripper; !松開機器人上的氣爪 Reset do_Checking; !視覺檢測復位 MoveJ pHome,v1000,z5,Gripper407_1WObj:=wobj0; !回到初始工作點 WaitTime 1; rPushBase; !推出第一個工件并開傳送帶 rPushCover; !推出第一個工件環(huán)并開傳送帶 ENDPROC PROC rPushBase() !送料機構(gòu)推出工件子程序 Set do_WorkpieceBase; !推出工件 WaitT

9、ime 0.5; Reset do_WorkpieceBase; !推桿收回 WaitTime 0.1; Set do_TransmitBase; !打開傳送帶 ENDPROC PROC rPushCover() !送料機構(gòu)推出工件環(huán)子程序 Set do_WorkpieceCover; !推出工件環(huán) WaitTime 0.5; Reset do_WorkpieceCover; !推桿收回 WaitTime 0.1; Set do_TransmitCover; !打開傳送帶 ENDPROC PROC rPickWorkpieceBase() !機器人從傳送帶上取工件子程序 ReSet do_Gr

10、ipper; !松開氣爪 MoveJ offs(pPickBase,0,0,100),v1000,z10,Gripper407_1WObj:=wobj0; !運動到抓取點的正上方100 WaitDI di_WorkpieceBaseInPos,1; !等待工件從傳送帶上傳送到位 Reset do_TransmitBase; !關(guān)閉傳送帶 MoveLDO pPickBase,v500,fine,Gripper407_1WObj:=wobj0,do_Gripper,1; !運動到抓取點并抓取 WaitTime 0.5; MoveL offs(pPickBase,0,0,100),v1000,z10

11、,Gripper407_1WObj:=wobj0; !運動到抓取點的正上方100 rPushBase; !調(diào)用送料機構(gòu)推出工件子程序 ENDPROC PROC rPlaceWorkpieceBase() !機器人將工件放置到壓鑄臺子程序 MoveJ offs(pPlaceInCasting,0,0,100),v1000,z10,Gripper407_1WObj:=wobj0; !運動到壓鑄臺的正上方100 MoveLDO pPlaceInCasting,v500,fine,Gripper407_1WObj:=wobj0,do_Gripper,0; !運動到壓鑄臺的并放下工件 Reset do_

12、Gripper; WaitTime 0.5; MoveL offs(pPlaceInCasting,0,0,100),v500,z10,Gripper407_1WObj:=wobj0; !運動到壓鑄臺的正上方100 ENDPROC PROC rPickWorkpieceCover() !機器人從傳送帶上取工件環(huán)子程序 Reset do_Gripper; !松開氣爪 MoveJ offs(pPickCover,0,0,100),v1000,z10,Gripper407_1WObj:=wobj0; !運動到抓取點的正上方100 WaitDI di_WorkpieceCoverInPos,1; !等

13、待工件從傳送帶上傳送到位 Reset do_TransmitCover; !關(guān)閉傳送帶 MoveLDO pPickCover,v200,fine,Gripper407_1WObj:=wobj0,do_Gripper,1; !運動到抓取點并抓取 WaitTime 0.5; MoveL offs(pPickCover,0,0,100),v1000,z10,Gripper407_1WObj:=wobj0; !運動到抓取點的正上方100 rGetColour; !調(diào)用視覺檢測子程序 rPushCover; !調(diào)用送料機構(gòu)推出工件環(huán)子程序 ENDPROC PROC rPlaceWorkpieceCove

14、r() !機器人將工件環(huán)放置到壓鑄臺子程序 MoveJ offs(pPlaceInCasting,0,0,100),v1000,z10,Gripper407_1WObj:=wobj0; !運動到壓鑄臺的正上方100 MoveLDO offs(pPlaceInCasting,3,0,36),v200,fine,Gripper407_1WObj:=wobj0,do_Gripper,0; !運動到壓鑄臺的并放下工件環(huán) WaitTime 0.5; MoveL offs(pPlaceInCasting,0,0,100),v500,z10,Gripper407_1WObj:=wobj0; !運動到壓鑄臺的

15、正上方100 ENDPROC PROC rCasting() !壓鑄子程序 Set do_CastClamp; !夾緊平行氣夾 WaitTime 0.5; Set do_CastXmove; !X方向運行到工作點 WaitDI di_CastXmoveInWork,1; !等待X方向運行到位 Set do_CastZmove; !Z方向向下壓鑄 WaitTime 0.5; Reset do_CastZmove; !Z方向收回 WaitTime 0.5; Reset do_CastXmove; !X方向回原點 WaitDI di_CastXmoveInHome,1; !等待X方向回到原點 Res

16、et do_CastClamp; !松開平行氣夾 WaitTime 0.5; ENDPROC PROC rPickCasting() !從壓鑄機構(gòu)取出成品子程序 MoveJ offs(pPickFromCasting,0,0,100),v1000,z10,Gripper407_1WObj:=wobj0; !運動到壓鑄臺取出點的正上方100 MoveLDO offs(pPickFromCasting,0,0,-28),v500,fine,Gripper407_1WObj:=wobj0,do_Gripper,1; !運動到壓鑄臺取出點并夾緊工件 WaitTime 0.5; MoveL offs(p

17、PickFromCasting,0,0,100),v500,z0,Gripper407_1WObj:=wobj0; !運動到壓鑄臺取出點的正上方100 ENDPROC PROC rStoring(num layer,num col) !存儲到倉庫子程序 MoveJ offs(pPlaceInStore,col*95-95,-150,240-120*layer),v1000,z10,Gripper407_1WObj:=wobj0; !運動到存儲點外側(cè)150(Y方向負150) !“col”為列,“95”為列寬,“l(fā)ayer”為層,從上層至下層為1-3,“120”為層高 MoveL offs(pPl

18、aceInStore,col*95-95,0,240-120*layer),v500,z0,Gripper407_1WObj:=wobj0; !運動到存儲點 WaitTime 0.6; Reset do_Gripper; !松開氣夾 WaitTime 0.5; MoveJ offs(pPlaceInStore,col*95-95,-150,240-120*layer),v1000,z10,Gripper407_1WObj:=wobj0; !運動到存儲點外側(cè)150(Y方向負150) ENDPROC PROC rPushToTrash() !放置到垃圾庫子程序 MoveJ Offs(pPushTo

19、Trash,0,0,250),v1000,fine,Gripper407_1WObj:=wobj0; !運動到放置點的正上方250 MoveJDO Offs(pPushToTrash,0,0,nCounter*10),v1000,fine,Gripper407_1WObj:=wobj0,do_Gripper,0; !運動到放置點 !"nCounter"為計數(shù),每放置一個后向上10mm WaitTime 0.5; MoveJ Offs(pPushToTrash,0,0,250),v1000,fine,Gripper407_1WObj:=wobj0; !運動到放置點的正上方25

20、0 nCounter:=nCounter+1; !計數(shù)加1 ENDPROC PROC rGetColour() !工件顏色判斷子程序 IF di_CoverYellow=1 THEN CheckedColour:="Y" !若檢測到黃色,則CheckedColour賦值"Y" ELSEIF di_CoverGreen=1 THEN CheckedColour:="G" !若檢測到綠色,則CheckedColour賦值"G" ELSEIF di_CoverBlue=1 THEN CheckedColour:=&quo

21、t;B" !若檢測到藍色,則CheckedColour賦值"B" ELSE CheckedColour:="non" !若檢測失敗,則CheckedColour賦值"non" ENDIF ENDPROC PROC rChecking() !視覺檢測子程序 MoveJ Offs(pChecking,-100,0,0),v500,fine,Gripper407_1WObj:=wobj0; !運動到檢測點的X方向-100 MoveJ pChecking,v300,fine,Gripper407_1WObj:=wobj0; !運動到檢測點 Set do_Checking; !使能相機開始檢測 WaitTime 0.8; Reset do_Checking; !停止檢測 ENDPROC PROC main() VAR num Yellow_num:=0; !定義黃色工件的當前個數(shù) VAR num Green_num:=0; !定義綠色工件的當前個數(shù) VAR num Blue_num:=0; !定義藍色工件的當前個數(shù) Initial; !初始化 WHILE TRUE DO MoveJ pHome,v1000,z5,Gripper407_1WObj:=wob

溫馨提示

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

評論

0/150

提交評論