You are here: Home / RTLWS 1999-2017 / RTLWS Submitted Papers / 
2024-07-25 - 11:36

Dates and Events:

OSADL Articles:

2023-11-12 12:00

Open Source License Obligations Checklists even better now

Import the checklists to other tools, create context diffs and merged lists

2023-03-01 12:00

Embedded Linux distributions

Results of the online "wish list"

2022-01-13 12:00

Phase #3 of OSADL project on OPC UA PubSub over TSN successfully completed

Another important milestone on the way to interoperable Open Source real-time Ethernet has been reached

2021-02-09 12:00

Open Source OPC UA PubSub over TSN project phase #3 launched

Letter of Intent with call for participation is now available

Real Time Linux Workshops

1999 - 2000 - 2001 - 2002 - 2003 - 2004 - 2005 - 2006 - 2007 - 2008 - 2009 - 2010 - 2011 - 2012 - 2013 - 2014 - 2015

Eleventh Real-Time Linux Workshop on September 28 to 30, in Dresden, Germany

Announcement - Hotels - Agenda - Paper Abstracts - Presentations - Registration - Abstract Submission - Xenomai User Meeting - Sponsors


An Open System for Predictive Control of Manipulator Robots

Walter Lages, Federal University of Rio Grande do Sul
Diego Santini, Federal University of Rio Grande do Sul

1. Introduction

In recent years, the demand for increased capability and flexibility has lead to an increase in the need for controllers based on open architectures. The Open Robot Control Software (OROCOS) project was born as an effort to match this demand. It is a general-purpose, open-source, modular framework for robot and machine control. In this paper, we present an implementation of a robot controller using OROCOS. The system environment is the Linux operating system with the RTAI real-time patch. The controller is based on a distributed architecture where each processing node is associated to a joint of the robot. Hence, the system could be extended to other robots. The CANbus is used for real-time data transfer such as sensor measurements and actuator commands. In OROCOS, each joint is mapped to a component and can use all the features of the framework. This reduces the cost and work because it allows the reuse of elements of an existing system. The paper present results of a controller implementation which illustrates the benefits of open architecture systems.

Many control methods for robot have been proposed in the literature. However, in realistic implementations it is difficult to obtain the desired performance, due to constraints on inputs or states that naturally arise. Usually, the controller is designed under the assumption that there are no limitations on inputs or state and, at most, the actual restrictions are taken into account afterwards. By using model predictive control (MPC), restrictions can be handled in a straightforward way while generating the control signal. For a robot this is an important issue, since the position of the robot can be restricted to belong to a safe region of operation and
control actions that respect actuators limits can be generated.

This paper presents a software library developed to implement model predictive control (MPC) strategies in real-time. By using MPC, an appropriate optimal control law is implicitly obtained. Furthermore, the system physical constraints on state and inputs are dealt with in a straightforward way. The library supports MPC for linear, nonlinear and linearized systems. For linear systems, the optimization problem is solved by using quadratic programming, while for the nonlinear case, sequential quadratic programming (SQP) is used. The linearized version enables the use of the faster quadratic programming algorithm for the nonlinear case. Experimental results show that the control signal computation can effectively be performed under the real-time requirements.

2. The Janus Robot

The Janus robot, is used in this paper. It is an anthropomorphic two-armed robot, with eight degrees of freedom in each arm, and a stereo vision system. The vision system consists of two links connected in series by two revolute joints. Two cameras are attached to the far-end of the chain. Each joint is driven by DC motors and contains an incremental quadrature encoder and a reference index inductive switch.

3. Model Predictive Control

Model predictive control is an optimal control strategy that uses the model of the system to obtain an optimal control sequence by minimizing an objective function. At each sampling interval, the model is used to predict the behavior of the system over a prediction horizon. Based on these predictions, an objective function is minimized with respect to the future sequence of inputs, thus requiring the solution of a constrained optimization problem for each sampling interval.

Although prediction and optimization are performed over a future horizon, only the values of the inputs for the current sampling interval are used and the same procedure is repeated at the next sampling time. This mechanism is known as moving or receding horizon strategy, in reference to the way in which the time window shifts forward from one sampling time to the next one.

The basic elements present in all model-based predictive controller are: prediction model, objective function, calculation of the control action. The prediction model is the central part of the MPC, because it is important to predict the future outputs of the system. In this scheme, the state space model is used as prediction model. The objective function defines the criteria to be optimized in order to force the generation of a control sequence that drives the system as desired.

Model predictive control is based on the assumption that for a small time horizon plant and model behavior are the same. For this assumption to hold the plant/model mismatch should be kept small. Obviously, for any real world plant, control inputs are subject to physical limitations. Hence, to avoid large plant/model mismatch those limitations should be considered while computing control inputs. This can be done in a straightforward way by defining upper and lower bounds on the control input

