iCAx开思网

标题: 五轴激光代码 [打印本页]

作者: 幸福的鱼    时间: 2011-12-9 16:55
标题: 五轴激光代码
PROGRAM program()
VAR
STARTSPEED:REAL
END_VAR
BEGIN
TASK Main/PRI = LOW
BEGIN
SYSDEF(0,0,0,0,0,0)
SYSREF_OFF
MOVE_PTP (AX3 = 0)/COORD = ROBOT
MOVE_PTP (AX4=0,AX5=0)/COORD=ROBOT
LPM=0
         FUNCTION SETFOCUS ( 1.2 , 0 , 0)
!****************************************************************
      POINT_ORI( -35 ,190 ,90 ,0 ,0 ,0 ,0 ,0 ,0 )
      POINT_TRF( 200 ,200 ,100 ,0 ,0 ,0 ,0 ,0 ,0 )
      SYSREF_ON/HEAD_ROT(0.05)
! ****************************************************************
         !****** Ver. 5.15.02 ******
        !****** Material: MS L5, Thickness: 2
         WORK_ON CUTTING,1(Shutter= 1 ,GasPress  = 1 , GasType=1)

        !****** START CUTTING NUMBER 2 ******************

        MOVE_LIN (-230.965,-22.001,250,-1.570796,0)/SPEED=75/FLY
        MOVE_LIN (-230.965,-22.001,210,-1.570796,0)/SPEED=75
        FUNCTION APP3D_ON ( -230.965,-22.001,200,-1.570796,0,4)
        GOSUB 1001
        MOVE_LIN (-231,-23,200,-1.570796,0)/FLY
        MOVE_LIN (-231.926,-22.967,200,-1.570796,0)/FLY
        MOVE_CIR (-243.297,-14.217,200,-1.570796,0)/VIA (-238.953,-20.284,200,-1.570796,0)/FLY
        MOVE_LIN (-243.75,-12.536,200,-1.570796,0)/FLY
        MOVE_CIR (-243.56,-6.647,200,-1.570796,0)/VIA (-244,-10,200,-1.570796,0)/FLY
        MOVE_LIN (-243.01,-5.025,200,-1.570796,0)/FLY
        MOVE_CIR (-222.39,-19.74,200,-1.570796,0)/VIA (-222.972,0.225,200,-1.570796,0)/FLY
        MOVE_LIN (-223.778,-20.809,200,-1.570796,0)/FLY
        MOVE_CIR (-230.123,-22.971,200,-1.570796,0)/VIA (-226.025,-22.01,200,-1.570796,0)/FLY
        MOVE_LIN (-231,-23,200,-1.570796,0)
        GOSUB 201

        MOVE_LIN (-230.965,-22.001,250,-1.570796,0)/SPEED=75/FLY

        !****** START CUTTING NUMBER 7 ******************

        MOVE_LIN (-154.5,-10.003,213,-1.570796,0)/SPEED=75/FLY
        MOVE_LIN (-154.5,-10.003,173,-1.570796,0)/SPEED=75
        FUNCTION APP3D_ON ( -154.5,-10.003,163,-1.570796,0,4)
        GOSUB 1001
        MOVE_LIN (-155.5,-10,163,-1.570796,0)/FLY
        MOVE_LIN (-155.458,-6.081,163,-1.570796,0)/FLY
        MOVE_CIR (-155.415,-15.541,163,-1.570796,0)/VIA (205.42,-4.608,163,-1.570796,0)/FLY
        MOVE_LIN (-155.5,-10,163,-1.570796,0)
        GOSUB 201

        MOVE_LIN (-154.5,-10.003,213,-1.570796,0)/SPEED=75/FLY
        MOVE_LIN (360,-164.13,213,-1.570796,0)/SPEED=75/FLY

        !****** START CUTTING NUMBER 5 ******************

        MOVE_LIN (360,-164.13,184.902,-1.570796,-1.570796)/SPEED=75/FLY
        MOVE_LIN (320,-164.13,184.902,-1.570796,-1.570796)/SPEED=75
        FUNCTION APP3D_ON ( 310,-164.13,184.902,-1.570796,-1.570796,4)
        GOSUB 1001
        MOVE_LIN (310,-165.125,185,-1.570796,-1.570796)/FLY
        MOVE_LIN (310,-165.065,185.61,-1.570796,-1.570796)/FLY
        MOVE_CIR (310,-165.065,184.39,-1.570796,-1.570796)/VIA (310,-158.875,185,-1.570796,-1.570796)/FLY
        MOVE_LIN (310,-165.125,185,-1.570796,-1.570796)
        GOSUB 201

        MOVE_LIN (360,-164.13,184.902,-1.570796,-1.570796)/SPEED=75/FLY

        !****** START CUTTING NUMBER 4 ******************

        MOVE_LIN (360,-198.13,184.902,-1.570796,-1.570796)/SPEED=75/FLY
        MOVE_LIN (320,-198.13,184.902,-1.570796,-1.570796)/SPEED=75
        FUNCTION APP3D_ON ( 310,-198.13,184.902,-1.570796,-1.570796,4)
        GOSUB 1001
        MOVE_LIN (310,-199.125,185,-1.570796,-1.570796)/FLY
        MOVE_LIN (310,-199.065,185.61,-1.570796,-1.570796)/FLY
        MOVE_CIR (310,-199.065,184.39,-1.570796,-1.570796)/VIA (310,-192.875,185,-1.570796,-1.570796)/FLY
        MOVE_LIN (310,-199.125,185,-1.570796,-1.570796)
        GOSUB 201

        MOVE_LIN (360,-198.13,184.902,-1.570796,-1.570796)/SPEED=75/FLY

        !****** START CUTTING NUMBER 6 ******************

        MOVE_LIN (360,208.87,184.902,-1.570796,-1.570796)/SPEED=75/FLY
        MOVE_LIN (320,208.87,184.902,-1.570796,-1.570796)/SPEED=75
        FUNCTION APP3D_ON ( 310,208.87,184.902,-1.570796,-1.570796,4)
        GOSUB 1001
        MOVE_LIN (310,207.875,185,-1.570796,-1.570796)/FLY
        MOVE_LIN (310,207.935,185.61,-1.570796,-1.570796)/FLY
        MOVE_CIR (310,207.935,184.39,-1.570796,-1.570796)/VIA (310,214.125,185,-1.570796,-1.570796)/FLY
        MOVE_LIN (310,207.875,185,-1.570796,-1.570796)
        GOSUB 201

        MOVE_LIN (360,208.87,184.902,-1.570796,-1.570796)/SPEED=75/FLY

        !****** START CUTTING NUMBER 3 ******************

        MOVE_LIN (360,244.902,187.13,-1.570796,-1.570796)/SPEED=75/FLY
        MOVE_LIN (320,244.902,187.13,-1.570796,-1.570796)/SPEED=75
        FUNCTION APP3D_ON ( 310,244.902,187.13,-1.570796,-1.570796,4)
        GOSUB 1001
        MOVE_LIN (310,245,188.125,-1.570796,-1.570796)/FLY
        MOVE_LIN (310,245.61,188.065,-1.570796,-1.570796)/FLY
        MOVE_CIR (310,244.39,188.065,-1.570796,-1.570796)/VIA (310,245,181.875,-1.570796,-1.570796)/FLY
        MOVE_LIN (310,245,188.125,-1.570796,-1.570796)
        GOSUB 201

        MOVE_LIN (360,244.902,187.13,-1.570796,-1.570796)/SPEED=75/FLY

        !****** START CUTTING NUMBER 1 ******************

        MOVE_LIN (360,88.797,178.004,-1.570796,-1.570796)/SPEED=75/FLY
        MOVE_LIN (320,88.797,178.004,-1.570796,-1.570796)/SPEED=75
        FUNCTION APP3D_ON ( 310,88.797,178.004,-1.570796,-1.570796,4)
        GOSUB 1001
        MOVE_LIN (310,88.884,179,-1.570796,-1.570796)/FLY
        MOVE_CIR (310,89.884,180,-1.570796,-1.570796)/VIA (310,89.177,179.707,-1.570796,-1.570796)/FLY
        MOVE_LIN (310,260,180,-1.492256,-1.570796)/FLY
        MOVE_LIN (309.85,261.906,180,-1.492256,-1.570796)/FLY
        MOVE_LIN (309.254,264.663,180,-1.178097,-1.570796)/FLY
        MOVE_LIN (308.544,266.379,180,-1.178097,-1.570796)/FLY
        MOVE_LIN (307.175,268.752,180,-1.021017,-1.570796)/FLY
        MOVE_LIN (305.896,270.267,180,-0.863938,-1.570796)/FLY
        MOVE_LIN (305.2,270.954,180,-0.706858,-1.570796)/FLY
        MOVE_CIR (295,275,180,-0.078539,-1.570796)/VIA (302.071,273.205,180,-0.549778,-1.570796)/FLY
        MOVE_LIN (25,275,180,0,-1.570796)/FLY
        MOVE_CIR (25,-295,180,3.141592,-1.570796)/VIA (-260,-10,180,1.552103,-1.37881)/FLY
        MOVE_LIN (295,-295,180,3.220132,-1.570796)/FLY
        MOVE_LIN (297.589,-294.757,180,3.377212,-1.570796)/FLY
        MOVE_LIN (299.479,-294.303,180,3.377212,-1.570796)/FLY
        MOVE_LIN (301.204,-293.616,180,3.534291,-1.570796)/FLY
        MOVE_LIN (302.093,-293.192,180,3.691371,-1.570796)/FLY
        MOVE_LIN (303.718,-292.196,180,3.691371,-1.570796)/FLY
        MOVE_LIN (305.176,-290.974,180,3.848451,-1.570796)/FLY
        MOVE_LIN (305.861,-290.308,180,4.00553,-1.570796)/FLY
        MOVE_LIN (307.058,-288.907,180,4.00553,-1.570796)/FLY
        MOVE_LIN (308.075,-287.284,180,4.16261,-1.570796)/FLY
        MOVE_LIN (308.503,-286.478,180,4.319689,-1.570796)/FLY
        MOVE_LIN (309.239,-284.699,180,4.319689,-1.570796)/FLY
        MOVE_LIN (309.691,-282.863,180,4.476769,-1.570796)/FLY
        MOVE_LIN (309.847,-281.94,180,4.633849,-1.570796)/FLY
        MOVE_LIN (310,-280,180,4.712389,-1.570796)/FLY
        MOVE_LIN (310,89.884,180,4.712389,-1.570796)/FLY
        MOVE_CIR (310,90.884,179,4.712389,-1.570796)/VIA (310,90.591,179.707,4.712389,-1.570796)/FLY
        MOVE_LIN (310,90.971,178.004,4.712389,-1.570796)
        GOSUB 201

        MOVE_LIN (360,90.971,178.004,4.712389,-1.570796)/SPEED=75
        GOTO 9999
        !     **** End All Cut ****

1001:        ! Line 1
WORK_ON PIERCING,1 ( Delay=200, Shutter=3,Type=2,Power=2000,Freq=50,DutyC=15,GasPress=1,GasType=1)
WORK_ON CUTTING,1 ( Shutter=3,Type=1,Power=1600,GasPress=2.4,GasType=1)
DELAY 0.4
FUNCTION TRA3D_ON (4)
SPEED -4500
RETURN



201:
        WORK_ON CUTTING,1 (Shutter=1 , GasType = 1, GasPress = 1 )
        FUNCTION TRA3D_OF
RETURN

9999:
SYSREF_OFF
MOVE_PTP (AX3 = 0)/COORD = ROBOT/SPEED=70
SYSDEF(0,0,0,0,0,0)
!FUNCTION FHOME
WORK_OFF CUTTING
END_TASK
END_PROGRAM





欢迎光临 iCAx开思网 (https://www.icax.org/) Powered by Discuz! X3.3