Open access peer-reviewed chapter

# Implementation of Multi-dimensional Model Predictive Control for Critical Process with Stochastic Behavior

By Jozef Hrbcek and Vojtech Simak

Submitted: October 11th 2010Reviewed: February 18th 2011Published: July 5th 2011

DOI: 10.5772/16364

Downloaded: 2367

## 1. Introduction

Model predictive control (MPC) is a control method (or group of control methods) which make explicit use of a model of the process to obtain the control signal by minimizing an objective function. Control law is easy to implement and requires little computation, its derivation is more complex than that of the classical PID controllers. The main benefit of MPC is its constraint handling capacity: unlike most other control strategies, constraints on inputs and outputs can be incorporated into the MPC optimization (Camacho, E., 2004). Another benefit of MPC is its ability to anticipate to future events as soon as they enter the prediction horizon. The implementation supposes good knowledge of system for the purpose of model creation using the system identification. Modeling and identification as a methodology dates back to Galileo (1564-1642), who also is important as the founder of dynamics (Johanson, R., 1993). Identification has many aspects and phases. In our work we use the parametric identification of real system using the measured data from control centre. For the purpose of identification it is interesting to describe the sought process using input-output relations. The general procedure for estimation of the process model consists of several steps: determination of the model structure, estimation of parameters and verification of the model. Finally we can convert the created models to any other usable form. This chapter gives an introduction to model predictive control, and recent development in design and implementation. The controlled object is an urban tunnel tube. The task is to design a control system of ventilation based on traffic parameters, i.e. to find relationship between traffic intensity, speed of traffic, atmospheric and concentration of pollutants inside the tunnel. Nowadays the control system is designed as tetra - positional PID controller using programmable logic controllers (PLC). More information about safety requirements for critical processes control is mentioned in the paper (Ždánsky, J., Rástočný, K. and Záhradník, J., 2008). The ventilation system should be optimized for chosen criteria. Using of MPC may lead to optimize the control way for chosen criteria. Even more we can predict the pollution in the tunnel tube according to appropriate model and measured values. This information is used in the MPC controller as measured disturbances. By introducing predictive control it will be made possible to greatly reduce electric power consumption while keeping the degree of pollution within the allowable limit.

Advertisement

## 2. Tunnel ventilation system

Emissions from cars are determined not only by the way they are built but also by the way they are driven in various traffic situations. Various gases are emitted by combustion engine. They consist largely of oxides of nitrogen (NOx), carbon monoxide (CO), steam (H2O) and particles (opacity). Because of these dangerous gases, it is necessary to provide fresh air in longer tunnels. The fresh air which is used to lower the concentration of CO also serves to improve visibility. The purpose of ventilation is to reduce the noxious fumes in a tunnel to a bearable amount by introducing fresh air. Every tunnel has some degree of natural ventilation. But a mechanical ventilation system should have to be installed. In order to create air stream, jet fans are installed on the ceiling or side walls of the tunnel. The fans take in tunnel air and blow it out at higher speed along the axis of the tunnel. In the tunnel is mounted several fans with about hundred kW each.

The design and industrial implementation of automatic control systems requires powerful and economic techniques together with efficient tools. In order to solve a control problem it is necessary to first describe somehow the dynamic behaviors of the system to be controlled. Traditionally this is done in terms of a mathematical model. Mathematical models are mathematical expressions of essential characteristics of an existing system that describe knowledge about the system in a usable form.

Ventilation control system will base on model and sensors information about NOx, opacity, velocity, number of vehicles and CO measurements. According to the amounts of pollutants in exhaust gas, air flow driven by the vehicles and degree of pollution inside the tunnel, optimized operation commands will given to the jet fans. “Optimum” means that pollutant concentration is kept within the allowable limit (for CO, 75 ppm or less), and at the same time electric power consumption is minimized. Another criterion is also possible, for example: number of switching the jet fans.

### 2.1. Tunnel description

