The Design of Neural Network based Model Predictive Control

4.3.2 The Design of Neural Network based Model Predictive Control

The Neural Network based Model Predictive Control (NNMPC) algorithm implemented here is originated from the work of Sorensen et al. (1999). They had introduced a new idea of developing a controller with extended control horizon based on a neural network. For the predictor, they suggested the k-step prediction by using

a NARX model: a NARX model:

u ( t − d + k ),..., u ( t − d − n u + k ))

where the n u and n y are the number of the delayed system inputs and output and the d is the system dead time. In other words, the k-step ahead prediction is calculated by shifting the expression forward in time while substituting prediction for actual measurement which does not exist.

As denoted in Equation 4.35, for the NNMPC scheme, the criterion or cost function to be minimized is defined as:

2 J 2 ( t , U ( t )) = [ r ( t + i ) − y ˆ ( t + i )] + ρ ∆ u ( t + i − 1 ) (4.55)

or in the matrix form:

J ( t , U ( t ))[ R ( t ) Y ˆ T

( t )] [ R ( t ) − Y ( t )] + ρ U ( t ) U ( t ) = E ( t ) E ( t ) + ρ U ( t ) U ( t ) (4.56)

where T R ( t ) = [ r ( t + N

1 )... r ( t + N 2 )]

1 )... y ˆ ( t + N 2 )]

1 )... e ( t + N 2 )]

~ U T ( t ) = [ ∆ u ( t )... ∆ u ( t + N

u − 1 )]

(4.57) and e ( t + k ) = r ( t + k ) − y ˆ ( t + k 1 ) for k=N 1 ,…, N2 (4.58)

Just like the neural network model fitting problem, the quasi-Newton optimization algorithm or more specifically the Gauss-Newton based Levenberg- Marquardt algorithm is employed here to determine the control law by minimizing the NNMPC cost function (Equation 4.55). To solve this problem, the calculation of the gradient is necessary and this has caused the most difficult part in this NNMPC algorithm. The gradient is given by:

∂ J ( t , U ( t )) ⎢ ∂ Y ( t ) ∂ U ( t ) ~ ⎥

G ( U ( t )) =

(4.59) ∂ U ( t )

where the partial derivatives of

∂ is given by:

U ( k N 1 ) ⎥ (4.60) ∂ U ( t + k )

and since the U ( t ) = ∆ u ( t ) = u ( t ) − u ( t − 1 )

∂ (4.61) U ( t + k )

∂ ~ U ( t + k ) The

∂ is a matrix of dimension Nu x Nu and this derivative is independent of U ( t + k ) time and constructed beforehand. So, the unsolved term left now is only the partial

∂ Y ˆ ( t ) derivative of

which is a matrix of dimension Nx U ( N 2 −N 1 + 1 ) : ∂ U ( t )

∂ (4.62) U ( t )

To calculate the partial derivative of

∂ in where:

The hidden output is calculated by taking into account for the past and future control inputs terms (first three sums depend on future control input and the remaining three on past control input):

min( k − d , n )

min( ~ k − d − N u + 2 , m + 1 )

w ji y ˆ ( t

min( k , n + )

min( k − d , m )

w ji y ˆ ( t + k − i )

+ w ji y ( t + k − i ) + w j , n + i + 1 u ( t − d + k − i ) + w j 0 (4.64)

For ∀ k ∈ [ N 1 , N 2 ] and ∀ l ∈ [ 0 , min( k − d , N u − 2 )] , assume

Where 2 f ( x ) = tanh( x ) → f ' ( x ) = 1 − ( f ( x ))

∂ u ( t + N u − 1 ) and h ( k , l , j ) =

min( k − d , n )

min( k − d − N u + 2 , m + 1 ∂ ) y ˆ ( t + k − i )

w ji

w ji

min( k − d , m )

since

∂ (4.68) u ( t + l )

⎩ 0 otherwise

∂ (4.69) u ( t + l )

⎩ 0 otherwise

∂ (4.70) u ( t + l )

The expression for h(k,l,j) can be reduced to

min( k − d − l , n )

min( k d N

w ji

min( k − d − l , n ⎪ ) ∂ y ˆ ( t + k − i ) ⎨