4. The Proposed Control Architecture

The control architecture proposed in this paper is based on distributed processing nodes, called AIC, for each joint of the robot. Each AIC drives a DC motor through a PWM converter and interfaces with an incremental quadrature encoder, an index inductive switch and an electromagnetic brake.

A CANbus is used for real-time data transfer such as sensor measurements and actuator commands, between each AIC and a host PC. CANbus is an open protocol that has gained widespread popularity not only in the automotive industry but also in the industrial automation arena. CAN has also proven that it fits very well into the suite of field-buses or sensor/actuator buses because of its low price, multiple suppliers, highly robust performance and already widespread acceptance. Priority arbitration, error detection and re-transmission are all handled by the CAN controller hardware. Thus, the network may have a mechanism to ensure that the data transmission and reception is uninterrupted.

A personal computer with an AMD Athlon 64 4000  processor and 1GB of RAM, running on Linux with the RTAI real-time patch is used as host. The controller based on the OROCOS framework executes in the host PC.

5. Components Models for Interface Janus to OROCOS

This section presents the components models that were build to interface the Janus to OROCOS: AIC, MPC and Bridge.

5.1. AIC Component Model

The AIC component model is an abstraction of the AIC hardware, thus represents every device in AIC card. Besides, it has to be able to represent any joint in the robot, independent of its details. For this, the AIC component model was created to grant flexibility and has a set of properties that enable the configuration of the component for each joint of the robot.

Each joint of Janus has an incremental encoder. This allows the measurement of the displacement of each joint and the position by integrating the displacement along the time. These data are written into two write-only data ports. Some joints have an index inductive switch to detect the physical limit for the joint. This data is written in a write-only data port. Furthermore, a write-only data port is used to make the voltage value that is applied to the motor available to other components. Note that all other components should only read this port.

The action of AIC component is made through the methods interface. The methods interface is used because it is synchronous with the caller, unlike the commands interface, this is appropriate for a MPC control strategy. The methods correspond to functions performed by the devices embedded in AIC card, like MotorSet(double voltage) to actuate the motor and EncoderRead(void) to update the position, displacement and index data ports.

5.2. MPC Component Model

The MPC component implements the MPC controller. The MPC component creates a periodic thread that receive the reference position and the measured position from AIC. Then, it calculates the voltage to be applied to the motor through the methods in AIC.

In order to enable the use of the controller implementation developed in this work for other robots and dynamic systems in general, the MPC algorithm was implemented as a general purpose C class library. Hence, by redefining the object that represents the system model, it is possible to use the very same software for applying MPC control to any system that can be described in space state.

The library was developed with generality in mind, so that it is useful not only for implementing MPC for robots, but for any system that has a model in state space. The library supports a number of models in state space: linear, non-linear and linearized, continuous, sampled and discrete. A class library was implemented to support all combinations of those model characteristics. Some of them can be derived from others, for example, a linearized sampled model can be derived from a non-linear continuous model. This way, in order to implement a linearized MPC such as used, one can just define the continuous non-linear model of the system and let the library to obtain the linearized sample model through derivation of classes.

5.3. Bridge Component Model

The bridge component model has the purpose of convert data formats between robot-oriented built-in OROCOS components and the joint-oriented custom components such as MPC and AIC.

6. Experimental Results

The experimental system controls the vision system of the Janus robot. The system configuration is done through scripts and XML files. For each joint, an AIC component is created with its respective properties. Then the MPC component is created and connected to the AICs, which grants them access to AICs methods. All the data ports connections are done through a configuration file in XML format as well.

The performance of the system was evaluated by a trajectory-tracking experiment. From the initial position, a new position is commanded to the joints of the robot, and the generated trajectory and the measured trajectory are compared. The performance of system is evaluated through the following criterions: integral absolute error criterion (IAE), integral time absolute error (ITAE), integral squared error (ISE) and integral time squared error (ITSE). The results obtained with the MPC are compared to the traditional independent PID controller common in many commercial manipulators.

7. Conclusion

An open architecture controller for the Janus robot was presented in this paper. By using the OROCOS and the component-based paradigm, it was possible to achieve a reduced development time, due to the reuse of components, avoiding the need to build these features and an easily extension to other manipulator robots due to the facility of add more AIC components to control more joints.

As shown above, the choice of MPC for the current application is well justified by some advantages: the straightforward way in which state/input constraints can be handled; coordinate transformations to a chained or power form are not necessary; the MPC implicitly generates a control law that deals with the robot nonlinearities.

The viability of the proposed scheme was demonstrated by a development of software library for real-time implementation of model predictive control. This library was implemented with generality in mind, so that it can be used for implementing MPC for any system that has a model in state space. Furthermore, real-time performance data showed that recent commercially available processors have enough processing power to meet the timing requirements.