Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Articles

KUKA robots program using KRL (Sample programming)

This sample program could be used to make the robot move between a few points in space. You can modify the positions and parameters like velocity and tool offsets to adapt it to your specific application.

KUKA robots are programmed using KRL (KUKA Robot Language), a structured text-based language. Below is a basic example of a KUKA robot program that moves the robot between a few points:

### Sample KUKA KRL Program

```krl

&ACCESS RVO

&REL 1

&PARAM DISKPATH = KRC:R1Program


DEF MoveSample( )

    ; Initialize the robot's base and tool

    BAS (#INITMOV, 0) ; Initialize the motion system

    $BASE = {X 0, Y 0, Z 0, A 0, B 0, C 0} ; Define base coordinates

    $TOOL = {X 0, Y 0, Z 100, A 0, B 0, C 0} ; Define tool coordinates


    ; Set velocity and acceleration

    $VEL.CP = 0.2 ; Set velocity for linear movement (m/s)

    $ACC.CP = 50 ; Set acceleration (percent)


    ; Move to Home Position (Safe Position)

    PTP HOME ; PTP = Point-to-Point motion


    ; Define Positions (XYZABC coordinates for Cartesian space)

    DECL E6POS POS1, POS2, POS3

    POS1 = {X 500, Y 0, Z 500, A 0, B 0, C 0}

    POS2 = {X 500, Y 200, Z 500, A 0, B 0, C 0}

    POS3 = {X 300, Y 200, Z 500, A 0, B 0, C 0}


    ; Linear Movement to positions

    LIN POS1 ; Move to POS1

    LIN POS2 ; Move to POS2

    LIN POS3 ; Move to POS3


    ; Wait for 2 seconds

    WAIT SEC 2


    ; Return to Home Position

    PTP HOME


    ; End of program

END

```


### Explanation:
- **Initialization (`BAS` function)**: This initializes the motion system and defines the base and tool coordinate systems. The base is set to the origin, and the tool is defined with an offset in Z direction.
- **Velocities and Acceleration**: `$VEL.CP` sets the linear velocity, and `$ACC.CP` sets the acceleration for movements.
- **Positions**: `POS1`, `POS2`, and `POS3` are defined using `E6POS` (a data structure for robot positions), and each movement is done using linear interpolation (`LIN` command).
- **PTP Motion**: The robot moves between positions using point-to-point (PTP) commands for precise movements, especially back to the home position.


caa October 19 2024 32 reads 0 comments Print

0 comments

Leave a Comment

Please Login to Post a Comment.
  • No Comments have been Posted.

Sign In
Not a member yet? Click here to register.
Forgot Password?
Users Online Now
Guests Online 1
Members Online 0

Total Members: 11
Newest Member: Jhilam