The ventilation system in urban tunnel Mrázovka in Prague represents one function unit designed as longitudinal ventilation with a central efferent shaft and protection system avoiding spread of harmful pollutants into the tunnel surround area. Ventilation is longitudinal facing in direction of traffic with air suction at the south opening of the eastern tube (ETT) and at the branch B, with air being transferred at the north opening to the western tunnel tube (WTT) (Pavelka, M. and Přibyl, P., 2006). The task is to design a control system of ventilation based on traffic parameters, i.e. to find relationship between traffic intensity, speed of traffic, atmospheric and concentration of pollutants inside the tunnel. To do that the eastern tunnel tube (ETT) has been chosen as a model example due to principle of mixing polluted air from ETT to WTT (measured concentrations of pollutants in the WTT are also influenced by traffic intensity in the ETT).

To get the required description, the following data has been taken from the tunnel control centre: traffic intensity of trucks and cars, their speed, concentrations of CO (carbon monoxide), NOx (oxides of nitrogen), OP (opacity-visibility) from the ETT, atmospheric pressure etc. These values are measured by sensors installed inside the tunnel (at five different places of the ETT). Traffic parameters are measured at three places, air flow at three places and concentrations of NOx and atmospheric pressure in the north portal.

Traffic intensity is sensed by a camera system and the cars are then counted and sorted by categories in database system. More information about monitoring of the traffic can be found in (Pirník, R., Čapka, M. and Halgaš, J., 2010). About the security by transferring the data is discussed in (Holečko, P., Krbilová, I., 2006). Figure 1.Simplified diagram of road tunnel (length of 1230m)

## 3. Mathematical models for MPC

Mathematical models are mathematical expressions of essential characteristics of an existing or designed system that describe knowledge about the system in a usable form. Turbulence inside the tunnel, variety of traffic and atmospherics make the system behavior stochastic. To make the models we use the parametric identification. The MATLABs tools allowed a conversion between several types of models. The main tasks of system identification were the choice of model type and model order. For Single-input Multiple-output discrete time linear systems we can write the metrics equation for jet fan characteristics:

[y1(k)y2(k)y2(k)]=[G11(k)G21(k)G31(k)][u1(k)]E1

The “Jet Fan Model” is a model in the MPC format that characterizes effect of ventilator on CO concentration, NOx concentration and visibility (opacity). It is a system with 1 input (u) and 3 outputs (dilution of CO-Out1, NOx concentration-Out2 and opacity OP-Out3). One of the main advantages of predictive control is incorporation of limiting conditions directly to the control algorithm. The “Jet Fan Model” characteristics are shown in Fig. 2.

The “Disturbance Model” is a model of the tunnel tube in state space representation:

x¯(t)=A¯(t)*x¯(t)+B¯(t)*u¯(t)y¯(t)=C¯(t)*x¯(t)+D¯(t)*u¯(t)E2

This model is used to predict the pollutions inside the tunnel tube. These data enter to the measured disturbances input (MD) of MPC controller for the purpose of switching the jet fans before the limit will be exceeded.

Created model was validated by several methods (Hrbček, J., 2009). The purpose of model validation is to verify that identified model fulfills the modeling requirements according to Figure 2.Jet fan characteristics Figure 3.Model of the tunnel tube. Out 1 – Concentration of CO, Out 2 –OP-opacity inside the tunnel, Out 3 – Concentration of NOx

subjective and objective criteria of good model approximation. In method “Model and parameter accuracy” we compare the model performance and behavior with real data. A deterministic simulation can be used, where real data are compared with the model response to the recorded input signal used in the identification. This test should ascertain whether the model response is comparable to real data in magnitude and response delay. Figure 4.Model and parameter accuracy test for CO concentrations. Measured data is shown by black line and simulated data are shown by gray dashed line.

This method showed graphically accuracy between simulated values and measured values. Although the simulated and measured data not fit precisely, this result is sufficient for most stochastic system like pollution inside the road tunnel.

An Akaike Final Prediction Error (FPE) for estimated model was also determinate. The average prediction error is expected to decrease as the number of estimated parameters increase. One reason for this behavior is that the prediction errors are computed for the data set that was used for parameter estimation. It is now relevant to ask what prediction performance can be expected when the estimated parameters are applied to another data set. This test shows the flexibility of the model structure. We are looking for minimum value of FPE coefficient.

## 4. Model predictive control of ventilation system

