Sei sulla pagina 1di 11

Telemark University College

Department of Electrical Engineering, Information Technology and Cybernetics

Model Predictive Control


HANS-PETTER HALVORSEN, 2012.06.21

Faculty of Technology, Postboks 203, Kjlnes ring 56, N-3901 Porsgrunn, Norway. Tel: +47 35 57 50 00 Fax: +47 35 57 54 01

Preface
In this Lab we will implement a MPC Controller in LabVIEW and compare the results with ordinary
PID (MPC vs. PID). LabVIEW has a built-in MPC controller we will use both on a simulated model of
the Air Heater and the Air Heater itself. We will test the MPC controller both on a simulator and on
the real process.

Go to the following website for more background information about the Lab Work:
http://home.hit.no/~hansha/?lab=mpc

ii

Table of Contents
Preface......................................................................................................................................................ii
Table of Contents ....................................................................................................................................iii
1

Introduction .................................................................................................................................... 4
1.1

Model Adaption....................................................................................................................... 4

Task 1: Create the Model in LabVIEW ......................................................................................... 5


Task 2: Model Adaption ............................................................................................................... 5
Task 3: Transfer function ............................................................................................................. 5
2

MPC................................................................................................................................................. 7
2.1

MPC in LabVIEW ...................................................................................................................... 7

Task 4: MPC Controller ................................................................................................................ 7


3

MPC vs. PID ..................................................................................................................................... 9


Task 5: PID Controller .................................................................................................................. 9
Task 6: MPC vs. PID .................................................................................................................... 10

iii

1 Introduction
1.1 Model Adaption
In this Assignment you will use the Air Heater system as shown below:

A simple mathematical model of the system could be:

]}

Where,

[ ] is the air temperature at the tube outlet


[ ] is the control signal to the heater
[ ] is the time-constant
[
] is the heater gain
[ ] is the time-delay representing air transportation and sluggishness in the heater
[ ] is the environmental (room) temperature. It is the temperature in the outlet air of
the air tube when the control signal to the heater has been set to zero for relatively long
time (some minutes).

Introduction

Heater: The air is heated by an electrical heater. The supplied power is controlled by an external
voltage signal in the range
(min power, max power).
Temperature sensors: Two Pt100 temperature elements are available. The range is
, and
this voltage range corresponds to the temperature range
(with a linear relation).

Task 1: Create the Model in LabVIEW


Create a model of the Air Heater system in LabVIEW based on the mathematical model above.
The model should be implemented as a Simulation Subsystem in LabVIEW.
[End of Task]

Task 2: Model Adaption


Adjust the parameters (
) of the model by some simple trial-and-error experiments where
you run the simulator in parallel with the real process.

You can set the air flow to its maximum value.


Use the USB-6008 DAQ from National Instruments.
[End of Task]

Task 3: Transfer function


Find the transfer function

( ) for the Air Heater on the following general form:


( )

( )
( )

Lab Work: Model Predictive Control

Introduction

Tip! Use Laplace transformation on the differential equation for the Air Heater and find the transfer
function from ( ) to
( ).
[End of Task]

Lab Work: Model Predictive Control

2 MPC
2.1 MPC in LabVIEW
LabVIEW has built-in functionality for Model Predictive Control (MPC).
Below we see the available VIs in the Predictive Control palette:

Task 4: MPC Controller


Develop and test a Model Predictive Controller (MPC) for the Air Heater system. It should be able to
use either a model of the system or the real process.
The MPC controller assumes that the model is on the form:

Since the Air Heater model has a time-delay, this causes some problems. Use the transfer function
found in a previous task and use built-in functions in LabVIEW to convert the transfer function to a
discrete state-space model with the time-delay included (See the MPC in LabVIEW tutorial).
Us, e.g. sampling time

MPC

LabVIEW have a built-in MPC controller you can use, or you can create your own algorithm that you
can use.

Test how the MPC controller works when using a setpoint profile like, e.g.:

Constraints:
Define necessary constraints according to physical limits in the process.
Constraints in the outputs:

Constraints in the inputs:

Cost function:
Define also the weight matrices

and

used in the cost function .

The cost function often used in MPC is like this (a linear quadratic function):

Prediction and Control Horizon:


As a start you can set the prediction and control horizon can be set close to the process response
time (time-constant). Then increase/decrease the prediction and control horizon length and observe
and discuss the results.
[End of Task]

Lab Work: Model Predictive Control

3 MPC vs. PID


Task 5: PID Controller
Extend or build a new application that implements a PID controller for the Air Heater. It should be
able to use either a model of the system or the real process.
Find PI parameters for the controller. Use the built-in PID controller in LabVIEW. Use, e.g.,
Skogestads method. Use your model for this (not the real system).
Description of Skogestads method:
You need to apply a step on the input and then observe the response and the output, as shown
below:

Here are the Skogestads formulas for finding the PID parameters:

In this task we can set

sec and

10

MPC vs. PID

For more details about the Skogestads method, please read this article: Model-based PID tuning
with Skogestads method.
[End of Task]

Task 6: MPC vs. PID


Compare the results from PID control and MPC on the Air Heater. Start by using the model, and then
test it on the real process.
Use the same a setpoint profile as in the previous task, e.g.:

Discuss the results.


Include some kind of model error and compare the results from MPC vs. PID. Discuss the results.
[End of Task]

Lab Work: Model Predictive Control

Telemark University College


Faculty of Technology
Kjlnes Ring 56
N-3918 Porsgrunn, Norway
www.hit.no

Hans-Petter Halvorsen, M.Sc.


Telemark University College
Department of Electrical Engineering, Information Technology and Cybernetics

E-mail: hans.p.halvorsen@hit.no
Blog: http://home.hit.no/~hansha/

Potrebbero piacerti anche