About us What we do Our associations Membership Machinery Finder Exhibitions Resource hub News & Publications PPMA BEST Contact us
background image
background image
background image
background image
background image
background image
background image
background image
background image
background image
Become a member arrow right
Stay up to date

Please provide a valid email address

Please select one or more contact preferences

Sign up

Developing and promoting the use of industrial robots and automation.

Robot programming methods.

​Programming robots is a crucial factor in the efficiency and effectiveness of your automated robotic systems. A range of different approaches are used by robot manufacturers and developers, covering core systems and task-specific controls.

The importance of using the right approach is underlined by the fact that until recently programming and integration accounted for 50-70% of the cost of a robot application. New AI and machine vision robot technology can facilitate programming and require significantly less input by operators or programmers.

What is robot programming?

The definition of robot programming is the method of inputting specific instructions for a robot to carry out automated tasks. Instructions are entered into the robot’s control system which then moves the motors, or actuators, on each axis. The programme dictates what the robot does, and enables robotic equipment to perform specific actions within a manufacturing, processing, logistics or packaging line.

To program a robot, the most common languages used are C/C++, Python, Java, and C#. Other programming languages used are specific to different manufacturers. Many robot manufacturers have their own program code and their own approach to programming. If a programmer knows how to work with one robot brand, they may not necessarily be able to work with another.

How to programme a robot.

The two key categories of robot programming are online and offline. Online programming involves moving the robot’s arm through a sequence of positions which are recorded and saved in the robot’s systems. Offline programming is the process of writing a program on a separate computer to control movements and then uploading it to the robot. These robot definitions are outlined in more detail below.

Online robot programming.

The robot teaching method is traditionally the core approach to online robot programming. This has been by far the most popular standard method of programming. Programmers/operators use a teach pendant, which is a control box for programming the motions of a robot.

Teach pendants are typically handheld devices and may be wired or wireless. The robot is set to learning or teach mode, and the pendant is used to control the robot step by step, by keypads and command buttons, to drive the robot to the required positions and paths in turn to create the program. For programming, the robot can be moved using different coordinate systems:

Joint co-ordinates

The robot joints are driven independently of each other in the required direction. This will require multiple moves of each axis/joint to achieve the position and orientation of the tool in relation to the workpiece.

Global co-ordinates

The tool centre point of the robot can be driven along the X, Y or Z axes of the robot’s global axis system. Rotations of the tool around these axes can also be performed easily using this coordinate system. In this definition, the robot’s global coordinate system is usually defined at the base of the robot.

Tool co-ordinates

Similar to the global coordinate system except that the axes of the robot are ‘attached’ to the centre point of the tool (TCP) and therefore move with it. This system is especially useful when the robot is required to move at angles, which can easily be achieved by rotating the axis to the desired angle and then initiating a straight line move along that axis.

Workpiece co-ordinates

In many instances, it is also possible to define the coordinate system as a point in space within the working envelope of the robot. An example of where this would be beneficial might be where the robot is working between different workpieces and tools which may be moving such as a pallet conveyor or external manipulator.

Other examples where this approach might be of use are where the robot is required to move in an arc of a specific radius or where multiple work tools are available for use in the robot system.

Lead through

Manual programming also includes the lead through approach. This system of programming was initially popular with some early robot types. However, its use has declined over time, becoming the preserve of some painting applications in the main. In this scenario, the robot is programmed by being physically moved through the task by an operator, defining points etc. along the way.

The disadvantages of this method include the fact that any errors or inaccuracies introduced by the operator cannot be easily rectified. Although no longer a mainstream method of programming industrial robots, many collaborative robots (or cobots) have this function available as a teaching option and it can be retrofitted to industrial robots where there is a need to do so.

Offline robot programming

For industrial robots, one of the disadvantages of online programming is downtime. Programming takes place using the robot itself, meaning it will not be able to operate productively.

Offline programming removes the need to use robot movements to create a program and moves programming to a virtual environment instead. The programmer still writes the code, but all of this happens inside a virtual twin of the robot.

Offline programming allows robots or programmers to create program and path data directly from CAD models of the parts being processed. Typically, offline programming methods are most beneficial in complex applications that require extended periods of manual programming. These instances may include applications where parts are large or complex or in production environments where there are a high number of different part types and a low volume of each.

Offline programming allows production to continue uninterrupted, and in most cases, only minor adjustments will be required to the program once downloaded to the robot, saving significant amounts of time when setting up to produce new part types. There are various approaches to off-line programming from simple path generation to full system design, programming and commissioning within a virtual environment.

Robot programming with AI and machine vision systems.