Under the term “Model Predictive Control” we understand a class of control methods that have certain characteristic features. MPC refers to a class of computer control algorithms that utilize an explicit process model to predict the future response of a plant. From this model the future behaviour of the system is predicted over a finite time interval, usually called prediction horizon, starting at the current time t.

### 4.1. The basic idea of predictive control

The receding horizon strategy is shown in Fig. 4. Figure 5.The receding horizon strategy, the basic idea of predictive control.

The future outputs for a determined horizon N, called the prediction horizon, are predicted at each instant t using the process model. These predicted outputs y(t+ k|t) 1 for k= 1…Ndepend on the known values up to instant t (past inputs and outputs) and on the future control signals u(t+k|t), k = 0... N-1, which are those to be sent to the system and calculated.

The set of future control signals is calculated by optimizing a determined criterion to keep the process as close as possible to the reference trajectory w(t+ k) (which can be the setpoint itself or a close approximation of it). This criterion usually takes the form of a quadratic function of the errors between the predicted output signal and the predicted reference trajectory. The control effort is included in the objective function in most cases. An explicit solution can be obtained if the criterion is quadratic, the model is linear, and there are no constraints; otherwise an iterative optimization method has to be used. Some assumptions about the structure of the future control law are also made in some cases, such as that it will be constant from a given instant.

The control signal u(t|t) is sent to the process whilst the next control signals calculated are rejected, because at the next sampling instant y(t+1) is already known and step 1 is repeated with this new value and all the sequences are brought up to date. Thus the u(t+1|t+1) is calculated ( which in principle will be different from the u(t+1|t) because of the new information available) using the receding horizon concept (Camacho, E. F., Bordons, C., 2004).

The notation indicates the value of the variable at the instant t+ kcalculated at instant t.

### 4.2. Application to real system

Tunnel ventilation is expected to fulfil the following requirements at least (Godan, J. at all. 2001):

• Concentration of emissions in the tunnel kept within the acceptable limits for the monitored harmful pollutants, in consideration of time spent by persons inside the tunnel;

• Good visibility for through passage of vehicles under polluted air inside the tunnel;

• Reduction of effects of smoke and heat on persons in the case of vehicle fire;

• Regulation of dispersion of pollutants in the air caused by petrol fumes from vehicles into the surround environment of the tunnel.

Model Predictive Control (MPC) comes from the late seventies when it became significantly developed (Camacho, E. F., Bordons, C., 2004) and several methods were defined. In this work we have applied the Dynamic Matrix Control (DMC) method which is one of the most spread approaches and creates the base of many commercially available MPC products. It is based on the model obtained from the real system:

y(k)=i=1Nhiu(ki),E3

where hiare FIR (Finite Impulse Response) coefficients of the model of the controlled system. Predicted values may be expressed:

y^(n+k|n)=hiΔu(n+ki)+d^(n+k|n)==hiΔu(n+ki)+hiΔu(n+ki)+d^(n+k|n)E4

We assume that the additive failure is constant during the prediction horizon:

d^(n+k|n)=d^(n|n)=ym(n)y^(n|n)E5

Response can be decomposed to the component depending on future values of control and to the component determined by the system state in time n:

y^(n+k|n)=hiΔu(n+ki)+f(n+k),E6

where f(n+k) is that component which does not depend on future values of action quantity:

f(n+k)=yn(n)(hk+ihi)Δu(ni).E7

Predicted values within the prediction horizon p(usually p>>N) can be arranged to the relation (8):

y^(n+1|n)=h1Δu(n)+f(n+1)y^(n+2|n)=h2Δu(n)+h1Δu(n+1)+f(n+2)...y^(n+p|n)=i=pm+phiΔu(n+pi)+f(n+p),E8

where the prediction horizon is k=1...p, with respect to mcontrol actions. Regulation circuit is stable if the prediction horizon is long enough. The values may be arranged to the dynamic matrix G:

G=|h10...0h2h1...0:::hphp1...hpm+1|,E9

and expression used for prediction can be written in the matrix form:

y^=Gu+f,E10

where ŷis a vector of contributions of action quantity and f are free responses.

The MATLAB’s Model Predictive Control Toolbox uses linear dynamic modeling tools. We can use transfer functions, State-space matrices, or its combination. We can also include delays, which are in the real system. The model of the plant is a linear time-invariant system described by the equations:

