Set up Kuka Controller

The following describes how the robot-side preparation for Mikado works, in particular the use of the various KRL scripts. Two interpreters run on the robot: The submit interpreter (C:\KRC\ROBOTER\KRC\R1\System\mik_service_sps.sub and mik_status_sps.sub) and the robot interpreter (C:\KRC\ROBOTER\KRC\R1\Program\mikado.src). The submit interpreter is usually started automatically and then runs in the background, the robot program must be selected. These both communicate with the Mikado controller via EthernetKRL.

System requirements

Mikado communicates with the Kuka controller via EthernetKRL and uses splines for movement commands. Therefore, at least KSS 8.3 must be installed as well as the additional package EthernetKRL 2.2 or higher. Since two submit programs are running for performance reasons, the MultiSubmit extension must be installed for KSS 8.3 and 8.4; from KSS 8.5 onwards this is standard.

Network configuration

For communication with the Mikado controller, a network connection must be established via the KLI interface (KUKA Line Interface) of the robot controller. According to the KUKA manual, the following connections can be used for this purpose:

  • KR C4: X66 (default) or X67.1-X67.3

  • KR C5: XF5 (Default)

Hint

  • The KLI interface must always be used. Other RJ-45 ports of the robot controller (e.g. KONI, KSI) do not work for communication with Mikado.

  • If the KLI interface is already occupied otherwise (e.g. by communication with a PLC), an external Ethernet switch can be used at XF5 (on the KR C5) or X66 (on the KR C4) to increase the number of available connections.

  • Alternatively, additional connections can also be activated for the KR C5 control unit using option packages:

    • XF5 or XF6 with the option KUKA.EtherNetSwitch Dual-Port

    • XF3-XF6 with the option KUKA.EtherNetSwitch Quad-Port

Hint

The IP address of the KLI interface of the robot controller must not be within the following ranges reserved by KUKA:

  • 192.168.0.0 - 192.168.0.255

  • 172.16.0.0 - 172.16.255.255

  • 172.17.0.0 - 172.17.255.255

Define a fixed IP address and an associated subnet mask for both the Mikado controller and the robot controller. The network configuration of the Mikado Controller is explained in more detail in section Network adapter.

We are working on a detailed description of the network configuration of the Kuka controller. For the time being, information on the network configuration of the controller can be found in the manufacturer’s user manual.

Warning

Make sure that the IP addresses of the Mikado Controller and Kuka Controller are in the same address space and that the subnet masks match. If, as recommended, a separate network connection is used for the camera, this must be in a different address space in order to avoid ambiguous packet transmission.

Then enter the IP address of the robot controller in the Mikado Assistant under “Parameters” -> “Robot” in the corresponding field and save the settings.

Prepare KRC

To be able to control the Kuka robot with Mikado Control, the corresponding robot programs must be copied to the robot controller, configured and started. The steps required for this are explained in more detail below.

Copying the files

First, the required robot programs must be copied to the robot controller. These programs can be found on the Mikado controller under:

/opt/isys-vision/mikado/robot_programs/kuka/`

or using the button in the Mikado Assistant (Parameters → Robot → Open directory). There are three subfolders within the directory, each of which corresponds to a folder on the robot controller:

  • EthernetKRL/* → C:\KRC\ROBOTER\Config\User\Common\EthernetKRL\*

  • Program/* → C:\KRC\ROBOTER\KRC\R1\Program\* or KRC:\R1\Program\*

  • System/* → C:\KRC\ROBOTER\KRC\R1\System\* or KRC:\R1\System\*

You will find the network settings in the EthernetKRL folder. Since a Kuka controller can have several network connections, the IP of the connection used for communication with Mikado must be stored in the configuration files (the IP address of the robot controller, not that of the Mikado controller!) To do this, you must enter the IP address of the Kuka controller in line 12 of the files MikadoXmlService.xml, MikadoXmlStatus.xml and MikadoXmlTraj.xml. This can be done quite easily with the text editor Kate, for example, after you have copied the files from the above-mentioned directory to a USB stick (the folder /opt and all files contained therein are write-protected, which is why editing is only possible after copying). Somewhat less conveniently, the files can also be edited directly on the Kuka controller. After making changes to the EthernetKRL XML files, a restart of the Kuka controller is necessary.

The system folder contains programs that are executed by the submit interpreter (see below).

The Program folder contains programs that are executed by the robot interpreter. In particular, this is the “mikado.src” program, which in turn calls other .src files.

To copy files from the USB stick with the SmartPAD to the Kuka controller: Display → Window → Navigator. Files can be selected in the Navigator and then copied via Edit → Copy and Edit → Paste. A USB mouse on the SmartPAD simplifies operation. With sufficient user rights, the HMI interface can also be minimized and Windows Explorer can be used.

Submit Interpreter [S]

Select the file mik_status_sps.sub for slot EX1 in the submit interpreter. To do this, switch to T1 mode and then to the Expert user level. Then go to S → Stop, then Display/Assign and select the program. The robot should now be displayed in the correct position in Mikado Control. Also load mik_service_sps.sub into slot EX2, this controls the IOs, for example.

To ensure that the modules are also automatically selected and started when the robot controller is restarted, they must be selected in the cold start configuration. To do this, switch from the Current display/assignment tab to Cold start configuration and select the two modules for slots EX1 and EX2 there too.

Robot Interpreter [R]

Now select the main program mikado.src for the robot interpreter and start it. To do this, navigate to the “Program” folder on the SmartPAD (see above), select the program and press the Select button at the bottom of the screen. The program is now preselected for execution and must then be started as follows, depending on the operating mode:

  • Manual modes T1 / T2: Press and hold the enabling button on the back of the SmartPAD. Then press and hold the Start button. (It may be necessary to press the Start button several times until the program has started successfully). Both buttons must be held down permanently in manual modes so that the robot program is executed and Mikado can perform movements. This operating mode is therefore suitable, for example, for setup (performing calibration, teaching poses, etc.), as the robot can be stopped immediately by releasing one of the two buttons.

  • Automatic modes Auto / External: Press the Start button (several times if necessary). It is not necessary to hold the enabling switch on the back of the SmartPAD in automatic modes. The program is started and then continues to run automatically without additional user interaction (i.e. unlike manual modes, no button needs to be held down permanently).

If the robot program has started successfully, the symbol for the robot interpreter R is displayed in green at the top of the SmartPAD screen. If the symbol has a different color (e.g. orange or red), the robot program has not yet started successfully.

If you now make a small movement from axis 6 in Mikado on the robot side, for example, this should be executed by Kuka.

Gripper device

The gripper (or suction cup) is controlled via outputs, which you set in the Mikado cell directory in the file config/gripper.yaml:

open_hand_signal_number: 23
close_hand_signal_number: 24

These status values can now be converted into finger positions via config/gripper.yaml:

joint_finger_name: finger_left
joint_value_open: 0.02
joint_value_closed: 0.005

The two synchronized fingers are therefore 4 cm apart when open and 1 cm apart when closed.

Optional: Execute native robot program

Native programs can be executed on the controller using the “Execute robot program” task.

If a new program named “XYZ” is to be added, the program should be saved in the file “KRC/R1/Program/prog_<NAME>.src” with the same function name (“prog_<NAME>”). The program must then be added to the file “C:/KRC/ROBOTER/KRC/R1/Program/run_program.src” in the “run_program_impl” area. Copy and adapt either variant A for functions with arguments or variant B for procedures without arguments from the comment block.

Hint

By default, the template results in a failure being reported back. Change the line result.success = false to true to report a successful execution to Mikado. With a semicolon ; you can also comment out the error message result.errorMsg, or you can delete the line completely.

Hint

If you execute a movement in the native program, the program must be ended with a pre-run stop. This can be triggered in Kuka by a wait for true. This is the only way Mikado can plan subsequent movements with the correct starting position.

Speed and fine-tuning

The speed at which movements are executed can be set via a number of parameters. In addition, the speed can be set on the Kuka controller/teach pendant, which is then multiplied by the Mikado values.

In general, the following parameters can be set in config/manipulator.yaml for all trips:

The parameter velocity_scaling scales the maximum speed specified in the URDF. If this is adjustable in Mikado, max_velocity_scaling sets the upper limit for the user. The value is between 0 and 1, which corresponds to the full speed or 100%%. acceleration_scaling sets the corresponding acceleration factor.

For the Cartesian (linear) part of a handle, slower movements can be defined separately in the individual .product files in the products folder. These also act as factors and therefore work in combination with velocity_scaling. ApproachVelocityScaling: 0.5 specifies the velocity factor before gripping and RetractVelocityScaling: 0.3 after gripping when lifting. To prevent Mikado from overwriting the changes, it is best to close it before adjusting the values in these .product files.

Based on the maximum speed in the URDF or joints_limits.yaml, the above factors and the possible accelerations, Mikado now calculates how long the individual sections of the journey will take. From this duration, a percentage of the maximum speed is recalculated for the Kuka. Unfortunately, this calculation generally leads to lower speeds than expected, so the result can be increased with velocity_scaling_factor, max_velocity_clipping sets an upper limit, min_velocity_clipping a lower one.