INTRODUCTION
Evaluation of robot actuator inputs to track a desired trajectory is
one of the most basic and important problems in robotic (Sun et al.,
2001; Behera et al., 1994). A robotic manipulator is highly nonlinear
system because of interactions between its links. These interactions make
it hard to control. Several conventional methods such as adaptive control,
proportionalplusintegralplusderivative (PID) control, selftuning
control, selftuning PID control and generalized predictive control have
been used in robot control (Chen et al., 1999; Malki et al.,
1997; Vega and Prada, 1991; Alonge et al., 2003; Nasisi and Carelli,
2003; Kanev and Verhaegen, 2000). However, because of high level interactions
and nonlinear dynamics, industrial manipulators which use conventional
linear control systems cannot be used over certain velocity limits and
the productivity is limited. Furthermore, increasing performance needs
also require improved manipulator techniques. Therefore, it is necessary
to apply some advanced control techniques to provide high quality tracking
control. One of these control techniques is generalized predictive control
(GPC).
GPC is based on the use of a model which includes the prediction of the
future outputs over a certain horizon (Clarke et al., 1987a, b).
Thus, it can predict future changes of the measurement signal and base
control actions on this prediction. GPC belongs to the class of modelbased
predictive control (MPC) techniques has become popular over the past two
decades as a powerful tool for solving many problems. Today, this technique
is still used widely because of their ability to systematically take into
account real plant constraints in realtime (Mahfouf et al., 1997;
Bordons and Camcho, 1998; NormeyRico and Camcho, 2000; Zhang et al.,
2004).
On the other hand, the conventional GPC algorithms use linear models
of the process to predict the output of the process over a certain horizon
and to evaluate a future sequence of control signals in order to minimize
a certain cost function that represents the future output prediction errors
over a reference trajectory (Clarke et al., 1987a, b). However,
if the process is nonlinear, use of linear models becomes impractical
and the identification of nonlinear models for control becomes necessary.
In recent years, the use of neural networks (NNs) for nonlinear system
identification has proved to be extremely successful (Huang and Lewis,
2003; Zamarrefio and Vega, 1999). NNs have been shown to possess good
function approximation capabilities and have been applied successfully
by many researchers in modeling some poorly understood systems or processes.
The results demonstrated the feasibility of identification and control
of nonlinear dynamic systems (Tsai et al., 2002; Lu and Tsai, 2004).
Therefore, artificial neural network (ANN) was used in the predictive
controller design to improve the ability of GPC.
NN based controller has been proposed by many researchers (Palos
et al., 2001; Laabidi et al., 2008). Gupta and Sinha (2000)
have presented an intelligent control system using a PD controller and
ANN. Takahashi and Yamada (1994) have presented a study based on designing
a NN controller, to control the tip of the angular position of a singlelink
flexible arm. Yildirim (2004) has proposed an adaptive robust neural controller
for twodegreesoffreedom robotic manipulator. Proposed neural controller
has been shown to perform better than the conventional control schemes.
Temurtas et al. (2005) have presented a controller ANN based on
GPC for three joint robotic manipulator. Their study can be cited as closest
to the work undertaken in this paper. In their study, three independent
singleinput singleoutput (SISO) controllers were used for control of
joints and mechanical vibrations in the links were neglected. In practical
robot applications, mechanic vibrations in links must not be neglected
since they make hard to robot control. On the other hand, if a number
of controllers are used in control design; many more hardware equipments
will be required. Therefore, this paper focuses on a multipleinput multipleoutput
(MIMO) controller design. In this study, MIMO NGPC controller designed for 6DOF robotic manipulator
with random disturbances and load effect. Conventional GPC was also used
for comparison. The controllers generate joint torques that will cause
the robotic manipulator to follow a desired trajectory for a given trajectory.
In the GPC, linear model was used to predict robot actuator inputs whereas
prediction was carried out over a threelayered NN in the NGPC. The curves
of trajectory and velocity belonging to joints were examined and endeffecter
position errors were computed for different control status. The results
obtained by using NGPC were compared with those of conventional GPC.
GENERALIZED PREDICTIVE CONTROL
Generalized Predictive Control (GPC) belongs to the class of digital
control methods called ModelBased Predictive control (MBPC) and was first
introduced by Clarke and his coworkers in 1987 (Clarke et al.,
1987a, b). MBPC techniques have been analyzed and implemented successfully
in process control industries since the end of the 1970`s and continue
to be used because they can systematically take into account real plant
constraints in realtime.
The GPC system for the robot control is given in Fig. 1.
It consists of three components, the robotic manipulator, controller and
parameter estimator.

Fig. 1: 
Block diagram of the GPC system for robotic manipulator 
In the GPC algorithm, the process is supposed to be represented by a
CARIMA (Controlled AutoRegressive Integrated Moving Average) model (Clarke
et al., 1987a, b):
where, y(t) denotes the output of the process, u(t) denotes its input
and ξ(t) denotes an uncorrelated random noise.
A (q^{1}) and B (q^{1}) are polynomials of q^{1},
the backward shift operator:
In the prediction process, future outputs are predicted by using past
inputs and past outputs. Predict step is selected short since using a
great number of elements for prediction causes high computation overhead.
In this study, the prediction was made for future three outputs. Therefore,
n_{a}, n_{b} are selected as 2, 1 respectively. Initial
values were used as follows; a_{1} = a_{2} = 0, b_{1}
= 1, b_{0} = 0.
The prediction process is executed as follows:
We rewrite equation 1;
The first step predicted output ();
The second predicted output ;
and the third predicted output:
A (q^{1}) and B (q^{1}) parameters in equation (1)
should be updated each step of control. For this process, a parameter
estimator is needed to update. In our application, Recursive Least Square
(RLS) was used to parameter estimation and detailed computational issues
of the RLS are addressed in Durmus et al. (2008).
The GPC strategy minimizes a weighted sum of square predicted future
errors and square control signal increments; the cost function for MIMO
GPC is defined as follows:
where, N_{1} is the minimum costing horizon, N_{2} is
the maximum costing horizon, N_{u} is the control horizon, y is
a predicted output, y_{r} is the reference output. λ is the
control input weighting factor and it is selected very small (as λ
. 10^{6}). Detailed computational
issues of the GPC are addressed in Clarke et al. (1987a, b).
NONLINEAR GENERALIZED PREDICTIVE CONTROL FOR ROBOTIC MANIPULATORS
The nonlinear generalized predictive control (NGPC) system for the robotic
manipulator is given in Fig. 2. It consists of four
components, the robotic manipulator, a tracking reference signal that
specifies the desired trajectory of the manipulator, an artificial neural
network for prediction and the Cost Function Minimization (CFM) algorithm
that determines the input needed to produce the desired trajectory of
the manipulator.
The NGPC algorithm operates in two modes, prediction and control. For
realizing this aim, a double pole double throw switch is used. The CFM
algorithm produces an output which is either used as an input to the robotic
manipulator or the manipulator`s neural network model.

