Adaptive Neuro-NMPC Control of Redundant Robotic
Manipulators for Path Tracking and Obstacle Avoidance
Ashkan M. Z. Jasour, Mohammad Farrokhi
Department of Electrical Engineering
Center of Excellence for Power System Automation and Operation
IRAN University of Science and Technology, TEHRAN, IRAN
Abstract—This paper presents a nonlinear model predictive control (NMPC) method with adaptive neuro-modelling for redundant
robotic manipulators. Using the NMPC, the end-effector of the robot tracks a predefined geometry path in the Cartesian space
without colliding with obstacles in the workspace and at the same time avoiding singular configurations of the robot. Furthermore,
using the neural network for the model prediction, no knowledge about system parameters is necessary; hence, yielding robustness
against changes in parameters of the system. Numerical results for a 4DOF redundant spatial manipulator actuated by DC
servomotors shows effectiveness of the proposed method.
Keywords—Robotic Manipulator, Path Tracking, Obstacle Avoidance, NMPC, Neural Networks.
One of the major challenges in robotic manipulators is the path tracking and the obstacle avoidance. The main reason for
development of manipulator robots is to replace human in doing long and repetitive operations and unhealthy tasks. In this case,
robots must be capable to operate effectively in complex environments. In particular, these robots are needed to track a
predefined path in such a way that no collision with obstacles in the environment occurs. High degrees of freedom for redundant
manipulators lead to infinite number of possible joint positions for the same pose of the end-effector. Hence, for a given end-
effector path in the Cartesian space, the robot can track it in many different configurations; among these, the collision free and
singular free tracking must be selected. Finding feasible path for joints of redundant manipulators for a given end-effector path
is called the redundancy resolution . Redundancy resolution and obstacle avoidance are considered in papers. Using the
gradient projection technique, redundancy and obstacle avoidance can be solved . In task-priority redundancy resolution
technique, the tasks are performed with the order of priority. Path tracking is given the first priority and obstacle avoidance or
singularity avoidance is given the second priority [3, 4]. This technique yields locally optimal solution that is suitable for real-
time redundancy control but not for large number of tasks. The generalized inverse Jacobin and extended Jacobin techniques,
which are used for redundancy solution, are time consuming -. Optimization techniques, which minimize the cost function
subject to constraints, like the end-effector path tracking and obstacle avoidance, are not suitable for on-line applications .
In this paper, a Nonlinear Model Predictive Control (NMPC) method is presented for redundancy resolution considering
obstacles and singularities avoidance. Although the Model Predictive Control (MPC) is not a new control method, works related
to manipulator robots using MPC is limited. Most of the related works are on the joint space control and on the end-effector
coordinating. The linear MPC is used in - and NMPC is used in - for joint space control of manipulators.
Using NMPC, the input voltages of DC servomotors of joints are obtained in such a way that the end-effector of the
redundant manipulator tracks a given path in the Cartesian space considering obstacles and singularities avoidance.
When the robot dynamic are uncertain, adaptive control laws must be used in order to tackle this problem. Adaptive control
methods using neural network are implemented in literatures for controlling highly uncertain and nonlinear systems [15, 16]. In
this paper, neural networks are used as a prediction system in NMPC. Using neural network no knowledge about system
parameters is necessary. Moreover, system robustness against changes in parameters is obtained.
This paper is organized as follows: Section 2 presents nonlinear dynamic of a 4DOF spatial redundant manipulator including
the actuators dynamic. Section 3 describes the nonlinear model predictive control method. Section 4 explains how to obtain
prediction model of the robot using neural networks. Section 5 implements the NMPC for the path tracking and obstacles
avoidance for a 4DOF manipulator. Simulation results are presented in section 6. Conclusions are drawn in Section 7.
2. Manipulator Robot Dynamic
Schematic diagram of a 4DOF spatial redundant manipulator robot is shown in Fig. 1. Table I gives Denavit-Hartenberg
parameters of this robot . Then, the position of the end-effector in the Cartesian space can be calculated in terms of joint
angles as fallows:
The dynamic model of the robot manipulator can be obtained using the Lagrangian method as [17, 18]
Fig. 1 Schematic of a 4DOF spatial manipulator
θθ Cθθ DθGθτ
∈θis the angular position of joints, ()
∈Mθis the symmetric and positive definite inertia matrix, (,)
the centrifugal and coriolis force vector, ()
∈Gθis the gravity vector, ()
&is the vector for joints friction of the links,
∈τ is the torque vector of joints, and n is the degree of freedom, which is equivalent to four for the robot considered in this
paper. The above matrix and vectors are given in Appendix.
Friction for joint i is defined as 
are coefficients of the viscous and dynamic frictions, respectively.
The dynamics of the armature-controlled DC servomotors that drive the links can be expressed in the form 
∈τis the vector of electromagnetic torque,
∈K is the diagonal matrix of the motor torque constant,
the vector of armature currents,
∈J is the diagonal matrix of the moment inertia,
∈Bis the diagonal matrix of
torsional damping coefficients, ,,
&&& denote the vectors of motor shaft positions, velocities and accelerations,
∈τis the vector of load torque,
∈V is the vector of armature input voltages,
∈Ris the diagonal
matrix of armature resistances,
∈Lis the diagonal matrix of armature inductances, and
∈K is the diagonal matrix
of the back electromotive force (EMF) coefficients.
Since dynamic equations of DC servomotors are considered here, the relationship between the robot joint and the motor-shaft
can be represented as
is a diagonal positive definite matrix representing the gear ratios for n joints. Since armature inductances are
small and negligible, Eq. (4) can be expressed as 
Using Eq. (5) to eliminate θm and τm in Eq. (6) and then substituting for τ using Eq. (2), the governed equation of n-link
robot manipulator including actuator dynamics can be obtained as
According to Eq. (7), the armature input voltages are considering as control efforts, respectively. The detailed parameters of
the robot manipulator and DC servomotors are given as Table II and Table III, respectively.
DENAVIT-HARTENBERG PARAMETERS OF THE ROBOT IN FIG.1
1 90 0 0 1
2 0 2
l 0 2
3 0 3
l 0 3
4 0 4
l 0 4
MANIPULATOR ROBOT PARAMETERS
Link 1 2 3 4
l (m) 1 0.5 0.4 0.3
m (kg) 1 0.5 0.4 0.3
DC SERVO MOTORS PARAMETERS
Motor 1 2 3 4
6.51 6.51 6.51 6.51
KE 0.7 0.7 0.7 0.7
KT 0.5 0.5 0.5 0.5
0.2 0.2 0.2 0.2
R 1:100 1:100 1:10 1:10
24 24 24 24
3. Model Predictive Control
Unlike in classical control methods, where the control actions are taken based on the past outputs of the system, the MPC is a
model-based optimal controller, which uses predictions of the system output to calculate the control law [19, 20].
Based on measurements obtained at every sampling time k, the controller predicts the output of the system over prediction
horizon NP in the future using the model of the system and determines the input over the control horizon NC≤ NP such that a
predefined cost function is minimized.
To incorporate feedbacks, only the first member of the obtained input is applied to the system until the next sampling time
. Using the new measurement at the next sampling time, the whole procedure of prediction and optimization is repeated.
From the theoretical point of view, the MPC algorithm can be expressed as
))(min(arg kJu u
such that the following conditions are satisfied:
≤+≤ ≤++≤ ++=++ ++=++ ≥+=+
where j∈[0 , NP-1], x and u are states and input of the system, x0 is the initial condition, and fd and hd are the model of the
system used for prediction. The notation a(m|n) indicates the value of a at instant m predicted at instant n. The intervals [xmin ,
xmax] and [umin , umax] stand for the lower and the upper bound of states and input, respectively. The cost function J is defined in
terms of the predicted and the desired output of the system over the prediction horizon. MPC schemes that are based on
nonlinear model or consider non-quadratic cost function and nonlinear constrains on inputs and states are called Nonlinear MPC
The optimization problem (8) must be solved at each sampling time k, yielding a sequence of optimal control laws
kKkN+−uuK For optimization, the sequential quadratic programming method is used in this paper .
4. Prediction Model Using Artificial Neural Network
As it was explained, a model of the system is needed for prediction in MPC. In this paper, a Multilayer Perceptron (MLP) is
used for modeling nonlinear dynamics of the robot in MPC. Using the neural network for model prediction, no prior knowledge
about system parameters is needed. The prediction is based on the input voltage, angular position, and angular velocity of joints
at the current sampling time. The output of the predictor is the angular position of the joint at the next sampling time. Using this
structure, a one-step-ahead prediction of joints position can be obtained. However, in the predictive control, multi-step
predictions over the prediction horizon are needed. By applying one-step prediction recursively, multi-step prediction can be
achieved. In this case, the outputs of the neural network are considered as inputs for the next step. Using the neural network
recursively, high accuracy of one-step-ahead prediction is needed. For this reason, one neural network is implemented for every
link of the robot to predict the position of every joint angle. The structure of the employed MLP is shows in Fig. 2. Transfer
functions for the hidden and the output layer neurons are of tangent hyperbolic and linear types, respectively. The inputs are the
angular position and the angular velocity of joints, and the input voltage of the ith joint at the current sampling time
[vti(k), θ1(k), θ2(k), θ3(k), θ4(k), ∆θ1(k), ∆θ2(k), ∆θ3(k), ∆θ4(k)] and the output is θi(k+1), which refers to the ith joint position at
the next sampling time.
Fig. 2 Neural Network structure
The neural networks are trained offline first using the data gathered form the system. The main reason for this is that the
weights of NNs are initialized with random numbers; hence, without any offline training the robot might collide with obstacles.
The offline training does not need to be very accurate; just a rough familiarity of NNs with the robot behavior to avoid large
initial tracking error and/or collision with obstacles suffices. It should be noted that the online training of NNs can cope with all
changes in robot parameters, including the masse of links, the friction of joints and parameters of servomotors.
5. Path Tracking and Obstacle Avoidance Using NMPC
The purpose of the path tracking and obstacle avoidance of robot manipulators is to obtain a control law such that the end-
effector tracks a given geometry path in the Cartesian space and at the same time to avoid collision of robot links with obstacles.
To achieve this purpose, the NMPC method is implemented in this paper. Block diagram of NMPC is shown in Fig. 3.
According to the NMPC algorithm, an appropriate cost function must be determined in order to obtain the control law.
For path tracking, the cost function must be directly related to the tracking error. On the other hand, the cost function for the
obstacles avoidance must be inversely related to the distance between the obstacle and the manipulator. Hence, in this paper, the
cost function is defined as
where DP is the Euclidean distance between the end-effector and the geometry path in the Cartesian space, DO is the minimum
Euclidean distance between the manipulator and obstacles; moreover, Q ≥0 and R≥ 0 are the weighting parameters.
Fig. 3 Block diagram of NMPC
Notation a(m|n) in (10) indicates the value of a at the instant m predicted at instant n. The intervals [DPmin, DPmax] and [DOmin,
DOmax] are the range of variations for DP and DO, respectively. According to the length of manipulator links, the value for DPmin
and DPmax is 0 and 2.4 meter and the value of DOmin and DOmax is 0 and 1.2 meter, respectively. Using the cost function in (10),
the two terms for the path tracking and the obstacle avoidance are normalized to [0 1].
Next, constrains in the optimization problem is considered. Considering the fact that the amplitude of input voltages is
limited, one of the constrains is
maxmin ttt VVV ≤≤ (12)
where Vt min and Vt max stand for the lower and the upper bound of input voltages for servo DC motors, respectively (-24 V
and 24 V as Table III shows).
Next, considering the fact that in singular configurations the joint velocities are infinite, the following constrain must be
taken into account:
maxmin θθθ &&& ≤≤ (13)
&are the lower and the upper bound of the joints velocities (which are -400 and 400 deg./s, considering the
robot and motors parameters), respectively.
By incorporating constrains (12) and (13) into the cost function, the optimization problem can be solved.
6. Simulation Results
The simulated results of the proposed control method are presented in this section. A rectangular path in the Cartesian space
along with obstacles inside the work space is considered. The developed neural network for every link consists of three layers: 9
neurons in the input layer, 10 neurons in the hidden layer, and 1 neuron in the output layer.
Simulation results for the case of sampling time of 0.5 sec., Np = 5, Nc = 1, without any changes in robot parameters are
shown in Figs. 4 to 9.
Figs. 10 and 11 show the results when an additional 20 kg mass at
is added to the fourth link of the robot.
Fig. 4 Desired and actual end-effector path
Fig. 5 Positions of manipulator joints
Fig. 6 Velocities of manipulator joints
Fig. 7 Input voltages of servo DC motors
Fig. 8 Path following of a 4DOF manipulator with four obstacles on the workspace
Fig. 9 The path tracking of Fig.8 from a different view angle
Fig. 10 End-effector path tracking with sudden changes in the mass of link 4
Fig. 11 Positions of manipulator joints
The optimization problem is solved using the SQP method. For more information refer to the MATLAB routine “fmincon”.
Fig. 12 shows the simulation runtime for the proposed method. As this figure shows, the runtime is mostly less than the
sampling time. However, it should be noted that: 1) the simulations are performed in MATLAB software, which requires more
time than a lower level computer program such as C++, 2) in simulations, solving the robot equations also incurs some
computational time, which is not required in practice, 3) some aspects of computations, such training of NNs, can be processed
in parallel. Hence, the simulation run time can be much less than Fig. 12. Therefore, in practice, the proposed method can be
successfully applied to robot manipulators using conventional digital computers.
In this paper, to achieve path tracking and obstacle avoidance for robotic manipulators, the NMPC method was employed.
For this reason, two terms were introduced in the cost function, one for the tracking problem and one for the obstacle avoidance
and by introducing constrains to joints velocities, singularities were avoided. Moreover, neural networks are employed for
adaptive model prediction that can cope with changes in system parameters. The main advantage of NNs is that no prior
knowledge about nonlinear equations of the robot or its parameters is needed.
 E. S. Conkur, “Path planning using potential fields for highly redundant manipulators”, Robotics and Autonomous Systems, Vol. 52, pp. 209–228, 2005.
 J. L. Chen, J. S. Liu, W. C. Lee, T. C. Liang, “On-line multi-criteria based collision-free posture generation of redundant manipulator in constrained
