欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

ABB机器人圆形角焊缝焊接程序

程序员文章站 2022-03-09 13:41:19
...

以下是ABB机器人圆形角焊缝的程序,它将一个焊接任务分为了多个子程序段(细化任务),该程序可实现自主计算焊道布置,简化操作,已经过实践检验。本文旨在提供思路,其中缺少少量关键代码,并不保证程序具有可运行能力。

MODULE MainModule
!***********************************************************
!
! Module:
!
! Description:
!
!
! Author: sunny
!
! Version: 1.0
!
!***********************************************************

!***********************************************************
!
! Procedure main
!
!   This is the entry point of your program
!
!***********************************************************

PROC main()!main Program
    MoveToblind;
    Threepoint_teach;
    CaculateWobj;
    pose_update tWeldGun,wweld;

    Back_to_Start;
    Autoweld;    
ENDPROC

PROC MoveToblind()!安全点设置
	MoveJ p_blind_home10, v100, z10, tWeldGun;
	!MoveJ p_blind_gd10, v100, z10, tWeldGun;
    !MoveJ p_blind_gd20, v100, z10, tWeldGun;
ENDPROC

PROC Threepoint_teach()!三点示教圆
    MoveJ p_circle_one, v100, fine, tWeldGun;
    stop;
	MoveL p_circle_two, v100, fine, tWeldGun;
    stop;
    MoveL p_circle_three, v100, fine, tWeldGun;
    stop;
ENDPROC

PROC CaculateWobj()!工具坐标计算         
    pCircleCenter.trans:=GetCircleCenter(p_circle_one.trans,p_circle_two.trans,p_circle_three.trans);
    pCircleCenter.rot:=p_circle_one.rot;
    pCircleCenter.robconf:=p_circle_one.robconf;
    pCircleCenter.extax:=p_circle_one.extax;
    Radius:=CaculateRadius(p_circle_one.trans,pCircleCenter.trans);
    CacFrame:=DefFrame(pCircleCenter,p_circle_one,p_circle_two);
    topsurface.uframe:=CacFrame;
    topsurface.oframe:=[[0,0,0],[1,0,0,0]];
    wweld.uframe:=topsurface.uframe;
    wweld.uframe.trans.z:=topsurface.uframe.trans.z-H;
    wweld.oframe:=[[0,0,0],[1,0,0,0]];
ENDPROC

PROC pose_update(PERS tooldata tWeldGun, PERS wobjdata wweld)!计算上表面圆周及示教焊接过程中的焊枪姿态

    pose1.trans:=p_circle_one.trans;
    pose1.rot:=p_circle_one.rot;
    pose2:=wweld.uframe;
    
    
    pCircleCenter.trans:=wweld.oframe.trans;
    pCircleCenter.rot:=pose_wweld.rot;
    MoveL p_circle_two, v100, fine, tWeldGun;
         
    p_upAngle0:=Offs(pCircleCenter, Circlepoint_x(0,Radius),Circlepoint_y(0,Radius),-H);
    p_upAngle60:=Offs(pCircleCenter, Circlepoint_x(60,Radius),Circlepoint_y(60,Radius),-H);
    p_upAngle120:=Offs(pCircleCenter, Circlepoint_x(120,Radius),Circlepoint_y(120,Radius),-H);
    p_upAngle180:=Offs(pCircleCenter, Circlepoint_x(180,Radius),Circlepoint_y(180,Radius),-H);
    p_upAngle240:=Offs(pCircleCenter, Circlepoint_x(240,Radius),Circlepoint_y(240,Radius),-H);
    p_upAngle300:=Offs(pCircleCenter, Circlepoint_x(300,Radius),Circlepoint_y(300,Radius),-H);
    p_upAngle360:=Offs(pCircleCenter, Circlepoint_x(360,Radius),Circlepoint_y(360,Radius),-H);
    p_upAngleAOA:=Offs(pCircleCenter, Circlepoint_x(AOA,Radius),Circlepoint_y(AOA,Radius),-H);
    
    p_upAngle0.rot:=pCircleCenter.rot;
    p_upAngle0.robconf:=pCircleCenter.robconf;
    MoveL p_upAngle0, v50, fine, tWeldGun\WObj:=wweld;
    stop;
    p_upAngle60.rot:=p_upAngle0.rot;
    p_upAngle60.robconf:=p_upAngle0.robconf;
    MoveL p_upAngle60, v50, fine, tWeldGun\WObj:=wweld;
    stop;
    p_upAngle120.rot:=p_upAngle60.rot;
    p_upAngle120.robconf:=p_upAngle60.robconf;
    MoveL p_upAngle120, v50,  fine, tWeldGun\WObj:=wweld;
    stop;
    p_upAngle180.rot:=p_upAngle120.rot;
    p_upAngle180.robconf:=p_upAngle120.robconf;
    MoveL p_upAngle180, v50,  fine, tWeldGun\WObj:=wweld;
    stop;
    p_upAngle240.rot:=p_upAngle180.rot;
    p_upAngle240.robconf:=p_upAngle180.robconf;
    MoveL p_upAngle240, v50,  fine, tWeldGun\WObj:=wweld;
    stop;
    p_upAngle300.rot:=p_upAngle240.rot;
    p_upAngle300.robconf:=p_upAngle240.robconf;
    MoveL p_upAngle300, v50, fine, tWeldGun\WObj:=wweld;
    stop;
    p_upAngle360.rot:=p_upAngle300.rot;
    p_upAngle360.robconf:=p_upAngle300.robconf;
    MoveL p_upAngle360, v50,  fine, tWeldGun\WObj:=wweld;
    stop;
    p_upAngleAOA.rot:=p_upAngle360.rot;
    p_upAngleAOA.robconf:=p_upAngle360.robconf;
    MoveL p_upAngleAOA, v50,  fine, tWeldGun\WObj:=wweld;
    stop;
