Set up Fanuc Controller

This chapter guides you through the installation and configuration of a Fanuc controller for use with a Mikado system.

Prerequisites

  • Robotercontroller:

    Fanuc controllers for robot control such as the R-30iB with software version v7 or higher are supported. Contact us if you would like to use different hardware or software.

  • Reset:

    To avoid interactions with other programs or configurations, you should reset the controller to the factory settings before connecting to Mikado if it is no longer in the delivery state. A backup of the controller configuration is also recommended (see your controller manual).

  • Teach panel:

    A teach panel (e.g. the iPendant) is required for the one-off setup and for manual operation.

  • Install the following options on the Fanuc controller:

    • R648 - User Socket Messaging

    The installed options can be viewed on the teach panel under Menu → NEXT → STATUS → Version ID, there on CONFIG (or F3).

  • Setting $Karel_ENB:

    • Menu → System → Variables: Check that $Karel_ENB = 1 is set

  • Registers, variables, server tags: The following slots must be kept free on the controller:

    • Server Tags: 3 - 5

    • Digital Outputs: 145 - 146

    • Integer Registers: 71-76

    • Position registers: 61 - 90

  • Kollisionsgrenzen / Dual Check Safety (DCS):

    If you have defined collision limits in the Fanuc controller or use Dual Check Safety, please note that these limits are not taken into account in the collision and path planning of Mikado. Therefore, always select a configuration in which the collision limits of the Fanuc controller are less restrictive than those in the Mikado configuration.

  • USB stick: It is best to use a USB stick as the installation medium. Alternatively, you can also transfer files via the network (FTP) (see Fanuc manual).

Network configuration

First, an Ethernet connection must be established. To do this, connect the Fanuc robot controller from its Ethernet port 1 to the corresponding Mikado controller Ethernet port. A new connection should now be displayed in the Mikado controller in the menu bar at the bottom right. In the case of a direct connection, this must now be set to a fixed IP and subnet mask. How a Mikado controller receives a fixed IP is explained in section Network adapter.

The IP address configuration of the robot controller now also has to be checked and updated.

  • Menu → Setup → Host Comm

  • TCP/IP → F3 Detail

  • Port#1 IP Addr: if necessary, update the IP address to match the Mikado controllers robot network connection. The robot controller and the Mikado controller cannot use the same IP address.

Hint

Make sure that the IP addresses of the Mikado Controller and Fanuc Controller are in the same address space and that the subnet masks match.

Then enter the IP address of the robot controller in the Mikado Assistant under Robot → Connection in the corresponding field and save the settings.

You can find a connection check description in Troubleshooting: Verbindung testen.

Installing the Mikado interface

Version compatibility has been tested with version v7.70/v8.30/v9.30, the installation file may also be compatible with higher versions.

  • First copy all the required installation files to the root directory of a USB stick (FAT32 formatted). You will find the files on the Mikado controller in the directory /opt/isys-vision/mikado/robot_programs/fanuc/fanuc_install_packages/fanuc_mikado_driver_VX.XX/ or using the corresponding button in the Mikado Assistant (“Parameters” -> “Robot” -> “Open directory”)

Hint

It is important that the files are copied to the root directory of the USB drive, as the installation script will not be able to find the files otherwise.

  • Insert the USB stick into the teach panel of the robot and navigate to the content

    • Menu → File → File → All

    • F5 UTIL → Set Device → UT1: (USB Port of the Teach Pendant)

  • Select the installation file install.cm and execute the installation by pressing the Enter key

  • To update an existing driver installation, you first have to remove the previous installation:

    • FNCTN → Abort ALL (2x)

    • First run uninstall.cm, then install.cm

  • After successful execution of the installation script, restart the robot controller

Parameterizing the Mikado interface

  • Flags and registers:

    As mentioned in section Prerequisites, some flags and registers are used for communication. Please check that these are not in use and comment on the flag and register descriptions if necessary.

  • Enable HTTP access and KCL. This enables the automatic start of the Fanuc programs with Mikado and is required so that native programs can be executed (see Optional: Execute native robot program).

    • Prerequisite: HTTP access is enabled in the settings

    • Use the Teach-Pendant to navigate to Menu → SETUP → Host Comm → HTTP

    • Select the line in which Resource: KCL:\* is entered

    • Activate KCL by executing Unprotect

    • (if possible) Set up the following access data in the corresponding fields: User: ROS, Password: ROS

