机器人搬迁后的Base自动修正

[复制链接]
查看258 | 回复0 | 2024-9-25 13:53:55 | 显示全部楼层 |阅读模式
/span>


机器人搬迁后,机器人新安装位置和工件关系会发生变化。例如下图左侧为原始位置,右侧为新位置。如果原始轨迹基于某工件坐标系,则重做工件坐标系即可还原轨迹。

若原始轨迹记录基于wobj0(默认的wobj0和机器人的base在一起)。

如果能测定新的机器人base和搬迁前base(wobj0)的关系,则可以令搬迁后的wobj0和搬迁前的wobj0位姿相同,即下图的wobj0_new和搬迁前的wobj0一致。

假设搬迁过程TCP不变。

在搬迁前,对产品上记录多个特征点记录(建议至少4点或以上,最多10点)。在搬迁后,使用相同的TCP,记录对应的特征点新位姿。

可以参考以下代码进行示教和运行。

修改Base Frame并重启后,可以直接运行原有轨迹。

对于现场有多个wobj,也可以采用以下方法,因为wobj均基于wobj0计算。

! 搬迁前记录的点CONST robtarget point1:=[[817.2953,-130.2663,757.0421],[1.003332E-07,3.023174E-08,-1,-7.385786E-10],[-1,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];CONST robtarget point2:=[[1217.295,-130.2663,757.042],[2.772383E-07,-2.070071E-08,-1,-4.376369E-08],[-1,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];CONST robtarget point3:=[[1217.295,169.7337,757.0421],[2.223997E-07,5.286756E-09,-1,-2.901647E-08],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];CONST robtarget point4:=[[817.2953,169.7337,757.042],[3.204404E-07,3.539003E-08,-1,2.106348E-08],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
! 搬迁后记录的点CONST robtarget point10:=[[817.2953,-630.2662,757.042],[6.42871E-08,8.400629E-08,-1,-1.437866E-07],[-1,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];CONST robtarget point20:=[[1217.295,-630.2662,757.0419],[1.537106E-07,1.186E-07,-1,-1.481581E-07],[-1,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];CONST robtarget point30:=[[1217.295,-330.2663,757.0419],[2.557981E-07,1.034749E-07,-1,-1.636885E-07],[-1,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];CONST robtarget point40:=[[817.2953,-330.2663,757.0419],[2.868262E-07,1.001469E-07,-1,-7.791146E-08],[-1,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
PERS pose Frame1:=[[0.000119209,500,5.96046E-5],[1,1.10517E-7,-7.45058E-8,-7.40146E-15]];PERS robtarget p{4};PERS robtarget pNew{4};VAR num maxErr;VAR num meanErr;
PROC cal1() p{1}:=point1; p{2}:=point2; p{3}:=point3; p{4}:=point4;    ! p为搬迁前的点     pNew{1}:=point10; pNew{2}:=point20; pNew{3}:=point30; pNew{4}:=point40;    ! pNew为搬迁后的点
frame1:=DefAccFrame(Pnew,p,4,maxErr,meanErr);    ! 可以人工把frame1的值抄到 配置-moc-robot下的base_Frame值,注意距离单位是m stop; WriteCfgData "/MOC/Robot/ROB_1","base_frame_pos_x",frame1.trans.x/1000; WriteCfgData "/MOC/Robot/ROB_1","base_frame_pos_y",frame1.trans.y/1000; WriteCfgData "/MOC/Robot/ROB_1","base_frame_pos_z",frame1.trans.z/1000; WriteCfgData "/MOC/Robot/ROB_1","base_frame_orient_u0",frame1.rot.q1; WriteCfgData "/MOC/Robot/ROB_1","base_frame_orient_u1",frame1.rot.q2; WriteCfgData "/MOC/Robot/ROB_1","base_frame_orient_u2",frame1.rot.q3; WriteCfgData "/MOC/Robot/ROB_1","base_frame_orient_u3",frame1.rot.q4; stop;ENDPROC
PROC rModify()    ! 搬迁前示教的点 MoveL point1,v1000,fine,MyTool; MoveL point2,v1000,fine,MyTool; MoveL point3,v1000,fine,MyTool; MoveL point4,v1000,fine,MyTool;ENDPROC
PROC rModify2()    ! 搬迁后示教的点 MoveL point10,v1000,fine,MyTool; MoveL point20,v1000,fine,MyTool; MoveL point30,v1000,fine,MyTool; MoveL point40,v1000,fine,MyTool;ENDPROC

********************************

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册哦

x
您需要登录后才可以回帖 登录 | 注册哦

本版积分规则