In almost every automation application with an industrial robot, it is necessary to setup a communication protocol to exchange signals with another device, it could be a PLC telling the robot if a working station is enabled or not, or a working station itself that might need a start signal when the robot has placed a part in it. We can say that the most common communication protocol nowadays is the PROFINET one, based on industrial Ethernet. A PROFINET I/O network is always composed by I/O Controllers, who are said to be the masters of the communication, and I/O Devices, who are connected to the I/O Controller and said to be slaves of it. We are going to see how to setup a Fanuc robot both as a PROFINET I/O Controller and as a PROFINET I/O Device. PROFINET Setup for Molex BoardPROFINET I/O Controller setupSetting up a robot to be a PROFINET I/O Controller is less common and more difficult than setting it up to be a Device and it involves a setup on pc side too.
First of all, connect with an ethernet cable both the slave device and the pc to the robot using the two lower ports of the board (the upper ones are for the robot to be configured as a Device).
Set a static IP to the ethernet port you used in your pc. On the Teach Pendant, go to Menu\I/O\PROFINET(M) and select Channel1.
Ensure that on F5 you read “DISABLE”, that means that the Controller is enabled.
Click on IP Address and F4 (EDIT), insert the IP address of the Controller, press F1 (SAVE) and reboot the controller.
On your pc, launch PROFINET configuration tool, press File\Configuration Manager and click on New. On the configuration field that appears, insert the project name and press OK, your project should appear under Available Configurations, select it and press OK.
By selecting Target Configuration and pressing the add new element button, it will be possible to start the network by checking the available target type and clicking OK.
In order to find the PROFINET board connected to the pc, select, under local network interface card, the IP address you set on your pc and click on Detect; a Target Automatic Detection window will appear. Check the detected board and press OK. Now you will read the board IP as Remote Target Address and you can click OK.
The target is now inserted, you can check it by selecting Channel1, the network will be shown on the right.
Now you need to add the GSDML file of the slave Device by clicking Add Device Library and following the instructions. You can verify the success of your operations by checking if you find an I/O Fanuc Robot Controller node between the device libraries:
Drag and dropping the GSDML on the right panel a configuration window will appear: there it is possible to define the Device name (note that it should be the same of the slave device) and its number. Going on Module Configuration page you can now insert the modules of I/O (in the right position) :
Once added all the modules you need, they will appear in the right panel, under Profinet Channel.
What remains to be done now is downloading the configuration into the robot. To do that you need to connect to the PROFINET board, so click on the connection button:
Before connecting to the board, you will need to save, and then just follow the instructions to download the project to the board.
Last steps of this configuration are on robot side.
In the Teach Pendant, on Menu\I/O\PROFINET(M), click on IO-Controller to check if the GSDML has been downloaded. If so, press F5 (UPDATE) and then F1 (SAVE).
I/O modules can be added by pressing F2 (ADD), and parameters of the added device can be modified under Configured Device. Select the parameter and press F4 (EDIT). Remember that the Device Name must be the same of the slave device connected to the robot; name that can be read pressing F2 (DETECT) under Unconfigured device.
After modifying all the parameters you need, press F1 (SAVE) and reboot the robot, all the Controller I/O will be mapped on Rack 101.
PROFINET I/O Device setupSetting up the robot to be a PROFINET I/O Device only requires configurations on teach pendant side.
First connect with an ethernet cable to the Controller, this time using one of the upper two ports of the board.
Go to Menu\I/O\PROFINET(M), select Channel2 and check if you see DISABLE on F5, that means the Slave is enabled. If not, press F5 (ENABLE). Set up the IP address and the name to the ones you need, selecting the parameter you want to change and pressing F4 (EDIT).
Now go to Channel2\IO-Device, selecting the slot and pressing F3 (EDIT) you can insert I/O modules (remember that order and size are crucial).
Once you have finished press F1 (SAVE) and reboot the robot, all the Device I/O will be mapped on Rack 102.
If you want to be sure your I/O assignment is correct, once the PROFINET I/O setup is ended, it’s better to clear all previous I/O setups, this can be easily done by Menu\I/O\Link Device\Clear Assignment and then reboot. After this operation you will find only the right I/O area assigned to digital I/O, that can be manually modified as required.
PROFINET Setup for BoardPROFINET I/O Controller setupThe Controller setup for the PROFINET board begins with a pc side setup, this time done using NCM Manager.
Open the software on your pc, go to Options\Set PG/PC Interface and select the right interface.
RunFirmware loader (by Siemens) and, following the instructions, load the firmware v2.5.2, then close the software and open back NCM Manager.
Go to PLC\Edit ethernet node and press Browse, it will find all the online nodes, select yours and press OK. Now you can use the fields under Set IP configuration and assign device name to configure your project and once you have finished press Close.
On NCM Manager, create a new project. Delete MPI from the project and use the Insert button to add first a Station\ 1 SIMATIC PC Station, and then a Subnet\ 3 Industrial Ethernet.
Double click on SIMATIC PC Station and then on Configuration.
On the right panel, look for your installed hardware (let’s suppose we have CP 1616, V2.5) and drag and drop it to the left panel:
On Properties\Parameters, set the IP address and select Ethernet as Subnet, then press OK.
Set the device name of the Controller board.
Select the installed device and drag and drop it on the ethernet network as shown: From the list in the right, opening the folders DI, DI/DO and DO, it is possible to select the modules you want to add and drag and drop them in the tab to the left; they will appear in slot 1, 2 and so on. Once you added all the required modules, save, compile and download the configuration to the robot, checking on Menu\I/O\PROFINET that the start mode is set to SUSPEND, I/O Controller is set to Enable and I/O Device to Disable: Under I/O Controller (always in Menu\I/O\PROFINET), set the number of digital IN/OUT required, then go back to the main PROFINET menu and set Start mode to READ IN in order to make the robot load the current configuration. Once the read in is done, set the Start mode to OPERATION and reboot the robot, the PROFINET Controller setup is completed. PROFINET I/O Device setupThe PROFINET I/O Device setup is much easier and there is no setup on pc side.
Go to Menu\I/O\PROFINET, set Start mode to SUSPEND, I/O Controller to Disable and I/O Device to Enable.
Enter the I/O Device menu and set the number of IN/OUT required.
Then go back to the main PROFINET menu, set Start mode to READ IN and, once the robot has read the configuration, to OPERATION and reboot the robot.
Under Menu\I/O\PROFINET\I/O Device\Modules you now need to setup the correct module configuration for all the modules you added, that is usually something like:
Subslot = Slot ModId (hex) = Module Ident Number SubdlotId(hex) = Submodule Ident Number To find out this numbers, open the GSDML with a viewer and look for the modules you added.The setup is complete after a cycle power of the robot. PROFISafe SetupBefore starting the PROFISafe setup, save a robot backup “all of above”, because the procedure is going to delete everything from the robot.
Fanuc provides a zip archive with some .img files we need to load to the robot, unzip it to an empty usb, and connect that to the cabinet. Turn off the cabinet and keep F1 and F5 pressed while turning it back on.
A menu will appear, select Controller Backup/Restore and Restore Controller Image, selecting UD1 as source (the usb of the cabinet) and then checking the path is correct.
Confirm the operation and wait until the controller handles it, then press enter and ends the procedure and the main menu appears.
Select Configuration menu and then Controlled Start, now press FTCN\Start Cold.
After the reboot it should appear the DCS menu (if not, go to Menu\System\DCS), press F2 (APPLY), you will be asked to enter a Code Number, that is usually 1111.
After the loading is completed, press F3 (ALL), F4 (OK) and then FTCN\Cycle Power. Now you can restore the robot backup done at the beginning.
To set PROFISafe parameters, go to Menu\I/O\PROFINET, go to the needed Channel (1 if the robot is Master, 2 if the robot is Slave, disable the unused one). On IO-Device you should set the Slot number 1 to be of type Safety, and of the required dimension (usually 1 byte).
Once the configuration is complete, press F1 (SAVE) and reboot the controller.
To enable the PROFISafe, go to Menu\System\DCS\PROFINET Safety and set Enable/Bypass to ENABLE, Safety input and output size(byte) to the dimension needed (usually 1 and 1). Set the F-Address to the one required by the I/O Controller. Under the main DCS menu (Menu\System\DCS) press F2 (APPLY) and follow the same procedure as before.
Once you reboot the robot the configuration is completed.
#FANUC
How to configure Profinet communication on Kuka robots using WorkVisual
Importing Profinet option packageIn the disk D of the robot where the Profinet option is installed, look for a folder named something like PROFINET PROFISAFE DEVICE, this might be in the KUKA_OPT folder. In that folder, there should be another folder named KukaOptionPachages or KOP, in which it is possible to find a file qith .kop extension. Copy that file in your PC. In WorkVisual, open the Option Package Management. Click Add new option package from a file. Select the .kop file you copied from the robot folder and, after a quick installation, the Profinet option will be installed in Workvisual. Profinet configuration on robot sideSet the controller as active, for the Profiten you want to configure, as shown in the picture below. Look for the Profinet node in the tree view and open its settings. In the settings tab, define the following data.
If the robot is SLAVE, keep Activate PROFINET device stack checked.
Set DeviceName as the same device's name that the PLC set in its settings.
Select the Number of safe I/Os, if used.
Select the Number of I/Os as the number of bits used for the communication between robot and PLC.
If necessary, set the Profinet version as the same version that is present in the Profinet node in the tree view.
Configure Profinet Safety ID for safety controlIn order to configure the Profinet Safety ID, open the Safety control in the tree view of the controller by double clicking on the corresponding node. In Common tab, select Communication Parameters in the left menu and insert the number to be set as Profinet Safety ID. This number must be the same number set in the PLC. See the image below, to better understand all the operations that need to be performed. Import GSDML file for PLCAfter configuring the robot side, it is necessary to import the GSDML configuration file in the PLC. This file could be found in the CD or USB key containing the software and the documentation that comes with the robot. If you do not have access to them, the file could be also found in the PC where WorkVisual is installed. The path is the following: *user installation path*\WorkVisual\DeviceDescriptions\GSDML Look for the corresponding version of the Profinet; in this example the used version is the 3.3 so the correct file would be: GSDML-V2.32-KUKA-KRC4-ProfiNet_3.3-20170131.xml Some of the files might seem duplicated, but the difference stands between KRC4 and VKRC4. The correct ones are the KRC4 files. Import this file in the PLC for its configuration. Disable the ProfinetIf the PLC is not configured for the communication but the robot is, the robot could be unable to operate. To temporary disable the Profinet, go to the Profinet settings and just uncheck the Activate PROFINET device stack option. Get the safety Activation codeIf the PLC requires the activation code for safety, check for this code in the robot pendant: Menu → Configuration → SafetyConfiguration
PLEASE NOTE: each time a change in the safety configuration of the robot is made, this code changes and need to be updated in the PLC.Important notes
The first bit of the first byte coming form the PLC in the robot should always be 1.
The correct setting for safety bit could be found in the manual located inside robot disk D, at the path: D:\KUKA_OPT\PROFINET KRC-NEXXT\DO
Profinet configuration errorsCommunication slot bit errorThis error happens when the Profinet communication bits are not aligned between robot and PLC. Communication error ProfiNet DeviceThis error happens if the ProfinetSafetyID is different between robot and PLC, and also if the procedure to Safe reset is done wrongly by the PLC. #KUKA
What is your level of technical expertise? #Welcome
External Axis KRC4 Configuration Manual
Here you will find all the steps for configuring an External Axis, using KUKA KRC4.First of all, verify that the right version of WorkVisual is intalled; it is possible to find a working version compatible with the robot currently being used in D:\WorkVisual path in the D drive of the robot. After connecting the robot with the KLI port (in the cabinet) via Ethernet, start WorkVisual and open the robot's project. All the different external axis' motors should be uploaded in the Catalogs; in order to do so, select File → Cataloghandling, as shown in the picture below. Within this window it is possible to upload all the different types of motors; select them in the Available catalogs section on the left and move them in the Projectcatalogs section on the right using the >> button. The next step is adding the external axis; after setting the cell in Active controller mode, right-click on the robot and select Add. Select the right motor to use (it is advisable to ask mechanical engineers which motor is the right one); in this case, the right model to use is the MG_ME_260_KSP40. NOTE: the model's wording KSP40/64 refers to the motor amperage, that can be 40 or 60 ampere. In order to know the right amperage, open the cabinet and check for the driving label on the top-right: Then look for the robot serial number, as shown in the figure below; the last value should be the amperage, in this case 40 ampere (x40). After adding the external axis, you need to configure this axis' type (if linear or rotational). In order to do so, right-click on the external axis and select Machine data configuration. In the window opening, under the voice Axis type, select the type of axis requested. Then the limit switches of the external axis must be adjusted. First, as a good practice, set higher values to the limit switches in order to freely move the external axis and verify that the value you have are correct. Only once verified the values, adjust the limit switches. NOTE: if the software does not accept the newly set value because out of scale, close the Machine data configuration window and reopen it (remember to save axis type). At this time, configure the machine data of the external axis; in order to do so, right-click on the axis (in this case E1) and then click on Machine data configuration. The first parameter to modify is the Maximum approximation distance PTP, that must be set from 90 (value of the rotational type) to 300 when the axis is linear. The second parameter to modify is the Positioning window, that must be set from 0,1 (default value for rotational type axis) to 1,5 when the axis is linear. The last parameter that must be modified is the Transmission ratio, motor / axis. In order to know the correct value to set, ask the mechanical engineers. In this case, 1 motor revolution is equal to 31,8279 mm. This value should be always verified with some handling robot's trials. NOTE: the sign (+/-) shows the direction of the movement of the rail. Usually, the rail should move accordingly to the X axis of the robot's world. Therefore, if necessary, the sign should be inverted. The next step is indicate that the robot is over the rail; in order to do so, go to the Geometry section (next to the Hardware section) and drag&drop the robot in the Flange base node. Once moved the robot over the rail, it is necessary to specify the rotation of the robot with respect to the rail. In order to do so, in the Hardware section, enter in the Machine data configuration window of the rail: Go to Machine transformation tab. If the rail is linear and the X axis of robot world is concordant with the direction of movement of the rail, modify B values to 90 and -90 (as shown in the figure below). Exampleframe between axis 1 and base point → B:90 frame between flange and axis 1 → B : -90 frame between measurement point and flange → B : 0To invertire X axis directionframe between axis 1 and base point → B:-90 frame between flange and axis 1 → B : 90 frame between measurement point and flange → B : 0Once all the modifications are done, save the configuration and upload it into the robot through the Deploy button. Remember to log as administrator. To fasten the process, click Finish. Confirm in the robot pendand whenever necessary. Once ended the installation, in order to move the robot it is necessary to use the robot pendand: Menu → Configuration → Security Configuration. Select “A new project from WorkVisual has just been activated” and “If you want to replace the security configuration used so far, activate it”. NOTE: you have to log as “Security maintenance worker”. Verify that all the settings are correct
Moving only the rail axis (in world coordinates), the TCP must stay fixed, with respect to the world, while robot and rail move.
Check that the +X axis direction match with the axis of the robot.
Check if the reduction ratio is correct. In order to do so, create a simple program that from a known point, moves in X by 3/4 meters (based on how much space is available) and check with a meter that the distance is accurate. If necessary, adjust the reduction ratio.
Once adjusted these points, calibrate the external axis.
Fix the software limit switches of the external axis, using values that reflect the one of the external axis when in the proximity of the two rail limit switches.
#KUKA
How to configure Profisafe in Kuka
A fundamental part of the production lines is the activation of safety in the cell where a robot is present. This is divided into various areas: the definition of the physical area of the cell, the configuration of protected work areas, the creation of safety tools and the activation of mastering and automated brake testing. Kuka allows you to activate these functions through various interfaces: Ethernet (ProfiSafe, CIP-Safety, FSoE) or the reserved X11 / X13 security interface. Let's see in detail the ProfiSafe. How to configure Profisafe in Kuka: - From the Teach pendant go to "Configuration and Security" and check the "Safe monitoring" checkbox. - Then reboot the robot and reload the files. - To control from Work Visual, in "Configuration and safety", set the current controller as active control: the global parameters in safety control must be like the following figure. -Go to "Configuration and commissioning" and set the current project as active control ( by right-clicking on the name of the controller). -Select the page relating to the profinet and choose the PROFIsafe configuration compatible with the packages installed inside the robot (check in Extras \ Optional package management). -Then on the plc side it is necessary to install and recompile the project by inserting the compatible gsdml version, which can be found in the device description where Work Visual is installed. (C:\installations\WorkVisual_V6.0.9_Build0584\DeviceDescriptions\GSDML ) -The "Safe Monitoring Spaces" can be managed in three ways: always on, always off and by input. If by input is selected, those inputs must also be managed on the plc side.To set the monitored areas and which mode to activate, as well as from the teach pendant, it is possible to go to Work Visual, select the active control in Configuration and Commissioning and in safety control, select the monitored areas and choose their mode. - On the PLC side, the signals highlighted in the following figures must be set to 1. -The PLC must insert a standard 64 safe I / O module and recompile the project: Most common errors after activation of Profisafe -The Profinet Safety ID between plc and robot do not coincide: this does not allow the motors to be switched on: always check in the communication parameters that the ID matches. -Having a different device name between Kuka and Siemens can also cause errors after activating Profisafe! -Every time changes are made to the system configuration part, it is necessary to reboot, renewing the reading of files. -The gsdml file used by plc is not compatible with the version installed in the Kuka: must be the same. In case of version incompatibility this is the error that will appear in the Kuka log: ”Failed to establish safety connection between PLC and kuka-noname because the GSDML file on the PLC is outdated”. -At least one safety tool must be activated (if the safety tool package is present in the robot), both on the robot side and on the plc side. On the PLC side, bit 0 of the seventh safe byte must be activated. If the robot is equipped with X11 safety and you want to switch to Profisafe, it is not enough to delete the Kuka System BUS (SYS-X48) from the Work Visual project, but you must also make changes at an electrical level. It is necessary to jumper the contacts of the X311 and disconnect both the Ethercat connector coming from the CCU and the power supply of the board. The figure of the pins to be jumpered is attached below. - In Work Visual, after activating the profisafe part, you have to remove the SIB Safety Modul (the one highlighted in the figure), recompile the project and commit it to the control. If this procedure is not carried out correctly, the errors that may appear in the Kuka log are the following: - <SYS-X48> EtherCat Bus-Scan: BUS-Dev 'KUKA SION-SIB-STD' [CFG-Dev: Slave not configured] - Safety stop - It is not possible to establish the connection with the PLC in 20000 ms (once again the robot and the PLC are not yet physically connected) #KUKA
Mapping of IO using WorkVisual
Here you will find a quick guide about the mapping of IO using WorkVisual. First, set the controller as active. The tab IO Mapping should appear automatically. If not, click on the corresponding icon, as shown in the image below. In the right side group of tabs, select Fieldbusses tab and click on the communication bus or device you need to configure (in this example there is a PROFINET device). On the left side, select the Input or Output in the robot to connect. A list of robot I/O should appear on the bottom left of the page, and device IO on the bottom right. Select the same number of I/O on both left and right lists and click Connect to connect the robot $IN or $OUT variables with the device I/O. It is possible to filter the inputs and outputs to make this process easier, as shown in the picture below. In the middle of the page, the connected IO will appear. At this point, Deploy the changes to the controller. #KUKA
Reference position setup on FANUC
This article shows how to setup a Reference Position on a FANUC robot To show the Reference Position menu press the MENU button, go to SETUP, select Ref Position Move over the Reference Position to define or modify and press DETAIL (F3 button) Here we can:
Choose a comment for the reference position
Enable / Disable the reference position
Tell if this reference position is a valid HOME POSITION (if checked and the robot is in this position UO[7] value is setted to TRUE)
Set the robot output signal that turns ON if the robot is at the defined position
Then there are the axes values on the left and on the right the angle ranges for each axis We can put the axes values manually or we can move over one of the axes value and press SHIFT button + RECORD (F5 button) Now if the robot is in the defined axes range the chosen robot output will turns ON You can find a video below how to configure it RefPos.mp4 #FANUC
Interrupt Job on Yaskawa Motoman
Sometimes it is necessary to interrupt the program you are running after receiving a signal from the outside and run another program. To do this, Yaskawa provides the "INTERRUPT JOB" that listens for a signal and, if this signal arrives, it interrupts the job in progress and executes the lines of code inside the interrupt job. The job that was being executed continues after the interrupt jobs are finished. NOTE: This is a paid option. If the interrupt jobs are not present in the manipulator, contact Yaskawa. Different interrupt jobs have different levels of priority, it will therefore be up to the programmer to establish the priority of an interrupt job through an interruption table: the smaller the value in the table, the higher the priority level. An interruption signal is detected at the rising edge of the signal. If more than one interruption signal is detected at the same time, the job for the level with higher priority is executed. NOTE: All interruptions are automatically disabled during the execution of an interrupt job. Therefore, if another interruption signal with a higher priority is received, its corresponding job is not executed. Interrupt job enablingFor an interrupt job to be executed, it must be activated in the running job. To do this, the EI and DI instructions must be added to the job
EI: is used to enable interrupts of a specific level. If the level is specified (the instruction will be of the type EI LEVEL = 1), this level will be enabled, otherwise, all levels will be enabled
DI: is used to disable interrupts of a specific level. If the level is specified (the instruction will be of the type DI LEVEL = 1), this level will be disabled, otherwise, all levels will be disabled
To be able to add EI or DI instructions, move the cursor to the desired position and press the “INFORM LIST” key. Then select the desired instruction from the “CONTROL” tab and press “ENTER”. Once the job has the instruction inside it, move the cursor to the instruction and press “SELECT” twice to be able to add the desired level. Once selected, press “ENTER” twice to confirm the level. NOTE: EI and DI are valid only on the job in which they are called Interrupt job implementationThe first thing to do to create an interrupt job is to create a normal job with the desired instructions. Once the job has been created, from the main menu select the item "JOB" and select "JOB INTERRUPTION". The following screen will open. There are 5 different areas:
“LEVEL” represents the priority level of each interrupt.
“SIGNAL” represents the input that the interrupt waits for in order to stop the program in execution. By pressing “SELECT” in this column, you can enter the desired input.
“JOB NAME” represents the job that will be performed as well as interrupt the job. By moving the cursor to the named area and pressing “SELECT” you can select which job to use as the interrupt job.
“PERMIT” allows you to manually execute a job while the EI instruction is active.
“EXEC” allows you to see if the interrupt job is running.
Once all parameters have been set correctly the creation of interrupt jobs is complete #YASKAWA
INTERRUPT INSTRUCTION EXPLANATION FOR DIFFERENT ROBOT BRANDS
Sometimes robots are requested to perform some actions until one or more conditions are met. This robot function is called interrupt and the conditions may be the change of state of signals. Other conditions can be the variation of analog or group signals or the occurrence of an error. As an example, interrupts can be used to pick parts from a stack of unknown height. In this case, robot gripper has to be equipped with a sensor that reveals the presence of the piece (e.g. suctions cup with vacuum sensor, piston valve, etc.). The robot approaches the stack with a downward movement, until the sensor notifies the robot that the piece has been found. The robot stops the movement and performs the routine that follows the part searching phase. Interrupts are usually linked to signals: when the linked signal is activated (or deactivated), robot stops its motion and executes a specific subroutine. The called subroutine can include normal instructions such as other movements, signal management and so on. At the end of the subroutine, robot continues with the main program. The following sections describe how to manage interrupts with three robot brands: Kuka, Fanuc and ABB. Robot controller types are, respectively, KRC4, R-30iB and IRC5. KUKA KRC4Interrupts in Kuka robots can pause the execution of a program and jump to the execution of another program (called interrupt program). At the end of such subroutine, the main program is resumed from the point it was interrupted. SyntaxInterrupts have to be declared at the beginning of the program (but not in the declaration section). The declaration syntax follows. [GLOBAL] INTERRUPT DECL (priority) WHEN (event) DO (subroutine)
[GLOBAL]: interrupts are accessible only in programs where they are declared or in their subprograms. If an interrupt has to be accessible even in other programs, the keyword GLOBAL has to be present in its declaration.
(priority): interrupts must be provided with a priority integer, which has to be univocal among the declared interrupts. Priority is useful when more than one interrupts occur at the same time. In this case all the interrupt programs are executed, from the one with the highest priority to the one with the lowest priority. The available priority values are: 1, 2, 4 to 39, 81 to 128. The smaller is the value, the higher is the priority. Up to 32 interrupts can be declared at the same time.
(event): this is the condition that is monitored by the robot when the interrupt is active. The event can be a global Boolean variable, a signal, a comparison or a logic operation (NOT, AND, OR, EXOR). The event is satisfied only if a rising edge or falling edge of the variable is detected (that is a change of state).
(subroutine): the name of the subprogram that has to be executed if the condition is met.
Once that interrupts have been declared, they have to be activated to be used. The syntax of the activation instruction follows. INTERRUPT (action) [(number)]
(action): this field specifies if the interrupt has to be enabled (action = ON) or disabled (action = OFF). Once that an interrupt is enabled, it can be temporarily disabled (action = DISABLE) or enabled (action = ENABLE).
(number): this field specifies the number of the interrupt that the activation instruction is referred to. The number of the interrupt corresponds to its declared priority. If number is not used, the activation instruction refers to all declared interrupts. A maximum of 16 interrupts can be active at the same time.
Once the INTERRUPT instruction has been executed, the interrupt will be actually activated after an interpolation cycle (= 12 ms). The subprogram (i.e. the interrupt program) can contain some powerful instructions in addition to the usual robot instructions:
BRAKE: this instruction can be used only in interrupt programs and stops the robot motion with a STOP 2. When this instruction is used, the program execution continues only after the robot has been stopped. Using BRAKE F stops the robot with a STOP 1.
RESUME: this instruction can be used only in interrupt programs and cancels the execution of all the subprograms up to the program where the interrupt was declared. That is, when this instruction is executed, the program pointer jumps to the next line of the main calling program. Such instruction is very useful when the robot is asked to perform different actions depending on the interrupt event. If the RESUME instruction is not used, the program execution will normally continue after the END instruction of the subprogram.
$AXIS_INT: when the interrupt condition is met, robots saves its joint position in this variable.
$POS_INT: when the interrupt condition is met, robots saves its cartesian position in this variable.
ExampleIn the following example, a robot places parts on a pallet. A laser sensor is used in order to know the correct height where the part can be released. As soon as the laser is intercepted, the interrupt is executed and the robot releases the part. DEF MAIN() […] ; Declare an interrupt with priority 2 INTERRUPT DECL 2 WHEN $IN[2] DO LASER_FOUND() […] ; Activate interrupt INTERRUPT ON 2 PTP OUT_SEARCH ; Start search routine SEARCH_LASER() ; Release part GRIPPER_OFF() ; Go back LIN START_SEARCH() […] ENDDEF SEARCH_LASER() ; Reach the starting point of the search trajectory PTP START_SEARCH ; Move to the end of the search trajectory till the laser is found LIN END_SEARCH ENDDEF LASER_FOUND() ; Deactivate interrupt INTERRUPT OFF 2 ; Stop the robot motion BRAKE LIN $POS_INT ; Jump to the next line of the calling program (i.e. GRIPPER_OFF() in MAIN() program) RESUME ENDFANUC R-30iBInterrupts in Fanuc robots are called skip condition instructions. A skip condition specifies a condition that, if not satisfied during the movement, makes the robot skip to another branch of the program. Otherwise, if the condition is met the robot suspends its motion to the current target point and sequentially continues with the next line of the program. SyntaxFirst, the skip condition has to be defined in the program code. Once that a skip condition is defined, it will be valid till the end of the program or until a new skip condition is executed. The following expressions represent the different ways a skip condition can be defined. SKIP CONDITION (variable) (operator) (value)
(variable): this field can be filled with real or digital variables. In the former case (i.e. real case) register R[i], system variable $..., Analog I/O or Group I/O can be used. In the latter case (i.e. digital case) Digital I/O, RI, RO, SI, SO, UI, UO can be used.
(operator): this field can be filled with a comparison operator. In real case <, >, <=, >=, = and <>[1] operators can be used. In digital case only = and <> operators can be used.
(value): this field has to be filled with the value assumed by the variable when the condition is met. In real case registers R[i] and constants can be used. In digital case the following values can be used: ON, OFF, On+[2], Off-[3], Digital I/O, register R[I], RI, RO, SI, SO, UI, UO.
[1] <> means not equal to. [2] On+ means that the condition is met only if a rising edge of the signal is detected (the signal changes from off to on). [3] Off- means that the condition is met only if a falling edge of the signa is detected (the signal changes from on to off). Multiple conditions can be concatenated with AND and OR statements if more than one condition has to be satisfied. The syntax follows: SKIP CONDITION (variable) (operator) (value) AND (variable) (operator) (value) AND (variable) (operator) (value) AND … SKIP CONDITION (variable) (operator) (value) OR (variable) (operator) (value) OR (variable) (operator) (value) OR ...A limit of this feature is that AND and OR statements cannot be used in combination in the same skip condition. The maximum number of concatenated conditions is 5. A skip condition can also be linked to the occurrence of a robot error. The syntax follows: SKIP CONDITION ERR_NUM = (value)The field (value) has to be filled with the number of the requested alarm.Once that the skip condition has been defined, it can be used during the movement instructions. The syntax follows (the linear movement is just an example; the skip instruction can be used with other kinds of movement too). L P[0] 1000mm/sec FINE Skip, LBL[(label)]The (label) value represents the number of the label the robot program has to jump to if the condition is not satisfied. In such case the robot completes the motion and jumps to the branch of the program defined by the label. Otherwise, if the condition is met during the movement, the robot stops the motion and executes the next line of code.ExampleIn the following example the robots perform a movement monitoring the digital input DI[100]. If the signal is activated before or during the motion, the robot stops its motion and the program pointer jumps to the next line (i.e. the linear movement toward P[2] position). Otherwise the robot reaches the P[1] position and jumps to the LBL[99]. ! Initialization of the interrupt SKIP CONDITION DI[100] = ON L P[1] 100mm/sec FINE Skip, LBL[99] ! If the condition is satisfied, stop the motion and continue L P[2] 100mm/sec FINE J P[3] 100% FINE ! If the condition has not been satisfied, jump to label 99 LBL[99] J P[5] 100% FINEABB IRC5Interrupts in ABB robots are defined as intnum (interrupt numeric entities). Signals and other events (e.g. timers) are possible conditions that may be linked to interrupts. When such conditions are met, subprograms (i.e. Trap routines) that were previously connected to the interrupt are executed. SyntaxThe syntax of an interrupt declaration follows. VAR intnum (interrupt name)
(interrupt name) contains the name of the interrupt. All intnum variables must be declared as global.Once the interrupt is declared, it has to be linked to a Trap routine. The syntax follows. CONNECT (intnum variable) WITH (trap routine)
(intnum variable): this is the interrupt entity name that has to be linked to the trap routine.
(trap routine): this is the name of the subroutine that is called when the interrupt occurs. More than one interrupt can be linked to the same routine; once that one interrupt occurs, the variable INTNO is equal to the interrupt name, therefore it is used to discriminate which interrupt has occurred (e.g. INTNO = interruptName).
Once the interrupt is connected to the trap routine, it has to be associated to an event. Events are the change of state of signals (analog, digital, group), variables (normal and persistent), timers and errors. There are several instructions that associate interrupts to conditions, one for each event type. The list of instructions follows.
ISignalAI and ISignalAO are used for analog signals.
ISignalDI and IsignalDO are used for digital signals.
ISignalGI and IsignalGO are used for group signals.
IVarValue and IPers are used for variables, in particular the latter is for persistent variables.
ITimer is used for timed interrupts.
IError is used for errors occurrences.
We take the digital input instruction as an example to explain the syntax. The instructions of the other events association slightly differ from the explained one. ISignalDI [single] (signal) (TriggValue) (interrupt)
[single]: this field can be left empty or filled with \Single or \SingleSafe. If the field is left empty, the interrupt occurs every time the signal changes its state (the sensibility to rising or falling edges depends on the TriggValue). On the other hand, if the field is not left empty the interrupt occurs only the first time the signal changes state. When \SingleSafe is set, the interrupt is not processed in stepwise execution; if the interrupt occurs, it is queued and is processed as soon as the continuous execution is started.
(signal): this is the name of the digital input that has to be associated to the interrupt.
(TriggValue): this is the value that the signal has to reach in order to make the interrupt occur. If TriggValue = 0, a falling edge of the signal is requested to meet the condition. If TriggValue = 1, a rising edge of the signal is requested to meet the condition. If TriggValue = 2, rising or falling edges of the signal are indifferently requested.
(interrupt): this is the interrupt entity name (i.e. the intnum variable) that has to be associated to the signal.
Once that interrupts have been linked to trap routines and events, they can be disabled and enabled depending on the situation. There are some instructions to manage the activation and deactivation of the interrupts.
IDelete(interrupt name): this is used to cancel an interrupt subscription. The field (interrupt name) has to be filled with the requested interrupt name. If the interrupt needs to be temporarily disabled, use ISleep.
IDisable: this is used to temporarily disable all interrupts.
IEnable: this is used to enable all interrupts after that they have been disabled.
ISleep (interrupt name): this is used to temporarily disable a specific interrupt.
IWatch (interrupt name): this is used to enable a previously deactivated interrupt.
Finally the trap routine that is called when the interrupt occurs has to be programmed. The syntax for declaring a trap routine follows. TRAP (trap routine name) […] ENDTRAPThe trap routines can contain movements and instructions, like a normal Procedure. Other useful instructions regarding the movements of the robot in a trap routine follow.
StorePath: this instruction saves the trajectory that the robot was doing before the interrupt occurred. Once that the path has been saved, another temporary movement can be performed by the robot.
RestoPath: this instruction restores the trajectory previously saved with the StorePath command.
StopMove: this instruction stops the robot motion if the robot is moving as soon as the interrupt occurs. If this instruction is not used, the robot continues to the destination point of the last movement.
StartMove: this instruction resumes the movement of the robot after that it has been stopped. It can be used after the StopMove instruction or after the RestoPath instruction to resume the trajectory.
ExampleThe following example shows the routine executed by a robot to clean its glue gun when a sensor detects that the gun is dirty. When the sensor activates the diGlueGunDirty input, the robot stops the motion and goes to the position assigned to clean the gun. Once that the gun has been cleaned, the robot goes back to the position it was stopped by the interrupt and resumes its previously saved motion. VAR intnum intGlueGunDirty; […] ! Link the interrupt with the trap routine and the digital input signal CONNECT intGlueGunDirty WITH CleanGlueGun; ISignalDI diGlueGunDirty, 1, intGlueGunDirty; […] TRAP CleanGlueGun VAR robtarget intPos; ! Stop the robot motion and save the path StopMove; StorePath; ! Get actual tool and base frames and move to the clean position GetSysData curTool; GetSysData curWobj; intPos := CRobT(\Tool:= curTool \WObj:=curWobj); MoveJ pClean, v100, fine, tool1; […] ! Go back to the interrupted position and restore the previous motion MoveJ intPos, v100, fine, curTool,\WObj:=curWobj; RestoPath; StartMove; ENDTRAPSearch instructionsABB robots make some special instructions available for quickly monitoring signals while carrying out movements. These instructions allow the robot to move toward a specific point and save the position when a specific digital input changes its state. Optionally robot movement can also be stopped when such events occur. An example follows. SearchL \Stop, diPieceFound, posSaved, posDestination, v50, tool;In this case the robot moves toward the point posDestination with speed v50; as soon as the input signal diPieceFound changes its state, the robot stops its movement (because of the parameter \Stop). Moreover the position of the robot when the signal has commuted is saved in posSaved. There are other search instructions for non-linear movements: SearchC for circular trajectories and SearchExtJ for external axis movements. #FeaturedArticles
Following bends with Kuka and RSI - Part 2
Using Kuka RSI (Robot Sensor Interface) to synchronize robot to the press-brakeIn the previous article we have seen how to configure an external kinematic able to mimic the motion of a metalsheet during bending. We have also seen that jogging the two external axes involved into that kinematic, the robot tcp will simulate the bending motion. Now we have to synchronize our robot to the real motion of the press-brake. As we anticipated in the previous article, we need a linear encoder attached to the beam of the press-brake in order to know its actual position. The value of this encoder will drive, through appropriate conversion, the two virtual motors of the kinematic. This is performed using the RSI optional package, that enables the sensor-guided motion. The robot is just holding its initial position (related to the external kinematic frame) while RSI adjust the position of the virtual motors according to the value read from the linear encoder. Depending on the press-brake, it might be necessary to filter the incoming data, to prevent peaks on the torque that might halt the robot. Kuka RSIKUKA.RobotSensorInterface is an add-on technology package that can be installed on Kuka robots. This package offers the possibility of real-time signal processing. It is also possible to influence the robot motion as a consequence of this processing. Starting from KSS 8.6 (and WorkVisual 6), RSI functions can be modified directly inside the WorkVisual environment. In previous software version, it was necessary to install a specific tool for handling RSI files (RSI Visual Shell). Therefore, depending on the software version of the robot, it is necessary to install the correct version of the RSI package and subroutines. Using Kuka RSI requires two parts: an RSI routine and a KRL subroutine that set up the required parameters and start the RSI motion. Programming of RSI is based on a visual paradigm. Program is based on a series of blocks, connected by arrows, that will move data from the output pin of a block to the input pin of the following block. The most important blocks are:
Input/Output functions:
DIGIN: read value (1 or more bits) from a robot input
DIGOUT: read value (1 or more bits) from a robot output
MAP2DIGOUT: write value (1 or more bits) to a robot output
Signal conditioning functions:
SUM: sums two signals
MULTI: multiplies two signals
P: multiply signal value with a constant value
Logic blocks:
OR: logical OR operation between two signals
LESS/GREATER: logical comparison between two signals
Motion block:
AXISCORREXT: perform an axis-specific correction (for external axes)
Debugging blocks:
MONITOR: visualize the connected inputs on the RSI Monitor. It is also possible to dump visualized data on a csv file
MAP2SEN_PINT: write the value of the connected input into the KRL variable $SEN_PINT[ index ]
MAP2SEN_PREA: write the value of the connected input into the KRL variable $SEN_PREA[ index ]
Working PrincipleUsing the RSI package it is possible to read the value of an analog input (the encoder that has been attached on the press-brake) and transform it into a robot motion. In order to achieve this result, it is important to perform the following steps:
Read the analog input (DWORD) connected to the encoder
Condition the signal (subtract the initial value) and verify possible overflow/underflow, as well as remove any signal ripple
Smooth the signal, to remove noise and to reduce slope of the signal (very important when dealing with hydraulic press-brakes)
Apply a proportional constant to get the desired value of axis correction
Read the digital input connected to the lower dead point of the press-brake to terminate the motion
The important parameters required for this routine are the following:
Encoder input number and ratio (ticks per millimeter)
Lower dead point input number
Initial value: value of the encoder at the clamping point
Bend descent: number of encoder ticks between clamping point and lower dead point (must be updated every time the bending parameters changes).
Final bend angle
Optional: motion of the external axis
Once all these parameters have been set, the robot program will just need to enable the RSI (rsi_on) and call the function rsi_movecorr(). RSI will take control of the virtual axes connected to the external kinematic, causing the robot performing the bending motion, perfectly syncronized to the press-brake. How to useAfter the installation of the KUKA RSI optional package, it is necessary to download and unzip the packages that you can find at the end of this page, and install in the proper folder:
RSI files (inside the zip BendFollow_RSI_XX.zip) must be placed on the following path: C:\krc\ROBOTER\Config\User\Common\SensorInterface\
KRL files (inside the zip BendFollow_KRL_XX.zip) must be placed anywhere inside the Krc\R1 folder.
Bend_ResetVirtAxes.src is needed to reset the external kinematic before starting the bending process. It requires the height of the die as a parameter
Bend_FollowRsi_ExtAxis.src is the real subroutine that will activate the RSI package. It requires:
Id of the bend
the internal angle of the metalsheet
the descent of the press-brake
the motion of the external axis
the id of the used tool
Test_Follow_RSI.src is the testing program, that shows how to use the software
PrerequisitesTo run these subprograms, you have to declare the following items in the $config.dat:
GI_PressEncoder: Digital input connected to the encoder (16 bit)
I_PP_PinchPoint: Digital input connected to the pinch point.
EncoderRatio: number of pulses per mm
oRSIFilter: Digital output (16 bit) used by RSI as a temporary storage of current encoder position
We also need to define the following subprograms
Press_ResetOutput(): reset all output for press-brake
Press_Start(): start press program
Press_GoTo_PinchPoint(): move the beam to the pinch point
Press_GoTo_LDP(bool wait): move the beam to the lower dead point (end of bend), and optionally wait for it before continuing
Press_Wait_LDP(): wait the lower dead point before continuing
Press_GoTo_UDP(bool wait): move the beam to the upper dead point (press open), and optionally wait for it before continuing
Press_NextStep(bool wait, bool isFlatten): move the press-brake to the next bend, and optionally wait for it before continuing.
Signal ConfigurationInside the file Bend_FollowRsi_ExtAxis.src there are a few parameters that need to be configured before starting the bending operation. Each RSI parameter can be configured using the KRL function rsi_setpublicpar. Most parameters are automatically set using pre-defined variables (e.g. encoder ratio), but some of them changes on every robot set-up:
DIGIN_1: index of the byte where the encoder input is mapped (byte 1 means that the encoder is mapped to Kuka input 1-16, while byte 2 maps bits 17-32 and so on).
DIGIN_2: index of the bit where is mapped the signal of LDP (lower dead point)
DIGIN_3: index of the bit where is mapped the signal of UDP (upper dead point)
DIGOUT_1: index of the byte of the support output oRSIFilter, used to temporary store encoder value. It is used only internally to RSI and should not be used anywhere in the program.
Map2DigOut_1: must have the same value of DIGOUT_1
Testing the systemThe program Test_Follow_RSI is a sample to verify if the system has been correctly configured. It is also shows how to use the subroutines for bending. First of all we have declared the number of bends that we want to do. This number must be equal to the number of bends declared on press-brake program. Right after the declaration, we have the initialization block, that should be run everytime the press-brake program is changed. This part consist on performing all bends (without any robot motion) in order to store the bend descent for every step. These values will be used by the RSI routine to syncronize the robot motion with the actual position of the press-brake. After this initialization, we have the real cycle, where we cycle through each bend and we perform the bending motion. If this test is successful, congratulations: the robot is now ready to be used in a real production environment. Usage with RSI 4.1 (KSS 8.6 and Workvisual 6)BendFollow_RSI_41.zip BendFollow_KRL_41.zip Usage with RSI 3.X (KSS below 8.6)BendFollow_RSI_32.zip BendFollow_KRL_32.zip RSI Diagram #KUKA