x(k+1)=Ax(k)+Buu(k)Bvv(k)+Bdd(k)ym(k)=Cmx(k)+Dvmv(k)+Ddmd(k)yu(k)=Cux(k)+Dvuv(k)+Ddud(k),E11

where x(k) is the nx-dimensional state vector of the plant, u(k) is the nu-dimensional vector of manipulated variables (MV), i.e., the command inputs, v(k) is the nv-dimensional vector of measured disturbances (MD), d(k) is the nd-dimensional vector of unmeasured disturbances (UD) entering the plant, ym(k) is the vector of measured outputs (MO), and yu(k) is the vector of unmeasured outputs (UO). The overall ny-dimensional output vector y(k) collects ym(k) and yu(k). In the above equations d(k) collects both state disturbances (Bd≠0) and output disturbances (Dd≠0).

The unmeasured disturbance d(k) is modeled as the output of the linear time invariant system:

xd(k+1)=A¯xd(k)+B¯nd(k)d(k)=C¯xd(k)+D¯nd(k).E12

The system described by the above equations is driven by the random Gaussian noise nd(k), having zero mean and unit covariance matrix. For instance, a step-like unmeasured disturbance is modeled as the output of an integrator. In many practical applications, the matrices A, B, C, D of the model representing the process to control are obtained by linearizing a nonlinear dynamical system, such as

x=f(x,u,v,d)y=h(x,u,v,d).E13

at some nominal value x=x0, u=u0, v=v0, d=d0. In these equations denotes either the time derivative (continuous time model) or the successor x(k+1) (discrete time model).

The MPC control action at time k is obtained by solving the optimization problem:

min{Δu(k|k),...,Δu(m1+k|k),ε[i=0p-1(j=1nz|wi+1,ju(yj(k+i+1|k)rj(k+i+1))|2+i=1nu|wi,jΔuΔuj(k+i|k)|2+i=1nu|wi,j(uj(k+i|k)ujtarget(k+i))|2)+ρεε2]},E14

where the subscript "( )j" denotes the j-th component of a vector, "(k+i|k)" denotes the value predicted for time k+ibased on the information available at time k; r(k) is the current sample of the output reference, subject to

ujmin(i)εVjminu(i)uj(k+i|k)ujmax(i)+εVjmaxu(i);Δujmin(i)εVjminΔu(i)Δuj(k+i|k)Δujmax(i)+εVjmaxΔu(i);yjmin(i)εVjminy(i)yj(k+i+1|k)yjmax(i)+εVjmaxy(i),Δu(k+h|k)=0,wherei=0,...,p1,h=m,...,p1,ε0,E15

with respect to the sequence of input increments {Δu(k|k),...,Δu(m1+k|k)} and to the slack variable ε, and by setting u(k)=u(k-1)+ Δu(k|k), where Δu(k|k) is the first element of the optimal sequence. Note that although only the measured output vector ym(k) is fed back to the MPC controller, r(k) is a reference for all the outputs. When the reference r is not known in advance, the current reference r(k) is used over the whole prediction horizon, namely r(k+i+1)=r(k) in Equation 14.

In Model Predictive Control the exploitation of future references is referred to as anticipative action (or look-ahead or preview). A similar anticipative action can be performed with respect to measured disturbances v(k), namely v(k+i)=v(k) if the measured disturbance is not known in advance (e.g. is coming from a Simulink block) or v(k+i) is obtained from the workspace. In the prediction, d(k+i) is instead obtained by setting nd(k+i)=0. The wΔuij, wuij, wyij, are nonnegative weights for the corresponding variable. The smaller w, the less important is the behavior of the corresponding variable to the overall performance index. And uj,min, uj,max, Δuj,min, Δuj,max, yj,min, yj,maxare lower/upper bounds on the corresponding variables. The constraints on u, Δu, and yare relaxed by introducing the slack variable ε≥ 0. The weight ρεon the slack variable ε penalizes the violation of the constraints. The larger ρεwith respect to input and output weights, the more the constraint violation is penalized. The Equal Concern for the Relaxation vectors Vumin,Vumax, VΔumin, VDumax, Vymin, Vymaxhave nonnegative entries which represent the concern for relaxing the corresponding constraint; the larger V, the softer the constraint. V=0 means that the constraint is a hard one that cannot be violated (Bemporad A., Morari M., N. Lawrence Ricker., 2010).

