Cartesian Nonlinear Model Predictive Control of Redundant Manipulators Considering Obstacles
Cartesian Nonlinear Model Predictive Control of Redundant Manipulators Considering Obstacles
Angelika Zube
Fraunhofer Institute of Optronics, System Technologies and Image Exploitation IOSB, Karlsruhe, Germany
[email protected]
Abstract—For redundant fixed or mobile manipulators in collision avoidance is achieved by using a cost function and
shared human-robot workspaces, control algorithms are nec- constraints that depend on the distance between the robot
essary that allow the robot to perform a task defined in the and the obstacles. The presented control algorithm is also
Cartesian space and that simultaneously realize additionally easily modifiable to realize other desired behaviors by adding
desired robot behaviors like avoiding collisions with humans or additional terms to the objective function.
other obstacles. In this contribution, a Nonlinear Model Predictive
Control (NMPC) approach is proposed to move the end-effector This paper is organized as follows: After an overview of
of the robot to a desired pose (3D position and orientation), along related work in Section II, the underlying robot model is
a geometric reference path or along a reference trajectory while described in Section III. In Section IV, the Cartesian motion
considering obstacles. Due to the underlying general robot model, task is formally defined as trajectory and path following
the control algorithm is applicable to both fixed and mobile
problem. The NMPC algorithm that solves the trajectory
manipulators, which is shown by means of simulations of a 7 DoF
fixed manipulator and of a 10 DoF mobile manipulator. or path following problems is discussed in Section V with
an addition for obstacle avoidance. Simulation results for a
7 DoF manipulator and a 10 DoF mobile manipulator are
I. I NTRODUCTION presented in Section VI. The paper closes with the conclusion
With regard to shared human-robot workspaces and clut- in Section VII.
tered environments, the use of redundant robots is desirable.
As they have more degrees of freedom (DoF) than needed to II. R ELATED W ORK
execute their given task, the redundant degrees of freedom can
Model predictive control methods are often applied to solve
be exploited to achieve an additionally desired robot behavior,
the trajectory following problem of mobile platforms [2]–[4].
e.g., avoiding collisions with humans or other obstacles, while
Usually, the 2D platform position and the heading angle are
the robot continues performing its original task.
controlled in order to follow a given reference trajectory based
The robot task is often specified in the Cartesian space. on a kinematic model of the robot.
The end-effector has to move to a desired Cartesian pose (3D
With respect to robot manipulators, model predictive con-
position and orientation), has to follow a geometric reference
trol is often reported to be used for joint position or velocity
path, e.g., defined by a sequence of poses, or has to follow a
control [5]–[10]. In these examples optimal joint torques are
reference trajectory that defines the desired Cartesian pose as
computed in order to follow a desired trajectory in the joint
a function of time. That means, the robot has to be controlled
space based on a dynamic robot model. In some cases, the
in order to fulfill the Cartesian task by applying suitable joint
joint trajectory is reported to be obtained from a Cartesian
configurations or velocities to a secondary position or velocity
reference trajectory by solving the inverse kinematics. In [11],
controller that is usually provided by the robot manufacturer. A
a goal joint configuration is given instead of a joint trajectory.
common approach is to transform the Cartesian reference poses
The robot manipulator is controlled in order to reach this joint
into joint configurations by solving the inverse kinematics
configuration while avoiding collisions with other robots. The
problem and then performing control strategies in the joint
robot geometries are modeled by line-swept sphere volumes.
space. But in the case of redundant robots, this procedure has
Collision avoidance is realized by adding collision constraints
the disadvantage, that there is no unique solution for the in-
to the optimization problem.
verse kinematics problem. Solutions resulting from (weighted)
pseudo-inverses of the direct kinematics as presented in [1] are In [12], model predictive control for robot manipulators is
often not optimal with regard to the task execution and are not extended in order to solve the path following problem for a
suitable for collision avoidance. given joint position path without time dependency. Therefore,
the velocity along the path is optimized together with the
To overcome this problem, this contribution proposes a
robot torques. The method is applied to a two-link planar arm
Nonlinear Model Predictive Control (NMPC) algorithm that
configuration.
accepts Cartesian reference paths or trajectories of the desired
3D end-effector position and orientation as input and computes For mobile manipulators, only a few model predictive
optimal joint positions and velocities. The controller is based control approaches exist. In [13] model predictive control
on a generic robot model, so that the controller is applicable is proposed to control the end-effector position of a mobile
to both fixed manipulators and mobile manipulators. Joint manipulator to reach the desired reference position. The con-
position and velocity constraints are directly considered in the sidered mobile manipulator consists of an omni-directional
control algorithm. Additionally to the Cartesian task execution, platform and two planar links. In [14] the end-effector position
138
with sample time Ts . NMPC optimizes the system input and B. Optimization Problem for Path Control
state sequences
Given a path instead of a trajectory, the reference pose at a
specific time is unknown, as the evolution of the path param-
V = {v(0), . . . , v(Np − 1)} (10)
eter θ(t) is not given a-priori. Therefore, the path parameter
Q = {q(1), . . . , q(Np )} (11) is optimized together with the joint positions and velocities
of the robot based on a system model that describes the path
for the next Np time steps based on the currently measured parameter dynamics. In this contribution the linear model
joint positions q(0) = q 0 by minimizing a cost function
containing the trajectory following error or the path following θ(k + 1) = θ(k) + Ts vθ (18)
error respectively. The optimized input v ∗ (0) is applied to
the system. Then, the optimization is repeated using the next with the path parameter velocity vθ is used. Hence, the
measurement. optimization problem for trajectory control is augmented to
find an optimal solution for the sequences
The formulation of the optimization problem for trajectory
and path following control is presented in the following V = {v(0), . . . , v(Np − 1)} (19)
sections. In both cases, the optimization problem is solved by Q = {q(1), . . . , q(Np )} (20)
nonlinear programming (NLP). Here, a primal-dual interior- Vθ = {vθ (0), . . . , vθ (Np − 1)} (21)
point algorithm with a filter line-search method from the
Θ = {θ(1), . . . , θ(Np )} (22)
optimization library IPOpt [17] is used, that exploits the sparse
structure of NMPC optimization problems. that minimizes the cost function
Np −1
X
A. Optimization Problem for Trajectory Control F (v(k), q(k + 1), vθ (k), θ(k + 1)) + E(q(Np ), θ(Np ))
k=0
For following the desired Cartesian trajectory y t , the opti- (23)
mal joint velocity and joint position sequences are computed subject to
by minimizing the cost function q(k + 1) − q(k) − Ts v = 0 (24)
Np −1 θ(k + 1) − θ(k) − Ts vθ = 0 (25)
X
F (v(k), q(k + 1)) + E(q(Np )) → min (12) and
V ,Q
k=0
−v max ≤ v(k) ≤ v max (26)
subject to the equality constraints
q min ≤ q(k + 1) ≤ q max (27)
q(k + 1) − q(k) − Ts v = 0 (13) vθ,min ≤ vθ (k) ≤ vθ,max (28)
θmin ≤ θ(k + 1) ≤ θmax (29)
and the inequality constraints
for k = 0, . . . , Np − 1. The terms of the cost function are
−v max ≤ v(k) ≤ v max (14) F (v, q, vθ , θ) =v T Qv v + q T Qq q + eTp Qe ep
q min ≤ q(k + 1) ≤ q max . (15)
+ qvθ vθ2 + qθ (θ − θmax )2 (30)
for k = 0, . . . , Np − 1. The equality constraints (13) contain E(q, θ) =q T Rq q + eTp Re ep + rθ (θ − θmax )2 (31)
the system model (8). The inequality constraints (14)–(15)
with qvθ ≥ 0, qθ ≥ 0, rθ ≥ 0 and the positive semi-definite
guarantee that the joint velocity and position limits are met.
diagonal matrices Qv , Qq , Qe , Rq and Re . The path following
The terms of the cost function are error ep is computed according to (7) and (9). Penalizing
the distance of the path parameter from θmax is necessary to
F (v, q) = v T Qv v + q T Qq q + eTt Qe et (16) enforce approaching the end of the path. With vθ,min ≥ 0 only
T
forward motions on the path are possible.
E(q) = q Rq q + eTt Re et (17)
with the trajectory following error et according to (6) and (9). C. Considering Obstacles
Qv , Qq , Qe , Rq and Re are positive semi-definite diagonal During task execution, the robot redundancy can be ex-
matrices. With F (v, q), high joint velocities, deviations of ploited to avoid collisions with obstacles. Therefore, the above
the joint positions from the home position and the trajectory presented cost functions are extended in order to additionally
following error are penalized. Penalizing the trajectory fol- increase the distance between the robot and the obstacles.
lowing error is needed to fulfill the trajectory following task.
Penalizing the joint velocities avoids unnecessary high input For smooth distance computations, distances between test
energy and oscillations. Avoiding high joint position values points on the robot pR,i (q) ∈ R3 (i = 1, . . . , nR ) and obstacle
keeps the joints away from the joint constraints and results in points pO,j ∈ R3 (j = 1, . . . , nO ) are considered,
more natural motion. The term E(q) is only applied to the last
2
d2i,j (q) =
pR,i (q) − pO,j
.
prediction step and is added to improve stability. (32)
139
The position of each robot test point with respect to the base
frame depends on the joint configuration q and is computed
using the kinematic robot model according to
pR,i (q) l p
= T 0 (q) l,i (33)
1 1
where the point i belongs to link l and pl,i is its position in
the corresponding link frame.
The obstacle points are updated in each control step, when (a) Start pose
new measurements are available, in order to take obstacle
motions into account. But during optimizing the input and state
variables for one control step, the obstacles are assumed to be
static over the full prediction horizon, as no prediction of the
obstacle motion is available. If the obstacle motion is predicted
using advanced monitoring strategies, the prediction can also
be incorporated in the control algorithm.
The cost function (12) or (23) is extended by a term that
penalizes the squared distances between the robot and the
(b) Final pose without considera- (c) Final pose considering obsta-
obstacle points. tion of obstacles cles
Np −1
Fig. 1. Example of a manipulator motion to a reference pose with and without
X
FO (q(k + 1)) + EO (q(Np )) (34) consideration of obstacles (green spheres); the blue spheres represent the robot
k=0 test points with minimum distances as radii.
For FO and EO different functions are possible. They have to
be twice continuously differentiable and have to increase for
small squared distances d2i,j, (q). In this work the terms are VI. S IMULATION R ESULTS
chosen to be A. 7 DoF Manipulator
nR X nO
X ci
FO (q) = 2 (q) − d2 (35) In the first example, the presented algorithm is applied to
i=1 j=1 i,j
d i,min a simulated KUKA Leightweight Robot (LWR IV) with seven
EO (q) = rO FO (q) (36) revolute joints. The control interface of the real robot (KUKA
Sunrise) as well as of the simulated robot delivers the measured
with the following characteristic: For ci > 0, the function joint angles and accepts joint velocity commands.
ci /(d2i,j − d2i,min ) goes to infinity for d2i,j → d2i,min and it goes
to zero when d2i,j increases. di,min is the minimum allowed For the consideration of obstacles, eight test points on the
distance between the robot point i and an obstacle point. If robot are chosen with a minimum distance to obstacle points
d2i,j < d2i,min , the term FO is set to infinity. of 0.2 m. These robot points are visualized in Fig. 1(a) as blue
spheres with radii according to the minimum distances.
Considering the quadratic distances between the robot and
obstacles in the objective function results in pushing the robot The robot manipulator is controlled to move from a start
away from obstacles while at the same time the robot end- configuration to a reference pose by using the joint velocities
effector is controlled to follow the reference pose as close as actuating variables. A sample time of Ts = 0.1 s and
as possible. But there is no guarantee, that the optimized Np = 10 prediction steps are used, which leads to a prediction
robot configurations are not in collision with an obstacle. horizon of 1 s. In Fig. 1(a) the start configuration of the
This guarantee can be achieved by introducing the following example motion is shown. Without considering obstacles the
constraints: manipulator successfully reaches the reference pose with the
d2i,j (q(k)) − d2i,min ≥ 0 (37) joint configuration shown in Fig. 1(b).
for k = 1, . . . , Np , i = 1, . . . , nR and j = 1, . . . , nO . That If the two obstacle points that are visualized in Fig. 1
means that the distance between the robot and the obstacle as green spheres are considered in the control algorithm, the
points has always to be greater or equal to a specified safety manipulator also reaches the reference pose but with a joint
distance di,min . The drawback of this approach is, that the configuration with higher distances between the robot and the
number of nonlinear constraints increases significantly and obstacle points (see Fig. 1(c)).
therefore solving the optimization problem becomes more
In both cases the maximum computing time for one control
expensive.
step is lower than 70 ms using an 2.8 GHz Intel Core i7
Using only the obstacle constraints (37) without the cost processor without parallelization of the control algorithm.
function terms (34) is also possible. But then, the robot
may move close to the obstacles keeping only the requested B. Mobile Manipulator with Reference Trajectory
minimum distance, even if motions with higher distances are
possible. But especially in the case of dynamic obstacles, it is In the second example, the developed method is applied to
desirable to increase the distance between the robot and the a simulated omni-directional mobile platform equipped with
obstacles as far as the task execution is not impeded. a 7 DoF manipulator (KUKA OmniRob with LWR IV). The
140
whole mobile manipulator has 10 DoF and is highly redundant
with regard to Cartesian reference poses. The robot is modeled
according to the Denavit-Hartenberg convention as a chain of
revolute and prismatic joints. Two prismatic joints q1 and q2
describe the platform translation in x- and y-direction with
respect to a global frame. A revolute joint q3 models the
platform rotation about the vertical robot z-axis.
On the real robot, the values for the platform joints
q1 , . . . , q3 cannot be directly measured but are obtained from Fig. 2. Mobile manipulator in start configuration with reference trajectory
(yellow) and obstacles (green); the blue spheres represent the robot test points
the platform localization based on a reference map and the with minimum distances as radii.
platform odometry. The platform is controlled by commanding
the translational velocities vx and vy and the rotational velocity
v3 with respect to the current platform pose. The translational ref
1.4
velocities vx and vy are computed by transforming the veloci- case 1
ties v1 and v2 of the prismatic platform joints from the global case 2
1.2 case 3
frame to the current robot base frame based on the current
z (in m)
platform rotation q3 ,
1
vx cos(q3 ) sin(q3 ) v1
= . (38)
vy − sin(q3 ) cos(q3 ) v2 0.8
0.6
0 1 2 3 4
For collision avoidance, ten test points are chosen on the y (in m)
robot. The minimum distance for the two points describing the (a) End-effector position
platform is set to 0.6 m and the points on the robot arm have
a minimum distance of 0.2 m. In Fig. 2, the corresponding
volume approximation is visualized by blue spheres. 0.08
case 1
case 2
The mobile manipulator is controlled to follow the end-
Computing time (in s)
0.06 case 3
effector pose trajectory shown as yellow line in Fig. 2. Again,
a sample time of Ts = 0.1 s and Np = 10 prediction steps are
0.04
used. The control parameters are chosen in order to achieve
a good collision avoidance behavior. The trajectory following
accuracy is of less importance. The diagonal elements of the 0.02
matrices in the cost function are Qv,ii = 1.0, Qq,ii = 0.01
for manipulator joints, Qq,ii = 0 for platform joints, Qe,ii = 0
0 5 10 15 20 25 30
100, Rq,ii = 0 and Re,ii = 1000. The obstacle cost function t (in s)
parameters are ci = 1.0 for platform points and ci = 0.1 for
(b) Computing time for one control step
manipulator points.
Fig. 3. Example of a mobile manipulator executing a trajectory following
The resulting end-effector position in the y-z-plane can be task without obstacles (case 1), with obstacles considered in the objective
seen in Fig. 3(a). In the first case (blue line), the trajectory function (case 2) and with obstacles considered in the objective function and
following control is performed without obstacles. The end- in the constraints (case 3).
effector follows the reference trajectory well with a maximum
deviation of 3.9 cm. The computing time for one control step
is below 20 ms except for the first optimization, when no C. Mobile Manipulator with Reference Path
appropriate start values are available (see Fig. 3(b)).
In this example, the mobile manipulator described in
The six obstacles that are visualized as green spheres in Section VI-B is controlled to follow a reference path. The
Fig. 2 are considered by the objective function in case 2 (green reference path corresponds to the reference trajectory in the
line) and by both the objective function and the constraints in previous section without time information and is shown in
case 3 (magenta line). In both cases the deviation of the result- Fig. 4.
ing end-effector pose from the reference trajectory increases The results are shown in Fig. 5. In case 1, no obstacles are
compared to case 1 (see Fig. 3(a)), especially near the obstacles considered. The end-effector follows the reference path with
for y ∈ [2.5 m, 3.2 m]. But the mobile manipulator successfully only small deviations below 1.0 cm. As no difficulties arise, the
moves through the obstacles without any collision and reaches path parameter velocity shows almost no significant changes.
the end of the trajectory with acceptable deviations. The Only at the end of the path, the path parameter automatically
computing time in case 2 only slightly increases compared to slows down, so that a smooth deceleration is achieved. The
case 1. In case 3, the computing time is significantly higher due computing time for one control step is in the range of 40 ms.
to the high number of constraints. But even close to obstacles
(t > 20 s) the computing time is acceptable with values below In case 2 and 3, the obstacles shown in Fig. 4 are consid-
80 ms. ered in the objective function or in both the objective function
141
Future work will integrate the control algorithm on real
robots using the obstacle information obtained from workspace
monitoring [18].
ACKNOWLEDGMENT
This work has been funded by the European Commission’s
7th Framework Programme as part of the project SAPHARI
under grant agreement ICT-287513.
Fig. 4. Mobile manipulator in start configuration with reference path (yellow)
and obstacles (green). The author thanks her colleague Christian Frese for the
inspiring discussions and comments on the presented work.
1.4
ref R EFERENCES
case 1
case 2 [1] W. Chen, I.-M. Chen, W. K. Lim, and G. Yang, “Cartesian coordinate
1.2 case 3 control for redundant modular robots,” in IEEE Int. Conf. on Systems,
Man, and Cybernetic, 2000, pp. 3253–3258.
z (in m)
142