workspace“, Robotica, Vol. 20, pp. 625–636, 2002.
 P. Chiacchio, S. Chiaverini, L. Sciavicco, B. Siciliano, ”Closed-loop inverse kinematics schemes for constrained redundant manipulators with task
space augmentation and task priority strategy“, International Journal of Robotics Research, Vol. 10, pp. 410-426, 1991.
 Y. Nakamuro, Advanced Robotics Redundancy and Optimization, Addison-Wesley Publishing Co., 1991.
 C. L. Boddy and J. D. Taylor,”Whole arm reactive collision avoidance control of kinematically redundant manipulators“, in Proc. of IEEE Int. Conf. on
Robotics and Automation, Vol. 3, pp. 382–387, Atlanta, Georgia, USA, May, 1993.
 T. Yoshikawa, ”Analysis and control of robot manipulators with redundancy”, in Proc. of the First International Symposium in Robotic Research , MIT
Press, Cambridge, MA, pp. 439-446, 1993.
 C. Chevallereau, W. Khalil, ”A new method for the solution of the inverse kinematics of redundant robots“, in Proc. of IEEE Int. Conf. on Robotics and
Automation, pp. 37–42, Washington, DC, USA, April, 1988.
 F. Valle, F. Tadeo, T. Alvarez, ”Predictive control of robotic manipulators”, in Proc. of IEEE Int. Conf. on Control Applications, pp. 203-208, Glasgow,