Despite its advantages, offline programming creates a new challenge that is not present in online programming, namely that virtual and real cells are always slightly different:

  • Real robots and real working zones may differ from the virtual copy
  • The parts themselves may differ from the perfect 3D model, due to deviations arising in pre-assembly
  • Real fixtures and clamps may differ too

As a result, after creating a program in a virtual environment, the programmer still needs to test it on a real robotic cell, using a teach pendant.

AI and machine vision systems can be used to effectively address the problem. A 3D model of the relevant part is uploaded from the CAD system. Then the operator chooses the parameters which the robot needs to follow (work and travel angles, offsets, weaving, etc.). No programming is required. Mathematical algorithms automatically generate the robot trajectories, usually in a few minutes or even less.

The next step is scanning the part using machine vision. AI algorithms compare the previously uploaded 3D model and the real part. The system finds all possible deviations and adapts the robotic trajectories as required.

AI provides robots with adequate computer vision and motion control to better understand their production environment and act accordingly. Similarly, machine learning conditions the robots in such a way that with timely evolution, they learn from their own mistakes, thus preventing constant human intervention and parallel effort.

The ease and speed of programming using this approach facilitates switches from one product or process to another and helps to make robots cost-effective and highly flexible.

Best practices for robot programming.

The principles of robot programming follow the same priorities as creating programs for any usage. While every step may not be required, system owners should specify a thorough approach which allows new programmers and operators to work effectively with programs and robotic equipment.

Documentation

Programming documentation requires a high-level framework to map out the sections and purpose of each element of the program. The documentation should include a clear description of the robotic workflow and the programming method used.

Robot planning techniques

Planning for robot programming involves setting out required resources, skill levels and timings, including all downtime, training and testing.

Modularity

All programming should be broken down for specific workflows, which also need to be easily understood.

Readability

Make sure that workflow files have meaningful names, and use comments and annotations to describe contents in adequate detail. However, comments should only be added for sections of the code that are not intuitive.

Avoid hard coding.

For robot programming, it is always advisable to create configurable files which allow process owners to make changes to automation variables without requiring a developer.

Include logging in the workflow.

Logging of events and operating information is essential for auditing and analysis.

Build in error handling.

If an unexpected error occurs, the robot should notify a human operator via email and include a screenshot of the error message, when the error occurred, and the source of the error.

Use online and colleague resources.

Never refrain from using all available resources which provide reliable expertise to aid the creation of your robot programs.

Testing

Ensure that you have a thorough testing methodology before putting a programme into operation. The importance of testing cannot be underestimated.

Common challenges in robot programming.

Learning and human interaction.

Robot programming needs to take account of how humans will work with the program and interfaces. The end result must be usable and memorable by the staff who will be responsible for operating robotic systems.

Flexibility and multi-functionality.

Flexibility is increasingly important in many production and processing environments. As demand for ever wider ranges of products grows, the means of manufacturing and packaging different products need to be economically viable and appropriate to market demands.

Repeatability and accuracy.

Robots outperform humans because of their ability to repeat functions with the same level of accuracy without taking breaks. Robot programs need to ensure that performance is thoroughly reliable, error-free and can maintain performance over extended periods.

Communication between robots.

Where robots work together, programs must ensure that information from one unit to others is transferred seamlessly and reliably, for example, about the end of one process in readiness for the next.

Mapping the work environment for mobile robots.

The increasing use of autonomous mobile robots (AMRs) in production and logistics settings requires programming for the avoidance of collisions with static and moving objects and operators in complex environments.

Data privacy

Robot programs involve the use of commercially sensitive data, and in certain environments, of personal data (eg where robotic programs are used to process employee, health or financial records). Data privacy obligations extend to robot programs just as they do to any other form of data handling.

Popular robot planning tools and software.

C

C is one of the most popular languages used to write robot programs, together with its object-oriented successor C++. Python enjoys great popularity with developers thanks to its ability to be used in machine learning. Java and C# are also widely used.

C++

C++ can also be used to develop Robot Operating System (ROS) packages which provide a set of libraries and tools for building robot applications. ROS-based tools which assist developers of robot applications include RVIZ and Gazebo. PickNik’s Movelt Studio leverages the widely popular MoveIt motion planning library and the Behavior Trees library, assisting developers in everything from application programming to motion control.

Matlab

Matlab is used for data analysis and interfaces with ROS, while Octave offers similar capabilities and is a free, open-source software.

Tools

Popular tools for robot programming include the Raspberry Pi computer which can be connected with peripherals such as cameras for machine vision functionality. The Arduino microcontroller is also frequently used for low-level robot control.

For modelling 3D versions of robots CAD Tools is an important resource, and is available through Adobe Illustrator, while MeshLab is an open-source software which also has extensive 3D capabilities.