Control Strategy in a Centrifugal Separation Process ANDERS SVENSSON Masters’ Degree Project

Control Strategy in a Centrifugal Separation Process ANDERS SVENSSON Masters’ Degree Project
Control Strategy in a Centrifugal
Separation Process
ANDERS SVENSSON
Masters’ Degree Project
Stockholm, Sweden March 2010
XR-EE-RT 2010:004
Master’s Thesis in Automatic Control
Control Strategy in a
Centrifugal Separation Process
Author:
Anders Svensson
Examiner (KTH):
Elling W. Jacobsen
Supervisors (Alfa Laval):
Carl Häggmark
Sverker Danielsson
March 5, 2010
Sammanfattning
Ett nytt koncept för separering av jäst från öl har tagits fram på Alfa Laval i
Tumba. Jästen matas nu ut kontinuerligt istället för att skjutas ut då separatorn har fyllts med för mycket jäst, konceptet gör att man kan spara öl som
annars försvinner i samband med skott. För att konceptet skall vara lönsamt
måste den utmatade jästen ha tillräckligt hög densitet trots att indensiteten
ständigt sjunker, samtidigt som man måste ha bra separering. I det här examensarbetet har en reglerstrategi för denna höghastighets centrifugal separationsprocess utvecklats. Genom experimentella studier av systemet kunde en
matematisk modell av separationsprocessen skapas. Modellen användes sedan
som grund för en MPC-regulator där densiteten styrdes genom att styra
flödena i processen. En implementering av styrningen genomfördes sedan i
processlaboratoriet i Tumba. Separeringen antogs vara bra så länge massflödet in var relativt lågt och trycknivåerna var bra. Med MPC-regulatorn
gick det att hålla densiteten över en satt gräns i laboratorieexperiment. Det
visas också att en flervariabel regulator i det här fallet har fördelar över envariabla. Förutsättningar för att i ett nästa steg även reglera separeringseffektiviteten anses finnas.
Abstract
A new concept for separating yeast from beer has been developed at Alfa
Laval in Tumba. The yeast is now continuously fed out from the separator
instead of discharged when too much yeast have collected in the separator. The concept makes it possible to save beer which otherwise would have
been wasted at discharges. For the concept to be profitable, the density of
out yeast must be high enough even though the inlet density is steadily declining, and at the same time have good separation effiency. In this thesis a
control strategy has been developed for this high speed centrifugal separation
process. Through experimental studies a mathematical model of the separation process could be made. This model was then used for a MPC-controller
where the density was controlled by controlling the flows of the process. An
implementation of the control strategy was carried out in the process laboratory in Tumba. The separation was assumed to be good as long as the
mass inflow was relatively low and the pressure levels were steady. With the
MPC-controller it was possible to maintain the density over the set limit in
laboratory experiments. It is also shown that a multivariable controller has
benefits compared to a single variable controller. Controlling the separation
efficiency is deemed possible and is the next step.
Acknowledgements
I would like to thank my supervisors at Alfa Laval, Carl Häggmark and
Sverker Danielsson, for giving me the opportunity to work with this project
and for their help and support during the time I spent at Alfa Laval. My
thanks also goes to Göran Ström, Manager of PCT and the whole PCT
department for the very good past half year they gave me. I would also like
to thank Alf Karlsson who helped me modify the TwinCAT program.
At KTH I want to thank my supervisor professor Elling W. Jacobsen for
his help and guidance.
Contents
1 Introduction
1.1 Beer brewing . . . . . .
1.2 Separation Fundamentals
1.3 New Concept - Dryaden
1.4 Earlier Work . . . . . . .
1.5 Problem . . . . . . . . .
1.6 The Thesis . . . . . . . .
2 The
2.1
2.2
2.3
2.4
2.5
2.6
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Separation Process
Fermentation tank . . . . . .
Actuators . . . . . . . . . . .
Sensors . . . . . . . . . . . . .
Yeast and Water Mixture . . .
Process Operating Conditions
Experiments . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5
5
6
8
9
9
10
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
12
12
12
13
15
16
16
3 Separation Process Modelling
3.1 Different Models . . . . . . . . . . . .
3.2 Black Box Modelling . . . . . . . . . .
3.3 Grey/Black Box Modelling . . . . . . .
3.4 Experiment Design . . . . . . . . . . .
3.5 Black Box based on Control Signals . .
3.6 Density Grey Box based on Mass Flows
3.7 Black Box based on Mass Flows . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
18
18
19
23
23
26
30
31
.
.
.
.
.
39
39
42
43
45
49
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
4 Control of the Separation Process
4.1 Model Predictive Control . . . . . .
4.2 MPC Toolbox . . . . . . . . . . . .
4.3 Robustness . . . . . . . . . . . . .
4.4 Control Strategies . . . . . . . . . .
4.5 Decentralized Input-Output Pairing
1
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
4.6
4.7
PID Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Implemented MPC Design . . . . . . . . . . . . . . . . . . . . 53
5 Implementation in the Process Laboratory in Tumba
5.1 Different Choices for Implementation of Control Design
5.2 TwinCAT . . . . . . . . . . . . . . . . . . . . . . . . .
5.3 OPC and The OPC Toolbox . . . . . . . . . . . . . . .
5.4 Simulink . . . . . . . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
57
57
58
59
62
6 Results and Discussion
6.1 PID-tuning . . . . . . . . . . . . . . . . . . .
6.2 Control Performance Evaluation . . . . . . . .
6.3 Heavy Phase flow and the Recirculation Pump
6.4 Influence of Periodic Signal . . . . . . . . . . .
6.5 Separation Efficiency . . . . . . . . . . . . . .
6.6 Simulink and TwinCAT . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
65
65
66
69
70
71
73
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
7 Conclusions and Future Work
74
7.1 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
7.2 Control Design in Further Development . . . . . . . . . . . . . 75
7.3 Summary and Final Words . . . . . . . . . . . . . . . . . . . . 76
A Control Theory
79
A.1 The Laplace Transform . . . . . . . . . . . . . . . . . . . . . . 79
A.2 Transfer Functions . . . . . . . . . . . . . . . . . . . . . . . . 79
A.3 PID Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
B Separation Theory
81
B.1 Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
C White-box modeling
83
C.1 Inputs and Outputs . . . . . . . . . . . . . . . . . . . . . . . . 84
C.2 Whitebox Performance . . . . . . . . . . . . . . . . . . . . . . 85
2
Nomenclature
Abbreviations
ARMAX
ARX
CPM
EDF
HP
I
LP
MD
MO
MPC
MV
NARX
OPC
PID
PLC
PRBS
R
RGA
RM
RTOS
SIT
ZOH
AutoRegressive Moving Average eXogenous
AutoRegressive Exogenous
Constant Pressure Modulating
Earliest Deadline First
Heavy Phase
Inlet
Light Phase
Measured Disturbances
Measured Outputs
Model Predictive Control
Manipulated Variables
Nonlinear ARX
OLE for Process Control
Proportional Integral Derivative (controller)
Programmable Logic Controller
Pseudo Random Binary Signal
Recirculation
Relative Gain Array
Rate Monotonic
Real-Time Operating System
System Identification Toolbox
Zero Order Hold
3
Process Notations
201
220
221
α
ω
ρ
e
N
p
Q
q
r
rg
ri
ry
u
x
y
DT
HP
I
LF
MFT
PT
R
Inlet
Light Phase
Heavy Phase
Half cone angle
Rotational speed
Density
Control error
Number of discs
Pressure
Flow
Massflow
Reference value
Interface level
Disc inner radios
Disc outer radius
Control signal
Dry fraction
Output
Density
Heavy Phase
Inlet
Light Phase
Massflow
Pressure
Recirculation
[rad]
[rad/s]
[kg/dm3 ]
[kPa],[Bar]
[m3 /h]
[ton/h]
[m]
[m]
[m]
4
Chapter 1
Introduction
This thesis was written at Alfa Laval in Tumba during the summer and fall
of 2009.
Alfa Laval is one of the leading manufacturers of high speed separators
in the world, and also have products in heat exchange and fluid handling.
Separators are used in many fields, from marine to medical applications.
This thesis is focused on separators used in the beer brewing process but the
techniques can be used in other fields as well.
The purpose of this thesis is to design and implement a control strategy in
a centrifugal separation process in the process lab at Alfa Laval. The scope
of the thesis is thus modeling, control design and implementation. Readers
without any prior knowledge in control theory are urged to read Appendix
A where some basic control theory is summarized.
First an introduction to the problem and beer brewing will be given, the
nextcoming chapter will describe the physical experiment setup. The chapters after that describes the modelling of the system, how to control it and
how to implement it. Finally the results, conclusions and recommendations
for further work are given.
1.1
Beer brewing
The brewing process is an old and complicated process and no effort will
be made to explain it thoroughly in this report. A small introduction may
though be in place to get at fuller understanding of the problem at hand.
The following section is a brief summary of [bre01].
Malting, the process of preparing the barley for brewing, is the first step
towards a bottle of beer. In this step enzymes is developed that has a part
in the breakdown of starch to sugar.
5
The malt is then crushed into malt grist which is mixed with water.
The temperature is raised and held at different levels which makes different
enzymes direct the breakdown. After the spent grain have been removed,
the wort is boiled together with hops.
When the wort has cooled it is fermented in large tanks, a process where
yeast is added to the wort and a biochemical process begins. Together with
the sugar in the wort, new cells are created and the sugar is broken down
into alcohol and carbon dioxide. When the fermentation is finished the yeast
sinks to the bottom of the tank. The product is now called green beer.
The green beer is a mixture of beer and yeast and before the process can
continue the yeast needs to be separated from the beer. The tank with green
beer is emptied and should now run through a separator. This step is what
the thesis is focused on.
After the separation, the green beer is aged in conditioning tanks and
now a second fermentation occurs, it is now the beer gets its characteristic
flavor. After the aging (one to six months) it needs to be clarified, which
is done by a separator and then filtration. Because of this filtration it is
not imperative that all yeast is separated after the first fermentation. It is
therefore acceptable with small disturbances of yeast passing through, since
those will be filtered out later.
Before the beer can be bottled it often needs to be pasteurized to ensure
longer life expectancy.
1.2
Separation Fundamentals
As a background, a short introduction in separation is needed. Classic separation theory is given in Appendix B.
Mechanical separation of materials is dependent on differences in density
and the heavier component will sedimentate. These sedimentation velocities
are dependent on the gravity and are usually slow (could be as low as 1
meter/week). Separators are used to get higher velocities via centrifugal
forces.
The fluid that is run into the separator is called the feed and contains
the components that needs to be separated; the light phase, heavy phase and
sediment (sludge). There are different types of separators depending on the
purpose. In this case, it is desired to get the light phase (beer) as free from
heavy phase (yeast) as possible.
A schematic view of a centrifugal separator can be seen in figure 1.1. The
main difference between the one shown here and the separator used is that
the used one is hermetically sealed. This means that there is no air in the
6
system, which is important when dealing with food and beverages. The fluid
flow through the separator can be described as follows:
The feed (feed and recirculated content) enters the separator from the
bottom (1 in figure) through a hollow spindle (2). The fluid enters the disk
stack (3) from below and spreads through distribution holes in the disks up
to the top. The disks which are rotating at speed ω give a much larger area
for yeast particles to sedimentate to and a higher sedimentation velocity, and
thus getting a more effective separation (see Appendix B). The light phase
goes inward towards the center and exits while the heavy phase is led out
from the center to the sludge space (7). From the sludge space the heavy
phase is led out through some custom made pipes (shown in figure 1.2), these
are located at (5). Both the light phase and the heavy phase exits through
the top of the separator (4 and 6). If too much sludge has collected and there
is a need to discharge, the sludge space is opened by lowering the bottom part
of the bowl (8). This will open the bowl and the yeast will be discharged.
IPLES
ARATEDISFEDINTOTHESEPARATORBOWL
THROUGHAHOLLOWSPINDLEANDENTERSTHE
HEHEAVYPHASEANDHEAVYSLUDGEAREFORCED
PHERYOFTHEBOWLWHILETHELIGHTPHASEFLOWS
REOFTHEBOWLFROMWHEREITISPUMPEDOUT
CESSING4HEHEAVYPHASEISLEDOVERATOP
AMBERWHEREANADJUSTABLEPARINGDEVICE
HESEPARATOR3LUDGECOLLECTSINTHE
ANDISDISCHARGEDINTERMITTENTLYANDAUTO
SCHARGEISACHIEVEDBYAHYDRAULICSYSTEM
SUITABLEINTERVALSFORCESTHESLIDINGBOWL
OPDOWNTHUSOPENINGTHESLUDGEPORTSAT
RY4HESLUDGEISCOLLECTEDINTHEFRAMEAND
UGEVIAACYCLONE
MPTION
MAXK7
CONTINUOUSLYPERDISCHARGE LHL
CKET FigureLH
1.1:
4YPICALBOWLDRAWINGFORSOLIDSEJECTINGHERMETICCENTRIFUGE$RAWING
DETAILSDONOTNECESSARILYCORRESPONDTOTHECENTRIFUGEDESCRIBED
Figure showing a cut through a separator. The separator used in
is similar, but hermetically sealed and with custom made heavy
4ECHNICALSPECIlCATIONS
LH
phase pipes.
L LH
the process
ERDISCHARGE L
4HROUGHPUTCAPACITYMAXMH
"OWLSPEEDSYNCHRONOUS RPM
"OWLVOLUME L
DANDLOCKRING SS5.3
3LUDGESPACE L
NDHOOD SS5.3
-OTORSPEEDSYNCHRONOUS(ZRPM
ART
GREYCASTIRONCLADWITH
SS5.3
-OTORPOWERINSTALLED K7
INGS NITRILERUBBER
3TOPPINGTIMEWITHOUTBRAKE MINS
3TARTINGTIME MINS
7
)NLETPRESSUREATMHK0A
/UTLETPRESSUREOIL MAXK0A
/UTLETPRESSUREHEAVYPHASE K0A
3OUNDPRESSURELEVEL D"!
/VERHEADHOISTLIFTINGCAPACITY MINKG
1.3
New Concept - Dryaden
There are actually no problems to build a separator that effectively separates
the beer from the yeast but the separator have to be over dimensioned.
However, even though the product is beer and it is desired that it contains
as little yeast as possible, it is also important not to waste any beer. Today
a separator needs to discharge the sludge in certain time intervals because of
the build up of sludge inside the separator. Since the sludge contains beer,
beer is wasted when discharged. 1 .
By continuously feeding out the heavy phase/sludge through some custom
made heavy phase pipes that have been added to the separator (see figure
1.2) there is no need to discharge and much yeast and beer can be spared.
There are also energy consuming aspects with the concept. For this method
to be successful it is important to have a high density of the heavy phase
when it leaves the separator, otherwise beer would be wasted. This is solved
by recirculating some of the heavy phase back into the feed. It is thereby
possible to maintain a high density even when the inlet density is low.
Figure 1.2: 3D-model of HP pipes leading down to the sludge space
1
Information about possible gains from the new concept can be found in [HD09]
8
The recirculation also prevents the pipes, in which the heavy phase are led
out from the separator, to clog. This might intuitively be hard to understand
since adding more yeast leads to less clogging. The reason is that a higher
driving pressure is obtained which in turn gives a higher flow in the pipes.
As long as the flow is high enough, the pipes will not clog.
1.4
Earlier Work
How separators work is thoroughly described in [Mob02], [MB02a], [IMM02],
[MB02b], [LF02] and [Leu07]. These sources deal with static relationships
and not dynamic which often is preferred. Dynamical models of separators
are dealt with in [RB06, Ch. 3, p. 21], [OR94]. These are however not centrifugal separators but separators that function via evaporation and related
physical phenomenon. Basic ideas and concepts are however taken from
these.
Concerning dynamical modeling and control of centrifugal separators, no
previous work have been found. Considering that Alfa Laval is a leading manufacturer of centrifugal separators and this is a relatively new research field
even for them, it might not be that unexpected that there are no literature
in the field.
In an earlier Master’s thesis, [Kar07], it is concluded that it is possible
to recirculate some of the heavy phase to avoid clogging and the need to
discharge (this was the first prototype of Dryaden). Since then, the prototype has been rebuilt and improved. Several experiments have already been
carried out in the new prototype and they have had some success in trying to
get the recirculation flow to function satisfactory while maintaining a good
heavy phase density.
1.5
Problem
When the fermentation tank is emptied, the concentration of yeast, which is
proportional to the density of the feed, varies with time. The yeast concentration, and thereby also the feed concentration, will be high in the beginning
since the yeast will have sunk to the bottom. The concentration will then
gradually become smaller and smaller as there are less yeast in the remaining
green beer. This concentration gradient causes problems in the separation
process and is the main cause of this thesis.
Without control, the new process is very dependent on the density of the
feed to be able to keep high densities in the heavy phase. The problem is
9
keeping an acceptable density even when the feed density becomes low while
at the same time keeping certain parameters within its limits. If the flow
through the heavy phase becomes too low, there is a risk that the pipe will
clog and to continue it would be necessary with a discharge.
Today the breweries solves the problem by simply disposing the content
in the bottom of the tank and by opening the separator bowl to dispose of
the yeast. This is an extra step, it is desirable to be able to open the tank,
and then let the control take care of the varying density. Disposing yeast is
also wasteful and undesired.
1.6
The Thesis
The main objective of this thesis is to analyze the system and to give a more
theoretical background to the control problem. In the end, the new control
strategy should be implemented in the process lab. The setup of the system
is given in chapter 2.
With the new controller, the process should be able to be run continuously
without the need to discharge any feed or sludge, while keeping the density of
the heavy phase within certain limits and having a good separation efficiency.
Since there is a limited time, some compromises are necessary. Controlling a system involves basically three steps; modeling, control design and
implementation.
The later chosen control strategy needs a model of the process to function.
The inner workings of the separator does not need to be modelled and a
model which describes the behavior of the controlled variables will suffice.
Obtaining this model will be the first step and is described in chapter 3.
When a good model is available it will be used to design a control strategy
which can control the process, as written in chapter 4. The requirements on
the strategy, i.e. the control objectives are:
• The flow in the heavy phase should be kept constant at 2 ton per hour
to avoid clogging. Small deviations are allowed.
• The concentration of yeast in the heavy phase should be as high as
possible, at least higher than 1.065kg/dm3 .
• Assumption: Constant feed flow and good pressure levels ⇒ good separation (explanation of assumption in chapter 4).
The control design needs to be implemented in the separation process.
All implementation aspects, both collecting data and controlling the final
system, will be given in chapter 5.
10
Finally the results from the final tests and conclusions that can be drawn
are presented in chapter 6 and 7.
11
Chapter 2
The Separation Process
To be able to understand the process a description of the laboratory experiment process setup follows below, i.e. how pumps, valves and such are
connected. A schematic view can be seen in figure 2.1. The experimental
conditions and how the experiments are performed are also given.
2.1
Fermentation tank
This tank is the starting point for the whole process and contains the beer
mixed with the yeast that is to be separated. The bottom is conical which
makes the yeast collect at the bottom center. In this test setup, both the
heavy phase and the light phase will be fed back into a 8m3 tank with flat
bottom, making the concentration fairly constant. Also, bakers yeast is used
and it is mixed with water.
2.2
Actuators
All actuators are controlled by a control signal 0-100 % and initially there
are four different actuators of the process that can be controlled, two pumps
and two valves. The separator itself could in the future be seen as a fifth
actuator since varying the rotational speed improves the separation. That
possibility has not been used in this thesis because of the separation efficiency
assumption.
The two pumps are ordinary pumps, one centrifugal pump and one excenter screw pump, that can deliver flow and pressure. The feed pump transports
the content of the tank to the separator and can deliver flows up to 20 ton/h,
but it will be kept constant at 11ton/h for the most of the time due to the
12
V
ρ
V
Heavy phase
Light phase
Recirculation
From tank
ρ
Feed
Figure 2.1: Schematic view of the process
separation assumption. The recirculation pump is smaller and recirculates
the heavy phase back into the feed and delivers a flow rate of 1.5 ton/h.
2.2.1
CPM Valves
These control the back pressure of the light and the heavy phase and is shown
in figure 2.2. The topmost chamber is filled with compressed air taken from
external pipes (in this case the compressed air system at Alfa Laval) which in
turn acts on a membrane which separates the air from the fluid. Because of
this membrane, the pressure in the fluid will be the same as the air pressure.
This means that even without a controller the pressure will be kept relatively
constant. The control signal is a percentage of the available pressure in the
external pipes.
2.3
Sensors
In figure 2.1, ρ denotes a mass flow and density sensor while V represents a
volume flow sensor. It is also possible to measure the pressures in the pipes.
There is a turbidity sensor in the light phase that was supposed to measure
the quality of the light phase. This sensor did however saturate even at low
yeast concentrations in the light phase, which made it impossible to use.
13
Fig. 5. CPMI-2 with pressure regulating valve and pressure gauge.
Figure 2.2: Cut through CPM-valve showing air chamber and fluid pipe.
2.3.1
Mass flow/density Sensors
The mass flow sensors, Endress+Hausser Promass I, measures the density
without disturbing the flow, i.e. from the point of view of the fluid it looks
like an ordinary pipe. Measurements are filtered in the transceiver and the
sensors have an accuracy of ±0.125%. [pro]
2.3.2
Pressure Sensors
The pressure sensors have a accuracy of ±0.1%.[kel] The signal is rather
noisy, it is however hard to distinguish the noise from the actual pressure
fluctuations since these are fast as well. Since the sensor measuring the light
phase and the heavy phase are installed on top of the separator, vibrations
from the separator could distort the signal. The inlet pressure and the light
phase pressure should have the same curve shape but with a pressure drop in
the light phase. By comparing the Fourier transform of the two signals it can
be concluded how much the vibrations of the separator affects the signal. As
can be seen in figure 2.3 the signals have energy in approximately the same
frequencies and no clear effect of the vibrations can be seen.
14
Periodogram
5
Inlet Pressure
10
0
10
−5
10
−4
10
−3
−2
10
−1
10
10
0
10
1
10
Periodogram
Light Phase Pressure
5
10
0
10
−5
10
−4
10
−3
−2
10
−1
10
10
0
10
1
10
Frequency [Hz]
Figure 2.3: Periodogram of the inlet and light phase pressure.
2.4
Yeast and Water Mixture
In the laboratory experiments a mixture of bakers yeast and water was used
and this mixture have similar properties as the green beer mixture. One
batch contains 96 kg of 95% dry bakers yeast and 2 m3 of water.
A common way of quantifying how much yeast a fluid contains is by
measuring its dry fraction, x, i.e. the percentage of the volume or weight
of the fluid corresponding to completely dry yeast. This is related to the
density according to:
ρHP =
xHP
ρD ρL
(ρLP − ρD ) + ρD
(2.1)
where ρD is the density of 100% yeast when dried (approximately 1.460
kg/dm3 ), ρL is assumed to be 1 kg/dm3 (pure water). The viscosity of the
yeast/water mixture is highly nonlinear and at dry fractions above approximately 24% the mixture stops behaving like a Newtonian fluid and instead
becomes thick and impossible to pump or lead through pipes. With the current separator configuration, higher dry fractions than 21% have not been
15
obtained and it poses no problem in this case.
Since yeast is a biological product and due to the decay of the yeast the
time every batch can be used is limited. After four days the batch needs to
be disposed of. In order to extend the expiration date of the yeast the tank
slurry was continuously cooled in a heat exchanger.
2.5
Process Operating Conditions
The process is quite flexible, but it is desired to stay within certain operating
conditions. If the pressure levels rises to high there could be problems with
leakage, too low pressures on the other hand can cause cavitations. This
applies to both the heavy and the light phase. The flow in the heavy phase
pipes should be 2 ton/h to be certain of no clogging conditions, but values
down to 1.7 ton/h are acceptable. Higher flows means no physical problem,
but it is impossible to keep a good heavy phase density with too high flows.
The non-Newtonian fluid is not a problem and the density does not have an
upper limit. The limits can be summarized as follows:
10 <
3<
4<
1.065 kg/dm3 <
1.7 <
0<
pL <
2.6
qI
pLP
pHP
ρHP
qHP
qR
pHP
< 13 ton/h
< 10 bar
< 10 bar
(2.2)
< 2.3 ton/h
< 1.5 ton/h
Experiments
All the results of this thesis are in some way related to results from experiments on the separation process. A short introduction of how the experiments are initiated are given to give a fuller understanding of how the process
works.
1. The separator is turned on and and the rotational speed is set to 4600
rpm.
2. When the bowl has closed, the feed pump is turned on. If no air pockets
have appeared, the contents of the tank will begin to pump into the
separator.
16
3. The flow in the heavy phase will now be very high and needs to be
lowered. The heavy and light phase pressures are manually adjusted to
obtain the desired flow through the heavy phase pipes. This will also
increase the density due to the altered flow.
4. The process is now allowed to stabilize and build up a yeast cake on the
inside of the separator and filling the sludge space. During this time
the heavy phase flow can be controlled by a PID.
The startup of the separator process is unfortunately hard to control with
an ordinary controller since it demands some manual tuning before it is in
operational mode.
2.6.1
Design of Final Experiment
The purpose was to create a laboratory simulation of yeast separation from a
cone-bottom tank in a brewery. This means that the density in the beginning
should be rather high, and then lower as time goes. To get that particular
density profile, a highly concentrated mixture (about 10% dry fraction, approximately 200 kg of yeast in 2 m3 of water) was continuously diluted until
it in the end had a dry fraction of 2-3%, which takes approximately 45 minutes.
17
Chapter 3
Separation Process Modelling
To be able to analyze and design control laws for the process there is a need
for a model of the process. Even though separators have been developed for
over a century, the behavior inside the machine is still not entirely known
and the existing relationships makes a lot of assumptions.
The model requirements depend on the purpose of the model and in this
application there was a need for two different models. One which relates
the actuator inputs (percentage 0-100) to the light phase pressure and the
pressure, density and the mass flow of the heavy phase. This model will be
used to analyze the process. The second model relates the mass flows to
the heavy phase density and will be used in the design of the MPC. This
chapter begins with a brief introduction of dynamic modelling and then the
two different models will be presented.
3.1
Different Models
Dynamical models can be divided into different groups depending on how
much a priori information is used. A model that is entirely based on known
physical relationship and parameter values is called a white box. The opposite, where no prior information is known, is called a black box model.
Models in between are quite reasonable called grey box models. All methods
have their benefits and disadvantages. White box models are easier to understand since the parameters represent physical properties such as inertia or
electrical resistance. From a black box model it is generally speaking impossible to for instance deduce one certain physical parameter. Black box models
also have the disadvantage that experiments must be performed which can
be time consuming, and sometimes impossible to perform. However, also
white box modeling can be very time-consuming, especially if it is supposed
18
to be detailed with many parameters. One benefit of black box models is
that once the data is available, often a good enough model can quickly be
derived. Another advantage with black box is that it is easy to work with
multivariable processes, either by directly identifying a MIMO state-space
model or, as in this thesis, by identifying several SISO or MISO models to
connect each input to each output.
Since the process was disassembled the first months no new experiments
could be performed which made it impossible to make a black box model.
A white box model based on the known relationships between the light and
heavy phase pressures and the heavy phase flow was made. This model
did however not perform good enough and during the experiments it was
found that there are better ways to control the flows than by controlling the
pressures. This made the white box model obsolete and the results of the
system identification became the final models. The white box model can be
found in Appendix C.
3.2
Black Box Modelling
If the relationships between the inputs and outputs are uncertain or even
unknown, a black box model can be used. It is dependent on experiments
and the inputs and measured outputs from this experiment are saved. The
idea is then to use a model with a certain order, chosen by the user, and
then fit the model parameters against the saved data to obtain a model that
produces the correct output from the given input.
During the system identification process the Matlab System Identification
Toolbox has been extensively used. All commands (written like: command)
are assumed to be from this toolbox unless otherwise stated. For usage and
further information about these commands, the reader is referred to [Matc].
3.2.1
Input/Output Data
Black box models requires good enough data to perform a system identification. The input signals must excite the system well enough in an appropriate
frequency range, which usually are in the area of the bandwidth of the system. A crucial part of system identification is thus design of the input signal.
Without a good input, identification may become very hard or even impossible. When performing the experiments it is also important to collect enough
data to have both a data set that can be used for the parameter estimation
and another data set the model can be verified against.
A common choice of input signal is a PRBS (Pseudo Random Binary
19
Signal) as seen in figure 3.1 which works well for linear systems. The benefit of
using such a signal is that interesting frequencies can be emphasized. [GL04]
If the system is nonlinear, it is desirable to also use different amplitudes since
it can give different results. By multiplying each step in the PRBS with a
random scalar the desired signal is achieved. A similar approach is suggested
in [Nel01].
PRBS
0.8
0.6
0.4
Amplitude
0.2
0
−0.2
−0.4
−0.6
−0.8
0
50
100
150
200
250
Samples
300
350
400
450
500
Figure 3.1: PRBS-signal between ±0.7.
Even if the input signal is good there can be other problems with the
data. Before the estimation is carried out the data needs to be analyzed. For
instance; outliers needs to be removed since these affect the estimation (often
more than expected). By prefiltering the data the model can be estimated
to focus on the interesting frequencies, such as the bandwidth of the system.
3.2.2
Correlation model
If not even the approximate time constants and delays are known, one way of
obtaining an initial guess is to compute a correlation model. This model does
however just produce a list of values and cannot be used in control design
and similar purposes. A correlation model is as its name suggests based on
statistical relationships between the inputs and outputs. [GL04] In Matlab
20
the function impulse (when used with System Identification Toolbox data)
can be used to obtain a correlation model.
3.2.3
Model Structure
To obtain a good black box model the model designer must choose an appropriate model structure. There are several options, here ARX and ARMAX
were considered.
A(q)y(t) = B(q)u(t) + e(t)
(3.1)
A(q)y(t) = B(q)u(t) + C(q)e(t)
(3.2)
Equation 3.1 and 3.2 gives the structure of the ARX and ARMAX models, respectively, where q represents the shift operator. The main difference
between them is the ARMAX structure possibilities to handle noise in a
better way. There is also a nonlinear version of the ARX, NARX. A linear
model did however suffice and tests with a NARX did not improve the model
performance and is therefore not a part of this report.
By choosing the order n of the polynomials A, B and C the model can
be defined by the vectors na, nb, nc and the delays, nk. Delays are just
as important as the order of the model and can affect the result very much
which will be shown later. Since the model is to be used for control it is
desirable to have as low order as possible to reduce the complexity while
still capturing the essential dynamics. Even with “unlimited” computational
power a higher order model does not mean a better model since also noise
and unwanted dynamics are captured.
The ARMAX parameters are estimated by a minimization of a robustified
quadratic prediction error criterion, the ARX parameters are also estimated
from the prediction error but by solving a least squares problem.[Matc] This
makes the ARX method faster which is a desired property in the initial design
phase where many different combinations need to be evaluated.
3.2.4
Inputs and Outputs
Sometimes it is not certain which signals are needed to get a good model.
Most of the times, the controlled inputs are known, but by experimenting
with measured disturbances a better fit might be obtained. These measured
disturbances can later be used for feedforward control. In this process there
are several measured variables such as temperatures, densities and vibration
amplitudes that could be used in the model, but not all of them will have
impact on the output. The ARX structure is a good structure for deducing
appropriate measured disturbances since it is very fast. When a suitable
21
combination of inputs and outputs have been found the model can be tuned
with these.
3.2.5
Model Validation
The right model is a model that fulfills its purpose, a model for simulating a
system does not have to be the same as the one that is used to derive control
laws for the same system. Before the model can be used it is important to
know approximately how well it will perform when given new data, i.e. validation data that was not used for the identification. All validation methods
below have drawbacks in some sense, but together they can provide a good
picture of how well the model will perform. An important tool is also of
course to inspect the shape of the produced model output.
Calculated Fit
In [Matc] and [Lju99] a mathematical interpretation of the result is suggested:
|y − ŷ|
· 100
(3.3)
F it = 1 −
|y − ȳ|
This gives a percentage where 100% indicates a perfect match. The fit varies
between different methods and what data is available. A simulation means
that only the input values are allowed. In control, it is however often more
important how well the model is able to predict the future and k-step prediction can be used (simulations are a special case of k-step prediction with
k = ∞). It is then allowed to use measurement from k-steps back to predict
the output, which leads to a better fit.
Residual Analysis
The remainder
ε(t) = y(t) − ŷ(t|θ̂N )
(3.4)
called the residuals can give useful information of how good the model is.
If the model has captured the dynamics of the true system, equation (3.4)
should not be 0, but white and uncorrelated with the input u. Whiteness
can be tested through the autocorrelation function
N
1 X
ε(t)ε(t + τ )
R̂ε (τ ) =
N t=1
22
(3.5)
and dependence of u through the cross-correlation function. [GL04], [GL03]
N
1 X
R̂εu (τ ) =
ε(t)u(t − τ )
N t=1
(3.6)
Correlation model
The correlation model previously used to gain insight of the model can also
be used for validation to some extent. By comparing the step response from
the correlation model with the one from the parametric model the confidence
in the model can increase if they match. A good match also here means that
two completely different methods gives similar results, however, a bad match
should not disqualify the model since the correlation model can be wrong as
well.
3.3
Grey/Black Box Modelling
If the parameters are not entirely known or if just basic physical relationships,
such as the transfer function
G(s) =
K
e−θs
sτ + 1
(3.7)
is known, a grey model approach could be used. By this approach parameters
are not “wasted” on already known relationships. The parameters are then
fit to a already known model structure in a similar manner as with black box
modeling. There are however often more information about the parameters
when using a grey box, for instance in equation (3.7) it might be known that
3 s < τ < 7 s.
Later in the thesis, the transfer function in equation 3.7 will be used.
Even though the structure then is assumed and not known, the name grey
box will be used to distinguish different models in the thesis, even though it
technically is a black box.
3.4
Experiment Design
When performing the system identification, there were unfortunately difficulties with using an automated PRBS since the process left the interesting
operation point even at small deviations from zero (plus offset). Thus, it was
necessary to generate the inputs manually. This makes the system closed
23
and not open-loop, effects of bias have not been investigated further since
this was realized when all experiments already had been performed.
Data was sampled rather fast with a sampling time of T = 0.1 s and
can in the modelling process be resampled to the desired T . Figure 3.2-3.4
shows the frequency content of the input signals. Since it is assumed that
the feed pump should deliver a constant flow, that signal has been left out
(see chapter 4).
Periodogram R Control Signal
10
10
5
Amplitude
10
0
10
−5
10
−10
10
−2
10
−1
0
10
10
Frequency (Hz)
1
10
Figure 3.2: Fourier analysis of recirculation pump control signal
As is shown in the figures, frequencies around the desired bandwidth of
0.01 Hz have been excited except with the recirculation pump control signal.
The experiments were performed during two different days and later merged
together. When merging, it is important to remove transients between the
experiments, this is done when using the function merge from System identification toolbox. The theory behind how these are merged can be found in
[Lju99, Ch. 14.3].
24
Periodogram LP Control Signal
10
10
5
Amplitude
10
0
10
−5
10
−10
10
−2
10
−1
0
10
10
Frequency (Hz)
1
10
Figure 3.3: Fourier analysis of light phase control signal
Periodogram HP Control Signal
10
10
5
Amplitude
10
0
10
−5
10
−10
10
−2
10
−1
0
10
10
Frequency (Hz)
1
10
Figure 3.4: Fourier analysis of heavy phase control signal
25
3.5
Black Box based on Control Signals
It did exist data from previous experiments, but these experiments were
not performed with identification in mind and were not good enough (furthermore, the control signals were not logged). Since there exists no prior
information of how the process depend on the control signals sent to the
pumps and valves a black box system identification had to be made. The
inputs were:
(3.8)
u = ρI uR uHP uLP
where ρI is a measured disturbance, and with outputs:
y = pLP pHP qHP ρHP
(3.9)
The sampling time is chosen so that the sampling frequency is approximately ten times the desired bandwidth of the closed loop system. [Lju99].
A desired closed loop bandwidth of 0.1-0.2 Hz then gives T = 0.5 s. The
relatively high bandwidth is explained by the fact that the flows changes
rather fast which calls for a higher bandwidth.
3.5.1
Preconditioning
A periodic signal with frequency 0.2630Hz was found in the density signal
which is shown in the Fourier analysis in figure 3.5. The data was therefore
prefiltered with a fifth order butterworth filter (standard in System Identification Toolbox). A cut-off frequency of 0.2Hz did not suffice (see figure 3.5(b)),
0.1Hz did (see figure 3.5(c)). A stop band filter around the frequency did not
give better results. In section 6.4 the influence of these periodic signals will
be discussed, but it can already here be seen that it causes problems because
in order to filter out the signal, a filter close to the desired bandwidth of the
system must be used. The source of the periodic signal is still unknown, but
one hypothesis is that the pump wheel at the heavy phase outlet from the
separator causes it.
To maintain input-output relationships, all signals must be filtered through
the same filter. [Lju99] This filter also gives the pressure signal a nicer shape
(filters out rapid fluctuations), and since the pressure do not need any precise
control, it does not matter if it is filtered at a low frequency.
3.5.2
Model
Initially different ARX-models were used to get a indication of the orders.
The model was then identified using four separate ARMAX models which
26
later are concentated into one with inputs and outputs according to (3.8)
and (3.9). The chosen models are given in table 3.1.
Model
Output variable na
nb
nc
AMX6641
qHP
6 [6 6 6 6] 4
[1 1
AMX4463
pLP
4 [4 4 4 4] 6
[3 1
AMX88610
pHP
8 [8 8 8 8] 6 [10 1
AMX8241
ρHP
8 [2 2 2 2] 4
[1 1
nk
1 1]
1 1]
1 1]
1 1]
Table 3.1: Considered ARMAX models with corresponding orders
3.5.3
Model Validation
The purpose of this model was to give an overview of how the system was
coupled. Because of the problems with the periodic signal and the bandwidth,
some more time should be spent on the model before it can be used for control
purposes. It gives a good fit, but does not pass a residual test. The fit of
the models to the different validation sets are presented in table 3.2 where it
can be seen that the prediction of the HP mass flow is the most difficult to
predict.
This was expected as the pressures are closely related to the heavy and
light phase valve control signals and the density behaves rather linear in the
operating range. If the curves are observed in figure 3.6 it can be seen that
even if the fit is bad the predicted output follows the measurement very well,
even at 40-step ahead prediction which is a rather long period of time when
predicting the flow.
Model
AMX6641 (k = 20)
AMX6641
AMX4463
AMX88610
AMX8241
Output variable
qHP
qHP
pLP
pHP
ρHP
Fit [%]
41.29, 44.43, -17.6, 56.01
-39.1, -26.74, -188.5, -2.766
70.26, 78.22, 55.40, 70.66
61.59, 64.78, 41.88, 67.90
81.21, 82.10, 84.36, 82.93
Table 3.2: Model fit for k = 40-step ahead prediction (20s).
27
Fourier analysis
−2
10
DT221
−3
10
−4
10
Amplitude
−5
10
−6
10
−7
10
−8
10
−9
10
−4
10
−3
10
−2
−1
10
10
0
1
10
10
Frequency [Hz]
(a) Frequency analysis of HP density.
Fourier analysis
−2
10
DT221
−3
10
−4
Amplitude
10
−5
10
−6
10
−7
10
−4
10
−3
10
−2
−1
10
10
0
1
10
10
Frequency [Hz]
(b) Filtered density signal using a butterworth filter with cut-off frequency 0.2 Hz.
Fourier analysis
−2
10
DT221
−3
10
−4
Amplitude
10
−5
10
−6
10
−7
10
−4
10
−3
10
−2
−1
10
10
0
10
1
10
Frequency [Hz]
(c) Filtered density signal using a butterworth filter with cut-off frequency 0.1 Hz
Figure 3.5: Fourier analysis of HP density, unfiltered and with two different
butterworth filters.
28
Measured and 40 step predicted output
Measured and 40 step predicted output
6.4
AMX4463
True value
7
6.8
6.2
6.6
6.4
6
6.2
6
5.8
5.8
5.6
5.6
5.4
5.2
5.4
AMX88610
True value
1000
1500
2000
Time
2500
5
3000
1000
(a) HP Pressure
1500
2000
Time
2500
3000
(b) LP Pressure
Measured and 40 step predicted output
Measured and 40 step predicted output
AMX8241
True value
1.075
4
1.07
1.065
3.5
1.06
3
1.055
2.5
1.05
2
1.045
1.5
1.04
1.035
1
1.03
0.5
1.025
1000
1500
2000
Time
2500
3000
1000
(c) HP Density
1500
2000
Time
2500
3000
(d) HP Mass flow
Figure 3.6: 40-step ahead prediction (20 s) of model based on control signals
plotted against the true measured value.
29
3.6
Density Grey Box based on Mass Flows
The white box model was based on a principle with mass flows in the process
determining the density. A similar approach was used here where the flows
were considered as inputs and the density the output. It was tried to use the
dry fractions, but modeling with the density gave a better result. Through
ARX testing and based on knowledge of the process, it was found that the
inlet density, ρI , should be used as a measured disturbance, something that
also seems logical since it has a large impact on the heavy phase density. The
final inputs to the model becomes:
(3.10)
u = qHP ρI qR
with output:
y = ρHP
(3.11)
These are the same as in the black box model presented in the next section
which makes it possible to compare the two different models. Because the
flows are just inputs here and the output is much slower than in the previous
model, the sampling time can be longer. The chosen sampling time was
T = 1 s, but could probably be higher (slower samplingrate) as the desired
bandwidth is approximately 0.05-0.01 Hz. Since the density also shows faster
behavior and computational power is not a big problem, the sampling time
of one second was chosen.
From the earlier experiments it could be concluded that the heavy phase
density approximately can be described by a first order system with a time
delay. This information can be used in the modelling and a grey box model
where the gain, time constants and delays are approximated was derived.
The choosen model structure can be related to a mass balance of the system
since the inlet flow and therefore also the summed outflow of the separator
is constant:
G(s) =
K2 −θ2 s
K3 −θ3 s
K1 −θ1 s
e
uqR (s)+
e
uqHP (s)+
e
uρI (s) (3.12)
sτ1 + 1
sτ2 + 1
sτ3 + 1
A second order, continuous time ARMA model for the additive noise is also
added to equation 3.12. Considering the simplicity, the model gave quite
good results. Second order models and models with imaginary poles were
tested as well but gave either no or only slightly better performance. The
parameters were estimated as:
30
τHP-flow
KHP-flow
θHP-flow
τR
KR
θR
τ ρI
Kρ I
θρI
=
=
=
=
=
=
=
=
=
11.1851
−0.0131
0
14.2646
0.0116
5
1
0.7525
0
(3.13)
The predicted output can be seen in figure 3.8 together with a black box
model and the fit to the four different experiment sets was 87.46%, 87.11%,
87.02% and 86.88%. Step responses from the model are shown in figure 3.10.
Figure 3.7 shows the residual analysis of the model. The yellow area in the
figure corresponds to the confidence interval and values outside of that area
indicates a failed residual test. Unfortunately the residual analysis for the
Grey box model shows clear correlation of the output. Even if the model did
not pass all test, the grey box will be used during the analysis in chapter 4.
Correlation function of residuals. Output HP Density
Cross corr. function between input Inlet Density and residuals from output HP Density
0.1
1
0.05
0.5
0
0
−0.05
−0.5
0
5
10
15
20
25
lag
Cross corr. function between input HP Mass Flow and residuals from output HP Density
0.1
0.05
0.05
0
0
−0.05
−0.1
−25
−0.1
−25
−20
−15
−10
−5
0
5
10
15
20
25
lag
Cross corr. function between input R Mass Flow and residuals from output HP Density
0.1
−0.05
−20
−15
−10
−5
0
lag
5
10
15
20
−0.1
−25
25
(a)
−20
−15
−10
−5
0
lag
5
10
15
20
25
(b)
Figure 3.7: Residual analysis of for the Grey box model.
3.7
Black Box based on Mass Flows
The inputs, output and sampling time were the same as in the grey box. The
most promising models are presented in table 3.3:
Their predicted outputs can be seen in figure 3.8 and figure 3.9 with their
step response in 3.10. The residual analyses are shown in figure 3.11. The
31
Model
na
AMX6622 6
AMX6422 6
AMX4422 4
nb
nc
nk
[6 6 6] 2 [2 4 3]
[4 4 4] 2 [2 4 3]
[4 4 4] 2 [2 4 3]
Fit [%]
63.50, 64.03, 62.04, 63.63
84.49, 84.08, 84.96, 85.15
51.22, 51.76, 51.73, 51.32
Table 3.3: Considered ARMAX models with fit for the four different validation data sets at a 20-step ahead prediction (20 s)
fit of AMX6422 is the highest, but this model on the other hand shows more
oscillations than the others, plus it does not pass the validation test because
of the cross correlations. The step response from recirculation flow to the
density also shows a characteristic minimum phase behavior which not have
been observed in the real process. AMX4422 passes the validation test and
have a good fit and the smoothest shape, the model does however have an
unstable pole which can be seen in the step response. Thus, the chosen
model is AMX6622 since it is the only on that passed all the tests previously
defined.
The step responses in figure 3.10 also gives a good description of how
the system works. By decreasing the HP flow or increasing the recirculation
the density will rise and vice versa. It can also be seen that the measured
disturbance have a large impact on the heavy phase density.
32
Measured and 20 step predicted output
Measured and 20 step predicted output
1.08
1.08
1.075
1.075
1.07
1.07
1.065
1.065
1.06
AMX6622
Process model
True value
1.06
1.055
1.055
1.05
1.05
1.045
1.045
1.04
1.04
AMX6622
Process model
True value
1.035
1.03
4000
4200
4400
4600
4800
Time
5000
5200
5400
1.035
1.03
4000
5600
4200
4400
4600
(a)
4800
5000
Time
5200
5400
5600
5800
(b)
Measured and 20 step predicted output
Measured and 20 step predicted output
1.075
1.08
1.07
1.07
1.065
1.06
1.06
1.055
1.05
1.05
1.045
1.04
1.04
1.035
AMX6622
Process model
True value
1.03
4000
4200
4400
4600
Time
4800
5000
1.03
5200
AMX6622
Process model
True value
1000
(c)
1500
2000
Time
2500
3000
(d)
Figure 3.8: 20-step ahead prediction (20 s) of models compared to four different validation sets (measured values). Here, AMX6622 and the process
model can be seen.
33
Measured and 20 step predicted output
Measured and 20 step predicted output
1.075
1.075
1.07
1.07
1.065
1.065
1.06
1.06
1.055
1.055
1.05
1.05
1.045
1.045
1.04
AMX6422
AMX4422
True value
1.035
1.04
AMX6422
AMX4422
True value
1.035
1.03
4000
4200
4400
4600
4800
Time
5000
5200
5400
5600
4000
4200
4400
4600
(a)
4800
5000
Time
5200
5400
5600
5800
(b)
Measured and 20 step predicted output
Measured and 20 step predicted output
1.09
1.08
AMX6422
AMX4422
True value
1.075
1.08
1.07
1.065
1.07
1.06
1.06
1.055
1.05
1.05
1.045
1.04
1.04
AMX6422
AMX4422
True value
1.035
1.03
4000
4200
4400
4600
Time
4800
5000
1.03
5200
1000
(c)
1500
2000
Time
2500
3000
(d)
Figure 3.9: 20-step ahead prediction (20 s) of models compared to four different validation sets (measured values). Here, AMX6422 and AMX4422 can
be seen.
34
−3
−3
Step Response
x 10
Step Response
x 10
Process model
Correlation model
AMX6622
AMX6422
AMX4422
0
−2
14
12
10
−4
8
−6
6
−8
4
−10
Correlation model
AMX6422
AMX4422
AMX6622
Process model
2
−12
0
−14
0
50
100
150
0
50
Time
100
Time
150
200
(a) Step response in HP massflow to (b) Step response in recirculation massheavy phase density
flow to heavy phase density
Step Response
2
1.5
1
0.5
0
Correlation model
AMX6422
AMX4422
AMX6622
Process model
−0.5
0
20
40
60
80
100
120
140
Time
(c) Step response in inlet density to HP
density
Figure 3.10: Step responses of all the different models and the resulting heavy
phase density.
35
Correlation function of residuals. Output HP Density
Cross corr. function between input Inlet Density and residuals from output HP Density
0.04
1
0.02
0.5
0
0
−0.02
−0.5
0
5
10
15
20
25
lag
Cross corr. function between input HP Mass Flow and residuals from output HP Density
0.04
0.02
−20
−15
−10
−5
0
5
10
15
20
25
lag
Cross corr. function between input R Mass Flow and residuals from output HP Density
0.04
0.02
0
0
−0.02
−0.04
−25
−0.04
−25
−0.02
−20
−15
−10
−5
0
lag
5
10
15
20
−0.04
−25
25
−20
−15
(a) AMX6622
−10
−5
0
lag
5
10
15
20
25
(b) AMX6622
Correlation function of residuals. Output HP Density
Cross corr. function between input Inlet Density and residuals from output HP Density
0.04
1
0.02
0.5
0
0
−0.02
−0.5
0
5
10
15
20
25
lag
Cross corr. function between input HP Mass Flow and residuals from output HP Density
0.04
0.02
−20
−15
−10
−5
0
5
10
15
20
25
lag
Cross corr. function between input R Mass Flow and residuals from output HP Density
0.04
0.02
0
0
−0.02
−0.04
−25
−0.04
−25
−0.02
−20
−15
−10
−5
0
lag
5
10
15
20
−0.04
−25
25
−20
−15
(c) AMX6422
−10
−5
0
lag
5
10
15
20
25
(d) AMX6422
Correlation function of residuals. Output HP Density
Cross corr. function between input Inlet Density and residuals from output HP Density
0.04
1
0.02
0.5
0
0
−0.02
−0.5
0
5
10
15
20
25
lag
Cross corr. function between input HP Mass Flow and residuals from output HP Density
0.04
0.02
−20
−15
−10
−5
0
5
10
15
20
25
lag
Cross corr. function between input R Mass Flow and residuals from output HP Density
0.04
0.02
0
0
−0.02
−0.04
−25
−0.04
−25
−0.02
−20
−15
−10
−5
0
lag
5
10
15
20
−0.04
−25
25
(e) AMX4422
−20
−15
−10
−5
0
lag
5
10
15
(f) AMX4422
Figure 3.11: Residual analysis of the three AMX-models.
36
20
25
3.7.1
Refinements
In the future it would be possible to include the pressures in a similar model,
but a slightly different identification must be performed in that case. Basically, it is a problem with causality since a change in the control signal
→ changed pressure → changed flows → changed density. It would then be
impossible to model the pressure based on the changed flows since they both
are states. To solve this, the reference for the flow can be the input in the
experiment instead of the control signal.
After the final experiments it was found out that the following orders and
delays gave much better results when modelling the black box model based
on the reference signals:
na = 6
nb = 4 4 4
nc = 2
nk = 3 4 2
The orders are the same that was tested before, but now with slightly
different delays, which gave very different result. The fit was 79.41%, 80.23%,
80.57% and 80.05% and the predicted output is shown in figure 3.12 and the
residual analysis in figure 3.13. Even though there are two data points just
outside the confidence interval, the model still shows very good correlation
results. If the work is to be continued, this model should be used instead.
37
Measured and 20 step predicted output
Measured and 20 step predicted output
1.08
1.07
AMX6423
True value
1.075
1.065
1.07
1.065
1.06
1.06
1.055
1.055
1.05
1.05
1.045
1.045
1.04
1.04
AMX6423
True value
4200
4400
4600
4800
5000
5200
5400
1.035
1.03
4000
5600
4200
4400
4600
4800
Time
(a)
5000
Time
5200
5400
5600
5800
(b)
Measured and 20 step predicted output
Measured and 20 step predicted output
1.075
1.07
1.07
1.065
1.065
1.06
1.06
1.055
1.055
1.05
1.05
1.045
1.045
1.04
1.04
1.035
1.035
AMX6423
True value
1.03
4000
4200
4400
4600
Time
4800
5000
AMX6423
True value
1.03
5200
1000
1500
2000
Time
(c)
2500
3000
(d)
Figure 3.12: 20-step ahead prediction (20 s) of the refined model compared
to four different validation sets (measured values).
Correlation function of residuals. Output HP Density
Correlation function of residuals. Output HP Density
1
1
0.5
0.5
0
0
−0.5
0
5
10
15
20
25
lag
Cross corr. function between input HP Mass Flow and residuals from output HP Density
0.04
0.02
0.02
0
0
−0.02
−0.04
−25
−0.5
0
5
10
15
20
25
lag
Cross corr. function between input HP Mass Flow and residuals from output HP Density
0.04
−0.02
−20
−15
−10
−5
0
lag
5
10
15
20
−0.04
−25
25
(a) AMX6423
−20
−15
−10
−5
0
lag
5
10
15
20
(b) AMX6423
Figure 3.13: Residual analysis of the refined AMX-model.
38
25
Chapter 4
Control of the Separation
Process
The main goal of the thesis is to design a control law for the system and
by the end of this chapter, the reader should have a good understanding of
the different choices made in the design process of the control strategy. First
MPC will be introduced so that the reader will be able to follow the reasoning
in the future sections. Then the different choices of the control strategies are
given. The sections after that concerns analysis of the chosen strategy.
The original control scheme that existed prior to this thesis did actually
perform quite well and it was able to keep the density up by the help of a
PID-controller while another controller managed the heavy phase flow. Ordinary PID-controllers are however not ideal if there are constraints (e.g. the
Operating Conditions in section 2.5) that need to be handled in the process,
in such cases MPC (Model Predictive Control) is often a good approach.
Besides the operating conditions in section 2.5, it is also important to
have a good separation. Since the separation efficiency cannot be measured,
only visually inspected through sightglasses, in the current experiment rigg,
it is assumed that it is good as long as the pressure levels are within the limits
and the inlet mass flow is low enough, i.e. below the flow that the separator
theoretically should be able to handle and still have full separation. This
assumption is based on the theory about separator area equivalency and
KQ-numbers given in Appendix B.
4.1
Model Predictive Control
Model Predictive Control (MPC) has its roots in the sixties and seventies
and is common in the process industry. Technically speaking, MPC is not
39
just one control strategy but many which share the approach where the
future behavior is predicted using a model of the process. Based on these
predictions, an optimal control signal is calculated in every time step.
This online optimization could be demanding considering computational
power and has therefore mostly been used in slower processes (such as petrochemical). However, as the computers and processors become faster and
faster, MPC can also be used in faster processes.
The control signals sent from the MPC are the Manipulated Variables
(MV) and these correspond to the controlled inputs in the model the MPC
is based upon (for example the heavy phase flow and the recirculation flow).
There are also Measured Disturbances (MD) which can be used for feedforward control and finally Measured Outputs (MO) which are the signals that
are to be controlled.
As written above, there exists different MPC strategies and there are
many tools for implementing the controller. Here, the Mathworks MPC
Toolbox has been used which together with the OPC Toolbox (see chapter
5) made it possible to implement it through Matlab/Simulink. MPC will be
explained with the MPC Toolbox as a starting point and only used functionality will be covered, interested readers are referred to [Mata].
The toolbox solves the optimization problem:
min
∆u(k|k),...,∆u(m−1+k|k),ε
( p−1 ny
X X y
w
i+1,j (yj (k
i=0
2
+ i + 1|k) − rj (k + i + 1)) +
j=1
nu
X
∆u
wi,j ∆uj (k + i|k)2 +
j=1
nu
X
!
u
wi,j (uj (k + i|k) − ujtarget (k + i))2
)
+ ρε ε2
j=1
(4.1)
where ny are the number of outputs and nu the number of inputs, subject
to:
u
u
ujmin (i) − εVjmin
(i) ≤ uj (k + i|k) ≤ ujmax (i) − εVjmax
(i)
∆u
∆u
∆ujmin (i) − εVjmin (i) ≤ ∆uj (k + i|k) ≤ ∆ujmax (i) − εVjmax (i)
y
y
yjmin (i) − εVjmin
(i) ≤ yj (k + i|k) ≤ yjmax (i) − εVjmax
(i)
(4.2)
i = 0, . . . , p − 1 ∆u(k + h|k) = 0 h = m, . . . , p − 1 ε ≥ 0
The equation and the different terms of the optimization problem will be
described below.
40
4.1.1
Horizons
The prediction horizon, p, sets the number of samples into the future the
controller predicts. The control horizon, m, sets how many control moves
that are anticipated. After the control horizon, the last control move is held
constant. The term containing ∆u, equals zero from the end of the control
horizon to the end of the prediction horizon. In short it can be said that a
shorter horizon leads to faster control, but this is dependent on combination
of the two values.
4.1.2
Constraints
One of the main advantages of MPC is the possibility of easily incorporating constraints (4.1). Constraints on u limits the MV to be within certain
limits while constraints on ∆u limits how much the control signal may differ
between control instances. The constraints on y sets the allowed values for
the output.
By using these in the optimization and calculation of the control signal,
it is possible to foresee hitting upcoming constraints and thereby adapt to
the situation. Compare this to for instance a PID which hits a constraint on
the control signal and saturates, any countermove will be performed when
the constraint already has been hit. With MPC it is possible to operate
just inside the limits. The weight ρε affects the slack variable (relaxes the
constraints) and how much violations of the constraints are punished. [Mata,
Mac02]
Constraint Softening
Constraints can be either hard or soft. A hard constraint (V = 0 in equation
(4.2)) means that it must hold at all times while a soft (V = 1) can be
broken. Initially all constraints are hard, but some can be allowed to soften
if infeasible results of the optimization problem are apparent. Inputs are often
hard (it is for example impossible to give more than 100%) while outputs are
softened. [Mata]
4.1.3
Weights
By adjusting the weights, w, in the optimization problem it is possible to
change the behavior. Basically a large weight punishes the variable while
a zero weight lets the variable move freely within its constraints. The first
term involving wy weights the difference between the output y and r. Thus,
a large wy punishes tracking errors. A large w∆u means that ∆u should be
41
kept small, i.e. it punishes control moves and the system becomes slower.
[Mata, Mac02]
The weight, wu , is not always included in MPC controllers (compare to
formulation in [Mac02]), but punishes deviations between a desired setpoint
for the manipulated variable, ujtarget , and the manipulated variable. As will
be seen later, this weight is of high importance in this project.
4.1.4
Estimation
Since the states of the MPC are not directly measurable a state estimator
must be used and the properties of this also affects the performance. An
often used method is Kalman filters where the designer by the Kalman gain
can decide how much to trust the new measurements. If the signals are noisy
the measurements should not be trusted and thereby having a lower gain.
Sudden and real changes could then be considered as noise and thus it would
take longer time to incorporate that change compared to if the Kalman gain
was high. [Mata], [TBF05]
4.2
MPC Toolbox
As written above, there are many different commercial software for implementing MPC, here the Mathworks MPC Toolbox have been used. This was
chosen because it is relatively powerful and it is possible to use the familiar
Simulink environment. A more thorough explanation of the functions can be
found in [Mata].
4.2.1
Estimation
The noise model in the identification process is automatically included in
the MPC’s output disturbance model, when a System Identification Toolbox
object is added as a plant model in the MPC. To reject constant disturbances
there are also integrators added to each measured output channel. It uses a
Kalman filter to estimate the state.
4.2.2
Feedforward
If disturbances are known in advance, these can be feedforwarded and thus
compensated for before they enter the process. All measured disturbances
are automatically feed forwarded if connected to the Simulink block. In the
implemented controller the feedforward is of less importance since the density
42
sensor is situated right before the separator, giving a approximate time of 2s
before the disturbance has entered the system. The MPC is only controlling
the slow acting density and can thus not act based on sudden disturbances.
If the setup were altered or another strategy were used, feedforwarding
could prove very useful. If for instance all measurements on the feed are
made right after it leaves the tank and thereafter needs to travel a period of
time before reaching the separator, the disturbances could be compensated
for (for instance a sudden drop in density etc.).
4.2.3
Bumpless transfer
Since the MPC will not control the process all the time it is important not to
get any undesired behavior when switching between controllers (in this case,
from TwinCAT to Simulink, see section 5.2). Such undesired behavior could
be “bumps” in the control signal and thus also the output signal due to the
abrupt shift of controller. By letting the MPC track the true manipulated
variables, even when it does not control the process, the overlap between the
change from manual to automatic control can be made smooth since at the
switching instant the manipulated variable from the MPC is identical to the
one used previously. The MPC will then smoothly change the manipulated
variable to the desired value.
4.2.4
Controller Extraction
Analysis of model predictive controllers can often be difficult. When it hits a
constraint it becomes nonlinear, but when operating inside of its boundaries,
ordinary tools of analysis can be used. In the MPC toolbox it is possible to
export a linear controller (using the ss-command in Matlab), this model does
however only include the model, the horizons, sampling time and the weights.
Other information concerning for example the estimation, which can have
a large impact on the performance can not be analyzed and simulations is
therefor necessary. The extracted controller gives transfer functions r → M V
and M O → M V .
4.3
Robustness
Even though the grey box model was not used for the MPC it can still be used
in the analysis. In this process it is rather easy to define the uncertainty in the
time-domain. Thanks to the structure with K, τ and θ, it is easy to specify
the uncertainty of the model and analyze the robustness. The tool used for
43
this is the Mathworks Robust Control Toolbox. The function robuststab
uses an algorithm where the uncertainty is transformed into the frequencydomain, it checks for nominal stability and then solves a µ-synthesis problem
to check that the poles remains stable. The function returns an upper and
lower bound of the robust stability margin. Values larger than 1 indicates
that the whole uncertainty set is stable. [Matb]
The uncertain parameters, i.e. K, τ and T , are given nominal values
which are the same as the ones calculated in the grey box identification.
These are then allowed to vary within certain limits according to
5 < τHP-flow
−0.1 < KHP-flow
1 < θHP-flow
5<
τR
0.001 <
KR
1<
θR
0.2 <
τρI
0.2 <
KρI
1<
θ ρI
< 15
< −0.01
< 10
< 20
< 0.02
< 10
< 10
<2
< 10
(4.3)
The toolbox can however not handle uncertain delays and instead a second
order Padé approximation is used:
GP ade (s) =
θ 2
s
12
θ 2
s
12
− 2θ s + 1
+ 2θ s + 1
(4.4)
The uncertain θ can then be included. The robustness analysis in practice
thus controls robustness against a non-minimum phase system with a nonminimum phase zero instead of one with a time-delay.
It is not sufficient to check stability from the reference to the output.
Figure 4.1 shows a block diagram of the output with added disturbances.
For stability the following transfer functions needs to be stable:
S=
T =
Gc =
SG =
GFy =
SFr =
1
1−GFy
GFy
1−GFy
GFr
1−GFy
G
1−GFy
Fy
1−GFy
Fr
1−GFy
(w → z, wu → u)
(4.5)
(n → z)
(4.6)
(r → z)
(4.7)
(wu → z)
(4.8)
(n → u)
(4.9)
(r → u)
(4.10)
44
Note that positive feedback have to be used when analyzing the extracted
controller.
wu
r
Fr
w
S
Process
S
z
S
n
Fy
Figure 4.1: Block diagram of controlled process with disturbances.
4.4
Control Strategies
There are many different ways of controlling this process and there are as
many MPC configurations as there are ways to model the process. The main
concern with the original design is that it is completely decentralized, it is
however worth noting that a decentralized controller does not automatically
give worse performance than a centralized. This section investigates and motivates the choice of control strategy for the separation process. Motivations
of why certain actuators were chosen to control certain flows are given in
next section.
4.4.1
Decentralized Control
The original control design, [HD09], was decentralized and is shown in figure
4.2, with symbols according to figure 4.3 and where a shaded controller means
that it is inactive. There were four different PID-controllers configured as in
table 4.1.
4.4.2
Modified Decentralized Control
The original control strategy can be modified by adding a cascaded controller
(see figure 4.4) where the inner loop controls the recirculation flow and the
outer loop controls the density. The idea with cascaded controllers is that
45
Actuator
Feed pump
Recirculation pump
LP Valve
HP Valve
r
11-13 ton/h
1.065-1.070kg/dm3
2m3 /h
4-8 bar
u
y
0-100%
qI
0-100% ρHP
0-100% QHP
0-100% pHP
Table 4.1: PID-configuration of the original decentralized control strategy.
One PID per actuator.
Actuator
r
Feed pump
11-13 ton/h
Recirculation pump (inner loop)
0-1.5 ton/h
- (outer loop)
1.065-1.070 kg/dm3
LP Valve
HP Valve
2 ton/h
u
y
0-100% qI
0-100% qR
ton/h ρHP
0-100% qHP
Table 4.2: PID-configuration of the modified decentralized control strategy.
One PID per actuator (except outer loop).
the inner loop is much faster than the outer loop. The outer controller
thus considers the control signal (i.e. the setpoint to the inner loop) as being
realized immediately because of the different time scales they operate in. The
control is still decentralized, but now there is also the possibility of controlling
the recirculation flow by setting its setpoint. The PID configurations (which
variable the actuator controls) also have been changed and will be explained
in section ??.The final block diagram and configuration is seen in figure 4.5
and table 4.2, respectively.
4.4.3
Reference Control MPC
One way of implementing MPC is to let it control the reference values of
underlying controllers, meaning that the manipulated variables of the MPC
are the setpoints for the PID-controllers (e.g. flow rate or pressure). This
makes the whole control into a cascaded one with the MPC as the outer loop
for the PID-controllers (which are configured as in the modified decentralized
strategy with the exception that the PID controlling the density is deactivated). In this configuration the multivariable MPC controls the density by
setting the reference value for the recirculation flow and the heavy phase flow
while the feed flow setpoint is held constant.
During the concept stage it is more flexible to omit the pressures from the
46
PID
HP flow
PID
HP pressure
HP
LP
PID
HP density
R
From tank
F
PID
F flow
Figure 4.2: Original decentralized control strategy
C with the PID’s and what
they control.
y
C
y
C
y
(a)
(b)
(c)
Figure 4.3: Block diagram legend a) Controller type, C, and controlled variable y, b) Pump c) Valve
r
S
-
PID
S
-
PID
Pump
Process
y
Inner loop
Outer loop
Figure 4.4: Cascade controller
MPC as this gives more alternatives to vary the pressures during the experiments. It is for instance very likely that the pressures affect the separation
efficiency, by constraining the pressures within certain limits the flexibility
of future experiments would be degraded. That is also the reason why the
47
PID
LP pressure
PID
HP flow
HP
LP
PID
PID
HP density
R flow
R
From tank
F
PID
F flow
Figure 4.5: Decentralized control strategy, where the shaded LP controller is
inactive
LP valve is not controlled by the MPC.
This approach has advantages when it comes to the implementation since
it is possible to run TwinCAT in the background and let Simulink handle the
MPC and just set the setpoints for the controllers in TwinCAT. The MPC
can then easily be switched on and off by choosing where TwinCAT should
get the reference values. The idea of controlling reference values is also very
practical during experiments because when some tuning to the MPC needs
to be done, TwinCAT will hold the process at the last reference values while
the MPC can be tuned. Later, the MPC can resume setting the setpoints.
More about this in chapter 5. The resulting strategy is shown in figure 4.6.
4.4.4
Control Signal MPC
The final option is to let a MPC manipulate the control signals directly.
Theoretically there is no reason why this control strategy would not work
(even though it is hard to say how well it would perform without further
analysis). The MPC would be able to control the flow and density of the
heavy phase as well as the pressures without setting any reference values to
underlying controllers, but by controlling the actual actuators. This strategy
is however not preferred because if the MPC fails, there is no underlying
controllers that can control the system.
Also, when the implementation strategy was chosen, the intention was to
48
MPC
HP density
PID
LP pressure
PID
HP flow
HP
LP
PID
PID
HP density
R flow
R
C
From tank
y
F
PID
F flow
Figure 4.6: MPC controlling reference signals to PID’s. The PID controlling
the density has now been deactivated.
control a rather slow process and the sampling rate could then be quite low.
When manipulating the control signals the MPC also has to control the flows
which needs faster control. It is thus uncertain if this control strategy at all
is possible to implement with the current experiment setup and software.
4.4.5
Chosen Strategy
The chosen control strategy is thus to have an underlying decentralized control, but with a MPC that can be switched on to give a multivariable control
of the process. This was chosen due to the high probability of success in the
implementation and experimental flexibility.
4.5
Decentralized Input-Output Pairing
In parallell with the work in the previous section, the task of deciding which
actuators that should control which variables was carried out. For example;
the heavy phase flow can be controlled both by the heavy and the light
phase valves, as well as the two pumps in the system. This section explains
the input-output pairings of the underlying decentralized controllers to the
49
reference control MPC, why the heavy phase valve controls the heavy phase
flow and other similar choices.
4.5.1
RGA
Relative Gain Array, RGA, is a frequency dependent measure of how strong
connections and interactions there are between different inputs and outputs.
It can be used to decide which input-output pairing that should be chosen
and which actuators should control which flows. In this process there are
however many other aspects to consider as well and in the end, even though
there are four actuators there are combinations that would not work at all
which will be shown later.
The measurement of interaction is given by the RGA matrix