Scotland, UK, September, 2002.
 J. K. Kim, M. C. Han,”Adaptive robust optimal predictive control of robot manipulators”, 30th Annual Conf. of the IEEE Industrial Electronics Society,
Busan, Korea, November, 2004.
 A. Vivas, V. Mosquera, ”Predictive functional control of a PUMA robot”, ACSE Conf., CICC, Cairo, Egypt, December, 2005.
 W. Wroblewski, ”Implementation of a model predictive control algorithm for a 6dof Manipulator-simulation results”, Fourth Int. Workshop on Robot
Motion and Control, Puszczykowo, Poland, June, 2004.
 R. Hedjar, R. Toumi, P. Boucher, D. Dumur, S. Tebbani, ”Finite horizon non linear predictive control with integral action of rigid link manipulators”,
IEEE Conference on Control Applications, Int. J. Appl. Math. Comput. Sci., Vol. 15, No. 4, pp. 101-113, août, Canada, 2005.
 Ph. Poignet, M. Gautier, “Nonlinear model predictive control of a robot manipulator”, in Proc. of 6th Int. Workshop on Advanced Motion Control, pp.
401-406, Nagoya,Japan, March, 2000.
 R. Hedjar, R. Toumi, P. Boucher, D. Dumur, “Feedback nonlinear predictive control of rigid link robot manipulators”, American Control Conference,
