30.11.2014 Views

Model Predictive Control System Design and Implementation Using ...

Model Predictive Control System Design and Implementation Using ...

Model Predictive Control System Design and Implementation Using ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1.3 <strong>Predictive</strong> <strong>Control</strong> within One Optimization Window 13<br />

Solution. From (1.14), by adding <strong>and</strong> subtracting the term<br />

(R s − Fx(k i )) T Φ(Φ T Φ + ¯R) −1 Φ T (R s − Fx(k i ))<br />

to the original cost function J, its value remains unchanged. This leads to<br />

J =(R s − Fx(k i )) T (R s − Fx(k i ))<br />

{ }} {<br />

−2ΔU T Φ T (R s − Fx(k i )) + ΔU T (Φ T Φ + ¯R)ΔU<br />

{ }} {<br />

+ (R s − Fx(k i )) T Φ(Φ T Φ + ¯R) −1 Φ T (R s − Fx(k i ))<br />

− (R s − Fx(k i )) T Φ(Φ T Φ + ¯R) −1 Φ T (R s − Fx(k i )), (1.23)<br />

where the quantities under the {}}{ . are the completed ‘squares’:<br />

J 0 = ( ΔU − (Φ T Φ + ¯R) −1 Φ T (R s − Fx(k i )) ) T<br />

× (Φ T Φ + ¯R) ( ΔU − (Φ T Φ + ¯R) −1 Φ T (R s − Fx(k i )) ) . (1.24)<br />

This can be easily verified by opening the squares. Since the first <strong>and</strong> last<br />

terms in (1.23) are independent of the variable ΔU (sometimes, we call this<br />

a decision variable), <strong>and</strong> (Φ T Φ + ¯R) is assumed to be positive definite, then<br />

the minimum of the cost function J is achieved if the quantity J 0 equals zero,<br />

i.e.,<br />

ΔU =(Φ T Φ + ¯R) −1 Φ T (R s − Fx(k i )). (1.25)<br />

This is the optimal control solution. By substituting this optimal solution into<br />

the cost function (1.23), we obtain the minimum of the cost as<br />

J min =(R s − Fx(k i )) T (R s − Fx(k i ))<br />

− (R s − Fx(k i )) T Φ(Φ T Φ + ¯R) −1 Φ T (R s − Fx(k i )).<br />

1.3.3 MATLAB Tutorial: Computation of MPC Gains<br />

Tutorial 1.2. The objective of this tutorial is to produce a MATLAB function<br />

for calculating Φ T Φ, Φ T F , Φ T ¯Rs . The key here is to create F <strong>and</strong> Φ matrices.<br />

Φ matrix is a Toeplitz matrix, which is created by defining its first column,<br />

<strong>and</strong> the next column is obtained through shifting the previous column.<br />

Step by Step<br />

1. Create a new file called mpcgain.m.<br />

2. The first step is to create the augmented model for MPC design. The<br />

input parameters to the function are the state-space model (A p ,B p ,C p ),<br />

prediction horizon N p <strong>and</strong> control horizon N c . Enter the following program<br />

into the file:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!