Fig. 2: 
Block diagram of the nonlinear
GPC system 
The switch position
is set to the robotic manipulator when the CFM algorithm has solved for
the best input, u(n), that will minimize a specified cost function. Between
samples, the switching position is set to the manipulator`s neural network
model where the CFM algorithm uses this model to compute the next control
input, u(n+1), from predictions of the response from the manipulator`s
model. Once the cost function is minimized, this input is passed to the
manipulator (Durmus et al., 2008).
The cost function in the NGPC is defined as following equation:
Where:
j 
= 
1,2,Y.#iterations 
N_{1} 
= 
The
minimum costing horizon 
N_{2} 
= 
The
maximum costing horizon 
Nu 
= 
The
control horizon 
y_{r}
(n) 
= 
A
reference trajectory 
y_{n} 
= 
The
predicted output of the neural network 
λ 
= 
The
control input weighting factor, it is selected very small (as λ
. 10^{6}) 
Δu
(n+j) 
= 
The
change in u and is defined as u (n+j)u (n+j1) 
u_{max
}and u_{min } 
= 
Maximum
and minimum control inputs s is the sharpness of the corners of the
constraint function, ε =10^{7} 
The minimization algorithm used in the NGPC is NewtonRaphson method
because it requires less iteration numbers for convergence. Detailed computational
issues of the NewtonRaphson method are addressed in Durmus et al.
(2008).
Robotic manipulator neural network model for NGPC: A multilayer
feedforward network (MLFN) with tapped time delays was used for the robotic
manipulator NN model.

