Introduction to ABB Robot Programming Language
ABB robots are programmed using the RAPID language. Learn the basic structures and definitions of the robot catalog and the language in part 1 of this 2-part series.
Figure 1. ABB robot catalog lineup. Image courtesy of ABB
ABB Robot Family
ABB is known around the world for its industrial robots. They are used in all industries from the medical, automotive, electronic assembly, even some nuclear applications. Industrial robots come in many shapes and sizes but there are four main categories common across all brands.
Figure 2. ABB’s IRB 140 industrial 6-axis articulating robot arm. Image used courtesy of ABB
The articulating robot is the most common six-axis robot used in industrial environments. ABB has an extensive model selection of articulating robots, including painting and welding robots.
Figure 3. ABB’s CRB 15000 Collaborative robot. Image used courtesy of ABB
This style of robot is still relatively new to the industrial world. The collaborative robot is designed to work alongside humans with or without safety guarding. ABB has four collaborative solutions.
Figure 4. ABB’s delta robots can easily handle high-speed pick-and-place operations. Image used courtesy of ABB
The delta robot, sometimes referred to as a spider robot, typically has four or five axes, and is usually capable of higher speeds than other robots. The major downside is the limited payload capacity.
Figure 5. SCARA robots are excellent for vertical pick-and-place operations. Image used courtesy of ABB
The selective compliance articulated robot arm (SCARA) is a high-speed robot used to pick and place small components quickly, such as in the electronics industry. ABB only has a few models of SCARA robots to choose from.
Industrial robots are great for picking and placing objects between different manufacturing processes, or when products need to be inspected and sorted. Other robots are optimal for welding or painting applications, or even food handling.
Programming Languages (Structured Text)
Typically, robots are programmed using some form of structured text similar to a C-style programing language, with the exception of collaborative robots, which tend to be more graphical and user-friendly in design, sometimes relying on human manipulation to ‘teach’ the robot its process.
Every robot manufacturer has a slightly different programming language but most industrial robots use a form of structured text (ST) programming. ST is a textual language that most resembles Python or a stripped-down version of a C language. All the major loops are available in ST, such as FOR, WHILE, CASE, and IF statements. Standard data types are available and arrays can be used but not lists. There are no classes but you can have multiple tasks containing different functions or methods, and many software packages include pre-built functions like a library in order to make certain usage applications more efficient.
The industrial control sector typically uses ST as a second to ladder logic because ST is part of the IEC 61131-3 standard, meaning the language must follow the same scanning and general structure of ladder logic. This structure refers to the code scanning order. When the processor scans the compiled code, it does so in a cyclic manner. This cyclic scanning order, commonplace in PLC programming, is different from C-style programming languages normally used in a PC or robot controller.
Typically with PC programming languages, the code is not scanned until something or someone causes an event. When a user presses a button on a screen, a section of code will execute via event handlers within the code, which is a typical PC programming structure. With cyclic scanning, a statement like “IF btn1 THEN text1 = ON” must be used and every line will be scanned every cycle, regardless of whether the button is pressed or not.
Figure 6. Robot programming is completed either on the local robot controller, or in a PC environment and transferred to the robot. Image by James Harrison used courtesy of Unsplash
ABB RAPID Programming Language
In the ABB robot world, the RAPID language is used for programming. It has a similar look and feel to most ST and closely resembles C-style programming languages.
The RAPID language has embedded functions that the robot can use. These embedded functions are what allow the robot to move to different locations (e.g., functions like “MoveL” is a linear move to a taught point). Some functions compute math instructions or deal with how sensitive the robot is to external forces.
These functions are called much like other functions in ST or RAPID, where only the main root function cannot be removed and is used to call other functions. You can even create your own functions that will return a value in a specific data type, much like you would with a C++ language.
A parameter, with respect to a function or method call, is a variable sent along with the call. For example, “CalculateNum(Num1, Num2)”. Num1 and Num2 are parameters; their value and data types are used in the function of CalculateNum.
In cyclic ST, parameters are not commonly available. A substitute would be to have a global variable that can be accessed by any method or routine within the code. Parameters are available in RAPID programming and can reduce the size of a program by allowing a single variable to serve more than one purpose.
An example would be an application requiring many taught positions, but only one position is accessed at any one time. A function calculates which position needs to be accessed then calls a motion method with the position as a parameter. When this method is called, the robot moves to the position stored in the parameter. When a new position is calculated, the parameter is recycled for the new method call. By using one method and sending the position through a parameter, the code to move the robot is very compact.
An interrupt in programming is a signal or event instructing the processor to execute another task once the current task is completed, regardless of the current location in the program.
A common example would be a pushbutton. When the user presses the pushbutton, specific code will execute, setting variables or displaying text. Interrupts are not found in cyclic ST programming, because breaking the scan cycle would go against the IEC standard.
In RAPID, programming interrupts are utilized when a robot enters an area or has a gripper signal. These signals can execute short specific code outside of the standard cyclic task.
The RAPID programming language is very similar to other common ST programming in many ways, but the differences assist programming for robotics. Using functions for robot-specific tasks or motion allows for easy-to-understand programming, and the ability to create your own functions allows for a more flexible programming environment.
The parameters and interrupts allow programmers to create compact and efficient code. If you are familiar with any C-style programming language or with ST, programming in RAPID should be a fairly easy switch.
In a following article, we will provide an example task tutorial of programming an ABB robot using RAPID programming.