Fanuc Preparation
For Mimic Core 1.3 and 2.0
In this course you will learn how to prepare robots from FANUC for using Mimic.
Please note that precision of the use of the robot with Mimic is dependent on the calibration of the robot itself. Not all robots are calibrated by default to address all application requirements. Please check the calibration of the robot prior to use.
What you need prior to Mimic installation
Please see 📄 Mimic Controller Setup (v2.4) to see what is needed for the Controller setup.
User Socket Messaging (R648), Remote Motion Interface (R912) version 4.0 (FANUC specific) and Stream Motion (J519), if using the Stream Motion setting in Mimic
FANUC Controller
RMI requires a controller of type R-30iB Plus (hardware)
The software version on the controller must be V9.30P/31 or newer
FANUC Controllers has different ethernet ports: A, B and C. Port C is dedicated to FANUC, and no external equipment can be connected to this. Hence, Mimic cannot be connect to port C, but should be connected to A or B.
These modules can be acquired from FANUC.
Mimic for FANUC - Robot Preperations
Hardware Setup
Complete the Tracker Hardware Setup before this step.
Wire the Mimic Controller to the Robot
Step 1. Connect the ethernet cable to the Mimic Controller
Step 2. Connect the ethernet cable to the robot
Mimic for FANUC - Get started
Transferring Files to the FANUC robot
Transfer the supplied files to the robot, this can be done directly through USB.
The files can be found on the USB.
The files to transfer are:
updateio.pc - Interface between Mimic and robot I/O
mapio.tp - Mapping of robot I/O used by Mimic
getregister.pc - Get robot register value in Mimic
setregister.pc - Set robot register value from Mimic
STREAM_MOTION.TP - TP-program used to start Stream Motion (only relevant when using Stream Motion)
mimic_play.pc - Start Mimic recording from robot
mimic_track.pc - Open Mimic track recording from robot
mimic_teach.pc - Open Mimic teach recording from robot
mimic_give_control.pc - Used to indicate when Mimic can take control of the robot
How to Configure a FANUC Robot
Step 1 Setup the IP address of the FANUC robot
The IP address of the FANUC robot and the Mimic Controller have to be on the same subnet, e.g. 192.168.1.XX.
If preferred, the IP address of the Mimic Controller can be changed through the Mimic software. Read more here: 📄 System Settings 2.2 (v2.4)
Step 2 Enable RMI JSON format instructions
Mimic sends instructions to the FANUC robot using the JSON format, which needs to be enabled on the robot.
An example of how this can be enabled on an Industrial robot is shown below:
Press the ”MENU” button on the teach pendant
Select “0 -- NEXT --” and press the “ENTER” button on the teach pendant to go to “MENU 2”
Select “6 SYSTEM” and then Select “2 Variables” and press the “ENTER” button on the teach pendant.
Select the variable titled “$RMI_CFG” and press the “ENTER” button on the teach pendant
Select the variable titled “$ASBN_ENB” and press the “FALSE” or “F5” button on the teach pendant.
Step 3 Enable HTTP access to KAREL code on the FANUC robot
Mimic needs access to run KAREL programs on the FANUC robot through an HTTP connection.
An example of how this can be enabled on an Industrial robot is shown below:
Press the “MENU” button on the teach pendant
Select “6 SETUP“ and navigate to the 3rd submenu titled “Setup 3” and select “4 Host Comm” and press “ENTER” on the teach pendant
Select “7 HTTP” and press the “ENTER” button on the teach pendant to enter the “HTTP Setup” menu.
Select the row which says “KAREL:*" in the column titled “RESOURCE”.
Select the first column on the furthest left, with a field saying either L, U or A. Press the “UNLOCK” or “F3” button on the teach pendant, the field should now say U for unlocked.
Step 4 Setting up User Socket Messaging
In order to let Mimic and the FANUC robot communicate using User Socket Messaging, a client tag needs to be defined.
Setting up a client tag
Press the MENU button on the teach pendant
Select “6 SETUP” and navigate to the 3rd submenu titled “Setup 3”, select “4 Host Comm” and press the “ENTER” button on the teach pendant.
Press the “SHOW” or “F4” button on the teach pendant, select “2 Clients” and press the “ENTER” button on the teach pendant.
In the “Tag” column, navigate to “C1:” and press the “ENTER” button on the teach pendant.
Navigate to the item titled “Protocol:”, press the “[CHOICE]” or “F4” button on the teach pendant, select “SM” and press the “ENTER” button on the teach pendant.
Navigate to the item titled “Startup State:” and press the “[CHOICE]” or “F4” button on the teach pendant, select “START” and press the “ENTER” button on the teach pendant.
Navigate to the item titled “Server IP/Hostname:” and input the IP address of the Mimic controller. Default is “192.168.1.20”.
Navigate to the item titled “Remote Port:” and input “8000”.
Press the “[ACTION]” or “F2” button on the teach pendant, select “DEFINE” and press the “ENTER” button on the teach pendant.
Press the “[ACTION]” or “F2” button again and select “START” and press the “ENTER” button on the teach pendant, to start the client tag.
Step 5 Starting background tasks on the FANUC robot
Mimic uses the “updateio.pc” KAREL program on the FANUC robot to interface with the robot I/O. This is done by reading from and writing to the last 32 registers on the robot and using the “mapio.tp” as background logic to map these registers to the desired inputs and outputs. The last 32 registers, I.e., registers 169 to 200 should be seen as reserved by Mimic. The “mapio.tp” program can be started as background logic as follows:
Press the MENU button on the teach pendant
Select “6 SETUP“ and navigate to the 2nd submenu titled “Setup 2”, select “6 BG Logic” and press the “ENTER” button on the teach pendant
Move to a row where the entry on the “PROGRAM” column is empty
Press the “[CHOICE]” or “F4” button on the teach pendant
Find “MAPIO” from the list and press the “ENTER” button on the teach pendant Note: If “MAPIO” is not on the list, try transferring the “mapio.tp” file to the robot again
To start the program, press the “RUN” or “F2” button on the teach pendant.
Step 6 Configure Stream Motion (Only required when using the Stream Motion setting in Mimic)
To ensure that Stream Motion is configured correctly for Mimic, ensure that the following settings have been set as described:
Press the ”MENU” button on the teach pendant
Select “0 -- NEXT --” and press the “ENTER” button on the teach pendant to go to “MENU 2”
Select “6 SYSTEM” and then Select “2 Variables” and press the “ENTER” button on the teach pendant.
Select the variable titled “$CPCFG” and press the “ENTER” button on the teach pendant to enter the configuration
Select the variable titled “$CP_ENABLE” and set it to “TRUE”
Press the “PREV” button on the teach pendant to go back to the variables list
Select the variable titled “$PARAM_GROUP” and press the “ENTER” button on the teach pendant to enter the configuration
Select the variable titled “$SV_OFF_ENB” and set them all to “FALSE”
Press the “PREV” button on the teach pendant to go back to the variables list
Select the variable titled “$STMO” and press the “ENTER” button on the teach pendant to enter the configuration
Select the variable titled “$START_MOVE” and set it to 5
Press the “PREV” button on the teach pendant to go back to the variables list
Select the variable titled “$STMO_GRP” and press the “ENTER” button on the teach pendant to enter the configuration
Select the variable titled “$FLTR_LN ” and set it to 100
Press the “PREV” button on the teach pendant to go back to the variables list
Additional Notes:
Ensure a precise load weight is specified, as this will help prevent acceleration errors
The “$MAX_SPD” value under the “$STMO_GRP” variable can be increased to increase the upper acceleration limit.
The performance of Stream Motion is dependent on the $SRC.$ITP_TIME value of the FANUC robot. If issues arise with Stream Motion, such as but not limited to jerk limit errors, ensure that the $SRC.$ITP_TIME is set correctly. A value of 8 ms performs well in most cases. The $SRC.$ITP_TIME setting can be found in the robot controller pendant, under System > Variables.
Setting up digital IO on FANUC
In order to use digital IO on the FANUC robot, the appropriate I/O needs to be assigned.
Assigning digital I/O
Press the MENU button on the teach pendant
Select “5 I/O” and navigate to the 1st submenu titled “I/O 1” and select “5 Digital” and press the “ENTER” button on the teach pendant.
Press the “CONFIG” or “F2” button on the teach pendant.
Configure the “RANGE” as “[1-8]” and set the appropriate “RACK”, “SLOT” and “START” values based on the I/O interface.
In case digital I/O are unused, values “0”, “0”, “1” should be chosen for “RACK”, “SLOT” and “START”.
Press the “IN/OUT” or “F3” button on the teach pendant, to switch between the configuration pages for inputs and outputs.
Repeat steps 4 and 5 again, to configure the remaining inputs or outputs
Power cycle the robot in order to let the changes take effect.
Giving Mimic control of the robot
To let Mimic take control of the robot in order to teach or play programs, a TP program can be created to start the mimic_give_control.pc Karel program. It is important that this TP program does not lock the motion group of the robot. To create a TP program which does not lock the motion group of the robot, follow these steps:
press “CREATE PROG.” in the “TEACH” row on the home screen of the teach pendant.
Select “Blank Template”
Press the “NEXT STEP” or “F4” button on the teach pendant, and input a desired name for your program and optionally a comment
Press the “NEXT STEP” or “F4” button on the teach pendant, and select “Advanced Program”
Press the “NEXT STEP” or “F4” button on the teach pendant, and select “TP Program”
Press the “NEXT STEP” or “F4” button on the teach pendant, and select “No Motion”
Press the “FINISH” or “F5” button on the teach pendant to create the TP program.
From here, the created TP program can be configured to the desired program flow, by calling either other TP programs or KAREL programs. Before trying to call KAREL programs, make sure the system variable “$KAREL_ENB” is set to “1” under “MENU->NEXT->SYSTEM->VARIABLES”. A KAREL or TP program can be called in the following way:
press the “NEW INSTRUCTION” button, select “CALL” and then select “CALL program”. Note that the teach pendant needs to be switched on to add or modify instructions in a TP program.
A list of the available TP programs is shown, and one can be chosen to call.
To call a KAREL program, instead press the “COLLECT” or “F3” button on the teach pendant. From here, select “KAREL progs” to see the list of possible KAREL programs to call.
Using Control from Robot
Control from robot is enabled through three KAREL programs, which can be called from a TP program running on the robot. These three KAREL programs are named “MIMIC_PLAY”, “MIMIC_TRACK” and “MIMIC_TEACH”. These KAREL programs allow Mimic to take control of the robot during TP program execution. To use these programs as part of a TP program, it is important that the TP program does not lock the motion group of the robot. This means that the TP program itself will not be able to make motion commands, but it will be able to call other TP programs which can contain motion commands. Therefore, all movement which is not controlled by Mimic needs to be placed in a separate TP program, which can be called in between control from robot calls to Mimic.
Running a TP program
TP programs which give Mimic control or use control from robot cannot be started directly from the teach pendant, as the teach pendant needs to be switched off for Mimic to be able to control the robot. The TP program therefore needs to be started from the button on the control box.
Enabling local execution of TP programs
Press the “MENU” button on the teach pendant.
Select “0 -- NEXT --”, Select “6 SYSTEM”, then “5 Config” and press the “ENTER” button on the teach pendant.
Navigate to the item titled “Remote/Local setup” and press the “[CHOICE]” or “F4” button on the teach pendant.
Select “2 Local” and press the “ENTER” button on the teach pendant, to enable execution of TP programs using the green button on the control box.
I/O Mapping from Mimic to Fanuc
The I/O belonging to Mimic is mapped to the I/O of the FANUC robot. This mapping is shown below:
Inputs:
Robot[0-7] -> Robot Input[1-8]
Robot[8-15] ->Digital Input[1-8]
Outputs:
Robot[0-7] -> Robot Output[1-8]
Robot[8-15] ->Digital Output[1-8]
Modifying the I/O used by Mimic
By default, the “mapio.tp” program uses the 8 robot inputs and outputs, along with the first 8 digital inputs and outputs. Which I/O is used can be changed by modifying the source code available in the file “MapIO.ls” and building it using the ROBOGUIDE software. Alternatively, if the ASCII upload option is installed on the FANUC robot, the source code file “MapIO.ls” can be uploaded to the robot and modified on directly on the teach pendant.
Modifying the registers used by Mimic
If the registers used by Mimic are inconvenient, it can be changed by modifying the “reg_offset” variable in the source code of the “updateio.pc” program, found in the KAREL file “updateio.kl”. Additionally, the “mapio.tp” program also needs to be changed to use the correct registers. The source file “updateio.kl” can be built using the ROBOGUIDE software. Alternatively, if the KAREL option is installed on the robot, the modified “updateio.kl” KAREL file can be transferred directly to the robot, without building first.
Using sub-routines with Mimic on FANUC
To use subroutines on the FANUC robots a mapping needs to be defined, to translate the ID specified in the Mimic software, to a TP-program on the robot. The string registers on the robot are used to define this mapping. The ID specified in Mimic corresponds to the index of the string register on the robot. If a subroutine with ID 1 is called, the robot will try to call a program with the user specified name in string register 1. If the ID is 2, the name in string register 2 will be used, and so on. This means that the user needs to make sure that the names specified in the string registers are always up to date. It also means that there is a limit to the number of subroutines that can be used. The string registers can be modified by following these steps:
Press the ”MENU” button on the teach pendant
Select “0 -- NEXT --” and press the “ENTER” button on the teach pendant to go to “MENU 2”
Select “3 DATA” and then Select “3 String Reg” and press the “ENTER” button on the teach pendant.
Modify string registers as needed
Your FANUC robot is now ready to use Mimic.