Fig.
3: 
Multilayer
feedforward neural network model with a time delayed structure 
The network structure is given in Fig. 3. The torque,
υ, is the control input to the manipulator system and the trajectory,
y is the output. The network inputs are past values of the torque and
the past values of the manipulator`s trajectory. The network has a single
hidden layer with multiple hidden layer nodes and a single output node.
The number of neurons in the input and output layers was decided according
to the structure of GPC. The past 2 inputs and past 3 outputs were used
for prediction since over past data using leads to over computation. In
this state, n_{d}, d_{d} and hid were selected as 2, 3
and 5 respectively. Consequently, the designed neural network has 36 inputs
and 6 outputs.
This network is multilayer network (input layer, hidden layer and output layer).
Whereas the hidden layer neurons use tagsigmoid activation functions, linear
activation function is used for output layer neurons. Equations used in the
neural network models are given in Eq. 1113.
Outputs of hidden layer neurons are:
Linear activation function outputs are:
where, j = 0 to hid1and hid is the number of hidden layer nodes, net_{j}
(n) is the activation level of the j^{th} hidden node, f (@)
is the activation function for the hidden layer nodes, n_{d} is
the number of input nodes associated with past u (n), d_{d} is
the number of input nodes associated with past y (n), w_{j}
is the weight connecting the j^{th} hidden node to the output
node, w_{j,i} is the weight connecting the i^{th} input
node to the j^{th} hidden node, y_{n} (ni) is the delayed
output of the manipulator`s joint used as an input to the network and
u (ni) is the input to the network and it`s delays.
A training set was prepared by using the results of conventional GPC.
The robotic manipulator was controlled for different trajectories to generate
the training and test sets. To obtain the torque value at time t as a
output, values of torque at time (t1), (t2), values of trajectory at
time (t1), (t2), (t3) and values of reference trajectory at time (t1)
were used in the input stage as 36 elements. These data have been generated
using GPC controller for different trajectories selected uniformly. Back
propagation (BP) was used for training neural network. 20, 000 input and
output vector sets were generated with GPC algorithm, using the robotic
manipulator simulation software. The training process was completed in
approximately 2, 000, 000 iterations.
ROBOTIC MANIPULATOR MODEL
Used the robotic manipulator (6DOF) is shown in Fig. 4
(Tarn et al., 1993). The dynamic model of robot includes kinematics
equations, friction effects and effect of carrying load at the endeffecter
for given robot.
There are six interactive secondorder nonlinear differential equations
which give the dynamic behaviors of 6DOF robotic manipulator. The fourthorder
RungeKutta integration method was used to solve these differential equations.
The motion equations of robotic manipulator were developed by LagrangeEuler
as follows (Spong and Vidyasagar, 1989).
where, ,
are ndimensional vectors, indicating the joint acceleration, velocity
and position, respectively. D (θ) is a ndimensional symmetric inertial
matrix. is
a ndimensional vector, represents Coriolis and centrifugal torques. G
(θ) is a ndimensional vector, represents torque due to gravity.
τ_{f} (t) is ndimensional vector, represents torque due
to friction effects. τ_{l} (t) is load effect, τ (t)
is, ndimensional, the generalized torque vector.
Robot arm friction model includes static, kinetic and fluid friction
used in this study (Rodrigo et al., 2002). The friction model is
given following:

Fig.
4: 
Configuration
of the 6DOF robotic manipulator 
where, f_{x}, x_{s}, f_{k} and k_{vn}
are static friction, constant to correct static friction due to Stribeck
Effect, kinetic friction and fluid friction, respectively (Rodrigo et
al., 2002).
In this study, position reference and velocity reference trajectory for
each joint were determined according to the sinusoidal trajectory principle.
The motion for the sinusoidal trajectory is given in Fig.
5.
The equations motions for the sinusoidal trajectory (Spong and Vidyasagar,
1989) are,
(n
= 6 for 6DOF robotic manipulator)`
where, θ_{i} (t) is the angular position of the joint i
at time t, θ_{i0} is the initial angular position of the
joint i at time t_{0} and θ_{if} is the final angular
position of the joint i at time t_{f}..

Fig. 5: 
The motion trajectory planning 
The coordinate of endeffecter for robot arm is computed as follows:
THE DESIGN OF CONTROLLER USING NGPC FOR 6DOF ROBOTIC MANIPULATOR
CONTROL
Here, the design of the NGPC based on ANN controller is given. The designed
controller has 36 inputs and 6 outputs.

Fig. 6: 
Block diagram of artificial neural network implemented
generalized predictive controller 
To obtain the torque value at
time t as a output, values of torque at time (t1), (t2), values of trajectory
at time (t1), (t2), (t3) and values of reference trajectory at time
(t1) are used in the input stage as 36 elements for 6DOF robotic manipulator.
Outputs are the torques which will be applied to joints to track the desired
trajectories. These data also have been used for prediction and learning
of artificial neural network in the NGPC. The block diagram of the control
system is shown in Fig. 6.
The NGPC starts with the input signal, θ_{i} (entered angle
of joints), which is presented to the trajectory planning model. This
model produces a tracking reference signal, y_{r} (n), which is
used as an input to the CFM block. The CFM block produces an output which
is both used as an input to the plant (robotic manipulator) and to neural
network for prediction. The neural network serves to predict the plant
outputs from N_{1} to N_{2} future time steps in Eq.
10 by using past data. The predicted outputs passed to CFM. The CFM
minimizes cost function that represents errors between reference signal
and predicted outputs of the plant until desired minimization is achieved.
Once the cost function is minimized, this input is passed to the manipulator.
This process repeats for each control step.
For comparison of control algorithms, the following control states and
values were used as a scenario of control.
The control states used in this study:
• 
There were carrying load and friction effects in the
control simulation 
• 
There were falling load and friction effects in the control simulation 
• 
There were disturbance (between 0.5 and +0.5 Newton*meters), falling
load and friction effects in the control simulation 
The control values used in the simulation:
• 
The total simulation time is 10 second and total step
number is 10000 
• 
The endeffecter of robotic manipulator caries 5 kg load in the
state of carrying and falling load. And the load is falling at the
4000th control step (at 4th second) in the state of falling load 
• 
Random disturbances between 0.5 and +0.5 Nm were added to the torques
computed at the end of each step for control states 
RESULTS AND DISCUSSION
Some sample control results of the 6DOF robotic manipulator which uses
GPC algorithm at the state of A were given in Fig. 7.
And some sample control results of the 6DOF robotic manipulator which
uses NGPC algorithm at the state of A were also given in Fig.
8. The same trajectory is used for both methods. The start and final
angles of the joints are given in Table 1.
There are errors at the beginning of motion results from inertia of motionless
robot arm (Fig. 7, 8). However, angular
velocity and torque errors are bigger in the GPC than those in the NGPC.
This can be because the neural network improves the predicted trajectory
at the beginning of the motion. So, motion of the manipulator is more
smooth and flexible in the NGPC.
There were similar situations at the load changes. In the Fig.
9 and 10, angular velocity and torque errors are
seen at time falling load (at 4th second) result from load change. If
the parameters of the system change in the control process, the performance
of control system is hardly affected.

Fig. 7: 
Some angle and velocity graphs of joints using GPC (State
A: with load and with friction) 
Table 1: 
Start and final angles of joints 

The errors were bigger in the GPC
than those of the artificial neural network implemented NGPC. It is shown
that the influence of load change to the NGPC is less than that of the
GPC. This means that the NGPC is much stable than GPC for the load changes.
It was seen that the proposed controller has better robustness in resisting
against the changes of the parameters of the control system. The neural
network provided quick adaptation for NGPC whereas GPC could not adapt
quickly. There were also similar situations with random disturbances (Fig.
11, 12).
Comparisons of the GPC and NGPC algorithms control results are summarized
and demonstrated in Table 2 and 3
by using angle location errors and x, y, z axis errors of endeffecter
for all of the control status. Endeffecter coordinates of robotic manipulator
were computed using Eq. 2224.
Angle location errors and x, y, z axis errors of the endeffecter are
smaller in the NGPC than those in the GPC (Table 2,
3). The difference between control results for the carrying
load, with random disturbances and the falling load states can be easily
shown.

Fig. 8: 
Some angle and velocity graphs of joints using neural
network implemented NGPC (State A: with load and with friction) 
Table 2: 
Angle location errors of control algorithms for control
status 


Fig. 9: 
Some torque and velocity graphs of joints using GPC
(State B: with friction and falling load) 
Table 3: 
The endeffecter axis errors for different control status 

These values for the NGPC are less than that of the GPC. NGPC reached
at the targeted point with less error.
In this study, GPC and NGPC algorithms were designed and applied to 6DOF
robotic manipulator for joint control. Nonlinear prediction model was
proposed instead of linear model to improve the ability of GPC. Conventional
GPC and NGPC algorithms were compared according to different scenarios
of control. When the parameters of the system change in the control process,
the performance of control system is hardly affected. It was seen that
the proposed controller has better robustness in resisting against the
changes of the parameters of the control system and its trajectory tracking
performance was observed higher than conventional GPC`s under uncertainties.

Fig. 10: 
Some torque and velocity graphs of joints using neural
network implemented NGPC (State B: with friction and falling load) 

Fig. 11: 
Torque and velocity graphs of joint 2 using GPC (State
C: with falling load and random disturbances) 

Fig. 12: 
Torque and velocity graphs of joint 2 using neural network
implemented NGPC (State C: with falling load and random disturbances) 
Artificial neural network improved the accuracy of predicted trajectory
at the beginning of motion, load changes and with random disturbances
and provided quick adaptation.