λ11 λ12 · · · λ1n
 λ21 λ22 · · · λ2n 
∆

RGA(G) = Λ(G) = G × (G−1 )T = 
(4.11)
· · · · · · · · · · · · 
λn1 λn2 · · · λnn
of a MIMO system G(iω), where × is an elementwise multiplication and with
elements according to
open-loop gain
(4.12)
λij =
closed-loop gain For loop i under the control of mj
where the closed loop gain assumes perfect control of other output variables
than i. [OR94, SP96]
RGA-elements of 1 indicates that for this input-output pairing, the other
control loops does not affect the current one and this is thus the ideal pairing.
A RGA-element value of 0 means that the corresponding input does not affect
the output directly at all. Negative pairings should be avoided since this can
lead to instability if the other loops are opened. The columns in the RGA
matrix corresponds to the inputs while the rows represents the outputs. For
a complete overview of RGA the reader is referred to [OR94] or [SP96].
4.5.2
Controlling the Heavy Phase Density
Even if the valves affect the heavy phase density, they do so by changing
the flow. Therefor, having any of the valves to control the density would be
unwise since it would compensate for the decreasing density by decreasing the
heavy phase flow which eventually would make the process to stop functioning
as the flow gets too low.
50
The two actuators that affects how much yeast that enters the separator
(and thus the heavy phase density) are the feed pump and the recirculation
pump. Since the feed pump needs to be kept at a constant level to ensure that
the separation assumption holds, the only choice is to let the recirculation
pump control the density.
4.5.3
Controlling the Heavy Phase Flow
Since the recirculation pumps is used for controlling the density, there are two
options when constructing the controller for the heavy phase flow; using the
light or heavy phase valve. Both options have advantages and disadvantages.
Due to the configuration of the process, where the recirculation pump
is connected before the heavy phase valve (see figure 2.1), the heavy phase
valve could have problems with controlling the heavy phase flow. The valve
regulates the pressure which alters the flow, when the recirculation pump is
run at high speed the flow and pressure before the valve is affected because
of the pump. The ability to control the heavy phase flow could thus be
compromised.
The light phase valve is not affected by the recirculation flow, it is however
connected to another problem. To lower the flow in the heavy phase with
the light phase valve, the valve must give a lower back pressure in the light
phase. This is only possible until a certain point. When the backpressure
becomes too low, there occur problems with cavitations that could damage
the equipment.
A RGA analysis could help to solve the problem and the following inputs
and outputs are used:
u = uR uHP uLP
(4.13)
y = qHP ρHP
(4.14)
RGA of square systems are independent of input and output scaling, nonsquare systems are not. Since there are more inputs than outputs, the system
is however still independent of the output scaling. In this case, all the inputs
would have the same scaling (all are control signals, 0-100), thus the input
scaling will not change the results. This gives the RGA matrices:
0.4567 2.5440 −2.0007
RGA(2π0) =
(4.15)
0.0087 −1.9515 2.9428
0.0083 − 0.0070i
2.8387 − 1.5127i −1.8470 + 1.5197i
RGA(2π0.1) =
−0.0053 + 0.0368i −1.8411 + 1.5127i 2.8464 − 1.5197i
(4.16)
51
It can be seen that the light phase should not be paired with the heavy
phase flow since that element is negative. If the heavy phase valve is used,
there is also a possibility that gain scheduling can help reduce the problems
caused by the recirculation pump (see section 4.6.1). A multivariable approach might be best to control the heavy phase flow, but this is difficult
to implement at this point (see chapter 5). It can thus be concluded that
even though there are downsides to using the heavy phase valve, it is still
the better choice.
The light phase valve is left uncontrolled and can be used to experiment
with separation efficiency or the pressure levels.
4.6
PID Controllers
On the lowest level in the control hierarchy in this application are the PIDcontrollers which control the individual loops. The system is supposed to
be able to function solely on these if the MPC would stop functioning (for
instance if the link between Simulink and TwinCAT is disconnected). Two
important aspects of PID-controllers and how to tune them are presented
below.
4.6.1
Gain Scheduling
Gain scheduling means that the controller have different parameters (not just
the gain) depending on the operating point. The different operating point
is in this case due to the effect of the recirculation pump and the switching
criteria is the control signal to the recirculation pump. If higher than 70%
another set of parameters will be used. During the switching the parameters
are interpolated from the original value to the new one to ensure a smooth
transition.
4.6.2
Anti-wind up
If a controller with an integral part reaches its output limit an undesired
effect called wind-up will occur. The controller cannot then compensate
as it needs to and the integrated error will build up. When the controller
finally gets within its bounds again, the integral part will be “wound up” and
give undesired performance, such as overshoots etc. This can be avoided by
different strategies where the simplest is by simply turning the integral part
off when saturating, this is also the way it is implemented (built in function
in the PLC Program, see section 5). This feature is extra important on the
52
heavy phase flow controller. In the start-up process it is possible that the
output signal becomes 100% before the flow reaches its setpoint since the
yeast needs to build up in the separator before the flow will decrease.
4.6.3
Ziegler-Nichols Tuning
A method of tuning PID-controllers was developed by Ziegler and Nichols.
The principle is that the integral and derivative part of the PID-controller is
turned of. The gain is then incremented in step until the system begins to
oscillate with a constant amplitude. Based on the gain where this happen,
K0 and the period time of the oscillations, T0 , the PID-parameters can be
derived. This gives a good starting point and the parameters can then be
adjusted to give better results. [GL06]
4.7
Implemented MPC Design
All in all, there are approximately forty parameters to tune in a MPC with
two manipulated variables, one measured disturbance and one measured output.
u = [qR qHP ]T
v = ρI
(4.17)
y = ρHP
The measured disturbance, ρI , is used to provide feed forward control
and changes in density can thus be compensated for earlier. It affects the
recirculation and with a high inlet density the controller will know that there
is no need to recirculate and vice versa.
Equation (4.17) gives the final inputs and output of the MPC. The prediction horizon is 30 samples with a control horizon of 3 samples to have a
prediction horizon about the same length as the settling time and ny >> nu .
[Ros03] Estimation gain is set to 0.65 after tuning from simulations to get
an appropriate gain.
4.7.1
Constraints
The constraints
1.065 kg/dm3 < ρHP
1.7 < qHP < 2.3 ton/h
0 < qR < 1.5 ton/h
are all hard, the output will soften automatically.
53
(4.18)
4.7.2
Weights
Towards the end of the batch, it will become harder and harder to keep the
density up since there are not as much yeast left (ρI is low). By setting the
weight wu on the recirculation to a low value compared to the desired heavy
phase flow, the controller will mainly use the pump to compensate for the
decreasing density in the first stage. If the recirculation pump is already on
full and at the constraint, the only way of keeping the density up is by having
a lower flow in the heavy phase. The weight w∆u is set quite high to make
the recirculation setpoint more steady.
The weight on the output has also been set to zero, meaning that it does
not matter what the density is, as long as it is over the limit. With a higher
weight the controller would have followed setpoint which of course generally
speaking is a good thing. The purpose of this experiment is however not to
follow a certain trajectory but to have as high density as possible. If the density goes higher than the setpoint and the output is weighted the controller
would try to lower the density, which in this case is unnecessary since a high
density is not a problem but only a good thing. With an unweighted output,
the controller does nothing to compensate in such situations. In the future,
if the purpose instead would be to keep a certain density, not just as high as
possible, the output weight should be non-zero.
The final weights are:
∆u
wHP-massflow
∆u
wR-massflow
u
wHP-massflow
u
wR-massflow
y
wHP-density
4.7.3
= 0.1
= 20
= 10
= 0
= 0
(4.19)
Analysis
One major downside of having no weight on the output is that analysis of the
controller becomes harder since the resulting linear controller gives a transfer
function with gain zero. By simulations it is possible to understand how the
controller will perform. Figure 4.7 shows the manipulated variables and the
inlet density of the plant while figure 4.8 shows the output. It can be seen
that the desired behavior is achieved, first the output is allowed to sink to the
constraint because of the decreasing inlet density. The recirculation is then
started to keep the density. Disturbances in the HP-density gives response
on both manipulated variables, but then HP-flow returns to 2 ton/h. At
t = 1200 the HP-flow begins to decrease, when it reaches the flow limit at
t = 1600 the HP density goes under the constraint.
54
Plant Inputs
InMFT221
2.5
2
InDT201
1.5
1.02
1.01
1
0.99
InMFTQr
2
1
0
−1
0
200
400
600
800
1000
1200
1400
1600
1800
2000
Time (sec)
Figure 4.7: Simulation of the system input with the MPC controller.
Plant Output: OutDT221
1.074
1.072
1.07
1.068
1.066
1.064
1.062
1.06
1.058
1.056
1.054
0
200
400
600
800
1000
1200
1400
1600
1800
2000
Time (sec)
Figure 4.8: Simulation of the system output with the MPC controller.
Another solution is to assign a small output weight to the controller,
which basically will not affect the performance. By using the robustness
strategy in section 4.3 robust stability is given, as shown in table 4.3 (lower
55
bound > 1). The results of this analysis should however be taken with a
slight skepticism since the analyzed controller is not the real one.
Transfer Function
Gc
S
T
SFy
SFr
SG
Lower Bound
1.0605
1.0604
1.0615
1.0605
1.0604
1.0725
Upper Bound
1.0751
1.0751
1.0751
1.0751
1.0751
1.2222
Table 4.3: Upper and lower bounds in robustness analysis
56
Chapter 5
Implementation in the Process
Laboratory in Tumba
Any process that is to be controlled in reality and not just in simulations,
needs some way of transforming the output of the control algorithms to
actuator commands. There are many different ways of how this can be done
and this chapter presents one way of how the already existing system can be
connected to and controlled from Matlab/Simulink.
5.1
Different Choices for Implementation of
Control Design
The whole system with pumps, valves, electronics etc. is implemented using
a PLC (Programmable Control Unit) from Beckhoff. The PLC device is in
turn controlled by the software TwinCat PLC from Beckhoff. An existing
TwinCAT PLC program, written by Alf Karlsson, already existed prior to
the beginning of this master’s thesis. This program did already have the
necessary safety functions and alarms needed to be able to operate the experimental rig without fear of damage to equipment or people. The best
solution would thus be to use the same program and implement the new
control design into this program while keeping the safety functionality.
The TwinCAT software has some additional toolkits that can be used for
control, it is however difficult to implement more advanced control strategies such as MPC or multivariable controllers. Those would have to be
programmed manually, a time consuming task. Three different choices of
control implementation were considered.
The first alternative was to only implement PID-controllers, which exists
in a TwinCAT toolbox, and neglect more advanced control. The second
57
alternative was to use a software called PLC-link which converts Simulink
blocks to PLC code. A drawback with this software is that not all Simulink
blocks are supported, which would have made it necessary to program a
MPC manually either way. The third, and used alternative, was to use
OPC to allow communication between TwinCAT and Simulink. A schematic
overview can be seen in figure 5.1.
Separator system
Pumps
Valves
…
Electrical wires
PLC
PC
TwinCAT
OPC Server
Measurements
Control signals
Ehternet
Laptop
Matlab/Simulink
Figure 5.1: Schematic view of the implementation.
5.2
TwinCAT
All the sensors and actuators are connected to a PLC which in turn is connected to a computer with the program TwinCAT from Beckhoff. This is
a software that turns an ordinary PC into a real-time controller by letting
it communicate with the devices in real-time (i.e. a soft PLC). From the
program it is possible to control all actuators, the separator and keep track
of the measurements. TwinCAT also has an OPC server (allows sharing of
measurements and control signals), which will be explained further in section
5.3.
58
The program can be in different grades of automatic mode. All PIDcontrollers can be set to manual mode which lets the user set the control
signal to the actuator directly, or they can be in auto and the PID then controls the output. There is also a Simulink Control mode. When in Simulink
Control, the reference signals to the HP-flow controller and the R-controller
are obtained from a OPC-server (see following section) that also Simulink has
access to. Going into Simulink Control mode deactivates the PID controlling
the density since Simulink instead controls the HP-flow setpoint.
5.2.1
PID-controllers
In the controller block, the variables fOutMaxLimit and fOutMinLimit sets
the upper and lower output limit of the controller. If either limit is hit, the
integral part of the controller freezes. Because of the problem with cavitations
in the pipes if the control signal (and thereby also the pressure) becomes too
low, it is then possible to change the limits to a value higher than 0. The
controller will then saturate at that value.
During the experiments it was discovered that the original PID controller
cannot handle negative gains, this was solved by choosing a positive gain but
inverting the control signal (100 − u).
5.2.2
Filtering
The density and flow signals are already filtered in the sensor before it is sent
to TwinCAT. Since no controller is dependent on pressure, these signals has
been left unfiltered.
To minimize the influence of the periodic signal in the density, a notch
filter (gives a dip at desired frequency) included in TwinCAT is used. Because
of fear of technical difficulties, the filter was not implemented during the
experiments. This filter does however not affect the Simulink control since
Simulink filters the signals on its own. The density PID-controller could
perform worse if this filter is not present since the periodic signal can give
oscillating control signals.
5.3
OPC and The OPC Toolbox
OPC or OLE for Process Control (where OLE stands for Object Linking and
Embedding) is a collection of standards specifications which allows easier
communications. In this case TwinCAT is communicating with a TwinCAT
59
OPC server and other devices can communicate with the server. Theoretically, this server can be accessed through a network or even the Internet, but
here it is run locally on the computer controlling the PLC. OPC clients can
then connect to the server and perform read/write operations on the items
it is allowed to manipulate.
Through the Mathworks OPC Toolbox, Matlab/Simulink can become
an OPC client to the OPC server, which makes communication between
Matlab/Simulink and TwinCAT possible. When writing to an item on the
server, the value will be updated and kept at that value until a new value
is written, TwinCAT then reads this value. The main advantage is that in
Simulink, reading from the OPC server works like a source block and writing
to the server is like a sink block. Simulink needs no information at all of how
the PLC works.
Matlab/Simulink only has access to the measured signals and the reference values for the controllers. The original TwinCAT program is still
controlling safety functions and it is possible to disconnect Matlab/Simulink
and manually set the references. In this way, the operator can drive the system to the desired state and thereafter activate the control from Simulink.
5.3.1
Real-time Implementation
The purpose of using the OPC toolbox is to use the Matlab/Simulink to
control the real separation process in real-time. This can be done through
something called pseudo real-time simulation in the OPC Toolbox, which
means that the simulation is slowed down to match the system clock. It
is thereby possible to implement all the functionality in Simulink on a live
system in real-time, as long as it is in discrete time. Reading from the OPC
server corresponds to sampling with a sensor and using a ZOH (Zero Order
Hold, meaning that the sampled value is kept constant during the whole
sample).
In general, when implementing control algorithms there usually exists
some RTOS (Real-Time Operating System) which through different scheduling strategies such as EDF (Earliest Deadline First) or RM (Rate Monotonic)
handles different tasks, deadlines and how to prioritize between them. For
example in a car the tasks related to safety, such as brakes, have a high
priority so that these always will execute before the deadline. Even if there
is just a simple foreground/background program structure (control actions
in the foreground interrupts the lower prioritized tasks in the background at
fixed intervals), the control actions will still take place in the designated time
slot.
It is however worth noting that no RTOS is used in this case and it is
60
not possible to give MPC control actions higher priority than for instance
logging data. If Simulink is unable to keep up with real-time a pseudo realtime latency violation occurs, and the user can specify what should happen;
nothing, a warning or an error will occur. From these it is then possible to
create an event to act appropriately. This particular system is however not
very sensitive to small delays and the appropriate action would be to use
the previous control signal. Since that value already is written to the OPC
server and TwinCAT will use it the next time it sets the output, no special
action needs to be taken.
5.3.2
Sampling Rates
Because control actions can be missed, the sampling rate is kept rather slow.
One very limiting factor in the implementation is the possible sampling rates
that Simulink can use. Logging can be performed at sampling times of 0.1 s
but if calculations and write operations are to be performed as well, longer
sampling times are needed. This can be affected by choosing between writing
synchronous or asynchronous, in the former Matlab will wait for the server
to confirm that the data has been written. This can in some cases take long
time and cause delays. Writing asynchronous sends a request to write and
Matlab continues executing commands. When the data has been written an
event will notify Matlab.
By using Matrikon OPC Server for Simulation it was possible to simulate the OPC behavior without having to run the process. Two Simulink
simulations were run in parallel with each other, one with the model of the
process and another with the MPC controller. Shared variables (such as the
density of the heavy phase which is an output from the process simulation
and becomes a measured output in the MPC controller) are then created on
the OPC Server and the two simulations can communicate with each other.
During these tests it could be concluded that there were problems with high
sampling rates. By testing on the real process but with only water, it could
be concluded that approximately the same sampling rates could be achieved.
The bottleneck is due to the OPC (not MPC computations since MPC simulations of several hours can be run in a matter of seconds in Simulink in
ordinary simulations), even though the exact cause of the bottleneck is unclear.
Ergo, OPC is not the way to go if the goal is to implement fast systems.
This was a contributing factor that led to the structure where the PIDcontrollers are run on the TwinCAT system, while the MPC is controlled
from Simulink.
61
5.4
Simulink
The start-up process is difficult to control and requires manual control since
the system does not work the same way every time. The Simulink control is
initiated when pressure, flows etc. are built up.
Simulink was used for two different purposes, system identification (logging of data) and control. The block diagram for the first case can be seen in
figure 5.2.The four control signals could be manipulated and were written to
the process via OPC, a minor delay of approximately a tenth of a second is
introduced here, but considering the time constants in the rest of the system,
this delay is neglected. The measurements could be read via OPC and was
then stored as a System Identification Toolbox Data structure.
OPC Config
Real-Time
45
OPC Configuration
Feedpump
0
Recirkpump
45
OPC Write (Async):
XJOBB.SimFeedPumpControlSignal
XJOBB.SimReci...pControlSignal
XJOBB.SimHeav...eControlSignal
XJOBB.SimLigh...eControlSignal
HeavyPhase
OPC Write
20
LightPhase
XJOBB.LightP...ontrolSignal
XJOBB.MFT201
XJOBB.MFT221
XJOBB.FT220
XJOBB.FT221
XJOBB.QT201
XJOBB.QT220
XJOBB.PT201
XJOBB.PT220
XJOBB.PT221
XJOBB.PT207
XJOBB.DT201
XJOBB.DT221
XJOBB.TT201
XJOBB.TT220
XJOBB.TT221
OPC Read
V
Input
IDDATA SINK
Output
Iddata Sink1
Q
T
Figure 5.2: Simulink block diagram of the measurement setup. In the middle
are the OPC blocks while a Iddata sink is to the right.
When controlling, basically all Simulink does is handling the MPC (apart
from logging data). Everything concerning MPC and not specific for Simulink
is explained in sections 4.1 and 4.2. The Simulink setup during control can
be seen in figure 5.3 and the setup is described below.
5.4.1
OPC Blocks
There are three blocks concerning the OPC Toolbox. The configuration block
is mandatory and holds information about the connection to the server and
the behavior if error occurs. Matlab errors are only given if an item or the
server is unavailable. If read/write errors or pseudo real-time simulation violations occur, just a warning will be produced. The display shows the latency
time and should be positive. The OPC read block reads asynchronously the
data at a sampling time of 0.1s while the write block is written to asynchronously every second by the MPC block.
62
5.4.2
MPC Simulink Block
To ease computational load when Simulink is not controlling, but still is
running, the optimization can be turned off but the states of the MPC are
still updated.
5.4.3
Filtering
The signals are passed through a fifth order butterworth filter, with cut-off
frequency at 0.1Hz, before entering the MPC. This filter makes sure that
the periodic signal in the density does not enter the controller and cause
oscillating control signals.
5.4.4
Running MPC and Simulink
The controller is started the same way as any Simulink simulation, by pressing the play button. One important step to remember is to allow for enough
time to pass (approximately 2-3 minutes) before turning TwinCAT into
Simulink Control mode after pressing play in Simulink. Otherwise the states
of the MPC will not be updated and the predictions will be wrong. Since the
filters is relatively slow, they also needs some time to adjust to the correct
level.
63
Figure 5.3: Simulink block diagram of the implementation
64
11
LightPhaseSetpoint
4.5
FeedFlowSetPoint
OPC Configuration
OPC Config
Real-Time
mv
MPC Controller
MPC
OPC Write
ext.mv
md
ref
mo
QP switch
OPC Write (Async):
XJOBB.S...etpopint
XJOBB.S...Setpoint
XJOBB.S...Setpoint
XJOBB.S...Setpoint
Latency Display
V
In
Switching signal
Optimization
On/Off
Optimization signal
Fix recirkmassflow
DT221
MV
1.07
Switch
ToControl
Outputs
Signal routing
Density reference [kg/dm^3]
External MV
XJOBB.FT220
XJOBB.FT221
XJOBB.QT201
XJOBB.QT220
XJOBB.PT201
OPC Read
Inputs
Butterworth filter
butterDen(z)
butterNum(z)
IDDATA SINK
FT221
MFT221
Measured disturbances, DT201
Measured outputs, DT221
Iddata Sink
Output
Input
Chapter 6
Results and Discussion
Earlier chapters have already given some results in the form of model quality
and control simulations. Here the results of the final tests will be presented
where all the pieces are put together.
6.1
PID-tuning
The tuning gave a satisfactory result, not perfect however. The PID controlling the recirculation flow performed quite well, while the HP flow controller
was harder. As will be demonstrated below, and as feared, one issue is the recirculation pump. The derived parameters are presented in tables 6.1 to 6.2.
The feed flow controller was kept at the original values (K = 8, TI = 3.4).
To save time for tuning of the MPC and since no tests would be performed
with the decentralized strategy, the PID controlling the heavy phase density
(which is inactive when using the MPC) was not tuned enough to give good
results.
Recirculation control
K
60
TI
3.4
Table 6.1: Parameters for the R mass flow PI-controller.
The recirculation flow could be controlled with a PID during all operating
conditions while the heavy phase suffered from the influence of the recirculation pump. The Gain scheduling did not work, more about this in section
6.3.
65
HP mass flow control
uR < 70%
K
12
TI
2.5
TD
0.4
uR > 70%
K
16
TI
2
TD
1
Table 6.2: Parameters for the HP mass flow PID-controller.
6.2
Control Performance Evaluation
All in all, the control design worked as intended, but some tuning might still
be needed. The primary goal was to maintain a density of 1.065 kg/dm3
for as long as possible. In figure 6.1 it is shown that the control system
manages to keep the density even though the inlet density is decreasing and
it also recover from disturbances. The MPC weighting of the setpoints for the
recirculation and the heavy phase mass flows also worked, as seen in figure
6.2. First, the recirculation is increased to compensate for the decreasing
inlet density. Then, since a lower heavy phase flow leads to a higher heavy
phase density, the heavy phase flow needs to be lowered in the end of the
batch to maintain heavy phase density.
The heavy phase density goes below the threshold towards the end, but at
that point the controller is already operating at the limits for the manipulated
variables (seen in figure 6.2) and it is not possible to maintain the density
any longer. Prior to that, the flow is kept at the desired 2 ton/h (as written
in section 2.5).
The actual control signals sent to the valves and pumps are also of interest
and can be seen in figure 6.3. Often the aim is to have as smooth control signals as possible, since this limits the wear in the process. The fluctuations in
this case are rather small and should not pose any significant problems. The
LP control signal is controlled manually and was kept constant during the
experiment. The HP valve saturates at the end of the batch, this particular
issue is addressed in section 6.3.
During the control design, the pressures were neglected to give a more
flexible controller during experiments. The assumption that the pressures
would not rise above critical values was correct, as seen in figure 6.4. The
pressures are almost constant but there are however a slight tendency of
66
increasing pressures, this is however quite small, only 0.5 bar in the worst case
(the inlet pressure). This is probably caused by an increased flow resistance
in the separator.
Densities
1.07
HP Density
Inlet density
1.014
1.012
1.065
1.008
1.06
1.006
1.004
1.055
1.05
Density [kg/dm3]
3
Density [kg/dm ]
1.01
0
500
1000
1500
2000
2500
3000
3500
Time [s]
Figure 6.1: Measured densities in the final test of a laboratory process simulation of separation from cone-bottom tank with time-varying inlet density.
Simulink control started at t = 0.
During disturbances the density sinks below the threshold and even though
it recovers it takes some time. The output is now unweighted, by having a
weight on the output it would be possible to keep a higher density than
the limit and thus have some margin when disturbances occur. The limit is
however already now quite high and a setpoint of higher than 1.070 kg/dm3
would be hard to maintain.
6.2.1
Response to Disturbances
The heavy phase mass flow setpoint decreases a bit when a disturbance occurs, but goes back to 2 ton/h rather quickly (figure 6.2). By decreasing the
weight on the HP-flow it could be possible to obtain a quicker response to
disturbances since the HP-flow affects the density faster than the recirculation. The quicker behavior would be to the price of that the flow is not kept
at the desired nominal value.
67
Setpoints
2.5
Setpoint [ton/h]
2
1.5
1
0.5
HP Mass flow setpoint
R Mass flow setpoint
0
0
500
1000
1500
2000
2500
3000
3500
Time [s]
Figure 6.2: Mass flow setpoints in the final test of a laboratory process simulation of separation from cone-bottom tank with time-varying inlet density.
Simulink control started at t = 0.
Usage of the recirculation pump is not punished at all which leads to
that disturbances mainly affects the pump. In figure 6.2 the setpoint for
the recirculation is also shown. The steps in the setpoint are reactions to
disturbances. It can also be seen that it continuously increases due to the
lowered inlet density which was the desired behavior in the design.
The model was designed for a constant feed flow of 11 ton/h, and as can
be seen in figure 6.5 it is robust enough to also manage lower feed flows. From
this experiment it can also be seen that it is possible to keep a dry fraction
of 20% for a long period of time. One drawback of having no weights on the
recirculation pump and the output is shown when the feed pump is reset to
11 ton/h. The recirculation setpoint could probably been lowered after that
and still been able to maintain the density.
This problem arises from the purpose of the control, which was to compensate for a decreasing inlet density. In that case the recirculation pump
would just recirculate more and more. By adding a weight to the recirculation saying that it for instance should keep a nominal value of 0 the pump
would try to recirculate as little as possible but still keeping the limits.
68
Control Signals
100
90
80
Control signal [%]
70
60
50
40
30
20
HP Control signal
LP control signal
R Pump control signal
10
0
0
500
1000
1500
2000
2500
3000
3500
Time [s]
Figure 6.3: Controls signals to the recirculation pump and the valves in the
final test of a laboratory process simulation of separation from cone-bottom
tank with time-varying inlet density. Simulink control started at t = 0.
6.3
Heavy Phase flow and the Recirculation
Pump
As the recirculation pump is placed today the valve in the heavy phase is
almost disabled when the pump is operating at high capacity. It becomes very
difficult to control the flow in such cases without the help of the light phase
valve. On the other hand, if the light phase valve would be used, problem
with cavitation could occur instead when the flow needs to be decreased.
This is an even more alarming issue since it can damage the equipment.
Would it help to use a multivariable control where both valves control
the flow in the heavy phase? It is possible, but not at all certain, since at the
end of the experiment, the heavy phase valve control signal was saturated
at 100% (seen in figure 6.3). The light phase was then manually decreased
to 22% (lower than that will cause cavitations) to try to get a lower flow,
the heavy phase valve saturated never the less. Gain scheduling did not help
because the valve saturates and the PID-parameters does not matter in that
case.
When the recirculation pump control signal manually was decreased (not
69
Pressures
700
650
Pressure [kPa]
600
550
500
450
Inlet Pressure
LP Pressure
HP Pressure
400
0
500
1000
1500
2000
2500
3000
3500
Time [s]
Figure 6.4: Measured pressures during the final experiment, Simulink control
started at t = 0.
shown in figures), the heavy phase valve started to function normally again
and the control signal dropped to approximately 50%, confirming that it is
the pump that causes problem. By moving the pump to after the heavy phase
valve it could be possible to maintain a low flow also at high recirculation
pump effects. Since a lower flow means higher density, this means that it
could be possible to get even better results and longer run-time before the
density goes below the threshold.
6.4
Influence of Periodic Signal
In addition to the successful test presented above, another test was also
performed where the periodic signal in the density was not filtered out. Even
though this experiment also was successful in the sense that the density was
maintained, it is clear that the signal is affecting the control.
If figure 6.6 is compared to 6.2 it can be seen that the setpoints are
much less smooth in figure 6.6. This in turn leads to more fluctuations in
the control signals to the actuators. Even if the density is kept, it leads to
unnecessary wear of the actuators.
A Fourier analysis (figure 6.7) of the HP setpoint shows that the periodic
70
Densities
Recirculation setpoint
Feed flow setpoint (scale factor 0.1)
Heavy phase setpoint
Heavy phase density
1.072
Density [kg/dm3]
Mass flow [ton/h]
2
1.071
0
1.07
0
200
400
600
800
1000
Time [s]
1200
1400
1600
1800
1.069
2000
Figure 6.5: Varying feed flow and the resulting density and setpoints.
signal propagates from the measured density to the manipulated variables in
the MPC (i.e. the setpoints). In figure 6.7(a) the experiment with the unfiltered signal is shown. It has a clearly visible peak at 10−0.58 Hz (0.2630 Hz).
Compared to 6.7(b) it is clear that the peak at is gone. It can be concluded
that the filtering of the signal gave better results.
6.5
Separation Efficiency
The separation efficiency could not be measured, only inspected through
a sightglass. During the experiments it could be seen that having a good
separation efficiency is not impossible. Towards the end of the test the yeast
have however been run through the system so many times that the yeast cells
have been crushed which will make separation harder. It will also colorize the
water making it harder to distinguish the water from the yeast. Apart from
the decay of the yeast, this also limits the experiment time if good separation
needs to be controlled.
71
Setpoints
2.4
2.2
2
Setpoint [ton/h]
1.8
1.6
1.4
1.2
1
0.8
0.6
HP Mass flow setpoint
R Mass flow setpoint
0.4
0
100
200
300
400
500
600
700
Time [s]
Figure 6.6: Setpoints from the MPC during experiment with unfiltered density signal.
Fourier analysis
Fourier analysis
0.012
0.05
MFT221Setpoint
MFT221Setpoint
0.045
0.01
0.04
0.035
0.008
Amplitude
Amplitude
0.03
0.006
0.025
0.02
0.004
0.015
0.01
0.002
0.005
0
−3
10
−2
10
−1
10
Frequency [Hz]
0
10
0
−4
10
1
10
−3
10
−2
−1
10
10
0
10
1
10
Frequency [Hz]
(a) Without filtered density signal
(b) With filtered density signal
Figure 6.7: Fourier transform of HP Mass flow setpoint. Note that the x-axis
have different scales.
72
6.6
Simulink and TwinCAT
The chosen method of implementing the MPC proved to be successful, at
least when controlling the density which is rather slow compared to the flow
rates. The pseudo-real-time latency was sometimes negative and fluctuated
around zero other times. On the whole, it did however perform well, but
faster sampling times could be hard to use. The OPC read block had a
sampling time of 0.1 s for the purpose of logging, the MPC did however
only have a sampling time of 1 s. It might be possible to use the same
approach with OPC even to control the flows which approximately would
require sampling times of 0.5 s.
Considering the results and how relatively easy it was to implement the
MPC on a real system, it can be concluded that using OPC and the OPC
toolbox was the right choice.
73
Chapter 7
Conclusions and Future Work
In this master’s thesis it is shown that it is possible to control the density
of the heavy phase in the separation process. Compared to earlier results
it is shown that with a multivariable control design it is possible to obtain
better results by being able to maintain the density for a longer time. This
is because the heavy phase flow can also be lowered automatically when the
recirculation pump is at full, making the control save even more beer. The
gains are now however limited, since the recirculation pump disturbes the
heavy phase flow from being controlled in the end of the batch. With the
increased complexity due to the multivariable controller in mind, it can be
discussed if it is worth it, if the flow cannot be lowered as desired. A more
complex controller demands more knowledge from the developer and perhaps
also the end-user, but can on the other hand be a selling argument.
Even though the system was controlled as planned and with a satisfying
result, there was only one output to be controlled. When the separation
efficiency is added to the picture, the problem may become more difficult.
The separation efficiency may also call for a multivariable controller. All in
all, the idea of controlling reference values for the flows worked well and is
probably easier to get good results with, compared to controlling the control
signals directly. It also makes the system more general as the MPC does not
need to know how the flows are controlled.
It was also seen that the existing relationships were not enough to solve
the problem and a system identification had to be done. This is not because
the equations are not good enough, but because an approach where there
existed no equations that described the necessary relationships was choosen.
A linear approach will suffice when controlling the density, and will probably
suffice also when controlling the separation.
74
7.1
Future Work
How far away is the main goal of the concept, to have a fully automated separation process? During the experiments the separation were both good and
poor. It now remains to investigate whether the density can be controlled
while at the same time maintaining a good separation. The connection between the inputs and the separation thus has to be investigated, but a possible
future control strategy can be seen in figure 7.1. Even though the separator
has been excluded from control action in this thesis, it could be a possibility
in the future.
MPC
HP density, separation…
PID
?
PID
HP flow
HP
LP
PID
PID
HP density
R flow
R
C
From tank
y
F
PID
F flow
Figure 7.1: MPC controlling reference signals to PID’s
The placement of the recirculation pump should also be considered. What
are the pros and cons with the current setup and what can be gained from a
new placement?
7.2
Control Design in Further Development
There are some work left to do before a product is ready for market and
control is needed during these experiments. What control strategy should be
used during these tests? Since the pressures deliberately were omitted to be
able to run different experiments the MPC can be used also when trying to
75
investigate different pressure levels and how that might affect the separation
effiency.
It should however not be used when trying to deduce what effects the
feed pump has on the separation efficiency since, as shown in chapter 6, the
MPC will compensate for the lowered density by increasing the recirculation.
This in turn will just add more yeast to the separator and thus, the separator
effiency will not be affected that much (even though some changes could be
expected).
If the goal is to just maintain density, then the original decentralized
control will probably suffice. The gains of using the MPC in this case is that
it is possible to maintain the density a little bit longer.
7.3
Summary and Final Words
Through experiments and analysing the existing data, a model of the process
could be made. A white box did not suffice so a black box model was necessary, but a grey box model was used in the analysis of the final controller.
A control strategy where a MPC controls underlying PID controllers was
chosen since that gave flexibility and a high chance of successfull implementation. The control strategy was then implemented in the process laboratory
with TwinCAT, OPC and Simulink. In the final tests the control strategy
and implementation worked well. One advantage of the final control design
is that it can be extended when separation efficiency needs to be controlled
as well.
To summarize, the next steps in the development of this concept should
be:
• Install new quality sensor in the light phase and perform new experiments.
• Consider placing recirculation pump after heavy phase control valve.
• Consider placement of the sensor measuring the inlet for better feedforward control.
76
Bibliography
[bre01]
Brewery Handbook. Alfa Laval AB, 2001.
[GL03]
Torkel Glad and Lennart Ljung. Reglerteori - Flervariabla och
olinjära metoder. Studentlitteratur, Lund, 2003.
[GL04]
Torkel Glad and Lennart Ljung. Modellbygge och simulering. Studentlitteratur, Lund, 2004.
[GL06]
Torkel Glad and Lennart Ljung. Reglerteknik - Grundläggande
teori. Studentlitteratur, Lund, 2006.
[HD09]
Carl Häggmark and Sverker Danielsson. Dryad. SK-09-0313, 2009.
[IMM02] Claes Inge, Hans Moberg, and Tommy Myrvang. Separatorsinlopp.
Alfa Laval, 2002.
[Kar07]
Emma Karlsson. Bactofugation of brewer’s yeast - concept study
of a new method for separating yeast from beer in a high speed
centrifugal separator. Master’s thesis, KTH, 2007.
[kel]
Technical information proline promass 80i,83i. http://www.kellerdruck.ch/frameen.asp?seite=english/homee/paprode/paprodspe/33xe.html.
[Leu07]
Wallace Woon-Fong Leung. Centrifugal Separations in Biotechnology. Elsevier, 2007.
[LF02]
Torgny Lagerstedt and Peter Franzén. Separatorutlopp. Alfa Laval,
2002.
[Lju99]
Lennart Ljung. System Identification, Theory for the User, 2nd
Ed. Prentice-Hall PTR, 1999.
[Mac02] J. M. Maciejowski. Predictive control with Constraints. Pearson
Education Limited, 2002.
77
[Mata]
Mathworks. Model predictive control toolbox documentation.
http://www.mathworks.com/access/helpdesk/help/toolbox/mpc/index.html.
[Matb]
Mathworks.
Robust
toolbox
documentation.
http://www.mathworks.com/access/helpdesk/help/toolbox/robust/index.html.
[Matc]
Mathworks.
System identification toolbox documentation.
http://www.mathworks.com/access/helpdesk/help/toolbox/ident/.
[MB02a] Hans Moberg and Leonard Borgström. Roterande strömning, tryckfall, gränsnivåer. Alfa Laval, 2002.
[MB02b] Hans Moberg and Leonard Borgström. Strömning och separering
mellan insatsplåtar. Alfa Laval, 2002.
[Mob02] Hans Moberg. Separeringsteori. Alfa Laval, 2002.
[Mob08] Hans Moberg. Ux-separatorer och vortexmunstycken. SK-08-0150,
2008.
[Nel01]
Oliver Nelles. Nonlinear System Identification. Springer-Verlag,
2001.
[OR94]
Babatunde A. Ogunnaike and W. Harmon Ray. Process Dynamics,
Modeling and Control. Oxford University Press, 1994.
[pro]
Technical information proline promass 80i,83i.
[RB06]
Brian Roffel and Ben Betlem. Process Dynamics and Control Modeling for Control and Prediction. Wiley, 2006.
[Ros03]
R.A. Rossiter. Modelbased Predictive Control - A practical approach. CRC Press, 2003.
[SP96]
Sigurd Skogestad and Ian Postletwaite. Multivariable Feedback
Control - Analysis and Design. John Wiley & Sons, 1996.
[TBF05] Sebastian Thrun, Wolfram Burgard, and Dieter Fox. Probabilistic
Robotics. MIT Press, 2005.
78
Appendix A
Control Theory
This chapter contains a very brief introduction in control theory, interested
readers are referred to the many books for further information.
A.1
The Laplace Transform
Z
∞
F (s) = L [f (t)] (s) =
f (t)e−st dt
(A.1)
0
The basic things to remember is that multiplication with s represents a
derivative and 1/s an integration.
A.2
Transfer Functions
By using the laplace transform it is possible to simplify the writing of differential equations. For instance, the first order differential equation:
ẏ = −ay + bu
(A.2)
becomes:
b
U (s)
s+a
as a transfer function from the input u to the output y.
Y (s) =
A.3
(A.3)
PID Control
One of the most used control designs is the PID-controller. Where P stands
for proportional, I integral and D derivative. Written on Laplace form, in
79
one of its many forms it becomes:
1
F (s) = K 1 +
+ TD s
TI s
(A.4)
All terms are multiplied by the control error e, i.e. r − y (reference valueactual value), which gives the control signal, u, which is sent to the controlled
process.
80
Appendix B
Separation Theory
A purificator is used in this project, i.e. the light phase (beer) should be
as free from heavy phase (yeast) as possible. To be able to mechanically
separate particles from a liquid, or liquids from liquids, there must be a
difference in their densities. A particle in a liquid with a lower density will
sink with the velocity in (B.1), this is commonly known as Stoke’s law.
vg =
d2 ρp − ρ
g
18µ
(B.1)
In a tank with the in and out flow Q [m3 /s],the particles will stay in the
tank for t = hbl/Q seconds, where h, b and l are the dimensions of the tank.
How large must the tank be for the particles to sink to the bottom before
it reaches the other end of the tank? The particle will reach the bottom in
t = h/vg seconds. Thus, we get the following equation:
Q = vg bl
(B.2)
With the flow Q, to be able to separate the particles with sedimentation
velocity vg , the tank must have an area of A = b · l. However, centrifugal separators are a bit different since the particle’s are not affected by the
gravitational field as much as the centrifugal forces. As given in [Mob02],
a measure of equivalent area can be calculated according to equation (B.3).
Another common measurement is KQ in B.4, where the latter is more based
on empirical results. These equations are useful when analysing which flow
that gives a good separation.
2π
N cot(α)ω 2 · ry3 − ri3
3g
n 1.5
KQ = 0.00412N cot(α)
ry2.75 − ri2.75
6000
Ae =
81
(B.3)
(B.4)
where N is the number of discs and ω is the rotational speed. The constants
α, ry and ri can be seen in figure B.1.
ω
α
ry
ri
Figure B.1: Basic geometry of a high speed centrifugal separator disc stack.
In (B.1), it is assumed that the particle is in the gravitational field. However, the following report will assume that it instead is in centrifugal separator, the velocity is then described by (B.5).
rω 2
vc = vg
g
B.1
(B.5)
Levels
The most important level is the interface level, i.e. the borderline between
the heavy and the light phase inside the separator. This is a simplification, in
reality there is no sharp line between them (more of a gradient). The radius
of the interface is called rg (from the swedish word “gränsnivå”). In practice
this level decides how good the separation is, but unfortunately it cannot be
measured.
82
Appendix C
White-box modeling
At first, the existing relationships was the only way to go since the available
data did not suffice for a black box model since they did not excite the system
enough. In light of this, the first model had to be a white box, which later
became a grey box when trying to fit the model against data. In the end,
not even the gray box model was good enough and a black box had to be
used.
A massbalance of the yeast can be written as in equation C.1.
d (xH m)
= xI q I + xH q r − xH q H
(C.1)
dt
where m is the mass of the volume containing yeast and beer. It is here
assumed that there is perfect separation, i.e. xL qL ≈ 0. The flows qI and qR
are inputs while ρI is in a measurable disturbance. This can be rewritten as
in equation (C.2).
1
d (xH )
=
(xI qI + xH qr − xH qH )
dt
m
(C.2)
The state xH is related to the density according to equation C.3, given in
[Mob08].
ρD ρL
ρH =
(C.3)
xH (ρL − ρD ) + ρD
where ρD is the density of 100% yeast when dried (approximately 1460
kg/m3 ), ρL is assumed to be 1000 kg/m3 (pure water). The density ρH
is in turn used in other equations to predict QH , which is given in equation
(C.4) from [Mob08].
s
QH = µnn An
83
2∆pn
ρh
(C.4)
where µ is a constant (approximately 0.7-0.9) typical for the nozzle, nn is
the number of nozzles (i.e. number of HP pipes), An is the area of the nozzle
and ∆pn is the pressure over the nozzle. The pressure ∆pn is
∆pn = pd − ∆ppipe − ∆pmisc
(C.5)
The pressuredrop ∆pmisc is added to compensate for unknown pressure drops
and tuned against process data while ∆ppipe is the pressure drop in the pipe.
The pressure pd is:
where pL and pH
ω 2 rg2
(ρH − ρL )
pd = pL − pH −
2
is given by:
pL = pLBackpressure − pLpumpwheel
pH = pHBackpressure − pHpumpwheel
(C.6)
(C.7)
The back pressures in the heavy and light phase are considered to be inputs.
The pressure drops over the pumpwheels are given by equation C.8 where
the radiuses are for the geometry of the corresponding pumpwheel.
1
2
2
pLpumpwheel = ρL ω 2 rL,outer
− rL,inner
2
(C.8)
1
2
2
pHpumpwheel = ρH ω 2 rH,outer
− rH,inner
2
The pressure drop through the pipe, ∆pP ipe is given in C.9.
8ρt νT Lpipe QH
∆pP ipe =
(C.9)
nn πrP4 ipe
The viscosity can be calculated by
x < 0.2024 : 2030(0.23 − xH )−2.5
νT =
x ≥ 0.2024 : 21100(0.253 − xH )−3.01
C.1
(C.10)
Inputs and Outputs
The states and structure of the model thus becomes:
x = xH
(C.11)
T
y = ρH QH
(C.12)
T
u = QI QR pLP pHP
(C.13)
v = ρI
(C.14)
Outputs (measured):
Control signals:
Measured disturbances
84
C.2
Whitebox Performance
The model assumes that the flow and thereby density varies with the pressure
∆pn , as long as this assumption holds the dynamics of the model are correct,
but otherwise it performs poorly. There are also problems with equation
(C.4) since it is defined for positive ∆pn , negative values gives imaginary
numbers.
The whitebox model was developed before any experiments could be performed, when that could be done, it became apparent that controlling the
pressure level to predict the flows according to (C.4) would probably not be
as successful as controlling the flow directly. The HP flow is dynamic and the
hysteresis in the process (same flow can be acquired by different pressures)
makes it difficult to obtain accurate predictions.
All in all, the chances of this approach being succesful was less than the
implemented approach, and was therefore not continued.
85
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement