đź“„ Fanuc Preparation (v2.4)
đź“„

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.

đź’ˇ

Mimic is compatible with FANUC robots. Be aware that: 

  • When using Mimic with FANUC robots, it is possible to choose between "RMI" and "Stream Motion" in the robot settings in Mimic. This setting decides whether Mimic uses FANUC's Remote Motion Interface(RMI) or Stream Motion to control the robot motion.

  • FANUC's PaintTool is incompatible with FANUC's Stream Motion. Hence, making Mimic incompatible with PaintTool when using the Stream Motion setting in Mimic.

  • When using the RMI setting in Mimic we recommend using Teach for creating recordings. FANUC will follow the motions recorded. However, FANUC's live execution of the movement will be slightly behind. Therefore, we do not recommend Track for direct surface treatment. Teach is not affected by this. 

  • When using the Stream Motion setting in Mimic, both RMI and Stream Motion is needed for Mimic to control the robot.
    RMI can be used independently 

 

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 

  • KAREL (R632) package for FANUC

  • 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. 

đź’ˇ

Note:

  • The FANUC Driver for Mimic is developed for RMI version 4.0. Backwards compatibility is not guaranteed.

  • Mimic for FANUC includes compiled KAREL programs which are used to interface with the robot I/O. These can run on the robot without the need of any additional modules. If it is desired to change which I/O or registers are used by Mimic, the included source code files have to be modified and compiled. To compile the source files, the ROBOGUIDE software from FANUC can be used. Alternatively, the KAREL option can be used to compile the source files locally on the robot.   

  • The robot code needed is on the USB in the package. It is always possible to get the latest robot code on Nordbo Update Tool⬇️ Software Download.

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

đź’ˇ

Note: (Optional) Use a Gigabit switch. 

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

đź’ˇ

Be aware that two additional files are supplied, named “updateio.kl” and “MapIO.ls”. These are the source code files of “updateio.pc” and “mapio.tp”, which will be needed if changing the I/O or registers used by Mimic is desired.  The KAREL option is needed here.

Note that if you are updating an existing installation, it will not be possible to transfer the newest version of the “mapio.tp” file, as it will be running as background logic on the robot. To stop the current “mapio.tp” program, follow these instructions:

  1. Press the “MENU” button on the teach pendant.  

  2. Select “6 SETUP” and navigate to the 2nd submenu titled “SETUP 2” and select “6 BG Logic” and press “ENTER” on the teach pendant.  

  3. Navigate to the row containing “MAPIO” in the “PROGRAM” column and press the “STOP” or “F3” button on the teach pendant.  

The program has now been stopped as background logic and can be updated. Remember to start the program as background logic again, after it has been updated. 

 

đź’ˇ

Example: How to transfer program files with USB on an industrial FANUC:

  1. Insert the USB into the teach pendant 

  2. Press the “MENU” button on the teach pendant 

  3. Select “7 File” then select “1 File” in the subsequent submenu and press the “ENTER” button on the teach pendant 

  4. Press the “[UTIL]” or “F5” button on the teach pendant 

  5. Select “1 Set Device” and press the “ENTER” button on the teach pendant. 

  6. Navigate to the 2nd submenu, select “1 USB on TP (UT1:) “ and press the “ENTER” button on the teach pendant.  

  7. To list all files on the USB, select line 1 from the selection, titled “(all files)” in the rightmost column and press the “ENTER” button on the teach pendant.  

  8. Navigate to the file desired for transfer to the robot and press the “LOAD” or “F3” button on the teach pendant. Press the “YES” or “F4” button on the teach pendant to transfer the file.  

 

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. 

đź’ˇ

Example of changing on an industrial FANUC: 
The IP address of the FANUC robot can be configured as following:

  1. Press the “MENU” button on the teach pendant 

  2. Select “6 SETUP “, navigate to the 3rd submenu titled “Setup 3” and choose “4 Host Comm” and press the “ENTER” button on the teach pendant 

  3. Select “1 TCP/IP” and press the “ENTER” button on the teach pendant.  

  4. Set the IP address in the field titled “Port#1 IP addr:”  

  5. Set the Subnet Mask to “255.255.255.0” 


 

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:

  1. Press the ”MENU” button on the teach pendant 

  2. Select “0 -- NEXT --” and press the “ENTER” button on the teach pendant to go to “MENU 2” 

  3. Select “6 SYSTEM” and then Select “2 Variables” and press the “ENTER” button on the teach pendant. 

  4. Select the variable titled “$RMI_CFG” and press the “ENTER” button on the teach pendant 

  5. 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:

  1. Press the “MENU” button on the teach pendant 

  2. Select “6 SETUP“ and navigate to the 3rd submenu titled “Setup 3” and select “4 Host Comm” and press “ENTER” on the teach pendant 

  3. Select “7 HTTP” and press the “ENTER” button on the teach pendant to enter the “HTTP Setup” menu.  

  4. Select the row which says “KAREL:*" in the column titled “RESOURCE”.  

  5. 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 

  1. Press the MENU button on the teach pendant 

  2. 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. 

  3. Press the “SHOW” or “F4” button on the teach pendant, select “2 Clients” and press the “ENTER” button on the teach pendant.  

  4. In the “Tag” column, navigate to “C1:” and press the “ENTER” button on the teach pendant.   

  5. 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. 

  6. 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. 

  7. Navigate to the item titled “Server IP/Hostname:” and input the IP address of the Mimic controller. Default is “192.168.1.20”.  

  8. Navigate to the item titled “Remote Port:” and input “8000”.  

  9. Press the “[ACTION]” or “F2” button on the teach pendant, select “DEFINE” and press the “ENTER” button on the teach pendant.  

  10. 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: 

  1. Press the MENU button on the teach pendant 

  2. 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 

  3. Move to a row where the entry on the “PROGRAM” column is empty 

  4. Press the “[CHOICE]” or “F4” button on the teach pendant 

  5. 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 

  6. 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:

  1. Press the ”MENU” button on the teach pendant 

  2. Select “0 -- NEXT --” and press the “ENTER” button on the teach pendant to go to “MENU 2” 

  3. Select “6 SYSTEM” and then Select “2 Variables” and press the “ENTER” button on the teach pendant. 

  4. Select the variable titled “$CPCFG” and press the “ENTER” button on the teach pendant to enter the configuration

    1. Select the variable titled “$CP_ENABLE” and set it to “TRUE”

    2. Press the “PREV” button on the teach pendant to go back to the variables list

  5. Select the variable titled “$PARAM_GROUP” and press the “ENTER” button on the teach pendant to enter the configuration

    1. Select the variable titled “$SV_OFF_ENB” and set them all to “FALSE”

    2. Press the “PREV” button on the teach pendant to go back to the variables list

  6. Select the variable titled “$STMO” and press the “ENTER” button on the teach pendant to enter the configuration

    1. Select the variable titled “$START_MOVE” and set it to 5

    2. Press the “PREV” button on the teach pendant to go back to the variables list

  7. Select the variable titled “$STMO_GRP” and press the “ENTER” button on the teach pendant to enter the configuration

    1. Select the variable titled “$FLTR_LN ” and set it to 100

    2. 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

  1. Press the MENU button on the teach pendant 

  2. 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. 

  3. Press the “CONFIG” or “F2” button on the teach pendant. 

  4. Configure the “RANGE” as “[1-8]” and set the appropriate “RACK”, “SLOT” and “START” values based on the I/O interface.   

  5. In case digital I/O are unused, values “0”, “0”, “1” should be chosen for “RACK”, “SLOT” and “START”.  

  6. Press the “IN/OUT” or “F3” button on the teach pendant, to switch between the configuration pages for inputs and outputs.  

  7. Repeat steps 4 and 5 again, to configure the remaining inputs or outputs  

  8. Power cycle the robot in order to let the changes take effect.  

 

đź’ˇ

Note: that the FANUC robot controller needs to be switched to “AUTO” mode, and the teach pendant needs to be switched to “OFF” in order to work with Mimic. Additionally, all faults need to be cleared using the “RESET” button on the teach pendant.


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: 

  1. press “CREATE PROG.” in the “TEACH” row on the home screen of the teach pendant. 

  2. Select “Blank Template” 

  3. Press the “NEXT STEP” or “F4” button on the teach pendant, and input a desired name for your program and optionally a comment 

  4. Press the “NEXT STEP” or “F4” button on the teach pendant, and select “Advanced Program” 

  5. Press the “NEXT STEP” or “F4” button on the teach pendant, and select “TP Program” 

  6. Press the “NEXT STEP” or “F4” button on the teach pendant, and select “No Motion” 

  7. 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: 

  1. 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.  

    1. A list of the available TP programs is shown, and one can be chosen to call.  

    2. 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. 


đź’ˇ

An example of how a TP program which gives Mimic control should be structured is shown below: 

TP_EXAMPLE 
1: CALL MIMIC_GIVE_CONTROL
[End]


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. 

đź’ˇ

An example of how a TP program with control from robot could be structured is shown below: 

TP_EXAMPLE 
1: CALL MOVE_1
2: CALL MIMIC_PLAY(ID)
3: CALL MOVE_2
[End]

Where “MOVE_1” and “MOVE_2” are user defined TP programs containing desired movement commands, and the “ID” in “MIMIC_PLAY(ID)” is the ID of the Mimic recording which is desired for playback.  

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

  1. Press the “MENU” button on the teach pendant. 

  2. Select “0 -- NEXT --”, Select “6 SYSTEM”, then “5 Config” and press the “ENTER” button on the teach pendant. 

  3. Navigate to the item titled “Remote/Local setup” and press the “[CHOICE]” or “F4” button on the teach pendant. 

  4. 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:

  1. Press the ”MENU” button on the teach pendant 

  2. Select “0 -- NEXT --” and press the “ENTER” button on the teach pendant to go to “MENU 2” 

  3. Select “3 DATA” and then Select “3 String Reg” and press the “ENTER” button on the teach pendant. 

  4. Modify string registers as needed

đź’ˇ

An example subroutine mapping is shown below:

SR[ 1:                 ] =SUBROUTINE1
SR[ 2: ] =SUBROUTINE2
SR[ 3: ] =SUBROUTINE3

Where SUBROUTINE1, SUBROUTINE2 and SUBROUTINE3 are user defined TP-programs. 


Your FANUC robot is now ready to use Mimic.