假设需要一个码垛程序, 从输送线抓到托盘, 托盘每层4个, 需要码5层, 可以用以下程序架构设计:
在config中定义层数cengshu , 每层码垛的个数(码垛的次数)cishu , 每层的高度levelHeight , 码垛放置点的集合putPoint[,] ,预放点1集合prePut1[,], 预放点2集合prePut2[,]
vbnet
DECL INT cengshu = 0
DECL INT cishu = 0
DECL INT levelHeight = 200
DECL FRAME putPoint[10,10]
DECL FRAME prePut1[10,10]
DECL FRAME prePut2[10,10]
码垛放件程序
注意,
1,
if false then
SPTP putbase Vel=100 % PDAT6 Tool[1] Base[0];
endif
是定义放件最下面层的基准点, 因为条件是if false, 所以机器人永远不会走这个点.
2,
在putbase 前加上x, 编程xputBase, 就可以将机器人的点位putbase 赋值给 用户定义的frame
putPoint[cengshu,cishu]
3, 走用户定义的点 putPoint[cengshu,cishu] 不能用机器人点位, 应该用命令
slin putPoint[cengshu,cishu] c_dis文章来源:https://www.toymoban.com/news/detail-688856.html
&ACCESS RVO1
&REL 61
&PARAM EDITMASK = *
&PARAM TEMPLATE = C:\KRC\Roboter\Template\vorgabe
&PARAM DISKPATH = KRC:\R1\Program\test
DEF put( )
INI
if false then
SPTP putbase Vel=100 % PDAT6 Tool[1] Base[0];
endif
PTP p20 Vel=100 % PDAT7 Tool[1] Base[0];
WAIT SEC 1
if (cengshu<6) then
if cishu == 1 then
putPoint[cengshu,cishu] = xputbase
putPoint[cengshu,cishu].z = putPoint[cengshu,cishu].z+(cengshu-1)*levelHeight
endif
if cishu == 2 then
putPoint[cengshu,cishu] = xputbase
putPoint[cengshu,cishu].x = putPoint[cengshu,cishu].x+100
putPoint[cengshu,cishu].a = putPoint[cengshu,cishu].a+90
putPoint[cengshu,cishu].z = putPoint[cengshu,cishu].z+(cengshu-1)*levelHeight
endif
if cishu == 3 then
putPoint[cengshu,cishu] = xputbase
putPoint[cengshu,cishu].x = putPoint[cengshu,cishu].x+100
putPoint[cengshu,cishu].y = putPoint[cengshu,cishu].y+100
putPoint[cengshu,cishu].z = putPoint[cengshu,cishu].z+(cengshu-1)*levelHeight
endif
if cishu == 4 then
putPoint[cengshu,cishu] = xputbase
putPoint[cengshu,cishu].y = putPoint[cengshu,cishu].y+100
putPoint[cengshu,cishu].z = putPoint[cengshu,cishu].z+(cengshu-1)*levelHeight
endif
endif
slin putPoint[cengshu,cishu] c_dis
END
主程序:文章来源地址https://www.toymoban.com/news/detail-688856.html
DEF test10( )
INI;
PTP P1 Vel=100 % PDAT1 Tool[1] Base[0]
for cengshu = 1 to 5
for cishu = 1 to 4
put()
endfor
endfor
PTP P2 Vel=100 % PDAT2 Tool[1] Base[0]
END
到了这里,关于Kuka机器人设计通用码垛程序的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!