ENDPROC

PROC Back_to_Start()!返回起焊安全点
    MoveJ p_upAngle360, v50,  z20, tWeldGun\WObj:=wweld;
    MoveC p_upAngle300, p_upAngle240,v50,  z20, tWeldGun\WObj:=wweld;
    MoveC p_upAngle180, p_upAngle120,v50,  z20, tWeldGun\WObj:=wweld;
    MoveC p_upAngle60, p_upAngle0,v50,  z20, tWeldGun\WObj:=wweld;
    
    MoveJ Offs(p_upAngle0,50,0,-50), v50,  fine, tWeldGun\WObj:=wweld;
    stop;
ENDPROC

PROC Path_Poseupdate()!焊接姿态赋值
    p_bAngle0.rot:=p_upAngle0.rot;
    p_bAngle0.robconf:=p_upAngle0.robconf;
    p_bAngle60.rot:=p_upAngle60.rot;
    p_bAngle60.robconf:=p_upAngle60.robconf;
    p_bAngle120.rot:=p_upAngle120.rot;
    p_bAngle120.robconf:=p_upAngle120.robconf;
    p_bAngle180.rot:=p_upAngle180.rot;
    p_bAngle180.robconf:=p_upAngle180.robconf;
    p_bAngle240.rot:=p_upAngle240.rot;
    p_bAngle240.robconf:=p_upAngle240.robconf;
    p_bAngle300.rot:=p_upAngle300.rot;
    p_bAngle300.robconf:=p_upAngle300.robconf;
    p_bAngle360.rot:=p_upAngle360.rot;
    p_bAngle360.robconf:=p_upAngle360.robconf;
    p_bAngleAOA.rot:=p_upAngleAOA.rot;
    p_bAngleAOA.robconf:=p_upAngleAOA.robconf;
ENDPROC

PROC Autoweld()!自动焊接及排道
    VAR num n:=0;
    VAR num i;             
    VAR num j;
    FOR i FROM NOW_i TO LAYER DO







	ENDFOR
ENDPROC

PROC welding()!焊接
    ArcLStart p_bAngle0, v50, seam1, weld1, fine, tWeldGun\WObj:=wweld;
    ArcC p_bAngle60, p_bAngle120, v50, seam1, weld1, fine, tWeldGun\WObj:=wweld;
    ArcC p_bAngle180, p_bAngle240, v50, seam1, weld1, fine, tWeldGun\WObj:=wweld;
    ArcCEnd p_bAngle300, p_bAngleAOA, v50, seam1, weld1, fine, tWeldGun\WObj:=wweld;
    MoveJ Offs(p_bAngle360,50,0,-50), v50,  fine, tWeldGun\WObj:=wweld; 

    Back_to_Start;
    stop;
ENDPROC

PROC WeldPathCac(num Tier, num n, PERS tooldata tWeldGun, PERS wobjdata wweld)!计算焊道的轨迹








    pCircleCenter.trans:=wweld.oframe.trans;
    pCircleCenter.rot:=pose_wweld.rot;
    p_bAngle0:=Offs(pCircleCenter, Circlepoint_x(0,Dr+Radius),Circlepoint_y(0,Dr+Radius), Dh);
    p_bAngle60:=Offs(pCircleCenter, Circlepoint_x(60,Dr+Radius),Circlepoint_y(60,Dr+Radius), Dh);
    p_bAngle120:=Offs(pCircleCenter, Circlepoint_x(120,Dr+Radius),Circlepoint_y(120,Dr+Radius), Dh);
    p_bAngle180:=Offs(pCircleCenter, Circlepoint_x(180,Dr+Radius),Circlepoint_y(180,Dr+Radius), Dh);
    p_bAngle240:=Offs(pCircleCenter, Circlepoint_x(240,Dr+Radius),Circlepoint_y(240,Dr+Radius), Dh);
    p_bAngle300:=Offs(pCircleCenter, Circlepoint_x(300,Dr+Radius),Circlepoint_y(300,Dr+Radius), Dh);
    p_bAngle360:=Offs(pCircleCenter, Circlepoint_x(360,Dr+Radius),Circlepoint_y(360,Dr+Radius), Dh);
    p_bAngleAOA:=Offs(pCircleCenter, Circlepoint_x(AOA,Dr+Radius),Circlepoint_y(AOA,Dr+Radius), Dh);
    Path_Poseupdate;
ENDPROC
相关标签: 职场和发展