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 KRC4 controller via EthernetKRL and uses splines for movement commands. Therefore, at least version 8.3 must be installed as well as the additional package EthernetKRL from version 2.2. Since two submit programs are running for performance reasons, the MultiSubmit extension must be installed with KRC 8.3; from KRC 8.5 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 or X67.1-X67.3
KR C5: XF5
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 programs must first be copied to the robot controller. These programs can be found 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\*orKRC:\R1\Program\*System/*→C:\KRC\ROBOTER\KRC\R1\System\*orKRC:\R1\System\*
You will find the network settings in the EthernetKRL folder. As a Kuka controller can have several network connections, the IP of the connection used must be stored on it (the IP of the Kuka!). 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 after you have copied the files to a USB stick (the folder /opt and all contained files are write-protected). Or somewhat less conveniently directly on the controller. After making changes to the EthernetKRL XML files, the Kuka controller must be restarted.
The system folder contains programs that are executed by the submit interpreter.
The Program folder contains programs that are executed by the robot interpreter, in particular the file “mikado.src” (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.
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.
Now select the main program mikado.src, this can be done in all operating modes (T1, T2, Auto or External). 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.