Hint

Section Optional: Execute native robot program explains what you also need to configure so that native robot programs can be integrated into your Mikado process

Start system

The ‘MIKADO’ program starts all the necessary subroutines and thus establishes the connection to Mikado.

Hint

If you want to stop the running Fanuc program, execute ABORT ALL twice (to be found under Functions).

Optional: Gripper control via I/Os

If you want to control your gripper via inputs and outputs, you can implement this as standard via digital inputs and outputs (DI and DO). The configuration options for this are listed in the gripper.yaml section.

However, if you want to use the robot I/Os (RI and RO), you must set up a mapping to DIs and DOs as follows:

  • Create new background logic program (BG Logic)

  • Example pseudocode:

    RO[1] = DO[101] RO[2] = DO[102] DI[101] = RI[1]

  • In the Mikado configuration, the gripper in this example is controlled via the output signals 101 and 102. Signal input 101 is read from robot input 1.

Optional: Execute native robot program

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

All you have to do is enter the program name of the Fanuc program in the Mikado task. If variables have been parameterized in the Mikado task, these are passed through to the Fanuc program accordingly. Unfortunately, you cannot set a return value for a Fanuc robot; a 0 is transmitted by default.

To use this task with a Fanuc robot, the following precautions must be taken:

  • Prerequisite: HTTP access is activated in the settings

  • Under Menu → System → Setup → Remote/Local Setup: set from local to remote

  • Enable required commands via HTTP access

    • Menu → System → Variables: Check that $Karel_ENB = 1 is set

    • Select: Select the HTTPKCL.VR program

    • Data → [SHOW] → KAREL Vars → CMDS: The list now displayed contains all blocked commands

    • Remove RUN, CONTINUE and ABORT from the list

  • Menu → System → Variables: Set the value $RMT_MASTER = 1 (Attention: this setting prevents the start of programs via UOP)

  • (Optional) If your native programs are active for a longer period of time, you should adjust the timeout time (default: maximum 200 seconds). You can find this in your cell directory under launch/manipulator.launch.xml: Search for the following line in the file and change the value of value (in seconds):

    <param name="timeout_running_programs" value="200" />

Hint

You can check the configuration for correctness by opening a browser on your Mikado controller and executing a command by calling up a URL:

http://<ROBOTER_IP>/KCL/run%20<PROGRAMMNAME> (z.B. http://192.168.2.42/KCL/run%20ROS_STATE)

If you do not receive an error message, the call was successful.

Hint

If the task “Execute robot program” is called in a Mikado process, the following happens:

  1. Mikado terminates the program on the controller that executes movements for Mikado

  2. Variable values are transmitted for the program to be called up

  3. Native program is started

  4. Mikado waits until the native program has ended

  5. Mikado restarts the program that executes movements for Mikado

Troubleshooting: Verbindung testen

Troubleshooting if there is no connection to the robot after configuration and restart. In the Status bar area, you can see whether the connection to the robot has been successfully established.

  • Check: Robot controller and Mikado controller have the same subnet mask and different fixed IPs in the same address space

  • Check: The status LED of the network port does not indicate an error

  • Check: Can the robot be reached via ping under the entered IP

The necessary tools to execute the ping command from the Mikado controller:

A console must be started on the Mikado controller. The ping command to be entered is then, for example:

ping 192.168.1.42

Pinging can be canceled by pressing Ctrl + C. A positive response would look like this:

ping 192.168.1.42
PING 192.168.1.42 (192.168.1.42) 56(84) bytes of data.
64 bytes from 192.168.1.42: icmp_seq=1 ttl=64 time=1.18 ms
64 bytes from 192.168.1.42: icmp_seq=2 ttl=64 time=0.448 ms
^C
--- 192.168.1.42 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.448/0.816/1.185/0.369 ms