首先视觉固定在机器人的Z轴丝杆中心搭配取料,在这过程中我们遇到了以下几个问题:
1.视觉与机械手标定后,发现视觉Y轴方向与机器人Y轴方向相反
2.建立用户坐标系后,物料进行旋转10度左右,进行拍照抓取发现角度没有问题,X和Y的方向不对
3.建立用户坐标系后,用相机中心和丝杆中心在用户坐标系的1号用户坐标,进行(0,0)原点移动,发现都不在视觉的mark中心,以镜像对称的方式移到了另外一边
4.在机械手标定,物料模板标定,机械手取料点标定的正确下,发现Y轴偏移值不对
针对上面的问题情况,分析出现的原因和采取对应的措施如下:
原因:前三个问题都出现在视觉与机械手标定,当视觉固定在Z轴上时,走九点标点方向就会相反
解决办法:在标定过程中,机械手往相反的方向跑就可以
原因:最后一个问题出现在视觉做mark点模板的时候,识别的特征点不对就会导致机械手取料位置不对
解决办法:重新做mark模板标定
-----------------------------------------------以下是封装的函数--------------------------------------------------------
--- <summary>*用三点示教定义和显示用户坐标系(本地坐标系)\n </summary>
--- <argument name="UF_Idx">用户坐标系编号,范围(1,9)。(type:number)\n </argument>
--- <argument name="select_plane">选择示教平面,0为XY平面,1为XZ平面(type:number)\n</argument>
--- <argument name="Base_point">原点。(type:table)\n</argument>
--- <argument name="X_point">X方向点。(type:table) \n</argument>
--- <argument name="Y_or_Z_point">Y方向或Z方向点。(type:table)\n</argument>
--- <argument name="ActiveTilt">启用倾斜,为1时启用,0或nil则不启用,可省略(type:number)\n</argument>
--- <argument name="ActiveOrthogonality">启用非正交,为1时启用,0或nil则不启用,可省略(type:number)\n</argument>
--- <argument name="XScale">X轴比例尺,单位:μm。可省略(type:number)\n</argument>
--- <argument name="YScale">Y轴或Z轴比例尺,单位:μm。可省略(type:number)\n</argument>
function Local(UF_Idx, select_plane, Base_point, X_point, Y_or_Z_point, ActiveTilt, ActiveOrthogonality, XScale, YScale) --用户坐标系三点示教法
--select_plane:0是XY平面,1是XZ平面。
local tValid = _LUA_NONE_ERR
local TmpValid = {}
local tmpIdx = 1
local TmpUserFrameP = {}
local Pn = {}
--传入参数错误判断
if type(UF_Idx) ~= "number" or type(Base_point) ~= "table" or type(X_point) ~= "table" or type(Y_or_Z_point) ~= "table" or type(select_plane) ~= "number" then
motion.ProgramStop(string.format("Function Local(): Argument input type is error!"))
--print("Function Local(): Argument input type is error!", "\n")
--tValid = _LUA_IP_TYPE_ERR
--return tValid
end
if UF_Idx < 1 or UF_Idx > 9 then
motion.ProgramStop(string.format("Function Local():Value of UF_Idx is out of range!"))
--print("Function Local():Value of UF_Idx is out of range!", "\n")
--tValid = _LUA_IP_OUT_RANGE_ERR
--return tValid
end
if type(ActiveTilt) ~=