返回首頁 hi, 歡迎來到機器人在線 請登錄/ 免費注冊 訂閱郵件
有疑問,咨詢在線客服

【ABB】ABB機器人如何通過離線編程與仿真完成搬運火花塞項目

時間:2020-08-11 來源:上海ABB工程有限公司 閱讀:5434

ABB機器人如何通過離線編程與仿真完成搬運火花塞項目?


本次的任務是在已經構建好的工作站里面將火花塞從左側工件托盤上搬運到右側擺臺上。在工作站配置中所使用的機器人ABB IRB1410型機器人,并且事先已經使用Smart組件構建完成機器人所使用的工具的夾取和放置的動態效果。


程序注釋:


MODULE MainMoudle

程序主模塊


PERS tooldata tGripper:=[TRUE,[[0,0,123],[1,0,0,0]],[1,[0,0,60],[1,0,0,0],0,0,0]];


定義工具數據


TASK PERS wobjdata WobjPick:=[FALSE,TRUE,"",[[812.92,-380,554],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];


定義左側托盤工件坐標數據


TASK PERS wobjdata WobjPlace:=[FALSE,TRUE,"",[[812.112,131.704,629],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];


定義右側托盤工件坐標數據


PERS loaddata LoadEmpty:=[0.001,[0,0,0.001],[1,0,0,0],0,0,0];


定義空載載荷數據


PERS loaddata LoadFull:=[0.1,[0,0,5],[1,0,0,0],0,0,0];


定義抓取工件后的載荷數據


PERS robtarget pPick:=[[226.448,104.769,13.931],[0.00734292,-1.6E-08,0.999973,-1E-09],[-1,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];


定義抓取數據,此數據隨著抓取位置的不同而變化,是變量


PERS?

robtarget?

pPlace:=[[223.781,102.869,13.3023],[0.00656412,0.698111,0.71593,-0.00649543],[0,-1,1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

定義放置數據,此數據隨著抓取位置的不同而變化,是變量


CONST?


robtarget?


pHome:=[[873.054605526,0,764.656133294],[0.007342891,0,0.999973041,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];


定義安全點


CONST?


robtarget?


pPickBase:=[[66.447802087,24.768906099,13.931002806],[0.007342918,-0.000000016,0.99997304,-0.000000001],


[-1,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];


定義抓取基準點


CONST?


robtarget?


pPlaceBase:=[[63.7807864,22.868891847,13.302282874],[0.006564124,0.698111195,0.715929802,-0.006495435],


[0,-1,1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];


定義放置基準點


PERS num nPickH:=150; 定義抓取位置的安全距離


PERS num nPlaceH:=100; 定義放置位置的安全距離


PERS num nOffsX:=40; 定義X方向偏移數值


PERS num nOffsY:=40; 定義Y方向偏移數值


PERS num nCount:=16; 定義搬運數量并賦初始值為1,此數值隨著搬運數量的變化而變化,是變量


PERS speeddata vMinSpeed:=[200,100,1000,5000];


PERS speeddata vMidSpeed:=[500,200,1000,5000];


PERS speeddata vMaxSpeed:=[800,300,1000,5000];定義高中低3種不同的運行速度,根據不同情況選擇不同的運行速度


PROC Main()


主程序


rInitAll; 調用初始化子程序


WHILE TRUE DO


條件語句,通過這樣的的調用方式,只運行初始化程序一次


rPick; 調用抓取子程序


rPlace; 調用放置子程序


ENDWHILE


ENDPROC


PROC rInitAll()


初始化子程序


ConfL\Off;


關閉線性運動和圓弧運動時的軸配置參數,使機器人能自由選擇軸運動方式接近目標點,預防報警


ConfJ\Off;


關閉關節運動時的軸配置參數,使機器人能自由選擇軸運動方式接近目標點,預防報警


AccSet 100,100; 設置加速度數據


VelSet 100,5000; 設置速度數據


Reset doGrip; 復位啟動信號


nCount:=1; 搬運計數數值置1


MoveJ pHome,vMinSpeed,fine,tGripper\WObj:=wobj0;


利用關節運動指令移動TCP到安全點pHome


ENDPROC


PROC rPick()


抓取子程序


rCalPos; 調用計算位置子程序


MoveJ Offs(pPick,0,0,nPickH),vMaxSpeed,z50,tGripper\WObj:=wobjPick;


以關節運動方式高速運動到抓取點工件上方150mm處


MoveL pPick,vMinSpeed,fine,tGripper\WObj:=wobjPick;


以直線運動方式低速運動到待抓取工件位置


Set doGrip; 啟動抓取操作


WaitTime 0.5; 等待0.5秒,確保抓取動作高質量完成


GripLoad LoadFull; 機器人滿載


MoveL Offs(pPick,0,0,nPickH),vMidSpeed,z50,tGripper\WObj:=wobjPick;


以直線運動方式中速運動到待抓取工件上方150mm


ENDPROC


PROC rPlace()


放置子程序


MoveJ Offs(pPlace,0,0,nPlaceH),vMidSpeed,z50,tGripper\WObj:=wobjPlace;


以關節運動方式中速運動到待抓取工件上方100mm


MoveL pPlace,vMinSpeed,fine,tGripper\WObj:=wobjPlace;


以直線運動方式低速運動到待放置位置處


Reset doGrip;復位啟動信號,放下火花塞


WaitTime 0.5;等待0.5秒,確保放置動作完成


GripLoad LoadEmpty;機器人空載


MoveL Offs(pPlace,0,0,nPickH),vMidSpeed,z50,tGripper\WObj:=wobjPlace;


以直線運動方式中速運動抬起100mm


rPlaceRD; 調用計數子程序


ENDPROC


PROC rPlaceRD()


計數子程序


nCount:=nCount+1;


搬運火花塞數量自增


IF nCount>32 THEN


IF條件判斷指令,當計數變量大于32的時候向下執行


TPErase; 清屏


TPWrite "Pick&Place done,the robot will stop!";


在觸摸屏上顯示"Pick&Place done,the robot will stop!"


nCount:=1; 計數變量置1


Reset doGrip;啟動復位信號


MoveJ pHome,vMinSpeed,fine,tGripper\WObj:=wobj0;


以關節運動形式低速運動到安全點


Stop;機器人停止


ENDIF


ENDPROC


PROC rCalPos()


計算位置子程序


!Row 1


TEST nCount


測量nCount變量,與CASE的數值作對比


CASE 1:


pPick:=Offs(pPickBase,0,0,0);


pPlace:=Offs(pPlaceBase,0,0,0);


CASE 2:


pPick:=Offs(pPickBase,nOffsX,0,0);


pPlace:=Offs(pPlaceBase,nOffsX,0,0);


CASE 3:


pPick:=Offs(pPickBase,2*nOffsX,0,0);


pPlace:=Offs(pPlaceBase,2*nOffsX,0,0);


CASE 4:


pPick:=Offs(pPickBase,3*nOffsX,0,0);


pPlace:=Offs(pPlaceBase,3*nOffsX,0,0);


!Row 2


CASE 5:


pPick:=Offs(pPickBase,-nOffsX,nOffsY,0);


pPlace:=Offs(pPlaceBase,-nOffsX,nOffsY,0);


CASE 6:


pPick:=Offs(pPickBase,0,nOffsY,0);


pPlace:=Offs(pPlaceBase,0,nOffsY,0);


CASE 7:


pPick:=Offs(pPickBase,nOffsX,nOffsY,0);


pPlace:=Offs(pPlaceBase,nOffsX,nOffsY,0);


CASE 8:


pPick:=Offs(pPickBase,2*nOffsX,nOffsY,0);


pPlace:=Offs(pPlaceBase,2*nOffsX,nOffsY,0);


CASE 9:


pPick:=Offs(pPickBase,3*nOffsX,nOffsY,0);


pPlace:=Offs(pPlaceBase,3*nOffsX,nOffsY,0);


CASE 10:


pPick:=Offs(pPickBase,4*nOffsX,nOffsY,0);


pPlace:=Offs(pPlaceBase,4*nOffsX,nOffsY,0);


!Row 3


CASE 11:


pPick:=Offs(pPickBase,-nOffsX,2*nOffsY,0);


pPlace:=Offs(pPlaceBase,-nOffsX,2*nOffsY,0);


CASE 12:


pPick:=Offs(pPickBase,0,2*nOffsY,0);


pPlace:=Offs(pPlaceBase,0,2*nOffsY,0);


CASE 13:


pPick:=Offs(pPickBase,nOffsX,2*nOffsY,0);


pPlace:=Offs(pPlaceBase,nOffsX,2*nOffsY,0);


CASE 14:


pPick:=Offs(pPickBase,2*nOffsX,2*nOffsY,0);


pPlace:=Offs(pPlaceBase,2*nOffsX,2*nOffsY,0);


CASE 15:


pPick:=Offs(pPickBase,3*nOffsX,2*nOffsY,0);


pPlace:=Offs(pPlaceBase,3*nOffsX,2*nOffsY,0);


CASE 16:


pPick:=Offs(pPickBase,4*nOffsX,2*nOffsY,0);


pPlace:=Offs(pPlaceBase,4*nOffsX,2*nOffsY,0);


!Row 4


CASE 17:


pPick:=Offs(pPickBase,-nOffsX,3*nOffsY,0);


pPlace:=Offs(pPlaceBase,-nOffsX,3*nOffsY,0);


CASE 18:


pPick:=Offs(pPickBase,0,3*nOffsY,0);


pPlace:=Offs(pPlaceBase,0,3*nOffsY,0);


CASE 19:


pPick:=Offs(pPickBase,nOffsX,3*nOffsY,0);


pPlace:=Offs(pPlaceBase,nOffsX,3*nOffsY,0);


CASE 20:


pPick:=Offs(pPickBase,2*nOffsX,3*nOffsY,0);


pPlace:=Offs(pPlaceBase,2*nOffsX,3*nOffsY,0);


CASE 21:


pPick:=Offs(pPickBase,3*nOffsX,3*nOffsY,0);


pPlace:=Offs(pPlaceBase,3*nOffsX,3*nOffsY,0);


CASE 22:


pPick:=Offs(pPickBase,4*nOffsX,3*nOffsY,0);


pPlace:=Offs(pPlaceBase,4*nOffsX,3*nOffsY,0);


!Row 5


CASE 23:


pPick:=Offs(pPickBase,-nOffsX,4*nOffsY,0);


pPlace:=Offs(pPlaceBase,-nOffsX,4*nOffsY,0);


CASE 24:


pPick:=Offs(pPickBase,0,4*nOffsY,0);


pPlace:=Offs(pPlaceBase,0,4*nOffsY,0);


CASE 25:


pPick:=Offs(pPickBase,nOffsX,4*nOffsY,0);


pPlace:=Offs(pPlaceBase,nOffsX,4*nOffsY,0);


CASE 26:


pPick:=Offs(pPickBase,2*nOffsX,4*nOffsY,0);


pPlace:=Offs(pPlaceBase,2*nOffsX,4*nOffsY,0);


CASE 27:


pPick:=Offs(pPickBase,3*nOffsX,4*nOffsY,0);


pPlace:=Offs(pPlaceBase,3*nOffsX,4*nOffsY,0);


CASE 28:


pPick:=Offs(pPickBase,4*nOffsX,4*nOffsY,0);


pPlace:=Offs(pPlaceBase,4*nOffsX,4*nOffsY,0);


!Row 6


CASE 29:


pPick:=Offs(pPickBase,0,5*nOffsY,0);


pPlace:=Offs(pPlaceBase,0,5*nOffsY,0);


CASE 30:


pPick:=Offs(pPickBase,nOffsX,5*nOffsY,0);


pPlace:=Offs(pPlaceBase,nOffsX,5*nOffsY,0);


CASE 31:


pPick:=Offs(pPickBase,2*nOffsX,5*nOffsY,0);


pPlace:=Offs(pPlaceBase,2*nOffsX,5*nOffsY,0);


CASE 32:


pPick:=Offs(pPickBase,3*nOffsX,5*nOffsY,0);


pPlace:=Offs(pPlaceBase,3*nOffsX,5*nOffsY,0);


計算火花塞抓取和放置位置數據


DEFAULT:


TPErase;清屏


TPWrite "the counter is error,please check it!";


在屏幕上顯示"the counter is error,please check it!"


Stop;機器人停止


ENDPROC


PROC rTeachPos()


示教位置子程序


MoveL pHome,v1000,z100,tGripper\WObj:=wobj0;


示教安全點


MoveL pPickBase,v1000,z100,tGripper\WObj:=WobjPick;


示教抓取基準點


MoveL pPlaceBase,v1000,z100,tGripper\WObj:=WobjPlace;


示教放置基準點


ENDPROC


ENDMODULE

好的文章,需要您的鼓勵

9

  • 最新文章
  • 精品案例
  • 現貨產品
延伸閱讀 熱門要聞

青海排五开奖结果