### 4.3. Constraints

In many control applications the desired performance cannot be expressed solely as a trajectory following problem. Many practical requirements are more naturally expressed as constraints on process variables. There are three types of process constraints: Manipulated Variable Constraints: these are hard limits on inputs u(k) to take care of, for example, valve saturation constraints; Manipulated Variable Rate Constraints: these are hard limits on the size of the manipulated variable moves Δu(k) to directly influence the rate of change of the manipulated variables; Output Variable Constraints: hard or soft limits on the outputs of the system are imposed to, for example, avoid overshoots and undershoots (Maciejovski, J.M., 2002). We use the Output constraints and Manipulated Variable Constraints.

## 5. Simulation in MATLAB

Models of the tunnel and ventilator have been obtained through identification of real equipments. Higher traffic intensity causes increase of pollutant concentrations in the tunnel. This intensity is expressed as a vector containing really measured data. The MATLAB environment is used to simulate behavior of the system according to the Fig. 5. Figure 6.Improved MPC of multi-dimensional ventilation system

It is a closed-loop control (regulation) of the system with limitations imposed to control quantity and outputs. It uses the internal model and solves optimization problem with the use of quadratic programming. We can choose the prediction horizon P and the control horizon M. The output constraints were set to 6, because this is the maximum input for three pairs of jet fans corresponding with real system. Weight matrix is selected as a diagonal matrix, with each element weighting the corresponding control signal. For instance, if the influence of particular control is to be reduced, then the corresponding diagonal element will be increased to reflect this intention. Weight tuning is the essential task to set the controller. In Fig. 7 we can see the results in comparison to Fig. 6. Figure 7.Simulated values of CO pollution inside the tunnel with (grey line) and without (black line) MPC controller and fan number (number of acting jet fans)

### 5.1. Simulation results

The presented simulation results are obtained for the following concentration limits: 6 ppm for CO concentrations, 0.02 ppm for NOx concentrations and 0.05 ppm for visibility concentrations. These values are below really defined maximum limits. According to the curve of the output quantity (Fig. 6) it is apparent, that no emission value has extended the defined limit. However, the value of under-set maximum limit may be extended since one ventilator need not be able to dilute CO concentration sufficiently.

The abbreviation ppm is a way of expressing very dilute concentrations of substances. Just as per cent means out of a hundred, so parts per million or ppm means out of a million. It describes the concentration of something in air.

For this simulation we have six acting jet fans in this part of road tunnel. In the next simulations we have used a possibility to set weighing matrices (uwt) for tuning the controller. The control quantity uis adapted to the input of Jet Fan control unit. The black lines represent the concentrations of pollution without using the controller. They are named CO. The grey lines represent the concentrations of pollution with using the controller. They are named COr. Opacity and concentration of NOx is below the dangerous limits. The jet fans were switched on two times per day for chosen limits. We can see how affect the ventilation system to reduce the pollution. In this paper we pointed out only to concentration of CO, because this type of pollution is most dangerous for human organism.

As it was mentioned in the previous section the weight tuning is also important part of controller creation.

Well tuned controller leads to optimal control. After changing the weights, the jet fans were switched on only once per day, furthermore the next day all the fans were not switched on in the same conditions. Figure 8.Weight tuning. Simulated values of CO pollution inside the tunnel with (grey line) and without (black line) MPC controller and fan number (number of acting jet fans)

Opacity and concentration of NOx is below the dangerous limits. The jet fans were switched on once per day for chosen limits. The concentrations of NOx and opacity (OP) are shown in Fig. 8. Figure 9.Simulated values of NOx concentrations inside the tunnel tube (black line) and opacity (grey line)

For this simulation the NOx concentrations and opacity was below defined maximum limits. When the jet fans are switched on these pollutions are also decreased.

### 5.2. Implementation

