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
R632 or R651 - Karel: Fanuc robots that were ordered and delivered in Europe (delivered with FRL PARAMS (R651)) have the option R632 installed by default. Ordering it seperately is therefore not necessary.
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 = 1is set
Registers, variables, server tags: The following slots must be kept free on the controller:
Server Tags: 3 - 5
Digital Outputs: 145 - 147
Integer Registers: 71-76
Position registers: 61 - 90
If the position registers are not available, they can be reconfigured. After successfully installing the robot files on the controller, select the Karel program
ROS_TRAJ. Then press the DATA button and select the Karel variables. If the correct program has been selected, you should now see the data structurecfg_along with other variables. Select it with ENTER and adjust the following two variables as needed:pt_buff_size (default: 30): Number of position registers used by the driver. It is not recommended to change this value unless absolutely necessary.
first_pr (default: 61): The first position register used. Make sure that at least pt_buff_size subsequent position registers are available.
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 Testing the connection.
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.cmand execute the installation by pressing the Enter keyTo update an existing driver installation, you first have to remove the previous installation:
FNCTN → Abort ALL (2x)
First run
uninstall.cm, theninstall.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 DOs and registers are used for communication. Please check that these are not in use and comment on the DO and register descriptions if necessary.
(Optional): Enable HTTP access and KCL. This enables the automatic start of the Fanuc programs with Mikado.
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 enteredActivate KCL by executing Unprotect
(if possible) Set up the following access data in the corresponding fields: User:
ROS, Password:ROS
Hint
Section Optional: Execute robot program explains what you also need to configure so that native robot programs can be integrated into your Mikado program
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 (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: Adjust robot speed in Mikado¶
The execution speed of robot movements can be adjusted directly from Mikado. However, a fixed speed of 70% is used by default. For more information about speed and other movement parameters, see the Optional: Fine-tune movement parameters section.
To adjust the speed directly from Mikado, entries must be added to the manipulator.yaml file. This file is located in the cell’s config folder.
Add the following lines at the end of the file:
connection_info_is_traj_velocity: true
# velocity override specifies the target velocity of each motion between 1.0 and 100.0%
velocity_override: 60.0
The velocity override accepts values between 1.0 and 100.0. When set, all trajectory points are executed at the specified target speed. The speed can also be adjusted during Mikado execution using the JavaScript function lab.setRobotVelocityOverride(double velocityOverride). However, the speed setting always applies to an entire trajectory.
Optional: Fine-tune movement parameters¶
The robot’s movements can be fine-tuned using three parameters to adjust speed, motion smoothness, and path accuracy. Suitable values for these parameters depend heavily on the specific application and the trajectories used. They can therefore be adjusted manually as needed.
Warning
Users who are unfamiliar with programming Fanuc robots are strongly advised against modifying these parameters. Exercise extreme caution when tuning movement parameters to prevent damage or injury. After changing the parameters, always start the motion sequence at a reduced speed and increase it gradually.
The FANUC motion instructions can be found in the TP program ROS_MOVESM. It contains two different types of movements: a movement with a blending value enabled and a fine movement (for the final trajectory point):
24: J PR[R[71:curr_pr]] R[77:velocity]% CNT50 ACC60 ;
25: JMP LBL[44] ;
26: LBL[55:last_pt] ;
27: J PR[R[71:curr_pr]] R[77:velocity]% FINE ACC60 ;
Velocity: The target speed of the movement is specified immediately after the target position register and is expressed as a percentage. It is read from a register (register 77 by default) and is set to 70% unless configured otherwise. To adjust the speed, either replace the indirect register assignment with a direct assignment (e.g. 60%) or change the speed from the Mikado software, as described in the Optional: Adjust robot speed in Mikado section. Depending on the trajectory characteristics and blending values, the target speed is often not reached during short movements.
Blending Value (CNT Value): The blending value determines how precisely each point along the trajectory must be reached. The higher the CNT value, the more the robot is allowed to deviate from trajectory points in order to maintain a higher speed. This allows for faster and smoother movements at the expense of accuracy and path fidelity. The higher this value, the further the robot may deviate from the collision-checked path, which can lead to collisions. Therefore, increase the CNT value only in small increments and test how this affects the execution of the trajectories. Changes to this parameter are made at your own risk.
Acceleration: Acceleration is also specified as a percentage, but uses the ACC prefix. The higher the acceleration value, the faster the robot attempts to reach the specified speed. For dense trajectories with closely spaced points, a high acceleration value can result in jerky movements.
Optional: Execute robot program¶
If you want to execute your own robot program within your workflow, this should be implemented using a control handover, as described under Optional: Give up robot control. You can then insert your program, for example, within the MIKADO robot program above the last JMP command, so that it is executed and Mikado subsequently regains control.
If it is necessary to distinguish between several programs that need to be called, you can achieve this by setting robot outputs and querying them in the robot program.
Optional: Give up robot control¶
In some workflows, it may be necessary for Mikado to relinquish control of the robot so that other robot programs can be executed. To do this, the Mikado motion program ROS_MOVESM must be exited, which can be triggered by setting output DO[147].
After exiting ROS_MOVESM, program execution continues in the robot program MIKADO: It jumps to a dedicated section of the program where you can simply insert your own program calls (see LBL[2] in the MIKADO program).
If you want to exit the MIKADO program completely, remove the JMP command from the last line of the program. However, if you do this, you will need to call the MIKADO program again later before Mikado can control the robot again.
To trigger the relinquishing of control, add a Set robot output signal task at the end of a Mikado sequence and select signal number 147. When the MIKADO robot program becomes active again, it switches DO[147] off. You can wait for this change in the Mikado program sequence using the task Wait for robot output signal (available since Mikado 3.4.0) before continuing with motion tasks. Since the robot may have moved in the meantime, it is important to insert a Read robot position task into the program sequence, as shown in the following screenshot.
Example of a Mikado program giving up control to the Fanuc robot¶
Troubleshooting¶
Debug messages on the teach pendant¶
For commissioning purposes, debug messages for the teach pendant are enabled by default on the robot and are displayed on the User screen. If you want to disable them, you can do so setting Karel variables. Select the Karel program ROS_TRAJ. Then press the DATA button, select the Karel variables, and press the ENTER key to open the configuration structure cfg_. Set the variable is_debug to FALSE. Proceed in the same way with the is_debug variable in the Karel file ROS_STATE.
Robot moves slowly or jerkily¶
The robot’s motion behavior can be adjusted using various movement parameters. These are described in the Optional: Fine-tune movement parameters section.
Testing the connection¶
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