Advertising

KUKA CNC for big nc code with wrist rotation and variable spindle speed

  • I am working on robotic machining. In our facility, we have KUKA KR240 R2900 with KRC4 and we are using KUKA.cnc to be able to carry out machining operations.

    I have been trying to utilize g-codes by changing spindle speed and wrist rotation simultaneously. I generated a program that add points between the initial one and the last point to change wrist axis orientation and spindle speed variation. I tried to write that code in KRL by using C_DIS command to interpolate points . It worked but i need this kind of interpolation in KUKA CNC.

    However, robot's feed rate dropped to lower levels than predetermined one (for example, it should be 3600 mm/min but it dropped to roughly 200 mm/min) and it stopped at the points which i add,between the initial and final points.

    To prevent this situation , is there any option for high-level linear interpolation or some commands that robot reads certain lines and keep them in its memory to interpolate these points? (or do you have any other suggestions ? )


    ( I added a graph & G-code to be more understandable and i upload g-code example may be i did mistake or i forget to add something in the g-code lines)



    ## Spindle speed and wrist rotation variation ##

    N14 T1

    N18 G54

    N22 S16000 M3

    N24 G0 X-13. Y15. Z40. A=0.0 B=-90. C=-180. Y1=0.000000

    N26 X-13. Y15. Z3. A=0.0 B=-90. C=-180. Y1=0.000000

    N28 G90 G17 G94 G1 X-13. Y15. Z0.0 A=0.0 B=-90. C=-180. Y1=0.000000 F3600.

    N31 X0 Y15 Z0 A=0 B=-90. C=-180. Y1=0.000000

    N22 S16000 M3

    N31 X20.5882 Y15 Z0 A=-22.5 B=-90. C=-180. Y1=0.000000

    N22 S16070 M3

    N31 X41.1765 Y15 Z0 A=-45 B=-90. C=-180. Y1=0.000000

    N22 S16140 M3

    N31 X61.7647 Y15 Z0 A=-45 B=-90. C=-180. Y1=0.000000

    N22 S16140 M3

    N31 X82.3529 Y15 Z0 A=-22.5 B=-90. C=-180. Y1=0.000000

    N22 S16060 M3

    N31 X102.9412 Y15 Z0 A=0 B=-90. C=-180. Y1=0.000000

    N22 S15980 M3

    N31 X123.5294 Y15 Z0 A=0 B=-90. C=-180. Y1=0.000000

    N22 S15980 M3

    N31 X144.1176 Y15 Z0 A=22.5 B=-90. C=-180. Y1=0.000000

    N22 S16240 M3

    N31 X164.7059 Y15 Z0 A=45 B=-90. C=-180. Y1=0.000000

    N22 S16500 M3

    N31 X185.2941 Y15 Z0 A=45 B=-90. C=-180. Y1=0.000000

    N22 S16500 M3

    N31 X205.8824 Y15 Z0 A=0 B=-90. C=-180. Y1=0.000000

    N22 S15750 M3

    N31 X226.4706 Y15 Z0 A=-45 B=-90. C=-180. Y1=0.000000

    N22 S15000 M3

    N31 X247.0588 Y15 Z0 A=-45 B=-90. C=-180. Y1=0.000000

    N22 S15000 M3

    N31 X267.6471 Y15 Z0 A=-22.5 B=-90. C=-180. Y1=0.000000

    N22 S15445 M3

    N31 X288.2353 Y15 Z0 A=0 B=-90. C=-180. Y1=0.000000

    N22 S15890 M3

    N31 X308.8235 Y15 Z0 A=0 B=-90. C=-180. Y1=0.000000

    N22 S15890 M3

    N31 X329.4118 Y15 Z0 A=22.5 B=-90. C=-180. Y1=0.000000

    N22 S10945 M3

    N31 X350 Y15 Z0 A=45 B=-90. C=-180. Y1=0.000000

    N22 S6000 M3

    N34 X363. Y15. Z0.0 A=45 B=-90. C=-180. Y1=0.000000

    N36 X363. Y15. Z3. A=45 B=-90. C=-180. Y1=0.000000

    N38 G0 X363. Y15. Z40. A=45 B=-90. C=-180. Y1=0.000000

    N40 M5

    N44 M2



    ## KRL ##


    DEF testcont_constant()

    INI

    PTP HOME Vel 100% DEFAULT

    $ Vel.CP= 0.0533

    $ORI_TYPE=#VAR


    LIN {X -13, Y 15, Z 40, A 0.0, B -90, C -180} C_DIS


    LIN {X -13, Y 15, Z 3, A 0.0, B -90, C -180} C_DIS


    LIN {X -13, Y 15, Z 0, A 0.0, B -90, C -180} C_DIS


    LIN {X 58.33, Y 15, Z 0, A 0.0, B -90, C -180} C_DIS


    LIN {X 166.67, Y 15, Z 0, A 40.0, B -90, C -180} C_DIS


    LIN {X 175, Y 15, Z 0, A 20.0, B -90, C -180} C_DIS


    LIN {X 233.33, Y 15, Z 0, A -20.0, B -90, C -180} C_DIS


    LIN {X 291.67, Y 15, Z 0, A -40.0, B -90, C -180} C_DIS


    LIN {X 350, Y 15, Z 0, A -60.0, B -90, C -180} C_DIS


    PTP HOME VEL 100% DEFAULT


    END

  • AD
  • 3600mm/s is too fast, the robot will never ever reach that speed, even on larger distances.


    The movement is approx 340mm, how should the robot accelerate on that short distance to 3600mm/s? He can't.

    And there is a very big change in the orientation, this will result in exorbitant speeds for the axis 4 to 6, the motors can't reach them so the robot slows down. It is possible to set the orientation speed and acceleration to bigger values ($VEL.ORI1 $vel.ORI2 $ACC.ORI1 $acc.ORI2), but this will only reduce, but not solve the phenomenon.

    There are several mechanical restrictions you have to pay attention to.

    And by the way, you have a rotational symmetric tool, so why do you change the orientation in the axis of symmetry?

  • I think it's weird to use mm/min and not m/s, but it seems standard for most NC code I have seen so far.

    For milling you're also talking about things like tool diameter, engagement, feed per revolution.... generally small things that make more sense in mm than m. You're also usually working with RPM for the spindle speed, so a per minute speed works for the conversion.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now