The biggest advantage of Automatic Code Generation affects those developers who already use MATLAB and Simulink for simulation and solutions design and to developers who used to tediously rework implemented structures in a language supported by Automation Studio in the past. In the procedures listed below the Automatic Code Generation tool provided by B&R represents an innovation with endless possibilities that help to productively reform the development of control systems. The basic principle is simple: The module created in Simulink is automatically translated using Real-Time Workshop and Real-Time Workshop Embedded Coder into the optimal language for the B&R target system guaranteeing maximum performance of the generated source code. Seamless integration into an Automation Studio project makes the development process perfect (B&R Automation Studio Target for Simulink. 2011). Since the tunnel ventilation system use programmable logic controllers (PLC) it is suitable for real implementation. In our department we have appropriate equipment for this solution. Figure 10.Workflow of the Automatic Code Generation

The elimination of extensive reengineering in Automation Studio allows simple transfer of complex and sophisticated Simulink models to the PLC (Hardware-in-the-Loop). Closed-loop controllers can also be easily tested and optimized on the target system without requiring the user to adjust large amounts of code and run the risk of creating coding errors (Rapid Prototyping). Rapid prototyping: Automatic Code Generation makes it possible to quickly and easily transform sophisticated Simulink based control systems into source code and integrate them into an Automation Studio project. Many potentially successful ideas have been immediately rejected due to the large amount of time required for conversion into executable machine code and the risk of developing a dead end solution.

The “Rapid Prototyping” concept brings an end to this. Using Simulink and the Automatic Code Generation tool provided by B&R, any system, no matter how complex, can be intuitively built, compiled and tested in a short amount of time. This practically eliminates implementation errors as the Automatic Code Generation tool has been well-proven over several years in critical fields like aviation or automotive industry (B&R Automation Studio Target for Simulink. 2011). Nowadays the control algorithm is implemented and awaiting for connection to the real system. Fig. 11. shows the model in Simulink.

We created the model in Simulink according to model for simulations. We replaced the simulated inputs by “B&R IN” blocks and simulated output by the “B&R OUT” block. The Real-time Workshop provides utilities to convert the SIMULINK embedded models in C code and then, with the compiler, compile the code into a real-time executable file. Although the underlying code is compiled into a real-time executable file via the C compiler, this conversion is performed automatically without much input from the user. The concept in Fig. 10. shows that a simulation model can be used in the simulation testing of the predictive control system, and after completing the test, then with simple modification to the original Simulink programs, the same real-time predictive control system can be connected to the actual plant for controlling the plant. Figure 11.The control system Figure 12.The control system in Simulink
Advertisement

## 6. Conclusion

The paper presents a methodology that has been used for design parametric models of the road tunnel system. We needs identification of system based on data obtained from the real ventilation system. Model from one week data has been created and verified in MATLAB environment. This part is the ground for best design of ventilation control system. Presented results point out that created model by identification method should be validate by several method. Model of a three-dimensional system has been created and simulated in MATLAB environment using the predictive controller. Presented results confirm higher effectiveness of predictive control approach. The weight tuning is important part of controller creation as the simulation results had proved. The predictive controller was successfully implemented to programmable logic controller.

## Download for free

chapter PDF
Citations in RIS format
Citations in bibtex format

## More

© 2011 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike-3.0 License, which permits use, distribution and reproduction for non-commercial purposes, provided the original is properly cited and derivative works building on this content are distributed under the same license.

## How to cite and reference

### Cite this chapter Copy to clipboard

Jozef Hrbcek and Vojtech Simak (July 5th 2011). Implementation of Multi-dimensional Model Predictive Control for Critical Process with Stochastic Behavior, Advanced Model Predictive Control, Tao Zheng, IntechOpen, DOI: 10.5772/16364. Available from:

### chapter statistics

2367total chapter downloads

7Crossref citations

### More statistics for editors and authors

Login to your personal dashboard for more detailed statistics on your publications.

### Related Content

#### Advanced Model Predictive Control

Edited by Tao Zheng

Next chapter

#### Fuzzy–neural Model Predictive Control of Multivariable Processes

By Michail Petrov, Sevil Ahmed, Alexander Ichtev and Albena Taneva

#### Frontiers of Model Predictive Control

Edited by Tao Zheng

First chapter

#### A Real-Time Gradient Method for Nonlinear Model Predictive Control

By Knut Graichen and Bartosz Käpernick

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.