Anchorage, Alaska, May, 2002.
 S.Huang, K.KiongTan, T.Heng Lee, A.S.Putra, “Adaptive Control of Mechanical Systems Using Neural Networks”, IEEE Transactions on Systems,
Man, and Cybernetics, Part C: Applications and Reviews, Vol 37, Issue 5 ,pp. 897 - 903,Sept, 2007.
 Hayakawa, T. Haddad, W.M. Hovakimyan, N. , “Neural Network Adaptive Control for a Class of Nonlinear Uncertain Dynamical Systems With
Asymptotic Stability Guarantees”, IEEE Transactions on Neural Networks, Vol 19 , Issue: 1 , pp. 80 - 89 ,Jan. 2008
 F. L. Lewis, C. T. Abdallah, and D. N. Dawson, Control of Robot Manipulators Theory and Practice, Marcel Dekker Inc, 2004.
 T. Yoshikawa, Foundation of Robotics, Analysis and Control, the MIT Press, Boston, USA, 1990.
 F. Allgower, R. Findeisen, Z. K. Nagy, “Nonlinear model predictive control: from theory to application”, J. Chin. Inst. Chem. Engrs, Vol. 35, No. 3, pp.
 R. Findeisen, L. Imsland, F. Allgower, and B. A. Foss, “State and output feedback nonlinear model predictive control: an overview”, European journal
of control, Vol. 9, pp. 190-206, 2003.
 R. Fletcher, Practical methods of optimization, John Wiley & Sons, 1987.
 Li.Xin Wang, A Course in Fuzzy System and Control, Prentice-Hall International, Inc, 1997.
(1,2)mmmcm mc mc
(3,1) m m c mc
(4,1) m c(A.1)
-s-s- s- s- s-s
- 2s- s- s- s
-sc-s- s- 2s
( ) ( )
-s-s -s -s
-s- 2s -s
s ss ss
s s -s-s
(4,1) s sc s s
where, li and mi (i=1,…,4) are the length and mass of the ith link, respectively, θi and i
&are the angular position and the angular
velocity of the ith joint, respectively, and ci = cos(θi ), si = sin(θi ), cij = cos(θi +θj), sij = sin(θi +θj), and so forth.