Home
        Selected Topics on Constrained and Nonlinear Control, Workbook
         Contents
1.                                                                                                                                                               I  ur  gt   m h1  MATLAB  gt   L w H    012 rozsah  Function h2  gt    Saturation Q  gt U   Saturation1 REAL  h2  a  betat2 sart u 1  u 2   E  dr           4                    beta2 sqrt u 1   posun   4                      3j m  mare Step  Mux w           hi   Step1    T  Step2                      w    Fig  7 7 Control structure for nonliner PD1 implemented in Matlab   Simulink   Matlab function block call PD2 u 1   u 2   u 3   u 4      global alfal alfa2 Qimin Qimax mic m2c betal beta12 beta2 posun    4                        4                     S1   alfa1  alfa2   closed loop poles   Qimin Qimax   limit values for the pump input   mic m2c   waighting coefficients for specifying operating  points for   linearization   mic m2c 0 corresponds to exact linearization  i e   linearization around   actual state   leading to overshooting thanks to nonmodelled  dynamics   mic m2c 1 corresponds to linearization around reference state     too slow   closed loop dynamics   recommended to work with mic m2c gt 0  0 1 0 2    betal betai2 beta2   valve coefficients  just betal2 7  beta2  required    posun   offset of the output valve  difference between tank  bottom and   valve output orifice   S1   tank area    load          basics calibParams       load          basics valvel      load        basics valve2    load          basic
2.                                                                                                                                        A A                                                                         Gain2 Transfer Fcn2 Light         i intensity 1  5 mea                               Fig  9 18 FIo controller     Simulink model    The experimental results can be plot using following commands     figure   stairs yl   1  yl   2    k     hold on   stairs yl   1  yl   4    k     xlabel    t s       ylabel    light intensity       legend    system output        setpoint        Using the recommended three process gains in the experiment you should  obtain similar results to Fig  9 19  9 20 Fig  9 21 9 22  and Fig  9 23 9 24    For the plant used in this example the desired control quality was achieved  when the process gain K   17 was used  The control results can be seen in  Fig  9 23     306 Peter Tap  k and Mikul     Huba    Light channel output  70 T T T                     System output  60   Setpoint 4             50r J                Light intensity        o  T                            105                      0 10 20 30 40 50 60  time s     Fig  9 19 Experimental results for K   3    From the experience with the previous experiments one can assume that  a higher value of the process gain leads to lower overshoot with slower tran   sients and vice versa  After getting some experience with the controller  let us  practice robust controller tuning  At first put dow
3.        0 i L i L  0 20 40 60 80 100    time  s     Fig  9 52 FSP for filtered optical channel     system output    9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 333                   T T  4  f 1  5m  4H   4    x       l       4  SU X am  S Td Mar S i aae Tnt eel  227 E  3    a  1 b 4        l i    0 20 40 60 80 100  time  s   T T  6  r 1       A  ae       Bulb voltage  V   wo       EE    r vragen             I     2l if Mian deg  if  I I  ir i  1  i   0 L L    I L  0 20 40 60 80 100  time  s   T T  8  r 1          Bulb voltage  V        0 20 40 60 80 100  time  s           Fig  9 53 FSP for filtered optical channel     control signal    334 Peter Tap  k and Mikul     Huba    Comments     Remarks    9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 335    Comments     Remarks    336 Peter Tap  k and Mikul     Huba    Comments     Remarks    9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 337    Comments     Remarks    
4.        255  7 4 Exact Feedback Linearization                      lt         257  T  Do o E aso eire Does Sorten t O UE 260  p   EE d 0 0000 su sed t   d   E hh ed See Me Nee deen ees 269    eferemdes oi cece dns hid bere Wand aera  tan a dee dad kbc aed aie enh PU WESEL 269    Contents xi    8    Remote Laboratory Software Module for Thermo Optical    P ord eS cl O atas ses odeurs oe ene 275  Pavol Bistak  ME S oco oe oe ote ea ed ek Rn be dee ba BOB 275  8 2 Technical Requirements                      eee eee eee 276  PORE    1E 276  6 2 2 Client Computer   cicius cases ges iod eia ees 276  23  GRA OVA coe ok ck hawt tet A ee EEERME de banana des 276  8 3 1 Server Installation 5    osse 276  8 3 2 Client lastallatian    cose e RR eds 277  8 4 Running the Client Server Application                     277  8 5 Client User Interf  c    0  ous aie seb Ras 279  Shl Senge TRECE  280  8 5 2 Server IP Address and Control Buttons            281  8 6 Running the Experiment               0   eee en 283  8 7 Rules for Creation of Models in Simulink                  284  S  Condis u c ls eee qu RD RE eer RE rds 286  Constrained PID control Tasks for Controlling the  Thermo Optical Plant                  2   291  Peter Tap  k and Mikul     Huba  9 1  Thermo optical Plant uDAQ28 LT   Quick Start           292  9 1 1 Installation in Windows Operating System          292  DX Light Channel Control occ  ced dell eee gushed  298  9 2 1 Feedforward Control                          299  O22 Ig C
5.       The above expressions give the loss for the given d and n     but the issue is  the find the    magnitude    of the loss for the set bounded as    d   Here    magnitude    can be defined in different ways  and the worst case loss     Halvorsen et al  2003  and average loss  Kariwala et al  2008  for a given H  are given by           lt 1  2 17   2    Luc   55  My  2 18   L L     IMI  2 19   79  ny   na  d l  where  M H    J    HG    HY  2 20     Here 6  M  denotes the singular value  induced 2 norm  of the matrix M H    and    M  z denotes the Frobenius norm  normal 2 norm  of the matrix M   Use of the norm of M to analyze the loss is known as the    exact local method        2 4 4 Loss Method for Finding Optimal H    The optimal H can be found by minimizing either the worst case loss  2 18   or the average loss  2 19   Fortunately   Kariwala et al  2008  prove that the  H that minimizes the average loss in equation  2 19  is super optimal  in the  sense that the same H minimizes the worst case loss in  2 18   Hence  only  minimization of the Frobenius norm in  2 19  is considered in the rest of the    paper  The scaling factor ES does not have any effect on the solution    2 Measurements for Control  Optimization and Estimation 61    of the equation  2 19  and hence it is omitted in the problem formulation   Similarly  the square does not effect the optimal solution and can be omitted    In summary  the problem is to find the combination matrix H that mini   mizes the 
6.      55r       TVOmean 5 0295e 005       Fig  9 30 Performance portrait     FPrlo controller    e Compare the control quality with the Ig controller using a real time ex   periment     In practice it is often not efficient and sufficient to compensate large time  constant   s influence just by restricting the closed loop bandwidth  Active  compensation of dominant loop time constant leads to control structures  such as PIo controller  Fig  9 33  9 34     The output of filtered optical channel will be used to practice FPIp   controller tuning  An analogue first order filter is used for non filtered light  channel filtering  The process can so be approximated as    K    e Tas    lum Tis t1     9 17   The time constant T   represents a analogue filter time constant  dead  time Ty is used to approximate the lag between a bulb voltage step and the  corresponding change in the light intensity  Obtain the parameters of filtered  light channel  The exnum command with experiment no 5 can be used   For the plant used in this example it gives    9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 315    70         lt  Setpoint  ee FPrl     60r      Flo             a  o  T    S  o  T    Light intesity        o  T                      10r                0 50 100 150 200 250 300 350 400 450  time s     Fig  9 31 FPrlo     controller vs FIo controller under 5s transport delay  plant output    K      8 8728  19 8939   T      17 0096  25 8687   Ta      0  0 6     The dead
7.     1 Problems in Anti Windup and Controller Performance Monitoring 19       1                                     Til s 1  Kpt Transfer Fen  1  Int  Gain  Outi In3  Ob wa  Transfer Fen1  In2 1  Gain1     Ti2 s 1             Fig  1 19 Implementation of two PI controllers with simple anti windup technique  in Simulink     1 1 7 4 Conclusion on Simulation Results    The simulations show that all three controller types are able to achieve good  control of the plant  For all three controllers  the performance is significantly  degraded in the presence of saturation  although to different degrees for the  different controllers     1 1 8 Anti windup    In this section  anti windup is implemented for all three controllers  and the  simulations re run     1 1 8 1 PI Controllers    The simple PI anti windup scheme in Fig  1 1 is used  This simple anti   windup scheme is implemented in Simulink as illustrated in Fig  1 19  The  figure shows the implementation of both PI controllers  where input 1 is the  reference  input 2 is the measurement  and input 3 is the actual  measured   values of the manipulated variables  The results when using this anti windup  technique are shown in Fig  1 20  We see that the performance is markedly  improved due to anti windup  although output 2 is not able to return to its  setpoint due to saturation     1 1 8 2 Decoupler    Although the inverse decoupler reduces the problems of input saturation com   pared to ordinary decoupling  anti windup is still ne
8.     Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh     4 White noise disturbances      4 and measurement noise j   hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh  kw   0 001     Wvar   kw ones 2 1    Disturbance variance   QXU   eye 7     kv   0 0004    Vvar   kv ones 2 1    Measurementn noise variance    1 1 9 2 Simple PI Controller without Anti windup    Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh      PI controller    Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh  s   tf  s       Kp1   0 5  Kp2    0 5    Signs are decided through     dcgain A B C D   which results in      88 3573  86 8074  108 0808  107 9375   Til   2  Ti2   2     ki   Kp1i  Tii s 1   Ti1 s    kinum kiden    tfdata k1   kinum    kinum i     kiden   kiden 1      k2   Kp2  Ti2 s 1   Ti2 s    k2num k2den    tfdata k2   k2num    k2num 1     k2den   k2den 1        1 1 9 3 Decoupling      Transfer function matrix G s  defined in file model m    4 which must be run before this file     10    11    12    13    14    15    16    17    18    19    20    21    22    23    24    25    26    27    28    29    30    31    32    33    34    35    36    37    38    39    40    41    42    43    44    45    1 Problems in Anti Windup and Controller Performance Monitoring 25    y  Similarly  the individual PI controllers used with the  decouplers are    4  in this case  identical to the controllers used for    ordinary  PI control  The file    4 PIcont m should therefore also run before this file    Ahhhhhhhhhhhhhhhhhhhhhhhh
9.     So why is least squares not optimal     80 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke    The    problem     objectives function  for normal least squares is to get the  best match of the available data  ie   minimize   Y       H X     and it does not  consider how the estimate y    Hr is going to be used in the future    So why is the loss approach expected to be better    In the loss approach  the problem is    Given that y    Ha  find an optimal H such that the average magnitude  of   y          ll   is minimized for the expected future ds and n  s  which are  assumed 2 norm bounded     Here  we use the data to obtain Y   Y opr  G    and G  step 1   This step  may possibly be improved but it seems reasonable    The main advantage is that in step 2  we obtain the estimate y    Hy that  will work best    on average  for the expected disturbances and measurement  noise  as are indirectly given by the data in Yop  that is  we consider the  future use of the estimator and not just fitting of the data      2 10 Discussion    2 10 1 Gradient Information    How can we use the proposed approach in practice  for example  to find the  optimal policy for a marathon runner  We need to be able to distinguish  between    optimal data   Y        and    nonoptimal data    to find G    and G1  A  simple approach is to set y4   Ju  that is  we want to estimate the gradient    Then we know that optimal data corresponds to y    Ju   0 and we can  do exactly as above  Data
10.     There are a field for setting the server IP address and following control  buttons in the bottom part of the client interface     e Server IP     the field for setting the server IP address in the form of four  three digit numbers separated by points  The IP address should be fixed  and the user should know it  For testing purposed it is possible to start  the client application on the server computer  In this case it is necessary  to enter the value 127 0 0 1 or the string localhost    e Connect     this button realize the connection to the server  A user is in   formed about the result of the connection in the field Output  When the  connection is successful the message is Connected to server     In the op   posite case  wrong IP setting  e g   the message is Could not connect to    282 Pavol Bist  k    remote host  some time it takes a longer period   In the case when some   one is already connected to the server  the connection with another client  will be not realized because in one time only one user can operate a real  hardware  This time the message is  Server busy     disconnecting       Fig  8 7 Connection    e Disconnect     the button that cancels the connection with the server and  thus the server is free to accept connection from another user  There is a  message Disconnected in the field Output when the client is disconnected   If a client is not active for longer period or because of network failure  she he could be disconnected from the server automatical
11.    1  4  4 1   B   1  1   C    1 0   D 0   syst   ss A  B  C  D     Ts   0 02       create a system structure by discretizing the continous   time model  sysStruct   mpt_sys syst  Ts        define system constraints   sysStruct ymax   10  sysStruct ymin    10    sysStruct umax   1  sysStruct umin    1   Now we can define a set of initial conditions XO and a set of admissible inputs  UO as polytope objects      4 set of initial states   XO   polytope  0 9 0 1  0 9  0 1  1 1 0 1  1 1  0 1        set of admissible inputs   UO   unitbox 1 0 1     inputs should be such that  ul  lt   O 1  Finally we can compute the reachable sets    N   50    R   mpt_reachSets sysStruct  XO  UO  N       plot the results   plot XO     r     R     g         The reachable sets  green  as well as the set of initial conditions  red  are  depicted in Figure 4 24              Fig  4 24 Reachable sets for Example 4 1     4 Multi Parametric Toolbox 143    To compute reachable sets for linear or hybrid systems whose inputs are  driven by an explicit control law  the following syntax can be used     R   mpt reachSets ctrl  X0  N      where ctrl is the controller object as generated by mpt  control  XO is a poly   tope which defines a set of initial conditions  z 0      Xo   and N is an integer  which specifies for how many steps should the reachable set be computed   The resulting reachable sets R are again returned as polytope array     Example 4 2  In this example we illustrate the reachability computation
12.    91 942  Gar    004568     9  ga     00     3     55918  Gy     97 3 942    8  or 32  noisy data set generated from ideal data  G   G    4 data sets   with 2  or 8  different noise sets to get a total of 8 data sets  We here generate  the data by adding noise to data from a model     calibration set   and the   validation set  is the noise free data  To center the data I used opposite  sign when the data was  repeated   The noise was generated using randn  command in Matlab    It was found that when tested on a single example then almost any of the  methods could be the winner  To avoid this effect  the comparison was run  many times  with different random noise     Table 2 5 shows the average value of   Y       HX  p for 8 data sets after  running 250 times  The best method is PCR  val 0 4931   PLS with 4 com   ponents  val 0 5137  is the best PLS  This is not surprising since we know  that the data contains 4 directions  The new loss method is not doing so well  in this case  val 1 055   which is not so surprising since with only 8 data  sets there is limited information about the noise  Note that it is even worse  than least squares  val 0 9985   As expected  the improvement by adding  noise was significant  val 0 5850   but it is still not quite as good as PCR  and PLS    Surprisingly  smoothening of y   had absolutely no effect in this case  even  when I added noise on the y  data  results not shown      2 Measurements for Control  Optimization and Estimation 79    Tab
13.    Exercises 93    It is assumed that the unmeasured disturbances are k   and kz  and all other  variables are known except of cg  which is assumed difficult to measure  The  unmeasured variables are summarized in Table 3 1  and all measurements    Symbol Description    ky Reaction constant for reaction 1  k2 Reaction constant for reaction 2  cg Concentration of desired product    Table 3 1 Unmeasured variables    and known parameters are shown in Table 3 2  The task is to find a con     Symbol Description Type Value Unit  q Feed flow rate Known input varying m    min  cA Outlet concentration A Measurement varying kmol m   cc Outlet concentration C Measurement varying kmol m    V   Tank volume Known parameter 0 9 m   car Feed concentration A Known parameter 10 0 kmol  m   cpr Feed concentration B Known parameter 0 0 kmol  m   ccr Feed concentration C Known parameter 0 0 kmol m     Table 3 2 Known variables  Inputs  measurements and parameters    trolled variable which can be controlled using the total flow rate  and which  maximizes the desired concentration   Subtasks     Set up the steady state component balances  Set up the optimization problem   Write the optimality conditions   Calculate the reduced gradient   Eliminate the unknown Variables    Cup poop    3 4 Solution    3 4 1 Component Balance    We do a The steady state component balances for the system read     g     ar     qcA     kica V     0  92   qCBF     QCB   kicaV     kaegV   0  3 3   92   Wor     9c   kocgV  
14.    One can analyze the loss with alternatives choices for c using the    exact local  method   so why do we need the maximum gain rule  The motivation for  using the maximum gain rule is at least threefold    1  It is simpler to compute    2  It given insight  in particular that we want to control  sensitive  variables  with a large scaled gain  Select variables c where the    optimal variation      c     Copt   from disturbances  and including measurement noise  is small  compared to the    achievable variation  c   Gu   from inputs     3  The scaled gain matrix is Gs   S1GS2  Here  the gain matrix G is ob   tained by linearizing in a single operating point  To find the    scaling     matrices S   and 52 we need to reoptimize for the disturbances  to find  C    Copt needed for  4  and to find the second derivative with respect to  the inputs  to find  5     J zi 2   which can be rather involved calculations   If this information missing  then one may often get good results by esti   mating the optimal variations to find S    for example  based on operating  data  and by setting S5     I  one should in this case scale the inputs so  that their expected effect on the cost is similar      This maximum gain rule has also proven to work surprisingly well on  many applications  Nevertheless  if one has data for the optimal sensitivity   F   then our recommendation is to use the    exact local method  instead of  the maximum gain rule  This is because one can analyze alternative ch
15.    e Use the dointersect function to detect hit of the target  remember Ex   ercise 5    e You can plot the whole polytope array R in one shot by plot R      Exercise 4 9  Given is a discrete time  LTI system xy441   Ax   Bux sub   ject to constraints tmin S   k S Tmax  Umin S Uk S Umax  lake the following  data     11 1    5 5  A  l i   B  los   gt  Tmin   je  gt  Tmax   H  gt  Umin    l  Umax   1    Let s stabilize the system by an LQR feedback uz       K zp with K   dlqr A   B  eye 2   1   which gives K    0 52 0 94   Obviously  such a controller  doesn   t take constraints into account     However  there are some states for which all constraints are satisfied  e g     x    0 1  0 1     clearly satisfies state constraints  u    K x    0 146    clearly satisfies input constraints    and some for which they are violated  e g      x    1  1    4 satisfies state constraints  u    K x    1 46   but violates input constraints    4 Multi Parametric Toolbox 121    Now comes the question  what is the set of states for which all constraints  hold  Can it be represented by a polytope     As you might have guessed  the answer can be found using the MPT   s poly   tope library  In fact  the set of states for which all state and input constraints  are satisfied can be represented by    Ds  x   Emin  lt  Tk S Tmax  Umin    Uk   Umax    4 18   Using the fact that uj        Kv  leads to  V      z   min S Tk     Cmax  Umin      Kik     Umax    4 19   which can be rewritten using a compact m
16.    h OP 6a n   l  n  1 Gn 2   p 3 Gna   n5 bhi Uno       OONO O RUN      0 5558   0 3492   0 2938   0 2399   0 2534   0 1782   0 2118   0 1633   0 1364    F Ch  0 1253  0 0095 0 0235 0 0204 0 5164 7 6000   72 2300  0 0299  0 0104 0 0119  0 0024 0 6424 6 0450   37 8500  0 0698 0 0331 0 0251 0 0295 0 5599 5 5910   0 1069  0 0288 0 0148 0 0188 0 0175 2 8360 7 6770  109 9813  0 0522 0 0292 0 0274 0 0266 2 3090 7 7400   98 4255  0 0245 0 0054 0 0032  0 0023 2 6220 5 4040   60 9862  0 0221 0 0126 0 0247 0 0188 2 2820 6 8110   98 1203  0 0186  0 0175 0 0146  0 0220 3 1980 5 4450   98 2250  0 0486 0 0383 0 0167 0 0464 3 2560 6 0385   89 0348    Table 5 3 Fuel path model parameters  h OP ah    n i       p     amp Q 00  1 O   C  4 C 2     0 2516   0 2132   0 2470   0 1571   0 1888   0 1555   0 1217   0 1715   0 1935    ano ang Gna no bhi bn al   0 0827  0 0771  0 0636  0 0431 0 1463 0 5987  0 9737   0 0728  0 0636  0 0441  0 0373 0 1474 0 6242  0 7749   0 0602  0 0607  0 0377  0 0448 0 1467 0 5805  0 8746   0 0402  0 0835  0 0181  0 0579 0 3897 0 5257  0 4549   0 0475  0 0865  0 0203  0 0601 0 3509 0 4987  0 9676   0 0299  0 0667  0 0183  0 0428 0 4020 0 4820  0 7991   0 0218  0 0471  0 0077  0 0168 0 5273 0 3537 0 7585  0 0025  0 0562  0 0081  0 0227 0 5931 0 3097  0 0154  0 0083  0 0478  0 0136  0 0041 0 6168 0 2477 0 0373    tr     ma e mg v   ot  rpm     18  20  22  19  21  23  20  22  24    6 658  8 166  9 296  5 668  7 275  8 625  4 987  6 437  7 663    122 5  141 5  157 5  107 5
17.    has been performed  at the same time  These changes  simulate varying working regimes of an engine  which is adapting its run to  a daily traffic  Changes in t  and nen quantities are determining the engine  load  at the same time  ensuring  that the engine passes through several work   ing points during its operation  As mentioned in Section 5 3 3 2  the engine  revolutions are not included among explicit variables of local models  but they  build together with a delayed throttle valve position a vector of an working  point    k     The quality of control is sufficient  Fig  5 23  variable A   with exceptional  acceptable overshoots in both directions  These overshoots of the controlled  variable A have been caused by smaller model precision  due to its distance  from the working point  at which the system identification has been per   formed  This effect is caused by the approximation of a particular model    5 Implementation of MPC Techniques to Real Mechatronic Systems 221                                                    22      sU LILI LI LILI LL   gt  217 J  20 40 60 80 100 120 140 160    2600   T T T i T T T     S 2300  I  c 2000   real l   7 7 z desired jo 60 80 100 120 140 160  1 2 T T T T T T T  L 1                                     R  0 8   I I l I 1    20 40 60 80 100 120 140 160  PEE  10   A 9 T T T T T T T      E 5 L 1 L L L L L  20 40 60 80 100 120 140 160  ts     Fig  5 23 Results of a real time control of the SI engine    from the other working points 
18.    models    The overshoots were also diminished by an introduction of a penalization of  a    difference from the terminal state     This means  that into cost function is  added a member  comprising the difference  between the instantaneous and  the desired terminal state of a state vector  As it can be seen  skipping this  member in a cost function reduces the guality of control significantly  Fig   5 22   The corresponding control action computed by the controller is shown  in  Fig  5 23  variable Inj time     The initial engine warm up  to 80  C   eliminated model plant mismatch  caused by temperature dependent behavior of the engine    The control has been performed by choosing the penalization r   0 1   Utilizing the member pl    N     f   N   3 of a cost function by setting p    1 0 allowed us to shorten the control horizon to Np   20 what significantly  unloaded the computational unit and stabilized the controlled output of the  engine on this shortened horizon  as well  The best control has been achieved  in the neighborhood of working points  what is logically connected to the most  precise engine model at those points  In other working points the control is  still good enough  with small deviations from the stoichiometric mixture     222 Gergely Takacs et al    5 3 6 Conclusion    Considering the preliminary results from the real time experiments at the  engine  it can be concluded  that the idea of the AFR model predictive con   trol based on local ARX models is 
19.    sysStruct A   0 0315  0  0 0315   0 0315     sysStruct B  0 0769  0     sysStruct C    0 1     sysStruct D   0    must be specified even if it is zero      constraints  sysStruct xmin     21   21    sysStruct xmax    3 5  3 5    sysStruct umin    17   sysStruct umax   3   sysStruct ymin    21   sysStruct ymax   3 5       symbolic labels   sysStruct StateName       level 1      level 2     sysStruct InputName       inflow       sysStruct OutputName       level  2           verify the setup  mpt_verifySysStruct sysStruct         simulate the evolution for 5 steps    x     5   10    4 initial state  u    2 ones 10  1     inputs to use in the simulation  X   x     4 store of the simulated states  for k   1 5   x   mpt_simSys sysStruct  x  u k      X    X  x     X  X23  end      plot the state trajectories  t   O size X  1  1   plot t  X    Solution 4 12  for Exercise 4 12    probStruct N   6     4 Multi Parametric Toolbox 163    probStruct Q   eye 2    probStruct R   1   probStruct norm   2   mpt_verifyProbStruct probStruct       Solution 4 13  for Exercise 4 13    1  What is the optimal control action for z 0      755      we assume sysStruct and probStruct have been defined    ctrl   mpt_control sysStruct  probStruct     online          4 optimal  u  associated to x0     5   10    u   ctrl   5   10      u     0 0121    2  Which input corresponds to z 0     1 5   Can you give the answer even  before running the code in MATLAB   hint  take a look at state constraints  in sysSt
20.   1       on line controller  controller online   mpt control sysStruct  probStruct       online         explicit controller  controller explicit   mpt control sysStruct  probStruct     explicit           initial state for the closed loop simulations  x0     3  0        timing of the on line controller  tic   X   sim controller online  x0      4 Multi Parametric Toolbox 165  t   toc  t size X  1       timing of the explicit controller  tic   X   sim controller explicit  x0     t   toc  t size X  1     Solution 4 16  for Exercise 4 16        run ex 2 to load all necessary data  close all      plot the controller regions  plot controller explicit       plot the two initial conditions of interest   x1     4   1     x2     4   2     hold on   plot xi 1   x1 2    kx    x2 1   x2 2      ko        markersize      12        optimal control action associated to x1         since x1 is contained in one of the regions     we expect a feasible answer   u   controller explicit x1      check that x1 is indeed in one of the regions  isinside controller explicit Pn  x1       optimal control action associated to x2         since x2 is outside of the colored area      there should be no control action associated    to this state  in which case u        u   controller explicit x2      check that x2 is indeed outside of the regions  isinside controller explicit Pn  x2       now plot the feedback laws  close all    plotu controller explicit       rotate the graph manually to inspect it    166 Mich
21.   1 KO   Is Tf s  1                Fig  9 34 Plo controller  Simulink Model  to get FPIo controller you need to add  pre filter to the reference setpoint input    Gains corresponding to approximation of step responses produced by incremental input chang  20                      a o  o  o 00 o  18r o A  16r L 2  o  14  o o     Measured gains  S 12r 99 o          Mean gain  D  B 10r id  8 o  a 8   6 E  4r  2 I   oO L L L 1 J  0 1 2 3 4 5  Bulb voltage    Fig  9 35 Process gain in several operation points as function of the plant input    T  Tio    0 8  0 6  0 06   9 20     T  Tio   0 8 and T  Tio   0 6 should give transients of the undelayed system  output with up to 2  overshooting and the delayed system output should  not overshoot  T  T10   0 06 corresponds to controller tuning where    Ty   e    max T4    1 6310  9 21     318 Peter Tap  k and Mikul     Huba    Process time constants    30r  25  o o o  a o o 96  O O 9  00        20  o o  o o9   o  o  o o o       Q Measured time constants    Mean time constant    Process time cosntant  a  T               o  T             oO L L L L J  0 1 2 3 4 5    Bulb voltage    Fig  9 36 Process time constant in several operation points as function of the plant  input    This tuning can yield to transients with approximately 10  overshooting  of the undelayed system output and the delayed system output should not  overshoot  see the performance portrait in Fig  9 37     Compare the results with the FIo controller  Fig  9 17   Use the foll
22.   127 5  145 0   95 7  114 1  130 3    Ch u ms  m y    mg v      8 2735  9 7026  10 7074  7 3588  8 7353  9 9395  6 5651  7 7898  8 8919    1500  1500  1500  2000  2000  2000  2500  2500  2500    ot  rpm     1500  1500  1500  2000  2000  2000  2500  2500  2500    VIZ    Te 39 SYLL   e    5 Implementation of MPC Techniques to Real Mechatronic Systems 215        amp                                                              Comb  engine  T  gt   u  f z  real process    Nady  identification    Ms a  Air path  1    Len  gt   V Au  Fuel path  ms  f          Fig  5 19 Scheme of the identification process    5 3 3 4 Weighting Functions    The full working range of the engine has been covered by discrete amount of  local linear models  LLMs   identified at particular working points  Due to a  request of a smooth and continuous global engine model  design of weighting  functions  defining validity of each local model according to an instantaneous  working point of the engine was crucial  There were designed particular in   terpolation functions for every LLM  assigning it 10096 validity exactly at  the belonging working point with decreasing trend depending on the change  of the throttle valve opening t  or the engine revolutions nen  The Gaussian  functions were used as the local weighting functions  due to their suitable  shape fulfilling approximation properties  Each one is defined  as     Pr   k      z 0    exp        Anen k  At   k    a EN   Peal  5 24     The choice of tuning
23.   2009   Normey Rico  and Camacho  2009  considers compensation of an output disturbance by  correction of the reference value  whereby the disturbance is reconstructed by  using the PPM  However  despite to the proclaimed unification  it separately  presents solutions corresponding to stable  integral and unstable plants    Use FSP structure from Fig  9 51 with filter    322 Peter Tap  k and Mikul     Huba    Controller output                 FPI  T T  9 0 8  iati FPI  T T  9 0 6         FPI  T T  9 0 06        Flo controller                2 5    Bulb Voltage          0    L L ir 1 i J  0 200 400 600 800 1000 1200 1400  time  s   Fig  9 40 Experimental results     control signal  1  Bus  F s              9 28  nd TT  9 28     Use FOPDT approximation  9 18   whereby Ks   K T and a   1 T   Choose K o   max K    0   max Ta   Tio   max Ti ao   min a   Set up  the experiments in the same way as in the previous exercise to be able to  compare the results  For controller tuning use following rules    The P action should be set to    Kp    1 T      ao   K o  9 29   Filter parameter  11 set to  Bu   Tio  1    1   Te  Tio  1   T   Tyo e 9 To   9 30     Try multiple T  and T  settings e g  T    T10  2 4 8  16   Tp   T   2  4  8    In this example various T  settings were used  The filter time constant was  set to Ty   T  4  Experimental results are shown in Figs  9 52  9 53    Questions     e Was there any overshooting in the experiments   e How did the increasing of parameter T  affe
24.   2009  Bidirectional branch and bound for controlled vaiable  selection  part ii  Exact local method for self optimizing control  Computers and  Chemical Engineering 33 1402 1414   Kariwala V  Cao Y  Janardhanan S  2008  Local self optimizing control with average  loss minimization  Ind Eng Chem Res 47 1150 1158   Yelchuru R  Skogestad S  2010  Miqp formulation for optimal controlled variable  selection in self optimizing control  In  PSE Asia  2010  July 25 28  Singapore    2 Measurements for Control  Optimization and Estimation    Comments     Remarks    87    88 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke    Comments     Remarks    2 Measurements for Control  Optimization and Estimation    Comments     Remarks    89    90 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke    Comments     Remarks    Chapter 3    Measurement polynomials as controlled  variables     Exercises    Johannes J  schke and Sigurd Skogestad    Abstract In this chapter we present two exercises for finding controlled  variables  which are polynomials in the measurements  Detailed solutions  and maple source code are included so that the reader can easily follow the  procedure     3 1 Introduction    To illustrate concepts from described in the textbook  we present some small  problem and go through the solution step by step  The reader is encouraged  to experiment on his own to understand the ideas better    For solving the CSTR case study  the multires package is require
25.   3     plot I     y        hold on  plot Q     r     Q1     g     Q2     b     Q3     m     opts   hold  off    Solution 4 4  for Exercise 4 4   Plot the the set difference between Q and  Q3   D Q   Q3    plot D     g        hold on  plot Q     r     Q3     m     opts   hold off    4 Multi Parametric Toolbox 125             Fig  4 13 Intersection of polytopes Q  Q2  and Q3     How many polytopes define the difference     length  D     ans      Solution 4 5  for Exercise 4 5      unitbox 2     unitbox 2  0 1     P1  P2    05r           0 5  215       Fig  4 14 Set difference between Q and Q3     126 Michal Kvasnica     4 enumerate extremal vertices   Vi   extreme P1     V2   extreme P2      nvi   size V1  1     number of vertices of P1    4 initialize the store of vertices    v           for each vertex of Vl  add v1 V2 to the store  for i   l size V1  1    vi   Vi        V    V  repmat vi  nvi  1  V2    end      compute the minkowski addition as convex hull  sum   polytope V        is the output equal to MPT   s native implementation   sum     P1 P2     ans      Solution 4 6  for Exercise 4 6   Here is a general solution     P1   polytope   1  1   1 1  1  1  1 1     P2   polytope   0 1  0 1  0 1  0 1  0 0 1        A1  bi    double P1      A2  b2    double P2     At    zeros size A1  1   size A2  2    A1  A2   A2    bt    bi  b2      Pt   polytope At  bt    sum   projection Pt  1 size A2  2         is the sum equal to the output of P1 P2   sum     P1 P2     ans      Solution 
26.   GI Ga  F    G  JIi Jua   G3      G  G1  Ga    G4     In addition  we need to handle setpoint changes for the primary variable   Y   s  which requires changes in the setpoint for c  Note that y    only affects  the cost function and may be viewed as a price variable p  so from  2 22   the required change in the setpoint is Ac    HF  Ay  s  where Fp may be  obtained from the model  exercise  derive the expression       2 8 2 Indirect Control of y  Based on Estimator    Note that we still have not used the available degrees of freedom in H  To  simplify the setpoint adjustment  we may use the degrees of freedom in H  to make HF    I  or equivalently  c   y   This means that c should be  an estimate of y    Note that y    G4u and c   H Giu  setting d   0 for  simplicity   These two gains need to be identical  so we use the extra degrees  of freedom in H to make   HG    G   2 34     It is then easy to include changes in setpoint  we just control c at y  s     Some comments on this estimator    e What kind of estimator is this  If we look at the problem formulation  then  we see that it is be the optimal estimator in the following sense  When we  control y  at the estimate  using the unconstrained degrees of freedom   then this minimizes the deviation from the given value  setpoint   for the  expected range of disturbances and measurement noise    e For practical purposes  when obtaining the model  it may be smart to let  the primary outputs be the degrees of freedom  u   y  that
27.   It consists of the estimation of the flow coefficients of valves and of  the pump s parameters according to the above mentioned process     6 2 3 Automatic Calibration and Identification    The above mentioned procedure of calibration and identification is obviously  time consuming and also not easy to calculate manually  To perform the such  long time step by step measurements of the pump s characteristics plus to  save the measured values subsequently after each measurement and evaluate  them afterwards  we have to sacrifice an enormous quantity of time  That s  all is the reason why we developed the software package for automatic iden   tification of system s individual parameters and for identification of all valve  and pump parameters  The control is very easy     only one click is needed to  get the required identification in the menu  Menu s environment can be seen  in Fig  6 5    As the processes were described in details in the previous chapter  the  individual functionalities will be mentioned now just shortly  At the identifi   cation of the valve 1 2 or 3  the tank is fill up to the height of approximately  24 5 cm  then we wait till the liquid s level is stabilized and the tank is af   terwards emptied to 0 8 cm   At almost zero level  the valve   s behaviour is  strictly non linear and as we are not planning to regulate the level under 1 cm   we don t consider the lowest boundary   The measured values are saved  to   gether with all used constants  into the ma
28.   Plant model Calculated    measuremehts                State estimates       Fig  1 3 Illustration of anti windup for controllers based on static state feedback  combined with state estimation     In many applications it is desired to have offset free control at steady state   This requires the use of integral action  This is often incorporated in a state  estimator state feedback control design as illustrated in Fig  1 4     The state estimator only estimates actual plant states  whereas the state  feedback is designed for a model where integrators  which integrate the con   trol offset  are appended to the plant model  When implementing the con   troller  the integrators are a part of the controller  in the control system    The values of the integrators are thus directly available in the control system   and clearly there is no need to estimate these states     8 Morten Hovd and Selvanathan Sivalingam    References Model for    state feedback    Controller design                                                          Plant r i  State inputs   icd      feedback     gt  Plant Tee r Integrator s           controller  I          State  estimator  State estimates                Fig  1 4 State estimator and static state feedback augmented with integral action     However  when integration is incorporated in this way  the integrating  states may wind up even if the actual input values are sent to the state  estimator  Fig  1 5 illustrates how the anti windup signal to the inte
29.   time  s   FPI  T T  970 6  38   T T T T    36r J  34r E    Light intensity                1060 1080 1100 1120    1040                               1000 1020 1140  time  s   PP T T  970 06  38r J   gt   o 36r J         E 34  4   z  o 32r J       1000 1020 1040 1060 1080 1100 1120 1140  time  s   Fl  controller  38r J  D   o 36          E 34     o 32       30  1000 1020 1040 1060 1080 1100 1120 1140  time  s     Fig  9 43 Experimental results detail     delayed system output     325    disturbance step    326 Peter Tap  k and Mikul     Huba    FPI T T  970 8       38  36  34  32    Light intensity         ggob                0          1000 1020 1040 1060 1080  time  s   FPI T T   0 6             1100 1120 1140       38  36  34    Light intensity    32    30b           77    1000 1020 1040 1060 1080  time  s   FPI  T T 4070 06             1100 1120 1140       38  36  34    Light intensity    32    30  1000 1020 1040             1060 1080 1100 1120 1140    time  s   Fly controller              o           Dv     Light intensity  Co  R          c2  o       1000 1020 1040 1060 1080 1100 1120 1140  time  s     Fig  9 44 Experimental results detail     undelayed system output  disturbance step    9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 327       Fig  9 45 PI  controller    FF                Pa Ks  gt     Att     me  gt  P  gt  j  gt   A i Temperature 1    Thermo  optical  Repeating P asction Saturation 3  Seguence v 0  gt  16 fo  interface    Gain
30.  0       94 Johannes J  schke and Sigurd Skogestad  3 4 2 Optimization Problem    The objective function is  J      cp   3 4     which we want to minimize subject to the process model     min J  s t   g    0  3 5   g2  0  ga   0    3 4 3 Optimality Conditions    We write the Lagrangian  L  J z    ATg z    3 6   where z    c4  cp  co  q T  The first order optimality conditions are then    VZzJ z    Vzg z   0    aia  es  3 7     Next we calculate the null space of the constraints N    n1  n2  n3  na   with    ni    car     ca   q   kV   3 8      qcpr     CBrkiV   qep t cgkaV     k1Vcar   kica V  Pee UN eee   a   k2V  q   la V     n3           copd      corqk  V     copkaVq     cork2V7ky   coq    coqkiV     cck2Vq   cckoV ki     kaVqcpr     koV cgrki   koVqcp   koV cpki      kaV kicAr   kaV kica      q   kaV  q   kV a    3 10   n4    1  3 11   Eliminate Lagrangian multipliers using the null space  we write the opti   mality conditions    c   N z TV J z  0       3 12     3 Measurement polynomials as controlled variables     Exercises 95  Since we control c  to zero  we need to consider only the numerator  which is  Num c         qcepr     CBrkiV   geB   eglaV     k1Vcapr   kicaV   3 13     This expression cannot be used for control yet  because it contains unknown  variables  These have to be eliminated in the next step     3 4 4 Eliminating Unknowns k    k2 and cp    We use the package multires to construct the matrix for the toric resultant       qcBF q    cBFV    VcAF  cAV V 0
31.  0  0     4 5 6 1 Import of Models from External Sources    MPT can design control laws for discrete time constrained linear  switched  linear and hybrid systems  Hybrid systems can be described in Piecewise   Affine  PWA  or Mixed Logical Dynamical  MLD  representations and an  efficient algorithm is provided to switch from one representation to the other  form and vice versa  To increase user   s comfort  models of dynamical systems  can be imported from various sources     Models of hybrid systems generated by the HYSDEL language  MLD structures generated by the function mpt_pwa2mld  Nonlinear models defined by mpt_nonlinfcn template  State space and transfer function objects of the Control toolbox   System identification toolbox objects   MPC toolbox objects    In order to import a dynamical system  one has to call  sysStruct   mpt sys object  Ts     where object can be either a string  in which case the model is imported  from a corresponding HYSDEL source files   or it can be a variable of one of  the above mentioned object types  The second input parameter Ts denotes  sampling time and can be omitted  in which case Ts   1 is assumed     Example 4 6  The following code will first define a continuous time state   space object which is then imported to MPT       sampling time  Ts   1       continuous time model as state space object  di   ss  1 1  0 1    1  0 5    1 0  0 1    0  0         import the model and discretize it  sysStruct   mpt sys di  Ts      Note 4 1  If the
32.  0 0    qcBF        q cAV 0 0  Vo  qcAF    qcA 0    cAV 0 0 0 0  M  0 0 qcBF    g cAV 0  V  3 14   0 0 qcAF     qcA 0    cAV 0 0  qcCF    qcC 0 0 0 0 vo  L 0 0 qcC F     qcC 0 0 0 V            3 4 5 The Determinant    The  factorized  determinant of M is  c  q cAV  cAFCA   CAFCOF     CAFCC     c     3 15     We see that the pre factor q cAV  is nonzero under operation  so the condi   tion for optimal operation is only the last factor           CAFCA   Carcor     CAFCO    CA     0  3 16   Now the we have ended up with a controlled variable combination which con     tains only known variables  It may be confirmed by the reader that controlling  c to zero leads to the same solution as solving the optimization problem  3 5      oma rt O U K WN F    W W o o o o W o Oo wn YN NNN NN NN E FB FE E FE F FE FE HH  O  340 0 R ON R O       4 AAR WN HF O O    NJN O a A O N F O    96 Johannes J  schke and Sigurd Skogestad    3 4 6 Maple Code    The maple code for the CSTR example is given below    Maple code for the CSTR example    SAHARA HAHAHA HHH BHP HHH HH     This is the file mapleCSTR mpl      Simple CSTR      Johannes Jaeschke       Nov  2010  THEIBIBBHHHBHBRHHHBHHBHHHHHHEHHHBHHBHERHHHBHHBHBHEHBHHHEHHBHHBHBHHHEHHEHHBBHE    with LinearAlgebra  with VectorCalculus      Define the cost to minimize  J    cB       Setting up the constraints   gi   q cAF   q cA   ki cA V    g2   q cBF   g cB   ki cA V   k2 cB V   g3   q cCF   q cC   k2 cB V    g  7 g1 g2 g3        Derive to obtain first or
33.  1 1 F                M       ni rec Transfer Fcn 1    WEN T  il s 1 Step Light    v intensity 1  f sta  O   us    Tis       Fig  9 46 PI  controller  Simulink model                                                                                                                                                                                                 e Which controller performed better in comparison with PI  controller     References    Astr  m  K  and H  gglund  T   2005   Advanced PID control  In ISA The Instru   mentation  Systems  and Automation Society  Research Triangle Park  NC    Normey Rico  J E   Bordons  C   and Camacho  E F   1997   Improving the robustness  of dead time compensating pi controllers  Control Engineering Practice  5  801     810    Normey Rico  J E  and Camacho  E F   2009   Unified approach for robust dead time  compensator design  J  Process Control  19  38 47    Normey Rico  J E   Guzman  J   Dormido  S   Berenguel  M   and Camacho  E F    2009   An unified approach for dtc design using interactive tools  Control Engi   neering Practice  17  1234 1244    Visioli  A   2006   Practical PID Control  Springer  London     328 Peter Tap  k and Mikul     Huba    Pl  controller     output of filtered light channel  K 19                                              70 r T     i e          delayed output  lo     undelayed output  60      setpoint J  i l  so        i    D  o M J            NE    Try  E 5  0 i f L    L 1  0 20 40 60 80 100  time  s     
34.  1 Introduction    This subsection introduces the use of multi parametric programming based  MPC in active vibration attenuation    The Multi Parametric Toolbox  MPT  is a freely available and distributed  Matlab toolbox for the design  analysis and rapid deployment of PWA con   trollers Kvasnica et al  2004  2006   The multi parametric control laws cre   ated via the MPT toolbox are not only usable in Matlab  but it is possible to  deploy them onto rapid software prototyping platforms using the Real Time  Workshop  More details about the MPT toolbox can be found in Chapter 4    This workbook assumes the current release  Version 2 6 2  of the toolbox   available online   Matlab is assumed to be used for multi parametric con   troller calculation and simulations  while the real time code is assumed to be  implemented using the xPC Target protocol and Simulink     5 2 5 2 Off line Controller Computation    The control objective assumed in this example is to regulate toward origin   since the beam equilibrium is located at the origin of the state space  Let the  cost function to be set as a quadratic  2 norm   Penalization and constraints  are identical to the NRMPC and QPMPC case  input penalty R   10E  4   state penalty matrix was set to O   CT C  Input constraints are set to  120 V  and output or state constraints are not engaged    We begin with loading the system model        load n4s2A mat  sysStruct A   n4s2 A   sysStruct B   n4s2 B     1 Software package and extended doc
35.  102  4 0 Computational Geometry in MPT                     0  103  A2l  POliSDeE  sooo cer athens ia pet era ma 103  4 22  Polytope Arraya 5    sessanta 106  4 2 3 X Operations on Polytopes                          107  42 4 Functions Overview    2 0 0 0    isle reu 113  qu     BXOFDBAB  olores A herein eee HE Parier E Ete ee 115  T     JSODDIOBE  lt   c fo 8 bane cao ed PE eee d UE dece E 122  4 5 Model Predictive Control in MPT                 suus 131  ADL  BeoscuUsBg   vo cube cable k   dek eae 133  4 5 2 Closed loop Simulations                 0 eee eee 134  4 5 3 Code Generation and Deployment                 135  4 5 4 Advanced MPC using MPT and YALMIP          136  455   ABS 234 eda vnc ark he eon eke Ronee bran 141  4 5 6     System Structure sysStruct                      147  4 5 7 Problem Structure probStruct                    151  ONEMS ALS  TORT Ec a Pe ee ee ee Pe 156   E  ins ER  162  SICH oened ek ee Mew hdd ad eee eden ees 166    Contents    Implementation of MPC Techniques to Real Mechatronic  SVOTE 25 ieee OR L ee O eda eed e p debe s 171  Gergely Takacs and Tom  s Pol  ni and Boris Rohal    Ilkiv and   Peter   imon  i   and Marek Honek and Mat     Kopa  ka and Jozef  Csamb  l and Slavom  r Wojnar    VNMEME CI ID nn PERSEQUERIS METER 172  5 2 MPC Methods for Vibration Control                      173  Boll OCI oe ce ok no dea zbo len EC edes 173  2 2 RWS ode eed cde enh abe eaten bd 174  5 2 3 Quadratic Programming based MPC               177  5 24   New
36.  2    ein an  vale 12 VO Interface raw signal from sensor3 in EU pf   calibP aramsB   valves                            calibP aramst5      I3  m   valve 2  gt   offset 3 Gain4  valves 4  M  tank3  valve 2 3  valves      3  4 Terminator          valve 3    Fig  6 4 Basic diagram for calibration and configuration     Under manual calibration we will partially fill the calibrated tank and  empty it subsequently  Raw integer number from each output is sensor offset  Tiempty  This is specified in engineering units  EU   Afterwards  we fill up  the tank to the maximum height of liquid   s level and we define the output   s  value Ziempty in EU  We deduct  once again  the value of sensor   s outputs   The conversion to liquid   s level in meters is defined by the relation     itu   Tiempty    Ax   Tlactual     Viempt  g    Tisetual     Flempty  6 5   sensorGaini    sensorGaini    236 Vladim  r   ilka and Mikul     Huba    Here  T1actual is the actual value of liquid s level in EU  X1empty is the output  in EU at the zero liquid level and 7154   is the value of the output in EU at  maximum liquid level and Az  is the height of the maximum liquid level  For  example  if we know that at the zero level  1empty   800 EU  at the maximum  level Az    0 25 m and output 3300 EU  for the output 2300 EU it holds     3300     800  sensorGaim       795   10000 EUm    2300     800  r     10000       0 15m    After the calibration it is suitable to perform identification of system s pa   rameters
37.  2  w dim 1 3    w dim 1 5  size Q 1      Matrix square roots of the penalization variables are computed  These are  required in the construction of the invariance condition  The closed loop linear  quadratic gain is calculated as well  and it makes use of the prediction model  and penalties introduced earlier     sqrtR   sqrtm R   sqrtQ   sqrtm Q    K  dlqr  An B Q sqrtR sqrtR     Phi0  An B K      5 2 4 3 Off line Variables and Constraints    Four optimization variables are declared  according to the dimensionality of  the problem  Matrix N is fully parametrized and sguare  while the rest of the  optimization variables are real valued and symmetric     Xg   sdpvar w dim 1 1  w dim 1 1     Yg   sdpvar w dim 1 1  w dim 1 1     N   sdpvar w dim 1 1  w dim 1 1   fu11     M   sdpvar w dim 1 2  w dim 1 1       The LMI constrain the semi definite programming problem  The set com   mand instructs the parser YALMIP to construct a constraint in an LMI  form     Invi  Yq Xq Xq Xq      Inv3    PhiO Yq B M Phi0 Xg N Phi0 Yg B M PhiO Xq     if  gamma lt 1 tolerance   gInv gamma eye w dim 1 5  w dim 1 2     zInv zeros w dim 1 5  w dim 1 2  2 w dim 1 1     Inv2 blkdiag sqrtQ sqrtR   Yq Xq  K YqtM K Xq     F   set  gInv zInv Inv2  zInv      Invi Inv3  Inv2    Inv3    Invi   gt  0     else  F   set  Invi Inv3  Inv3  Invi   gt  0     end    The if construct checks whether there is an input constraint defined or not   If yes  the feasibility condition is translated to the proper LMI and added 
38.  20    21    22    23    24    25    26    27    28    29    30    31    32    33    34    35    36    1 Problems in Anti Windup and Controller Performance Monitoring    Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh      Reference signals       Parameters in signal generator blocks for      references    Ahhhhhhkhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh  ylamp   1    yifreq   0 005    y2amp   0     y2freq   0 005     Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh      System parameters     4 Distillation column model 4  hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhlhhh lhl  A      0 005131 0 0 0 0 i  0  0 07366 0 0 0    0 0  0 1829 0 0    0 0 0  0 4620 0 9895    0 0 0  0 9895  0 4620     B      0 629 0 624      0 055  0 172    0 030  0 108     0 186  0 139     1 230  0 056        0 7223  0 5170 0 3386  0 1633 0 1121      a  ll    Output 1  1 5 T                l l 1 L l L L  50 100 150 200 250 300 350 400    Output 2    I  450    500       2 T        ib        2 L          L l L L L l L  0 50 100 150 200 250 300 350 400    Fig  1 24 Responses with LQG controller with integral action and anti windup     L  450    500    23    37    38    39    40    41    42    43    44    45    46    47    48    49    50    51    52    53    54    55    56    10    24 Morten Hovd and Selvanathan Sivalingam     0 8913  0 4728 0 9876 0 8425 0 2186       Bd      0 062  0 067    0 131 0 040    0 022  0 106     0 188 0 027     0 045 0 014     D   00   00    sys   ss A B C D    G   tf sys     Used in decoupler
39.  6 7 Pump implementation in simulink     For removing sediments from the walls of the tanks use a soft brash appro   priate for bottle cleaning  Pump out the water containing such sediments and  flush the system several times by clean water  After that you need to pump  out also the standard water used for cleaning and again fill the container by  the distilled one    For eliminating the evaporation fill in the water into tanks that are covered  and have smaller evaporation area    After a longer period without use it may happen that some valve does not  open or close  In such a case it is necessary to repeat open close procedure  several times  even when it does not function  and then slightly hit the metal  screws in the valve centre  This may help to release the valve    When you know that the system will not be used for a longer time  pump  out all water    When you keep all these rules  the system does not require any mainte   nance  Only in extreme situations when the system was not used for longer  time period without pumping out all water  the sediments may not only cover  the walls of containers  but even tubes  pressure sensors and valves  When  facing problems with pressure sensor  after emptying the containers by a gen   tle pull remove the sensor from the tube and clean the tube by a thin wooden  tool  When the sediments clog up the valve  it is necessary to unscrew fit   tings from both sides and to flush the valve under pressure  e g  by a rubber  ball filled b
40.  8  Sos p  a 2  E a 6  206 a  04  4  0 2  0 2    4 6 8 10 12 0 02 04 06 08 1 12 14 16 18  pump voltage  V  pump 1 output  m  s  x10    a  IO characteristic  b  Inverse IO characteristic  The characteristic of the flow coefficient of the valve  o5 Outflow characteristic fer teal system an model   tenet  0 038           identification     2cm steps Ll nea Set  1 o identification     steady states  0036        approximation 2     0 084  2  S 0 032       amp  0 15    0 03    5 E    0 028       2    0 026 0 1  8  5 0 024  2    0 022 0 05  0 02  0 018    0 i i i i i n   i  o 0 05 0  0 2 0 25 o 5 10 15 2 30 35 40 45    1 0 15 0     25  level  m  t s      c  Determining c1 by the first method  d  Determining c1 by the second method    Fig  6 6 Measured Input Output pump characteristic and its approximation by the  4th degree polynomial and inverse input output pump characteristic and its approx   imation by the 4th degree polynomial  above   Determination of the valve coefficient  c   with two approaches     comparing the measurement and approximative data for  tank 1  below      The measurement of pump s characteristics is more time consuming  In  order to achieve the required accuracy  we continue with increasing the pump  input by the step 396 of the maximal range 10096 up to the moment where  the pump starts slowly to draw the liquid   In our case it will be around 19      21 96   At lower inputs  the pump is not working    At the beginning of measurement  we empty the tank  and 
41.  Az t    Bult    4 23     or a Piecewise Affine  PWA  system with    f a t  u t     Aix t    Byu t    f  if Wl aD    4 24     u t     where the state update matrices change according to the position of the state     input vector  i e  the tuple  A   Bi  fi  is valid if Bel     Dj  where D   i    1      D are polytopes of the state input space  Furthermore  it is assumed    that the system variables are subject to constraints  zx t ce X  ult  EU  vt 20   4 25     where T and U are polytopic sets   In MPC  optimal control actions are calculated by formulating and solving  a suitable optimization problem  which usually takes the following form     N 1  min   Pyanlp   X 10x     Ruzllp  4 26a   k 0  s t  zo   x t    4 26b     k 1   f   k  uk   k   0    N   1  4 26c   EX k 0      N  4 26d   RAM  We oco  4 266     where x  and ux denote  respectively  the state and input predictions at time  instants t   k  initialized by the measurements of the current state z t   and  Py  Q  R are penalty matrices  The prediction is carried out over a finite  prediction horizon N  In addition    Pz  p with p   2 stands for the square of  the weighted 2 norm of z  i e  z7 Pz  Similarly  p   1 and p   oo denote the  1  and co norms of some vector    The aim of MPC is to find the vector Uy     ud   uT     uT    T of optimal  control inputs which minimizes the cost function  4 26a   If f       in  4 26c     132 Michal Kvasnica    is linear as in  4 23   the MPC formulation can be rewritten as a Quadra
42.  FW4W ns   The objective is to find the nonsquare ne x ny  matrix H  note that nu   ne   We will here consider some special cases  of this problem  which historically were developed before the convex and  analytical solutions presented above     2 7 1 No Measurement Noise  Nullspace Method     full  H      For the special case with no measurement noise  Wy   0  and with more   independent  measurements than  independent  inputs and disturbances   Ny   Nu   na  it is possible to find H such that    HF  0  2 28     that is  the loss is zero  This is called the    nullspace method     Alstad and  Skogestad  2007  because H is in the nullspace of F   In this case  Gy and  W a do not matter for finding the optimal H    The nullspace method is very simple and has been found to be very useful  in applications  Since the nullspace method neglects the effect of measurement  error  it is important to use preselect a subset of the measurements that are  expected to be insensitive to measurement errors    Also  one cannot include too many disturbances  because otherwise one  cannot satisfy the requirement ny  gt  ny   ng    One limitation with the analytical formulas in  2 24  and  2 25  is that  they do not give the nullspace method as a special case  This is because  Y   FWa Wn  at most has rank ng when W ny   0  Thus  the ny x ny  matrix YY    at most has rank nq and is not invertible because this would  require the rank to be ny  However  the convex optimization problems in   Theorem
43.  M2 1  nc 1   nx   nc 1    nx nx    R eye nc      F F1 M2  1   nc 1  nx   nc 1  nx nx         Qe M1 1  nc 1   nx   nc 1     nxtnx       G G1 M1 1  nc 1  nx   nc 1  nx nx      Qe M1 1  mc 1   nx   nc  1     nx nx        To ensure feasibility and stability beyond the prediction horizon  the con   straint checking horizon is calculated as well  This process is started up by  an initialization procedure     180 Gergely Takacs et al    Ki K    Ki 2     K   A B K     i 1    Nc 0    u uh 1     The length of the constraint checking horizon is computed in the following  loop     while  u  gt  uh    Ki i 2    2K   A B K     i 1    f Ki i 2      Am  Ki 1  i 1      Ki 1  i 1        b  uh ones  i 1  1    ul ones  i 1  1     xO linprog  f Am b    u Ki i 2    x0   Nc Nc 1   i i 1    end    This can be followed by defining the constraints and re formulating them  to be useful for direct guadratic programming solution  This formulation  assumes symmetric input constraints     Aci  eye nc     bO  uh ones nc Nc 1    ul ones nc Nc 1     Bxi zeros  nc 1  nx      for i 0 Nc  Aci nc i     Ki i 1    M21    Bxi nc i      Ki i 1    M11    end    Ac  Ac1  Ac1    Bx  Bxi   Bx1      5 2 3 4 Re formulating for the Simulink Interface    This sub subsection introduces a way to reformulate the prediction matrices   so they can be used directly with the Simulink interface of qpOASES  First  the cost prediction matrix H is re formulated  so it is suitable to pass on to  the qpOASES problem     Hap      for i 1
44.  Meeting on Cyberntetics and Systems Research  Vienna   Austria    270 Vladim  r   ilka and Mikul     Huba    Huba M  1999  Dynamical classes in the minimum time pole assignment control  In   Computing Anticipatory Systems   CASYS    98  Woodbury  American Institute of  Physics  pp 499 512   Huba M  2001  Constrained control of the two tank system  In  9th Mediterranean  Conference on Control and Automation  Dubrovnik  pp 93 98   Huba M  2003  Gain scheduled PI level control of a tank with variable cross section   In  2nd IFAC Conference on Control Systems Design  Bratislava  Slovakia   Huba M  2005  P  und pd polvorgaberegler fiir regelstrecken mit begrenzter stell   gr  sse  Automatisierungstechnik AT 53 6  273   283   Huba M  2006  Constrained pole assignment control  In  Current Trends in Nonlinear  Systems and Control  L  Menini  L  Zaccarian  Ch  T  Abdallah  Edts   Birkh  user   Boston  pp 163 183   Huba M  2010  Designing robust controller tuning for dead time systems  In  IFAC  Int  Conf  System Structure and Control  Ancona  Italy   Huba M  2011a  Basic notions of robust constrained pid control  In  Selected topics  on constrained and nonlinear control  M  Huba  S  Skogestad  M  Fikar  M  Hovd   T A  Johansen  B  Roha  Ilkiv Editors  STU Bratislava   NTNU Trondheim   Huba M  2011b  Constrained pole assignment controller for sopdt plant  complex  poles  In  NIL Workshop on constrained and nonlinear control  M  Huba  S  Sko   gestad  M  Fikar  M  Hovd  T A  Johansen  
45.  N and M are converted into the standard  double precision matrix format  from the YALMIP optimization variable no   tation     info   solvesdp F  geomean blkdiag Yq Xq   ops    Yq   double Yq   Xq   double Xq    N   double N   M   double M      5 2 4 5 Factoring  Storing and Preparing Parameters for the  On line NRMPC Run    After the optimization variables are available  the parameters used in the  on line NRMPC run have to be factored out and stored     5 Implementation of MPC Techniques to Real Mechatronic Systems 187     V XiU    lu eye w dim 1 1     Yq Xq    XiU   XiU     Qzi  inv  Xq     XiU XiU    V   Yq XiU      Qz  Yq V V       Xq XiU   W       Code segments  V  Yq XiU  and   Xq XiU   V actually implement mathe   matical operations  V  Y X  U and     X4X U   V   The full  optimized shift matrices Ag and Co are calculated according to     AO    Xq XiU   N V       CO   M V      Qi1 inv Xq    Q12 XiU    Q21 XiU     Q22  V   Yq XiU     Kt  K CO      where code segment  Xq XiU   N V     is equivalent to the operation   Xa XiU  KVT    A matrix right division is used in the segment M V    to implement the  operation M VT 1  After this respective partitions of Q  are stored in vari   ables for the needs of the on line NRMPC code  It is true that partitions Q12   Q    are related in symmetry     5 2 4 6 Cost Transformation    The following code segment is related to cost transformation  and the result   ing conversion of augmented states  The cost to be minimized in the on l
46.  P      P2  described in Sec   tion 4 2 3 6  is easy to implement of the polytopes P   and P2 are given in  their V representation  ie  P    convh x1      m   P2   convh y1      yp    Then   Pi    P     convh zi   yj  Vi  Vj    4 14     Now assume that P   and P2 are as follows      gt  gt  P1   unitbox 2    gt  gt  P2   unitbox 2  0 1    0 8    0 6    04     02       i i fi i Ll i L i i   0 8  0 6  04  02 0 0 2 04 0 6 0 8 1     i        04   1       Fig  4 10 Set difference between Q3 and Q     118 Michal Kvasnica    i e  hypercubes  in 2D   centered at the origin  The task is to implement  Minkowski addition via  4 14   Hint  use the extreme function to enumerate  vertices of P   and P2  Compare your result to the output of MPT   s internal  implementation  i e  to P1 P2     Exercise 4 6  Recall that Minkowski addition of two polytopes is given by  P   B Pa    x    y   x     Pi  y     Po    Assume that the polytopes are given  by their H representation  i e  P1    x   Aix  lt  bi   Pa    y   Aoy     bo    Define a new variable z   x   y  Then we have    P   Pa        y   x     Pi  y E    Po   4 15a      x  y   Aix  lt  b    A2y     bo   4 15b     z z a y  Aix  lt  by  A2y  lt  b2   4 15c   dete A KED  4 15e      z1  l  j  lt  8   4 158      z   iz  st      Z   lt  b    4 15g           Note that in  4 15d  we have eliminated the variable y by replacing it with  z     x  The last line  4 15g  states that the Minkowski difference can be in  fact computed by projecting the poly
47.  Reduction    MPT also addresses the issue of complexity reduction of the resulting explicit  control laws  As explained in more detail in Section 4 5  the on line evalua   tion of explicit control laws involves checking which region of the controller  contains a given measured state  Although such an effort is usually small   it can become prohibitive for complex controllers with several thousands or  even more regions  Therefore MPT allows to reduce this complexity by sim   plifying the controller partitions over which the control law is defined  This  simplification is performed by merging regions which contain the same ex   pression of the control law  By doing so  the number of regions may be greatly  reduced  while maintaining the same performance as the original controller   The results of the merging procedure for a sample explicit controller of a  hybrid system is depicted in Figure 4 26     10    3           10   10     10  10  10          8 10        s  6 m 2 0 2 4 D      8  6 A 0 4 6     a  Regions of an explicit controller before  b  Regions of an explicit controller after  simplification  252 regions   simplification  39 regions      Fig  4 26 Region merging results     To simplify the representation of a given explicit controller by merging  regions which contain the same control law  one has to call     ctrl simple   mpt simplify ctrl     4 Multi Parametric Toolbox 147    If the function is called as indicated above  a heuristic merging will be used   It is al
48.  T          L L L  0 50 100 150 200 250 300 350 400 450 500                Output 2  2 T T T T  jt X a  0 gg   S n   Mc necs  aL 4   2 l l l l l l l l l  0 50 100 150 200 250 300 350 400 450 500          Fig  1 16 Responses with the inverted decoupler  with saturation in the inputs    1 1 7 3 LQG Controller with Integral Action    The responses in the outputs when using the LQG controller are shown in  Fig  1 17  We observe that the performance is good  and there is very little    interaction between the outputs    The corresponding responses when the input is constrained between  are shown in Fig  1 18  Note that the Kalman filter is here supplied        0 5  the    18 Morten Hovd and Selvanathan Sivalingam    Output 1    15 1             L L L L L L L L  50 100 150 200 250 300 350 400 450 500                   Output 2  2 T  TE 4  0  AL 4   A L L L L L L L L L  0 50 100 150 200 250 300 350 400 450 500    Fig  1 17 Responses with the LOG controller with integral action  in the absence of  saturation     Output 1                                  L L L L L fi  0 50 100 150 200 250 300 350 400 450 500    Output 2    an  n                        L L L fi  0 50 100 150 200 250 300 350 400 450 500    Fig  1 18 Responses with the LQG controller with integral action  with saturation  in the inputs     actual  constrained  saturated  input values  but there is no anti windup for  the augmented integrators  The performance is significantly poorer than for  the case without saturation 
49.  T    We would like to recall as well the special case of two tanks connection  It  differs from  6 1  in the way that the outflow from the first tank is at zero      valve 1 is closed  the second pump is turned off and the liquid s height in the  second tank is controller by controlling the inflow into the first tank  We can  write down the system equations as it follows     260 Vladim  r   ilka and Mikul     Huba      1  t     As     Ci2 V X1     T2  1  t2      12V    1     T2     Co   t2  y   T2  7 8     The above mentioned system has the relative degree r   2  That   s why we  have to proceed  when looking for the feedback  from the equation         v  so  u1 can be defined as    2A T1  uj   um     T2     1   12V    1     12     2A102 T2   A  12 2    Different from the previous examples  by application of this feedback we  obtain from the original system  7 8   linear system y   v   with transfer  function     Thus  we would have to apply a different approach to continuous gainschedul   ing of the controller paramters based on  7 9   whereby the new input vi  should be computed in a way respecting all basic performance limitations      nonmodelled dynamics  model uncertainty  meausrement and quantization  noise and the contorl signal constraints     7 5 PD  controller    In reality  the control signal is always constrained  what can be expressed as  Ur      U1  Us   Ui   0    Uz  7 9     So  despite to the fact that the control signal is usually generated by linear  contr
50.  The liguid from the bottom tank can not flow into the upper  one  plus the upper tank s inflow impact does not depend on the liguid s level  in the lower tank  Due to the available eguipment  in the practical part of  this chapter we will consider just coupling in series with mutual interaction  of tanks    In order to be able to demonstrate theoretical aims of the control algorithm  design and verify real processes by simulation using their models  we need to  know the process model and its parameters  Sometimes  the simplest possible  model is reguired  but for some tasks  the most accurate model possible is  wellcommed  In case of inaccurate mathematical model  the accociated con   troller  if not sufficiently robust  would function only in simulations  That s  why we will be dealing from now with the analytical description of the real  scheme necessary for construction of the model  with the identification of the  proposed model parameters  as well as with confrontation of the model with  the real process and with control processes associated with control design  based on considered models     6 2 Coupled Tanks     Hydraulic Plant    Coupled tanks represent one of the most common examples of non linear  system  The task is usually related to basic manipulation reguired for dealing  with the available physical system  System considered in our publication is  shown in Fig  6 1  This hydraulic system is composed of 2 pumps and 3  coupled tanks  each of them with the own dra
51.  a scalar factor a    0 gives R    ax   x     P    alpha   0 6  R   alpha P   e Affine transformation of P by an invertible matrix M gives R   Mx x      PY   M    1 5 0  O 1   R   M P    Now practice on the triangle defined in Exercise 1     1  Let Q1 denote the shift of Q in the direction of the vector  0 5      0 2     2  Let Q2 be Q1 scaled by a factor of 0 8   3  Let Q3 represent Q2 rotated by 45     4  Plot Q in red  Q1 in green  Q2 in blue and Q3 in magenta  Moreover  plot  all polytopes in the same graph using wireframe     Hints     e Rotation is achieved by applying the following matrix transformation with  0 being the angle in radians      0     sin 0   M so cos 0     ids     e To plot several polytopes in the same graph  do it in a standard MATLAB  fashion  i e  plot P1   r   P2   b      P3        g      e To plot using wireframe  use additional options     opts   struct    wire     1     linewidth     3    plot Pi   r   P2   b   P3   g   opts     116 Michal Kvasnica    Exercise 4 3  Now concentrate only on Q and Q3 from the previous exercise   It is obvious from the plot that these two polytopes overlap  i e  they have a  non empty intersection  To check this  use dointersect     dointersect Q3  Q   ans    1    Since the intersection of any two polytopes is again a polytope  the intersec   tion can be computed explicitly by calling the overloaded  amp  operator     Q4 Q3  amp  Q    To visualize the intersection  we plot Q4 in solid yellow and Q3 and Q using  wiref
52.  all practical control problems  the range of actuation for the  control input is limited  Whenever the input reaches the end of its range  of actuation  the control input is saturated   the feedback path is broken   If the controller has been designed and implemented without regard for this  problem  the controller will continue operating as if the inputs have unlimited  range of actuation  but further increases in the controller output will not be  implemented on the plant  The result may be that there is a large discrepancy  between the internal states of the controller and the input actually applied to  the plant  This problem often persists even after the controlled variable has  been brought back near its reference value  and controllers that would work  fine with unlimited inputs or with small disturbances  may show very poor  performance once saturation is encountered    The problem described is typically most severe when the controller has  slow dynamics     integral action is particularly at risk  since a pure integration  corresponds to a time constant of infinity   An alternative term for integral  action is reset action  since the integral action    resets    the controlled variable  to its reference value at steady state  When the input saturates while there  remains an offset in the controlled variable  the integral term will just continue  growing  it  winds up     The problem described above is therefore often termed  reset windup  and remedial action is corr
53.  and we have the    Johannes    1 2  L u d    J u  d      Jope d    5 a i  2 11           From these expressions we see that minimizing the loss L is equivalent to          minimizing   z     which is equivalent to minimizing  z 1 2  u     Uopt   ES   Thus  we have the important conclusion that minimizing the loss is equiv   alent to minimizing the weighted 2 norm of the gradient J   with the weight  being given by the matrix J m   However  for the    normal    case when there  are no restrictions  like fixing some elements to zero  on the matrix H  we  will show below that the weight J a   does not have any effect on the optimal  H     or  2    2 3 4 Optimal Sensitivities    Note from  2 6  that we can write Uop    Fud where F     o More  generally  we can write  yt   Fd  2 12     where F is the optimal sensitivity of the outputs  measurements  with respect  to the disturbances  Here  F can be obtained using  2 2  and  2 6      y     G uopi   Gid     G    J qu Jua   G   d  that is   F    G  J  Jua   GU  ede     However  Juu can be difficult to obtain  especially if one relies on numerical  methods  and also taking the difference can introduce numerical inaccuracy   Thus  for practical use it is often better to obtain F  from its definition   F   dy     dd  by numerically reoptimizing the model for the disturbances     2 Measurements for Control  Optimization and Estimation 59    2 4 The Loss Method    Now we are finally ready to derive the main results     2 4 1 The Loss Var
54.  approach 1 or 2   However  note that this means  that we need some non optimal data where we know the value of J      2 10 2 Relationship to NCO tracking    Finally  some ideas related to NCO tracking    The NCO idea is to set the Gradient  0  An important difference com   pared to the proposed loss approach  is that in NCO tracking one tries to  find an expression for u     open loop implementation  similar to deadbeat  control     On the other hand in the loss method  self optimizing control   we    stop     when we have the expression for the gradient c   J     the implementation to  find u that gives J     0 is by feedback control    From  2 10  and  2 11  we see that we want to minimize  u     Uopr  or Ju   but weighted by Juu   Recall here that in the full H case  Juu is not needed   Still  it remains unclear if this means that we can just minimize   Ju            10    11    12    13    14    15    16    17    18    19    20    21    22    23    24    25    26    27    28    29    30    31    32    33    2 Measurements for Control  Optimization and Estimation 81    Another problem with NCO idea to  Control gradient to zero  is that this  is not really possible since gradient can not be measured  Thus  it needs to be  estimated  For the case with no noise the estimate J  is same as    nullspace  method   so c   Hy   Ju    For noisy case not so clear  but may as well use c   Hy     2 11 Appendix      This is file matlab test cases m    Load data from C  Documents and Se
55.  bench is a combustion engine itself  rigidly connected to  the eddy current brake  As an interface and a communication part is utilized  a rapid control prototyping system based on dSpace hardware  This allows to  execute the designed controllers of the air fuel ratio on the engine  instead  of the original electronic control unit  ECU      5 3 2 1 Combustion Engine    For the experiments and measurements has been used a spark ignition engine  from the Volkswagen Polo 1 4 16V  Fig  5 10   It is a four cylinder in line  engine with a DOHC valve train    Engine characteristics     Engine code  AUA   Volume  1390ccm   Number of cylinders  4   Number of valves  16   Bore x stroke  76 5 x 75 6mm  Compression ratio  10 5   Power  55kW  75k  at 5000rpm   Torque  126Nm at 3800rpm   Injection system  multipoint  sequential  1 injector per valve  Ignition  electronic  independent injectors  Fuel  Natural 95   Emissions processing  three way catalys    The original Bosch ECU has been completely replaced by a rapid proto   typing system  It is dedicated for the control of power stages  as injectors and  ignitors  as described in the Subsection 5 3 2 3     202 Gergely Takacs et al       Fig  5 10 Spark ignition engine VW Polo 1 4 with a brake    5 3 2 2 Engine Brake  Dynamometer     For the sake of identification experiments resulting in acquisition of the local  ARX models of the air and fuel path it was necessary to keep the engine at  predefined working points  This aim has been reach
56.  close all     7 Constrained PID Control Tasks for Coupled Tanks Control 263    PD2 controller     levels 1 2                   0 25  0 2  E 0 15       gt       0 1  0 05  0 1 1 1 1 1 1 1  0 50 100 150 200 250 300 350  time  s   x 10  PD2   controller output       1 5    pump power  m  s               150 200 250 300 350  time  s     0 50 100    Fig  7 5 Typical setpoint steps in the loop with PD   controller with tuning  7 21   may contain up to two step at saturation limits after larger setpoint steps at its output   but for stable systems the 2nd interval at saturation corresponding to braking the  transient may disappear or not reach the saturation    264 Vladim  r   ilka and Mikul     Huba    PD2 controller     levels 1 2                                  0 25  0 2  E 0 15       gt   2  0 1  0 05  0 1 1 1 1 1 1 1  0 50 100 150 200 250 300 350  time  s   x 10  PD2   controller output  1 5             s l     o  o   o   E  2  20 5  0 1 1 1 1 1  0 50 100 150 200 250 300 350  time  s     Fig  7 6 Typical setpoint steps in the loop with PD   controller with tuning  7 22   derived by the performance portrait method Huba  2011b  gives a bit tighter control  and faster dynamics of transient responses than the traditionally used tuning  7 21   what may be e g  observed by longer period at the maximal level of h   in the first  tank and yet more by higher noise amplification    7 Constrained PID Control Tasks for Coupled Tanks Control 265                                            
57.  condition  MPT toolbox is shipped  with several freely available LP   QP  MILP  MIQP solvers to perform this task  without further effort from the users  Clearly  as solving the optimization  problem is more difficult compared to a simple table lookup  execution of the  u 7 ctrl x  took 50 miliseconds     4 5 2 Closed loop Simulations    MPT provides several functions to perform closed loop simulations of MPC   based controllers  The most general approach is to use the specially crafted  Simulink block  which allows MPC controllers to be used for virtually any  type of simulations  A screenshot of such a block is shown in Figure 4 19  where the controller is connected in a feedback fashion  The Simulink block  supports both explicit as well as on line MPC controllers    Another option is to use command line interfaces  which perform closed   loop simulations according to the receding horizon principle           X  U         X  U     sim ctrl  simmodel  xO  Tsim   simplot ctrl  simmodel  x0  Tsim     The sim function takes a controller object  representing either an explicit  or an on line MPC controller   the simulation model  the initial condition   and the number of simulation steps as the inputs and provides closed loop  evolution of system states and control actions as the output  The simplot  function behaves in a similar fashion  but  in addition  generates a graphical      2 4 GHz CPU  2GB RAM  MATLAB 7 4  MPT 2 6 2    4 Multi Parametric Toolbox 135       Dynamical Sy
58.  counteract interactions  due to the inputs that are actually implemented on the plant  is to implement  the decoupler as illustrated in Fig  1 6                                                                                      Unsaturated Saturated  inputs inputs  M E  Eo 5e         Controller    912    loop 1 911 i  Controller  921    lap    loop 2 922     T2 k2    1 s y2                                 Plant          Fig  1 6 Implementation of decoupler in order to reduce the effect of input satura   tion  The decoupler will only attempt to counteract interactions due to inputs that  are actually implemented on the plant     The implementation in Fig  1 6 is easily extended to systems of dimension  higher than 2 x 2  When the inputs are unsaturated  the  Decoupler with  saturation    in Fig  1 1 corresponds to the decoupling compensator W s     G s   G s   where G s  denotes the diagonal matrix with the same diagonal    10 Morten Hovd and Selvanathan Sivalingam    elements as G s   The precompensated plant therefore becomes GW   G   i e   we are  nominally  left only with the diagonal elements of the plant    Note that if the individual loop controllers k  s  contain slow dynamics   which is usually the case  PI controllers are often used   they will still need  anti windup  In this case the anti windup signal to the controller should not  be the saturated input  but the saturated input with the contribution from the  decoupling removed  i e   the decoupling means that 
59.  effects of noise   and  therefore does not indicate the presence of stiction    Again the routine bicoherence m returns a negative value for NGI and a  positive value for NLI  and therefore nonlinearity has not been detected for  this PV time series  Similarly  the routine g1stat m finds no clear indication  of PV being non Gaussian  the probability of false alarm being estimated to  1 0  None of these routines therefore indicate stiction in the loop     44 Morten Hovd and Selvanathan Sivalingam                   o L L L L L L L L   500  400  300  200  100 0 100 200 300 400 500    Fig  1 46 The OP to PV cross correlation function for data set 4        0 6    0 2     PV     0 2                  0 2  0 15  0 1  0 05 0 0 05 0 1 0 15    Fig  1 47 OP PV plot for data set 4     1 3 3 Conclusions    1  Data set 1 is a  traditional stiction example  as seen from Fig  1 34  The  oscillations are here at a significantly lower frequency than the dominant  dynamics of the plant    2  Data set 2 is obtained with the same stiction model parameters  but with  a higher proportional gain in the controller  The oscillations are therefore    1 Problems in Anti Windup and Controller Performance Monitoring 45    faster     in a similar frequency range as the dominant dynamics of the  plant    3  Data set 3 is also obtained with the same stiction model parameters  How   ever  here integral action is used in the valve positioner  This results in  rather fast oscillations     so fast that the oscil
60.  for Coupled Tanks Control 271    Comments     Remarks    272 Vladim  r   ilka and Mikul     Huba    Comments     Remarks    7 Constrained PID Control Tasks for Coupled Tanks Control 273    Comments     Remarks    274 Vladim  r   ilka and Mikul     Huba    Comments     Remarks    Chapter 8    Remote Laboratory Software Module for  Thermo Optical Plant    Pavol Bistak    Abstract Virtual and remote laboratories play an important role in the  education process of engineers  Their expansion is closely connected to the  growth of Internet  This contribution describes how it is possible to install and  use the remote laboratory for the thermo optical plant  It explains the process  of installation both the server and the client applications  Then the user  interface of the client application is discussed in details  An administrator of  the remote laboratory can modify existing control structures therefore there  are special rules included in one section how to create new Simulink block  diagrams in order to be compatible with the remote laboratory software   Thus one can set up the remote laboratory easily and it can be modified to  her his needs quickly     8 1 Introduction    The remote laboratory software module for the uDAQ28 LT thermo optical  plant is represented by the client server application which main task is to  enable remote experiments via Internet  Although the software has been de   signed to co operate with the uDAQ28 LT real plant its usage is not limited  only 
61.  ia v ike v av    PVO  B bounding_box P   Q range P A f   Q domain P A f     R projection P dim     Check if two polytopes are equal  P   Q    Check if two polytopes are not equal  P   O    Check if P D O    Check if P C Q    Check if PD O    Check if P c Q    Intersection of two polytopes  PN Q    Union of two polytopes  PU       Minkowski sum  P    O  cf   4 10     Pontryagin difference  P    Q  cf   4 11      Set difference operator  cf   4 12      Minimal hyper rectangle containing a polytope P   Affine transformation of a polytope   Q  Ar f  x eP     Compute polytope that is mapped to P    O    x   Ax  f EP     Orthogonal projection of P onto coordinates  given in dim  cf   4 7      4 Multi Parametric Toolbox 115    4 3 Exercises    Exercise 4 1  Perform following tasks     1  Create a polytope P as the 2D unit box centered at the origin  i e  P    f x  x2        1 lt  rz  lt 1     1 lt r2 lt 1     2  Create an another polytope Q as the convex hull of points v         1  0       Uo    T  0 7  U3      0  i   3  Plot P in red and Q in blue  don t forget to use figure to open a new  plot     4  Is P a subset of Q  Check this using vertices of Q    5  Is 0 as subset of P  Check this using vertices of P     Exercise 4 2  MPT offers an easy way to perform affine transformations of  polytopes  These include     e Shifting the polytope P in the direction given by a vector v leads a new  polytope R   x   v   x     P   It can by obtained by   v    0 8  1 4   R P v   e Scaling P by
62.  identical with the Matlab workspace data format   mat  file  and therefore it possible to read data into the Matlab environment  later on and process the saved data more carefully              Fig  8 10 Saving data into the file    8 6 Running the Experiment    The sequence of running the experiment is following     1    on    The basic assumption is that the server is running  If it does not it is  necessary to run it as it was written in Section 8 4    Start the client application according to the guide in Section 8 4    Set the IP address of the server into the Server IP field    Press the Connect button and check if the message Connected to server     appeared in the Output field  Fig  8 7     Set the the parameters in the lower left sector Settings     e Select the block diagram and initial parameters by entering the names  of corresponding files  Model Scheme  Model Parameters   e Set the desired value  sampling period and duration of the experiment    Press the Run button to start the operation of the selected block diagram   This will cause running the remote experiment  During the period of the    284 Pavol Bist  k    experiment running  specified in Running Time  it is not possible to in   teract with the experiment and it is necessary to wait until it finishes to  take over the control of the application again  Depending on the network  traffic and the load of the server it could happened that the experiment  does not run correctly or the data are not transferred 
63.  is  to use    72 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke       closed loop data     this may seem strange  but it is OK   Then we have  G      I     2 9 Estimator for y  Based on Data    The idea is to use the same approach as for the previous problem  but using  data instead of a model  The objective is to estimate y  based on measure   ments y  which we from now on will call    to follow statistics notation   That  is  we want to find   y   Hr     where      y   The available information is given by the data Yau     Y    X   Note that the data must first be centered    To use our method  we first need to know the expected optimal variation  Y  Here  optimal  means that y  is constant  In addition  we also need to  obtain G    and G  from the data  This means that the data must contain     non optimal    variations in u  and not only contain optimal data where u    Uopt  d     Comment  The setup is the same as for the previous problem  expect that  it is not clear how noise in y  can be included  It is a bit similar to    imple   mentation error  which has been neglected since we assumed integral action     2 9 1 Data Approach 1    Here we assume that Y 4  is obtained from two different sources of data     1     Optimal    data with constant y   X   Y opt   This is closed loop data for  y with y  constant for various disturbances  d  and also with noise  It  should be representative data for the expected operation  This directly  gives the matrix Y   Y
64.  it really contributes to the enhancement of Slovak Norwegian coopera   tion and to improvement of the educational framework at both participating  universities  Thereby  I would like to thank all colleagues participating in  the project activities at both participating universities and especially pro   fessor Sigurd Skogestad  coordinator of activities at the NTNU Trondheim   associate professor Katarina Z  kov   for managing the project activities  and  professor Miroslav Fikar for the patient and voluminous work with collect   ing all contribution and compilation of all main three project publications   textbook  workbook  and workshop preprints      Bratislava Mikul     Huba  2 1 2011 Project coordinator    iii    Acknowledgements    The authors and editors are pleased to acknowledge the financial support the  grant No  NIL I 007 d from Iceland  Liechtenstein and Norway through the  EEA Financial Mechanism and the Norwegian Financial Mechanism  This  book is also co financed from the state budget of the Slovak Republic     Contents    Problems in Anti Windup and Controller Performance  IM GWIEOPINE 2cicias ce a ob eee DRE REP ea Ed Ea  Morten Hovd and Selvanathan Sivalingam   1 1  Anti Windup  Control of a Distillation Column with Input    oo ocn NEED  L4  1     BNOUNBIOB  o ese oem e e bedded  1 1 2 Some Background Material on Anti windup          1 1 3 Decoupling and Input Constraints                  1 1 4 The Plant Model used in the Assignment            LIS ASCO adde
65.  nc  Hagpt H i        5 Implementation of MPC Techniques to Real Mechatronic Systems 181    Hqp  Hqp Hqpt    end    Passing on F is possible with the original formulation  The cost matrix Ac  needs to be transformed likewise     AcQPh Ac 1 nc  Nc        AcQP        for i 1  nc Nc   AcQPt AcQPh i      AcQP  AcQP AcQPt     end    where the matrices need to be divided in the usual C programming style   along with constraint matrices Bx and b0     BxOP Bx 1 nc Nc      bOQP b0 1 nc Nc                                                                                                                                                                                            H  Hqp  Cost H COx  F  gt  Matrix  Cost F    A   ultiply  Matrix  Multiply  BxOP  gt  Matrix  b   ultiply u pred  Bx R  Matrix  ultiply  b00P  Auh comp H     ACOP Bx x  Matrix constraint PK    Ac Gainl  x     status       ub qpOASES nWSR  Simple symmetric  tp    bounds  gt    Lo   gt    Pie ubA  Hi    Fig  5 3 Parsing the MPC problem to the qpOASES interface    182 Gergely Takacs et al    5 2 3 5 Off line Simulation    In case an off line simulation is necessary for results verification or other  purposes  we may use the Matlab default quadratic solver  named quadprog   To do this  one needs to launch a cycle with one iteration for each sampling  instant and supply the optimization problem to the solver in the following  fashion     for k 1 run    U1   k  f statusi 1 k  output  quadprog H F  X1   k   Ac bO   Bx X1C  
66.  ny    Gy Yalli ny 1 r1 1 ny    Xopt   Yalli ny 1 r1 ny 1 c1        step 2    AHopt    pinv Xopt Xopt     Gy      analytical expression   Hopt  loss  soc_avg Gy  Xopt      D Hopt Gy inv G1       Hopt4 inv D  Hopt    resb Hopt4 X    resbO Hopt4 X0     a41 norm resb Y1      a42 norm resb0 Y10      method4       loss             NEW modified loss method for case with noise on Y  redo step  1      New estimate of Y1    Yismooth   Hopt4 X      then redo step 1 and 2    163    164    165    166    167    168    169    170    177    178    179    180    181    182    183    184    185    186    187    188    189    190    191    192    193    194    195    196    197    198    199    200    201    202    203    204    205    206    2 Measurements for Control  Optimization and Estimation 85    Yallsmooth    Yismooth  X     u s v  svd Y1smooth     Yallsmooth   Yall v   Gismooth Yallsmooth 1 ny 1 ny    Gysmooth Yallsmooth ny 1 r1 1 ny    Xsmooth   Yallsmooth ny 1 r1i ny 1 c1      step 2    Hopt  loss  soc_avg Gysmooth  Xsmooth     D Hopt Gysmooth inv Gismooth      HoptiO inv D  Hopt    resa Hopt10 X    resa0O Hopt10 X0     a101 norm resa Y1     a102 norm resa0 Y10      method10     uulossuw smooth           loss method  add artificial noise weights   noisemag 2 e 4    noisemag tol     Noise Alt 1 just additive noise    noise   noisemag eye rx     Xoptnoise    Xopt noise       Noise Alt2  Add noise proportional to variation in each  output   4  rx  cx   size Xopt       Amag        4for 
67.  of the input  the windup problem goes away    This is because desired changes that violate the actuation constraints simply  will not have any effect  Note that the actuator should implement  new desired value   present value   Aux  If the previous desired value is used instead of present value above  the velocity  form of the controller will not remove windup problems    The velocity form can also be found for more complex controllers  in par   ticular for PID controllers  However  derivative action is normally rather fast   and the effects thereof quickly die out  It is therefore often not considered  necessary to account for the derivative action in anti windup of PID con   trollers     1 1 2 3 Anti windup in Cascaded Control Systems    For ordinary plant input  it is usually simple to determine the range of actu   ation  For instance  a valve opening is constrained to be within 0 and 100    maximum and minimum operating speeds for pumps are often well known   etc  In the case of cascaded control loops  the    plant input    seen by the outer  loop is actually the reference signal to the inner loop  and the control is  typically based on the assumption that the inner loop is able to follow the  reference changes set by the outer loop  In such cases  the  available range of    1 Problems in Anti Windup and Controller Performance Monitoring 5    actuation    for the outer loop may be harder to determine  and may depend  on operating conditions  An example of this problem ma
68.  on  the double integrator example      load system and problem parameters  Double Integrator      compute explicit controller  ctrl   mpt control sysStruct  probStruct       4 define the set of initial conditions  XO   unitbox 2 1     3 0        compute the 5 Steps reachable set  N   5   R   mpt_reachSets ctrl  XO  N        plot results  plot ctrl Pn     y     XO     r     R     g         The reachable sets  green  as well as the set of initial conditions  red  are  depicted on top of the controller regions  yellow  in Figure 4 25     Reachable sets  green   set of initial conditions X0  red   controller regions  yellow              Fig  4 25 Reachable sets for Example 4 2     144 Michal Kvasnica    4 5 5 2 Verification    Reachability computation can be directly extended to answer the following  question  Do the states of a dynamical system  whose inputs either belong  to some set of admissible inputs  or whose inputs are driven by an explicit  control law  enter some set of    unsafe    states in a given number of steps     Example 4 8  In this example we show how to answer the verification ques   tion for the first case  i e  system inputs belong to some set of admissible  inputs  u k      Uo   Although we use a linear system here  exactly the same  procedure applies to hybrid systems in PWA representation as well       define matrices of the state space object   A    1  4  4 1   B    1  1   C    10   D 0   syst   ss A  B  C  D     Ts   0 02       create a system structur
69.  one inflow  and one outflow up to two level system linearized by generalized input output  linearization and controlled by the PD   controller     7 2 Basic P and PI controllers    At the beginning  it would be the best to introduce the simplest case of  hydraulic system s configuration  In doing so we will consider one level system  which has all the valves closed  The pump feeding the liquid into this tank  will represent the actuator  Under control  such system behaves as simple  integrator  Considering 6 1 we will define differential equations of such system  in the following form      EE  dj   A  yi   T    7 1     Obviously  we are dealing with linear system with the transfer function    _  i s  _ 1    U s Ais       Fis     ie  with integrator having the integral time constant A   gain 1 A1   From  theory we know that to stabilize such a system  7 1   P controller with a gain  P  would be sufficient  The closed loop transfer function will be       P  F s  u P  G s  m 1  PES  m Ais   Pi    If we want to control this system  we can request it to behave as the first  order linear system with the transfer function      1  sS     Tis 1       In such a case  the P controller   s gain results as    A1    P   1 Ti    It is clear that by choosing the time constant T    we are able to define  the dynamics of the closed loop that might also be expressed by its closed  loop pole a      1 T   By decreasing this time constant  when the closed loop  pole is being shifted to    oo  we 
70.  op   including the weights  needed in  2 26     2     Non optimal    data with constant d  This is data for    and y  collected  with varying u  From this data we directly obtain G    and G1  By selecting  u   y  one may also here used closed loop data  but with y  varying   in  this case G1   I    3  Find optimal H using  2 26  with HG    I     2 9 2 Data Approach 2  Loss Regression    More generally  we do not have separate    optimal    and    non optimal    data   Instead  we have combined data Yai where y  and x vary simultaneously     2 Measurements for Control  Optimization and Estimation 73    Note that we here use the notation from statistics chemometrics and call the  measurements y for a    We can then do a two step procedure  In the first step  we    split up    the  data Y 4 data to find G1  G    and Y opr  and in step 2 we proceed as    normal     to find the optimal H     Step 1A  We rearrange the data Yq such that the y  values are in the  first rows  and the      y measurements are in the rest  called X      Yau    Y1  X     Step 1B  We now want to separate the data into    optimal    and    nonop   timal    data  The data can generally be transformed by multiplying by a   real  unitary matrix V  because    HYau         HYauV    for the 2   norm  Thus  we can use the SVD of    Y    U S v   to transform the data to     split up the data        G  0  YauVi     7      G  X opt    Now  we have G1  G    and Y   X    and can proceed as normal using  our derived fo
71.  or  7 19  and by using  7 9  the real control signal is achieved    When substituting for 71 72 in the above transformations directly the  actual level values  we use standard approach of the exact linearization  Due  to the non modeled dynamics it is  however  better to work with generalized  operating points for x1  x2 defined somewhere between the actual and the  final state as      i   w  mi d 1   m  h  m     0 1  i   1 2  7 20     In this way we are using a method that represents combination of the exact  linearization and of linearization around fixed operation point    Example of transient responses are in Fig  7 5 and Fig  7 6  The tradition   ally used tuning derived by the conditions of the triple real pole    Q1 2      0 321 Ty  7 21     used in older works  the closed loop poles were now chosen according to Huba   2011b  as  01 2      0 321 T4  7 22     where Ty   0 8s is the identified loop dead time  was now confronted with  newer one Huba  2011b  derived by the performance portrait method  The  dynamics of the control signal changes is obviously from the dynamical class  2  But  due to the plant character the second pulse in the control transients  is not so dominant as the first one  what is a typical feature of all stable  systems    The controller structure in Simulink is depicted in Fig  7 7  Control pro   gram which works with results of automatic calibration and indentification  is listed below     7 5 0 2 Program for Matlab Simulink    cle   clear all  
72.  parameters o       250 and 01 2   0 8 used in the  weighting functions has been chosen experimentally  awaiting continuous and    216 Gergely Takacs et al    smooth output of the modeled system  At the same time it has been found  out  that there can be used identical weighting functions for weighting of an  air and fuel path parameters  as well    All the weighting functions were at the end normalized  5 25   so the sum  of values of all weighting functions belonging to a particular working point   Fig  5 20   equals exactly one  or   55  pn O k     1     PR P  R     ENACO 2    rel  weight        1500    2000       24 2500  t  deg  Don  rpm     Fig  5 20 Relative weighting Gaussian functions    5 3 4 Predictive Control    The strategy of an    exceeding oxygen amount    control using a predictive  controller is based on a prediction of a controlled quantity A and subsequent  minimization of a chosen cost function on the horizon Np expressed in a  standard quadratic form  The value of A is predicted by utilization of partially  linear models of the air and fuel path  Through the independent air path  model the proper amount of fuel is predicted and enters the cost function J   Hence  the target of the cost function minimization is to determine such a  control law  that the measured system output A is stoichiometric  The second  modeled subsystem  the fuel path  is an explicit component of the objective  function where the amount of the fuel is the function of optimized contr
73.  quality compared to DCO  controllers    e What was the most obvious difference in control signal shape compared to  DCO controllers    e Was there any overshooting in the experiments     9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 321    System output  Comparison of the undelayed system output  60              a FPI  T T  9 0 8  v oio PP T T  9 0 6     E FP T T   0 06    lo controller              40          pene setpoint           Light intensity  wo  o    20             600 800 1000 1200 1400  time  s     0 L L  0 200 400    Fig  9 39 Experimental results     undelayed system output    9 2 6 Filtered Smith Predictor  FSP     Tasks     e Control the filtered light channel output by FSP   e Analyze the control quality for various controller tunings   e Compare results with control performance of PI  controller      The FSP was originally proposed in Normey Rico et al   1997  for stable  FOPDT processes to improve robustness of the traditional SP  Later  the  disturbance filter F  s  has been also proposed to decouple the reference  setpoint and the disturbance response and to stabilize the controller loop in  case of unstable and integral plants Normey Rico and Camacho  2009   It  may be interpreted as a structure with the dynamical feedforward control  and the reference plant model Astr  m and Hagglund  2005   Visioli  2006    or the 2DOF IMC structure  The unified approach to designing FSPs for  the FOPDT plants introduced in Normey Rico et al
74.  range  considered  there may be several constrained regions  and the procedure of  finding H needs to be repeated in each constrained region  Switching be   tween the regions will then be needed  and we will show that monitoring the  controlled variables c   Hy in neighboring regions can be used for switching     Sigurd Skogestad  Department of Chemical Engineering  Norwegian University of Science and Techno  ogy in Trondheim  Norway  e mail  skoge chemeng ntnu no    Ramprasad Yelchuru  Department of Chemical Engineering  Norwegian University of Science and Techno  ogy in Trondheim  Norway  e mail  ramprasad yelchuru chemeng ntnu no    Johannes J  schke  Department of Chemical Engineering  Norwegian University of Science and Techno  ogy in Trondheim  Norway  e mail  jaschkeGchemeng ntnu no                         53    54 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke    What we here call the    loss method    is the same as what is called the     exact local method    in these papers  Halvorsen et al  2003   Alstad et al   2009      The new material in this summary paper is mainly related to using data   Y   X  as the basis  and for example  to use the    loss    method for regression   see section 5  data approach 1 and 2     2 2 Problem Formulation    2 2 1 Classification of Variables    u   inputs  degrees of freedom  for optimization and control  it does not  actually matter what they are as long as they form an independent set   e d  disturbances  includ
75.  state space object is already in discrete time domain  it is  not necessary to provide the sampling time parameter Ts to mpt sys  Af   ter importing a model using mpt  sys it is still necessary to define system  constraints as described previously     4 Multi Parametric Toolbox 149    MPT allows to define following types of constraints     Min Max constraints on system outputs   Min Max constraints on system states   Min Max constraints on manipulated variables   Min Max constraints on slew rate of manipulated variables    4 5 6 2 Constraints on System Outputs    Output equation is in general driven by the following relation for PWA sys   tems    y k    Ci   k    Drulk    g   4 30     and by  y k    Ca k    Du k   4 31     for LTI systems  It is therefore clear that by choice of C   I one can use these  constraints to restrict system states as well  Min Max output constraints have  to be given in the following fields of the system structure     sysStruct ymax   outmax  sysStruct ymin   outmin    where outmax and outmin are ny X 1 vectors     4 5 6 3 Constraints on System States    Constraints on system states are optional and can be defined by    sysStruct xmax   xmax  sysStruct xmin   xmin    where xmax and xmin are n  X 1 vectors     4 5 6 4 Constraints on Manipulated Variables    Goal of each control technigue is to design a controller which chooses a proper  value of the manipulated variable in order to achieve the given goal  usually  to guarantee stability  but other a
76.  the set  plot PSI       compute extremal vertices of PSI    4 Multi Parametric Toolbox 129    E   extreme PSI      for i   1 size E  1     x   E           u    K x     if isinside unitbox 1   u   amp  amp  isinside X  x   fprintf    Vertex 7 d 0K n     i      else    fprintf  Constraints violated  for vertex Ai Nn   i      end  end       A        Fig  4 16 Target hi    4p       3 2   0 1 2 3 4  n          Fig  4 17 Set of states for which the LQR controller satisfies all constraints     130 Michal Kvasnica    Solution 4 10  for Exercise 4 10        the sets X and U were defined in the previous example  PSI X amp U   k  1     the algorithm has no guarantee of finite time convergence  kmax   10   while k  lt  kmax  PSI k 1    inv A B K  PSI k   amp  PSI k    k k  1   if PSI k     PSI k 1   break  end  end  PHI   PSI end       plot all sets  plot  PSI      4 or a one liner   PHI   mpt_infset  A B K   PSI 1   kmax              Fig  4 18 The invariant subset     the innermost region      4 Multi Parametric Toolbox 131    4 5 Model Predictive Control in MPT    We consider the class of discrete time  time invariant systems given by the  state space representation    c t    1    f x t  u t     4 22     where x t  is the state vector at time t  x t   1  is the successor state  u t   denotes the control input  Moreover  f         is the state update function which  depends on the type of the model  which can either describe a linear time   invariant  LTI  system with    f a t  u t    
77.  then  rcx  D  0m    Thus  for case 3 we do not have a convex problem formulation  that is  we  need to solve the nonconvex problem in  2 21   with additional constraints  on the structure of H   This is not surprising as decentralized control is  generally a nonconvex problem  Nevertheless  Theorems 2 1 and 2 4  with  additional constraints on the structure of H  give convex optimization  problems that provide upper bounds on the optimal H for case 3  In  particular  in Theorem 2 4 4 we may make use of the extra degree of  freedom provided by the matrix Q  Yelchuru and Skogestad  2010     Also note that  as opposed to cases 1 and 2  Juu is needed to find the  optimal solution for case 3  This may seem a bit surprising    Case 4  Decentralized control using single measurements  that is nys   ne   where nys is the number of selected measurements   Theorems 2 1  2 4  hold also in this case    This is a special case of case 3 where we use the fewest number of measure   ments  This case is different from case 2 in that H is a diagonal matrix    The reason why Theorems 2 1  2 4 hold in this case  is that we can still  keep D full because the    non zero    part of H is square and we can to  change it to anything  so we can treat it a special case of  full H      2 7 Some Special Cases  Nullspace Method and  Maximum Gain Rule     The general optimization problem is    2 Measurements for Control  Optimization and Estimation 67    1 2 y    1  min Ji   HG   HY   2 27   F    where Y   
78.  these constraints time varying  one can exploit the fact  that the symbolic decision variables V x and V u are stored as cell arrays  indexed by the prediction index k      gt  gt  G   C     5  lt   V x 1   lt   5    gt  gt  G   C     6  lt   V x 2   lt   6    gt  gt  C   C   1  lt   V x 3   lt   1     Such a construction will force the predicted states to stay within of given  time varying bounds     4 Multi Parametric Toolbox 139    4 5 4 3 Move Blocking    Move blocking is a popular technique frequently used to reduce complexity  of MPC optimization problems by eliminating some degrees of freedom from    the sequence Uy    ud  u1      ul    T  In practice  usually three types of   move blocking are used    1  Keeping first Ne moves uo      uw  free and fixing the remained uy 41    UN  2       uyx 1   0  This can be achieved by     gt  gt  C  C    V u Nc 1 N 1     0     2  First Ne moves are free  while the remaining control moves are driven by  a state feedback u   Ka  ie  un 4 n   Kap  k 2 1      N    Ne  1     for k   Nc 1 N 1  C   C    V u k     K x k    end    3  Introduce blocks of control moves which are to stay fixed  e g  ug   u1   us  and ua   u4      gt  gt  C C   V uf 1   V u 2    V u 2   V u 3     gt  gt  C C  V uf 4   V u 5      The optimal values of ug and ua obtained by solving the corresponding  optimization problems then pre determine the values of u1  u2  and u4     4 5 4 4 Contraction Constraints    Another way of achieving closed loop stability is to i
79.  time Tq is relatively small comparing to the process time constant  T    we have so called lag dominant plant   thus it can be neglected in further  calculations  Figs  9 35 and 9 36 show how the process gain and time constant  vary through the operational range independence on the plant input    Again the controller tuning can be done using the performance portrait  method  Fig  9 37   It is best to choose    Tio   max T1     Kio   max K   9 18   which for this plants is  Tio   25 8687  Ko   19 8939  9 19     Try multiple disturbance observer filter time constants Tp  In this example  following T T 9 ratios were used     316 Peter Tap  k and Mikul     Huba            FP    4 5    F             A    o  oa     99                 Control signal  no  n oa    E  ol              0 5             0 50 100 150 200 250 300 350 400 450  time s     Fig  9 32 FPrlo controller vs FIo controller under 5s transport delay  control signal       Fig  9 33 FPIo controller    9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 317    Gain3                           u                   Step                                                                                 Temperature 1                                                                      VO Interface  4    Light    intensity 1          Ps  Pit KO       Thermo  eptical  Plant      Saturation 3  gt     0   M Fan   Gain1 1 Naandiee Fond 0   ni rec ERE  ransfer Fcn     Tf s 1 LED  4  Gain2 Transfer Fcn2  X T10 s 1  
80.  value will be overwritten by the value set in the Sample T ime field of the  client application      The desired value is given by the global variable denoted as w  the Final  value parameter of the Step block in the supplied block diagram  e g     This denotation must be kept everywhere  If a variable with this name  is used in the initial parameter file   m file  or somewhere in the block  diagram   mdl file  its value will be overwritten by the value set in the  Input Desired Value  field of the client application      Signals that should be displayed in the client application interface have  to be gathered using the multiplexer block into the only one Scope block  whose name is identical with the name Scope and its settings coincide with  those of Fig  8 13     N     9v    Scope    Fig  8 12 Gathering signals into the Scope block    When creating new block diagrams it is recommended to start with the  supplied block diagram  Fig  8 11  and modify its structure while keeping  the blocks drawn by the orange color unchanged  Thus it is possible to add  an arbitrary controller to the thermo optical plant block that can be re   alized in the Simulink  The block diagram in the Fig  8 11 and its initial  parameter file have been developed by a simple modification of the original  files  PI1 windupless mdl a init  PI1 windupless  m  that are supplied on the  installation CD of the uDAQ28 LT thermo optical plant    Warning  Time responses from the supplied block diagram and the p
81.  with the reference changes and noise variances prescribed above   Plot the results and compare to the performance without anti windup   make comparable plots with and without anti windup implemented    Comment on the results     12 Morten Hovd and Selvanathan Sivalingam    1 1 6 Solution    1 1 6 1 Model Implementation    The model is implemented in Simulink as illustrated in Fig  1 7  Note that the   state space model for the distillation column has been implemented with the   disturbance as the second input  in accordance with  1 10   A manual switch   is used to include exclude saturation of the manipulated variable  and clearly   this switch will have to be set in accordance with the case to be simulated   The Matlab code to define the model is listed in Section 1 1 9 1     1 1 6 2 Controller Designs  PI Controllers    The PI controllers without anti windup are implemented using transfer func   tion blocks in Simulink  cf  Fig  1 8  Alternatively  the PID Controller block  in the    Continuous    library can be used  but one should be aware that the  tuning parameters in that block does not correspond to the    standard    pro   portional gain and integral time parameters  consult Simulink documentation  for details     The Matlab code used to define the controller numerator and denomina   tor polynomials are given in subsection 1 1 9 2  Note that the sign of the  proportional gain is adjusted to ensure negative feedback     Dynamic Decoupler    The dynamic decoupler is 
82. 0 measurements and the validation data  set 50 measurements  specified in files I received     The results are shown in Table 2 4  The loss method is the best  validation  error 2 9 compared to 3 1 for the traditional methods   but the differences  are small    The difference between the methods is small for this test case and in  this case the loss method gives better validation  2 9033  than least squares   3 1092  in spite of the fact that the calibration fit is perfect in both cases    This is a case where one would expect it to help to add artificial noise to the  loss method  The reason is that we have 701 as but only 50 data sets for  calibration  so the data would not be expected to contain sufficient informa   tion about the expected noise  However  the numerical results do not confirm  this  and the fit gets worse when we add noise     78 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke    Y  contains both the two y variables  water and protein   presumably  better fit can be obtained by fitting one at a time   Table showing the fit  Y      HX  p to calibration and validation data     Table 2 4 Wheat Spectra Calibration and Validation data    0 0000 3 1092 least squares    PCR  50   0 3136 3 0871   PCR 47  tol 1 1 e 3           Again  smoothening of y  has no effect  which again is not surprising since  the fit was perfect     2 9 7 Test 3  Our Own Example    The data contains 2 yi  7 x  2 d    G   E   Ga    E bl gy     0 2034563  gy     00 213489  G   
83. 1 to    4 to USB Serial Port     296 Peter Tap  k and Mikul     Huba    9 1 1 2 Driver and Software Package Installation in Matlab     To install driver and software package in Matlab  follow these instructions     e Before installation it is good to make sure that any unterminated process  matlab exe is not in the memory  if it is  terminate it  tab Processes in  Task Manager  activated by keys CTRL ALT DEL    e Run Matlab   e Change the working directory to the directory from the package of sup   porting software where installation file udaq_setup p is located  e g  by  typing command cd e  dirname     e Run file udaq setup p by typing command  udaq setup     After successful completion of installation there is directory matlabroot u   dag udag28LT and particular subdirectories and files copied on the local hard  drive   matlabroot represents the name of the directory displayed after typing  command  matlabroot  in Matlab command window  Two mdl files are open  after installation in Matlab  udaq28LT iov2 mdl  located in matlabroot u   dag udag28LT examples and the library containing two blocks  drivers   rep   resented by mdl file matlabroot udaq udaq28LT blks udaq28L T  lib mdl  You  can create your own simulation mdl file that communicates with thermo   optical plant by copying the driver block from the library  or from other  functioning mdl file  into your own mdl file     9 1 1 3 Thermo optical Plant Communication Interface   Thermo optical plant communication interfac
84. 1073  1 14     48 Morten Hovd and Selvanathan Sivalingam    With this modified benchmark variance  we find a modified Harris index of  HI nog   1 49  or NHImoa   0 327  Thus  with the chosen closed loop time  constant as basis for comparison  the motivation for retuning the controller  is significantly reduced  as the observed variance is not much larger than the  acceptable    variance     Acknowledgements The authors are pleased to acknowledge the financial support  by a grant No  NIL I 007 d from Iceland  Liechtenstein and Norway through the EEA  Financial Mechanism and the Norwegian Financial Mechanism    The contributions of Anders Fougner and Anders Willersrud in preparing the anti   windup assignment are also gratefully acknowledged     References    Hanus R  Kinnaert M  Henrotte JL  1987  Conditioning technique  a general anti   windup and bumpless transfer method  Automatica 23 6  729   739   Hovd M  Sivalingam S  2011  A short introduction to anti windup  In  Huba M   Skogestad S  Fikar M  Hovd M  Johansen TA  Rohal Ilkiv B  eds  Selected Top   ics on Constrained and Nonlinear Control  Textbook  STU Bratislava     NTNU  Trondheim   Sivalingam S  Hovd M  2011  Controller performance monitoring and assessment   In  Huba M  Skogestad S  Fikar M  Hovd M  Johansen TA  Rohal Ilkiv B  eds   Selected Topics on Constrained and Nonlinear Control  Textbook  STU Bratislava      NTNU Trondheim   Skogestad S  Postlethwaite I  2005  Multivariable Feedback Control  Analysis and  De
85. 4 7  for Exercise 4 7   The implementation literally follows the  five steps listed in Exercise 4 7     4 Multi Parametric Toolbox 127      input data   C1   polytope   0  2  02  24  2 4  4 2  4  2      C2   polytope   4  2   4 2   2 4   2  4  0 2  0 2     C    C1 C2       Q 5 unitbox 2      UJ      the algorithm  H   hull C    D   H B    E   H C   F  G    E   B       DNF       is the output equal to C B   G     C B     ans        Solution 4 8  for Exercise 4 8   Hit or miss in 10 steps       input data   Xi   unitbox 2     3  0     Xf   O 5 unitbox 2     A    0 5   0 75  0 75  0 5    N   10       initialize the data storage  S   Xi   for k   1 N    compute the set Xk1   A Xk  r   AxS end        add Xki at the end of S  s   S r    end      plot the sets  remember that Xi is part of S   plot Xf     k     S       hit or miss   if dointersect Xf  S   disp  Target hit    else  disp  Target  missed      128 Michal Kvasnica    end             Fig  4 15 Reachable sets for N   10 show a miss     If a miss  how large must N be for a hit     N   0    S   Xi    while  dointersect S  Xf   N N  1    A S  end       S r      r   S  end  plot  X     k     S    N    Solution 4 9  for Exercise 4 9      input data  A    1 1  O 1   B    1  0 5   K   dlqr A  B  eye 2   1    xmax    5  5   xmin     5   5   umax   1  umin    1       set of states which satisfy state and input constraints  X   polytope  eye 2    eye 2     xmax   xmin      U   polytope   K  K    umax   umin      PSI X amp U      plot
86. 9 22 Experimental results for K 10    e Make a disturbance by a LED voltage step during the experiments   e Compare the control quality with the FIo controller using a real experi   ment     Tuning of the closed loop systems involving dead time still represents a  challenging domain of control research  an increase of the dead time values  with respect to the dominant plant time constant leads in the loops with PID  controllers to rapid performance deterioration  Therefore filtered predictive  Io  FPrIo  controller will be used in this exercise  Under the FPrIo controller  controller we will understand the static feedforward control with the gain  1 Ko extended by the input disturbance reconstruction and compensation   Fig  9 27  with the disturbance observer filter time constant T  and by the  pre filter with the time constant Tp   Ty    Robust tuning of the FPrlIo controller may again be done by the perfor   mance portrait  The information on plant parameters is needed  For the plant  used in this exercises the performance portrait for undelayed plant output is  in Fig  9 29  the delayed plant output performance was analyzed in Fig  9 30   Compare the performance of filtered predictive Ip controller vs FIo controller   Use additional transport delay when controlling a non filtered optical chan   nel  In the following example 5s transport delay was added to the non filtered  light channel output  so the transport delay of the plant ranges from 5 4 to    310 Peter Tap  k and 
87. Assign symbolic labels level 1  level 2 to the two state variables  in   flow to the input  and level 2 to the output variable    3  Verify that sysStruct contains valid entries by running     gt  gt  mpt_verifySysStruct sysStruct      If sysStruct is mis configured  the verification function will output an  error    4  Simulate the evolution of the system for 5 steps  starting from the initial  condition z 0      p  and using the control inputs u t       2  t    1     10   hint  use the mpt_simSys function  see help mpt_simSys for  more details      Exercise 4 12  For the two tanks system defined in the previous exercise  we would like to synthesize an MPC controller which would minimize the  following performance objective     N  min DETO  u  Ru   4 32   k 0  Assume N   6  Q     9   and R   1  Create a problem structure    probStruct which will reflect this settings  do not forget to set prob   Struct  norm 2 to indicate that a quadratic performance objective should  be used   Verify consistency of the generated structure by running     gt  gt  mpt_verifyProbStruct probStruct     4 Multi Parametric Toolbox 157    Exercise 4 13  Consider again the two tanks setup from the previous two  exercises  Finally we will synthesize an MPC controller  To do that  run     gt  gt  ctrl   mpt_control sysStruct  probStruct     online        The    online    flag indicates that we will use an on line MPC controller  After  the controller object is constructed  we can obtain the optimal con
88. B  Roha  Ilkiv Editors  STU Bratislava    NTNU Trondheim   Huba M  2011c  Robust controller tuning for constrained double integrator  In  NIL  Workshop on constrained and nonlinear control  M  Huba  S  Skogestad  M  Fikar   M  Hovd  T A  Johansen  B  Roha  Ilkiv Editors  STU Bratislava   NTNU Trond   heim   Huba M  Bist  k P  1999  Dynamic classes in the pid control  In  Proceedings of the  1999 American Control Conference  San Diego  AACC   Huba M  Sovi  ov   D  Oravec I  1999  Invariant sets based concept of the pole assign   ment control  In  European Control Conference ECC   99  Duesseldorf  VDI VDE   Pan H  Wong H  Kapila V  de Queiroz MS  2005  Experimental validation of a non   linear backstepping liquid level controller for a state coupled two tank system   Control Engineering Practice 13 1  27     40   Zilka V  Hal  s M  2010  Disturbance decoupling of coupled tanks  From theory to  practice  In  IFAC Symposium on System  Structure and Control   CSSS 2010   Ancona  Italy   Zilka V  Hal  s M  2011  Noninteracting control of coupled tanks  From theory to  practice  In  13th International Conference on Computer Aided Systems Theory    EUROCAST 2011  Las Palmas  Gran Canaria   Zilka V  Hal  s M  Huba M  2009  Nonlinear controllers for a fluid tank system   In  R  Moreno D  az  F  Pichler  A  Quesada Arencibia  Eds    Computer Aided  Systems Theory   EUROCAST 2009  Springer  Berlin  Germany  Lecture Notes in  Computer Science  pp 618 625    7 Constrained PID Control Tasks
89. Estimation 75    Wn is a tuning parameter but a systematic approach is the following  Plot  the singular values of Xp  and select wn such that the singular values of  X extended follow the same trend     2 9 3 Modification  Smoothening of Data     The loss regression method is based on the loss method where it is assumed  that a model is available  When we are using data  then the model has to  be extracted first  step 1   and this step of the method is not based on a  rigorous approach to the final objective  which is to use the model for future  predictions    Therefore  it is likely that this step may be improved  One possible modi   fications is suggested next  although it seems from the later numerical tests  that it actually may have no effect     2 9 3 1 Smoothening of y1    The above procedure  including step 1  assumes that all the noise is in the  x   y  One way of dealing noise in y   is to run through the procedure twice   First  we go through the procedure  steps 1 and 2  and find the optimal  Ho   Next  we go through the procedure again  but with a modified step 1A  where use Ho to estimate the smoothened  fitted  values of y   that corre   spond to the measured X     yoon   HX  and then we use this smoothened data in the other steps     Y ui    s X     Yismooth   Hoptloss X      then redo step 1 and 2  Yallsmooth    Yismooth  X     u s v  svd Y1smooth     4 etc        However  from the numerical examples this smoothening has no effect on  the results  which in 
90. Fig  9 47 PI  controller  filtered light channel control for K   19    9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 329    Pl  controller     control signal  K 19  5 T T T       A  T  L    9  oi  T  L    A  T  fi          Bulb voltage  V   no  c1    N  T    1 5r    0  5r             0 i L L  0 20 40 60 80 100    time  s        Fig  9 48 PI  controller  filtered light channel control for K   19    330 Peter Tap  k and Mikul     Huba    Pl  controller     output of filtered light channel  K 9                      70 T T T   T DUE          delayed output       undelayed output  60r   setpoint J       Light intensity                      0 20 40 60 80 100  time  s        Fig  9 49 PI  controller  filtered light channel control for K   9    9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 331    Pl  controller     control signal  K 9  5 T T T       A  T  L    i  ol  T  L       A  T  fi          Bulb voltage  V   no  c1    N  T    0 5F             0 i L L  0 20 40 60 80 100    time  s        Fig  9 50 PI  controller  filtered light channel control for K   9     IISINININISISIIEREEEREEERERERERERERERERERERERERTRTRRRRRRIRI     Disturbance Filter Disturbance Observer       Fig  9 51 Modified P FSP with the primary loop using 2DOF P controller with the  disturbance filters    332 Peter Tap  k and Mikul     Huba    Filtered light channel output  45 T T T T          40        c1                 o    N  o    20    Light intensity         
91. Figure 4 8                    X X    1   a  Polytopes Pi and 75  b  Set difference O   P     P2     Fig  4 8 Illustration of the set difference operation     4 2 4 Functions Overview    A compact overview of the functions and operators described above is given  in Tables 4 1 and 4 2  For more information  see the output of help mpt   help polytope and references therein     Table 4 1 Computational geometry functions    P polytope A b  Constructor for the polytope P    x     R    Az     b    P polytope V  Constructor for creating a V represented polytope  double  P  Access the H representation  e g   A b  double P    extreme  P  Access the V representation  e g  V extreme P    display P  Displays details about the polytope P   nx dimension P  Returns dimension of a given polytope P  nc nconstr  P  For a polytope P    x   Ax     b  returns number of  constraints of the A matrix  i e  number of rows    Lag Horizontal concatenation of polytopes into an array   e g  PA  P1 P2 P3     3 Subscripting operator for polytope arrays   e g  PA i  returns the i th polytope in PA   length  PA  Returns number of elements in a polytope array P4   end Returns the final element of an array      c r  chebyball P  Center c and radius r of the Chebychev ball inside P   bool isfulldim P  Checks if polytope 7 is full dimensional   bool isinside P x  Checks if r     P  Works also for polytope arrays     114    Michal Kvasnica    Table 4 2 Operators defined for polytope objects    vu as ia s iko s has
92. Frobenius norm of    M    in  2 19   that is     min   72076   av    2 21   H F    where Y    FW 4 W ns   We call this the minimum loss method for finding  optimal linear measurement combinations  c     H y    The objective in  2 21  is to find the nonsquare n  xn  matrix H  note that  Ny   ne   In most cases it may be recast as a convex optimization problem  as given in  2 23  below  The exception is if H has a specified structure  for  example  H is a selection matrix  which is discussed in Section 2 6     Further Comments    1  Using the norm of M to analyze the loss is known as the    exact local  method  and finding the optimal H is the    exact local method optimization  problem     However  in this paper we simply call it the    loss method     2  To include changes in the weights in the cost function p  prices   we need  to find the optimal sensitivity to price changes  y         Fpp The corrected  setpoint for the variables c   Hy is then    cs   Hy      HF p  2 22     3  The effect  transfer function  from c  to z is My   J1  HG      and  from c  to u is G      HG      Since there are extra degrees of freedom  in H which are not set by the optimization problem  either of these  M   or G  can be selected freely  see below for details     Exercise 2 1  Consider a scalar case  nu   ne   1  with no disturbances   F     0  and assume that the measurements y have been scaled such  that Wry   I  noise of equal magnitude on all outputs   For the scalar  case  Jua does not m
93. I bic f max    bicoherence pv   gives NGI      0 0014 and NLI   0 4394  Since both these indices are re     38 Morten Hovd and Selvanathan Sivalingam       05r    PV  o  T     0 5              15 1 1 l 1 L   1 5  1  0 5 0 0 5 1 15       Fig  1 36 OP PV plot for data set 1     guired to be positive in order to indicate significant non linearity  no stiction  is indicated  In contrast  the command    sg sl  glstat pv 0 51 128    shows that the signal is non Gaussian  the Pfa  probability of false alarm   is zero   However  the estimated inter quartile range R is quite close to the  theoretical value for a linear system  and thus glstat does not find any clear  sign of non linearity     1 3 2 2 Data Set 2    The time plots of OP and PV for data set 2 are shown in Fig  1 37  The OP  resembles the sawtooth shape  but here PV also resembles a sawtooth shape   and stiction is therefore not readily identifiable from the time plots    The cross correlation function for data set 2 is shown in Fig  1 38  This is  nearly an even valued function  and this test therefore does not indicate the  presence of stiction    The OP     PV plot for data set 2 is shown in Fig  1 39  The plot looks like  an ellipsoid seen from the side  but due to the angle it is difficult to assess  whether there are any sharp corners in the plot  In Fig  1 40  the PV time  series is therefore shifted by 30 samples  The plot is a little messy  since the  time shifting destroys the correspondence between the effects 
94. M  Huba  S  Skogestad  M  Fikar  M  Hovd   T  A  Johansen  B  Rohal Ilkiv    Editors    Selected Topics on  Constrained and Nonlinear  Control  Workbook    STU Bratislava     NTNU Trondheim    Copyright    2011 authors   Compilation  Miroslav Fikar   Cover  Tatiana Hubova   Printed and bounded in Slovakia by Miloslav Roubal ROSA  Dolny Kubin  and Tla  iare   Vr  bel  Doln   Kubin    ISBN  978 80 968627 3 3    Preface    This workbook was created within the NIL I 007 d Project    Enhancing NO   SK Cooperation in Automatic Control     ECAC  carried out in 2009 2011 by  university teams from the Slovak University of Technology in Bratislava and  from the Norwegian University of Science and Technology in Trondheim  As  it is already given by the project title  its primary aim was enhancing co   operation in academic research in the automatic control area in the partner  institutions  This was achieved by supporting broad spectrum of activities  ranging from student mobilities at the MSc  and PhD  level  staff mobilities   organization of multilateral workshop and conferences  joint development of  teaching materials and publishing scientific publications  With respect to the  original project proposal  the period for carrying out the foreseen activi   ties was reasonably shortened and that made management of the all work  much more demanding  Despite of this  the project has reached practically  all planned outputs     this workbook represents one of them     and we believe  that
95. Manager    Ele Action view Help       eH mepsu x e          J MATOKAM     BB  Acronis Devices    Wl Batteries  H Computer        ee Disk drives    a Display adapters      DVD CD ROM drives       3 IDE ATA ATAPI controllers  4   gt  Keyboards   77  Mice ard other pcinting devices    be Modems  ES a Monitors     HB Network adapters    PCMCIA adapters    Forts  COM  amp  LPT   JZ Communications Part  COMA      7  ECP Printer Port  LPT1   JZ     gt  Processors    SCSI and RAD controllers    9  Sound  video and game controllers    Fig  9 5 Device manager     USB serial port    Advanced Settings for COM3    COM Pert Number   coma      CIMT  nuse             USB Transter 5ges 00M2   m    Select lower setting CIMA N fonce problems at low baud rates   Select highe  settings lor laste  performance     Receive  Byles  4056    Tranem    Bytes  4036          Select lower settings to coriec  response problems  Serial Enurreictor    Serial Printer  Latency Timer  mzec   1 v      Cancel li Power Off         Timecuts Evert On Surprise Removal  Set ATS On Chee  Minimum Asad Timeout  mses   0    Disable Modem CtlAt Startup    Minimum Wrke Timeout  msect      n  l             BM Options    Miscellaneous Dprions                       F    r  r  F  r  r             295    Fig  9 6 Assignment COM port number to USB Serial Port  Latency Timer setting    other applications or programs  first assign  change  com port number bigger  than 4 to one of those programs and then assign available number from 
96. Mikul     Huba    Light channel output  45 T T T T                  System output    40r s Setpoint f                    DD        O1 eo c1  T    n  e    Light intensity       E  oa          o  T  L                   0 L L L L L  0 10 20 30 40 50 60    time s     Fig  9 23 Experimental results for K 17    5 7 s  The process gain still range in interval  3 17   For 1  overshooting tol   erance it yields to filtered predictive Ip controller parameters     Tao   6 48  9 11   Ty   4 28  9 12   Ko   14 15  9 13   For FIo controller it gives  Tao   5 7  9 14   Ty   eTao 5 16  9 15   Ko  17  9 16     The performance of both controllers is compared in Fig  9 31  9 32  Feel  free to make this experiment with larger dead time e g  10s   Questions     e What type of plant is FPrlg controller suitable to control for    e Was there any overshooting in output and input transients during the  experiments    e Which controller performed better in disturbance rejection     9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 311    Control signal  3 5 T T T          Bulb voltage    0 54 4                0 L L L L L  0 10 20 30 40 50 60    time s   Fig  9 24 Experimental results for K 17    k Step Response  NonOvershooting 8 Monotonic Control          0 8    0 6    0 4       0 2          04 K  K mi    Fig  9 25 Performance portrait for FIo controller    312    70    60    R  91   o o        o    Light intensity    10       Peter Tap  k and Mikul     Huba       Setpoint    c
97. Operating temperatures range   Power supply   Communication interface     0    70  C  12V 2A DC  external adapter   USB   virtual serial port    298 Peter Tap  k and Mikul     Huba           Block Parameters  s uncioni    m uDAQ28 LT Communication Interface  mask   link    c  2006 Martin Kamensky    Serial port   USB serial port number assigned to uDAQ28 LT system       Sampling time  sec    the lowest working value in Windows is about 0 04   0 05 s    Sample delayed       number of events  percentually  when simulink loop can take  more than time determined by sample time    Read timeout  msec    timeout for reading data from the port  the lowest working value  is about 25 ms     Matlab priority     NORMAL  PRIORITY   priority of common Windows application   ABOVE NORMAL PRIORITY   recommended   higher priority than common Windows  application priority   HIGH  PRIORITY   recommended   high priority   REALTIME  PRIORITY   NOT recommended   takes almost all system resources          Parameters    Serial pot z  Sample time  sec      perme me eee M                   Sampling delayed       1    Read timeout  msec  lower than sample time    Ts 2 1000    Matlab priority   ABOVE NORMAL PRIORITY E      jv Warming if delayed  error if unchecked     Detailed timing and timeout printout    Cancel   Help   Apply      Fig  9 8 User dialog window of communication interface                Data transfer speed  250 kbit s    9 2 Light Channel Control    The non filtered and filtered light cha
98. Static state  feedbacks can be found by solving equation    yf    Ui    The proof  technical details and additional references can be found in Conte  et al  2007     For the system  6 1   the static state feedback that solves the linearization  problem can be found by solving the equation    Yi  v  for u1 that is    ui   A101   Ac   y x1  7 7     7 Constrained PID Control Tasks for Coupled Tanks Control 259    When we apply this  the feedback we get from the original system  6 1  linear  system        v   with transfer function     Fils    lt     Now it is enough to design controller which will provide the required loop  behavior  It will be necessary for it to have opened loop transfer function    Tr When we talk about simple first degree integrator  in this case it is    enough use simple P controller  Its gain will be    1    Pras  1 Ti    For the two level system  6 2  we will do the same  By requiring  j    v  j2   v2    the solution will be given equations for u  and u2    uj   Avl   A1   12 sign x     z2  y  x   x2    A1c1 71  uo   As   Agcy sign zi   x2 V   x   z  l   A  2C24 T2    Similarly to previous case  after application of these feedbacks we obtain  two independent  decoupled  systems j1   v1  jo   v2 having the transfer  functions    Fi s       F   s       wSBlRewle    We can continue again in the same way as with the one level system  As we  now have two independent liear systems  for each level we can design separate  P controller     1  R     1 Ti  1  Ps  2
99. Ywheat Y       2 y   s  701 x   s  100 data set   X  Xwheat   idxcal   Y1  Ywheat   idxcal     50 calibration  sets   XO Xwheat   idxval   Y10 Ywheat   idxval     50 validation sets    X  Xwheat   idxval   Y1  Ywheat   idxval     50 calibration  sets   switched    XO Xwheat   idxcal   Y10 Ywheat   idxcal     50 validation  sets   switched      Jump to   MATLAB code starts here    4  SS   a a n a eS Se ee eae     4 Test case 3  Own example    G1    1 0  0 1   Gdi   0 0  0 0   gy1   0 20 3 4 5 6 3   gy2   0 0 2 1 3 4 9     gdi   0 0 4 5 6 8  9   gd2   0 0  3  5 5 9 18     Gyd    gd1    gd2      Y10    G1 Gd1    XO    Gy Gyd   Y100 Y10     na 0  aa a 0      Run repeatedly from here for several cases  Y10 Y100      8 data sets    Noise   O 5 randn 7 8   X    XO  X0    Noise    76    77    78    79    80    81    82    83    84    85    86    87    88    89    90    91    92    93    94    95    96    97    98    99    100    101    102    103    104    105    106    107    108    109    110    111    112    2 Measurements for Control  Optimization and Estimation 83    yi    Y10  Y10    use Y10 and  Y10 to get centered data    4432 data sets   4X    XO  X0     Noise   0 5 randn 7 32    4X    X X X X    Noise    Y1    Y10  Y10    use Y10 and  Y10 to get centered data  4Y1    Y1 Y1 Y1 Y1    A4 NoiseY  0 0 randn 2 32    with 2 yl s     Y1    Y1 Yi Y1 Y1    NoiseY    4 100 times where I take out data each time     4 MATLAB code starts here      Least squares    PCR with default tol   
100. a   rameter file should not be the optimal ones  First it is necessary to identify    286 Pavol Bist  k    J Scope    parameters    General  Data history   Tip  try right clicking on axes     Limit data points to last    sai    jv Save data to workspace    Variable name    ScopeData  Format  Janay           DK Cancel   Help   Apply      Fig  8 13 Scope block parameter settings    each individual piece of the uDAQ28 LT thermo optical plant and conse   quently to modify parameters of the controller in the initial parameter file     8 8 Conclusion    Remote laboratory software module extends possibilities how to exploit the  thermo optical plant in that way that thank to the Internet it is accessible  for greater number of interested persons  If the safety conditions are kept it  can run 24 hours per day  Thus the time and distance barrier are decreased  and the effectiveness of the real plant usage is enhanced    To increase the accessibility of the remote laboratory it is recommended  to include the starting Web page of the client application into a Learning  Management System  LMS  or into other system for Web pages administra   tion and provide the detailed description of the remote experiments that are  available  introduce the file names of block diagrams and initial parameters  that can be chosen   It is also advantageous to provide users with the value of  the server IP address  if its value is not predefined in the client application     The client application is univer
101. a device    Click Next to continue        Fig  9 1 Found new hardware wizard    Found New Hardware Wizard    This wizard helps you install software for     DIGICON uDAQ28 LT       If your hardware came with an installation CD  QE or floppy disk  insert it now     What do you want the wizard to do     O Install the software automatically  Recommended           Click Next to continue        Fig  9 2 Install driver from specific location selection    293    294 Peter Tap  k and Mikul     Huba    Found New Hardware Wizard    Please choose pour search and installation options        Seach for the best driver in these locations     Use the check boxes below to limit or expand the delault search  which includes local  paths and removable media  The best driver found will be installed     v  Search removable media  lloopy  CD ROM       V  Include thes location in the search     E Vdriver v Browse    O Dont search   will choose the driver to install    Choose this option to select the device driver from a kst Windows does not guarantee that  the driver you choose wil be the best match for your hardware        Fig  9 3 Driver location selection    Found New Hardware Wizard    Completing the Found New  Hardware Wizard    The wizard has finished installing the software for     Q USB Serial Converter    Click Finish to close the wizard        Cancel       Fig  9 4 Successful completion of installation    9 Constrained PID control Tasks for Controlling the Thermo Optical Plant      Device 
102. ables  temperature and its filtered value  ambient temperature  light in   tensity  its filtered value and its derivative  the ventilator speed of rotation  and its motor current   The temperature and the light intensity control chan   nels are interconnected by three manipulated variables  the bulb voltage  the  heat and light source   the light diode voltage  the light source  and the ven   tilator voltage  the system cooling   The plant can be easily connected to  standard computers via USB  when it enables to work with the sampling pe   riods 40 50 ms and larger  Within the Matlab Simulink scheme the plant is  represented as a single block  limiting use of costly and complicated software  package for the real time control     9 1 1 Installation in Windows Operating System    9 1 1 1 Device Driver Installation    New hardware is detected automatically by operating system and Found New  Hardware Wizard will start after plugging device into electrical power network  and connecting it to PC by USB cable  Fig  9 1   Choose driver installation  from specific location  Fig  9 2    Directory driver from the package of supporting software is needed to  select as device driver location path  Fig  9 3   Complete installation requires  two cycles of adding new hardware  USB Serial Converter and USB Serial  Port is installed into operating system  Found New Hardware Wizard starts  automatically second time   The user is informed on successful completion of  installation  see the windo
103. ack all inequalities into a matrix   A   1 0   10  01  O  1     b    t  1  1  1     polytope A  b           1    2  Create an another polytope Q as the convex hull of points v        1  0 7   12    1  0  U3      0  1    vi     0 5  0   v2    0 5  0   v3    0  0 5    Q   polytope  vi v2 v3         don   t forget the transpose     3  Plot P in red and Q in blue  don   t forget to use figure to open a new  plot      figure  plot P     r      figure  plot Q     b        4  Is P a subset of Q  Check this using vertices of Q  Or a one liner       P  lt   Q  ans      0  5  Is Q as subset of P  Check this using vertices of P  Or a one liner       Q  lt   P  ans    1    Solution 4 2  for Exercise 4 2     1  Let Q1 denote the shift of Q in the direction of the vector  0 5      0 2    01   Q    0 5   0 2     2  Let Q2 be Q1 scaled by a factor of 0 8  Q2   0 8 Q1    3  Let Q3 represent Q2 rotated by 45      th  Q3    4  Plot Q in red  Q1 in green  Q2 in blue and Q3 in magenta  Moreover  plot  all polytopes in the same graph using wireframe     45 180 pi  M    cos th   sin th   sin th  cos th     M Q2     124 Michal Kvasnica    opts   struct    wire     1     linewidth     3    plot Q     r     Q1   g  Q2     b     Q3     m     opts   axis equal             Fig  4 12 Resulting plot for Exercise 4 2     Solution 4 3  for Exercise 4 3   Plot the intersection of Q  Q2 and Q3       Q  amp  Q2  amp  Q3    H s  M    I   Q  amp  Q2   I  I  amp  Q3     opts   struct    wire     1     linewidth   
104. akacs stuba sk    Peter Tap  k   Institute of Control and Industrial Informatics  Faculty of Electrical  Engineering and Information Technology  Slovak University of Technology  in Bratislava  e mail  peter tapak stuba sk    Slavomir Wojnar   Institute of Measurement  Automation and Informatics  Faculty of Me   chanical Engineering  Slovak University of Technology in Bratislava  e mail   slawomir wojnar stuba sk    Ramprasad Yelchuru   Department of Chemical Engineering  Norwegian Univer    sity of Science and Technology  Trondheim  Norway  e mail   ramprasad yelchuru chemeng ntnu no   Vladimir Zilka   Institute of Control and Industrial Informatics  Faculty of Electrical  Engineering and Information Technology  Slovak University of Technology  in Bratislava  e mail  vladimir zilkaAstuba sk    Chapter 1    Problems in Anti Windup and Controller  Performance Monitoring    Morten Hovd and Selvanathan Sivalingam    Abstract This chapter provides assignments for control engineering students  on the topics of anti windup and controller performance monitoring  The as   signments are provided with detailed problem setups and solution manuals   Windup has been recognized for decades as a serious problem in control  applications  and knowledge of remedies for this problem  i e   anti windup  techniques  is essential knowledge for control engineers  The first problem in  this chapter will allow students to acquire and apply such knowledge  The  subsequent problems focus on different as
105. al Ilkiv B  Johansen TA  2007  Multiple ARX model based air fuel  ratio predictive control for SI engines  In  IFAC Workshop on advanced fuzzy and  neural control  Valenciennes  France  conference paper MO5 3   Pol  ni T  Johansen TA  Rohal Ilkiv B  2008  Identification and modeling of air   fuel ratio dynamics of a gasoline combustion engine with weighted arx model  network  Transaction of the ASME  Journal of Dynamic Systems  Measurement   and Control  130 6   061009   Preumont A  2002  Vibration Control of Active Structures  2nd edn  Kluwer Aca   demic Publishers   Rossiter JA  2003  Model based predictive control  a practical approach  1st edn   CRC Press LCC   Song G  Qiao PZ  Bibienda WK  Zhou GP  2002  Active vibration damping of com   posite beam using smart sensors and actuators  Journal of Aerospace Engineering  15 3  97   103   Sturm JF  1999  Using SeDuMi 1 02  a MATLAB toolbox for optimization over  symmetric cones  Optimization Methods and Software   Special issue on Interior  Point Methods 11 12 625 653   Takacs G  Rohal  Ilkiv B  2009  MPC with guaranteed stability and constraint feasi   bility on flexible vibrating active structures  a comparative study  In  Proceedings  of The eleventh IASTED International Conference on Control and Applications   Cambridge  United Kingdom    Wills AG  Bates D  Fleming AJ  Ninness B  Moheimani SOR  2008  Model predictive  control applied to constraint handling in active noise and vibration control  IEEE  Transactions on Contr
106. al Kvasnica      finally  look at it from the top  view 2     Acknowledgements The authors are pleased to acknowledge the financial support  of the Scientific Grant Agency of the Slovak Republic under the grants 1 0071 09 and  1 0537 10 and of the Slovak Research and Development Agency under the contracts  No  VV 0029 07 and No  LPP 0092 07  It is also supported by a grant No  NIL I 007   d from Iceland  Liechtenstein and Norway through the EEA Financial Mechanism  and the Norwegian Financial Mechanism     References    Borrelli F  2003  Constrained Optimal Control Of Linear And Hybrid Systems  Lec   ture Notes in Control and Information Sciences  vol 290  Springer   Geyer T  2005  Low Complexity Model Predictive Control in Power Electronics and  Power Systems  Dr  sc  thesis  ETH Zurich  Zurich  Switzerland  available from  http    control ee ethz ch  index cgi page publications action details id 2124   Kvasnica M  Fikar M  Cirka L  Herceg M  2011a  Complexity reduction in explicit  model predictive control  In  Huba M  Skogestad S  Fikar M  Hovd M  Johansen  TA  Rohal Ilkiv B  eds  Selected Topics on Constrained and Nonlinear Control   Textbook  STU Bratislava   NTNU Trondheim  pp 241 288   Kvasnica M  Rauov   I  Fikar M  2011b  Separation functions used in simplification  of explicit mpc feedback laws  In  Huba M  Skogestad S  Fikar M  Hovd M  Jo   hansen TA  Rohal Ilkiv B  eds  Preprints of the NIL workshop  Selected Topics  on Constrained and Nonlinear Control  STU Brati
107. al Plant 279    8 5 Client User Interface    The client application serves as the control panel for remote experiments  Its  interface must provide remote users with tools that will enable to exploit all  functions of the server side  Generally this interface allows its users to connect  to the server  set parameters of experiments  control the run of experiments   visualize experiments in the form of animations  graphs  numerical data and  finally to save data for later processing        T T T T  200 300 400 500                                     Fig  8 4 Graphical user interface of client application     The graphical user interface of the client application can be divided to four  quadrants    he two upper quadrants cover a graphical visualization of data  from the running experiment  In the left upper quadrant the experiment is  animated by the series of pictures selected from a database according to the  current state values of the experiment    In the upper right quadrant there are experiment data displayed in the  form of graphs  There are graphs of input  desired   output and control val   ues  These responses give an overview how the experiments evolves  More  detailed responses can be acquired after saving the numerical data and dis   playing them using different software for graphs  Matlab  e g    In the dis   played graphs the scale of the axis is continuously modified according to the  actual values of the displayed data  Below the graphs there is a Legend for  
108. al level of the liquid before opening the valve  and T1final its final level when we finish experiment by closing the valve   Finally  At  represents the duration of the experiment    The second way of determination c   does not require to know the exact  inflow from the pump  which can leads to higher accuracy  This way is also    234 Vladim  r   ilka and Mikul     Huba    faster  Time reguired to prepare and perform the measurement takes just  about minute    In both cases it is convenient to perform several measurements at different  level heights x   and to define the resulting value c   as a mean value  It is  caused mainly by the fact that the solenoid valves do not have aperture of  a simple circular shape  which  together with the relatively low pressure and  low level height may lead uncertain and to slightly fluctuating values of the  valve constant ci    Indetermining the valve constant c12 describing interconnection between  the tanks we can use similar approach  The difference would only be in the  fact that during the experiment the outflow valves from tank 1 and 2 will be  closed and before its beginning one tank will be filled to the maximum level  and the other one made empty  We stop the measurement just before the  complete alignment of both levels  The resulting relation defined from  6 2   for c19 will be       Ino     hao      y  hu     hai     iC    12 Atiz    With hio  hao as the initial liquid   s levels in the first or second tank  h11  h21 as  the f
109. alue from the certain interval of values    e Sample Time     sampling period  Model state variables are measured and  changed only in the regular instants characterized by this value  The min   imal sampling period is given by physical possibilities of the system     8 Remote Laboratory Software Module for Thermo Optical Plant 281    e Running Time     duration of the experiment  It limits the time how long a  selected block diagram with specified parameters will be running  During  this time the model state variables are visualized by the help of graphs  and animations  Also the numerical values of the model state variables are  displayed in the field Output    e Save to File     the name of the file placed on the user computer to which  time sequences of the model state variables will be saved after pressing the  button Save  It is necessary to enter the whole path  C  output mat  e g     If the file does not exist it will be created         ModelScheme PL        Model Parameters  initPI1  Input  Desired Value   15 000  Sample Time   0 20  Running Time   50 00   Save to File  cloutputmat                            Fig  8 5 Settings    Warning  When entering any parameter the corresponding field is high   lighted by yellow color that indicates data editing  The new parameter is  valid only if the editing is finished by pressing the Enter key     8 5 2 Server IP Address and Control Buttons    Connect      Disconnect          me q 9 9   i seem uns     Fig  8 6 Control buttons
110. anical Engi   neering  Slovak University of Technology in Bratislava  e mail  marek honekAstuba sk    Mat     Kopa  ka   Institute of Measurement  Automation and Informatics  Faculty of Me   chanical Engineering  Slovak University of Technology in Bratislava  e mail   matus kopacka stuba sk    Jozef Csamb  l  Institute of Measurement  Automation and Informatics  Faculty of Mechanical Engi   neering  Slovak University of Technology in Bratislava  e mail  jozef csambal stuba sk    Slavomir Wojnar   Institute of Measurement  Automation and Informatics  Faculty of Me   chanical Engineering  Slovak University of Technology in Bratislava  e mail   slawomir wojnar stuba sk    171    172 Gergely Takacs et al    wide application possibilities of MPC and the numerous examples of mecha   tronic systems  two real life laboratory examples have been selected  First  an active vibration attenuation system is discussed  with numerous hardware  implementation details  This is then followed by a detailed discussion of the  implementation of three very different stabilizing MPC approaches  tradi   tional quadratic programming based MPC  pre computed explicit MPC and  a sub optimal approach called Newton Raphson   s MPC  Details are given on  software and code implementation using coding examples in the Matlab and  C programming environment  The next section of this chapter deals with a  very different practical example  a spark ignition engine example  This section  will introduce the details o
111. anteed stability  Automatica 34 10  1205 1217   Dong X  Meng G  Peng J  2006  Vibration control of piezoelectric smart structures  based on system identification technique  Numerical simulation and experimental  study  Journal of Sound and Vibration 273 680   693   Ferreau H  2006  An online active set strategy for fast solution of parametric quadratic  programs with applications to predictive engine control  Master s thesis  University  of Heidelberg   Ferreau H  Bock H  Diehl M  2008  An online active set strategy to overcome the  limitations of explicit mpc  International Journal of Robust and Nonlinear Control  18 8  816   830   dSPACE GmbH  2009  HelpDesk Application   Hou Z  2007  Air fuel ratio control for gasoline engine using neural network multi step  predictive model  3rd international conference on intelligent computing  Qingdao   China   Kouvaritakis B  Rossiter J  Schuurmans J  2000  Efficient robust predictive control   IEEE Transactions on Automatic Control 45 8  1545 1549   Kouvaritakis B  Cannon M  Rossiter J  2002  Who needs QP for linear MPC anyway   Automatica 38 879   884    5 Implementation of MPC Techniques to Real Mechatronic Systems 223    Kvasnica M  Grieder P  Baoti   M  2004  Multi Parametric Toolbox  MPT   Online   available  http   control ee ethz ch    Kvasnica M  Grieder P  Baotic M  Christophersen FJ  2006  Multi Parametric Tool   box  MPT   Extended documentation   Lara A  Burch JC  Schloss JM  Sadek IS  Adali S  2003  Piezo patch sensor act
112. ape  but here PV also resembles a sawtooth shape   and stiction is therefore not readily identifiable from the time plots  The  oscillations are of modest amplitude  around an order of magnitude larger  than the measurement noise      1 Problems in Anti Windup and Controller Performance Monitoring 41       1 05     0 95   4    0 9       L L i L L  7000 7050 7100 7150 7200 7250 7300  Time                0 8 L L L L L  7000 7050 7100 7150 7200 7250 7300  Time       Fig  1 41 OP and PV for data set 3                     30  20  10 0 10 20 30    Fig  1 42 The OP to PV cross correlation function for data set 3     The cross correlation function for data set 3 is shown in Fig  1 42  This  is an almost perfectly even valued function  and this test therefore does not  indicate the presence of stiction    The OP     PV plot for data set 3 is shown in Fig  1 43  The plot looks  like an ellipsoid seen from the side  but due to the angle it is difficult to  assess whether there are any sharp corners in the plot  In Fig  1 44  the PV  time series is therefore shifted by 5 samples  Again  we find that the plot is a    42    Morten Hovd and Selvanathan Sivalingam                   L L L   0 04  0 03  0 02  0 01    Fig  1 43 OP PV plot for data set 3     0 25    fi L L  0 0 01 0 02 0 03 0 04       PV k 5                 L L L   0 04  0 03  0 02  0 01    L L  0 0 01 0 02 0 03 0 04    Fig  1 44 OP PV plot for data set 3  with the PV data series shifted 5 samples     little messy  since the tim
113. ariables  without anti windup     1 2 4 4 Simulation with Anti windup    The simple anti windup technique for PI controllers described in Hovd and  Sivalingam  2011  is used  and is implemented as illustrated in Fig  1 29   Note that if we want to account for saturation in the valve in addition to the  effect of the selector  this could easily be done in the simulation by putting a  saturation element in series after the selector  before sending the    anti windup  signal    to each controller  In a real life implementation  it would be preferable  to use for anti windup a direct measurement of the valve position    The simulated responses in the controlled variables  when including anti   windup  are shown in Fig  1 30  and the corresponding responses in the con   troller outputs are shown in Fig  1 31  We see that only small deviations of          I I  Flow controller output  Pressure controller output  Input applied                               fi L fi fi L fi L n  0 200 400 600 800 1000 1200 1400 1600 1800 2000    Fig  1 28 Responses in controller outputs  without anti windup     1 Problems in Anti Windup and Controller Performance Monitoring 33      kf  u E m 0  1 Gaint Flow setpoint   deviation variable     Tif s 1  Transfer Font f                                                 Flow                                                                               uf  deviation variable   1  Flow controller output 20s 1  5 Flow disturbance  10s 1  Flow    W min    ur  MinM
114. ase where H may be any     full    matrix  In terms of selecting controlled variables  c   Hy  this means  that any combination of measurements are allowed  However  in practice there  may be constraints on H  for example  one wants to use a subset of the  measurements or one want to use a decentralized structure for H    We will consider the following special cases    Case 1  No restrictions on H  This is the case already considered where  Theorems 2 1    2 4 hold     66 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke    Note that key for deriving Theorems 2 1    2 4 was that if H is a solution  then so is H     DH where D is any non singular matrix    Case 2  H contains a subset of the measurements but is otherwise full   Theorems 2 1  2 4 hold also in this case    The reason is that H     DH will have the same structure as H for   any nonsingular D  This is because if H has columns equal to zero  then   these columns will remain zero in DH even if D is  full   For example  if   H  i ea then we can still allow a full D      z  where    is  0rx0zc Tc   any number  and keep the structure of H in H     DH    Case 3  H contains measurements from disjoint set  so H has a block  diagonal  decentralized  structure  Theorems 2 1    2 4 do not hold in this  case    The reason is that for H     DH to have the same structure  D must    have a structure similar to H  For example  let H     eee then  00022  zx 0     LLLLL  D  la o  where x is any number  and if H   k 00x a
115. atrix formulation as    cesis  jes Ies  4 20   which clearly is an intersection of two polytopes in the x space  hence a poly   tope itself     Can you compute and plot the set V using the numerical data above  Verify  constraint satisfaction by checking the extremal vertices of W     Exercise 4 10  We still consider the LQR case from the previous example   We have seen that for any state r     V the LQR feedback u      K respects  constraints  But for how long  Let   s investigate one of the corner points of  V     E   extreme PSI   x   E 1       u    K x  u    1 0000    What is now the successor state tp41   Av    Buy     xn   Axx   Bru  xn    2 1713   3 3287    But this point is outside of W     isinside PSI  xn   ans      0  which means that for this new state some constraints would be violated     u    K xn  u    2 0002    122 Michal Kvasnica    In other words  V does not possess the set invariance property  In simple  words  a set P  is invariant if  for all starting points xg inside such set  all  future trajectories x  remain in the set Vk  gt  0  Set invariance is crucial for  MPC in order to guarantee stability of the closed loop system    Now that we checked that W is not invariant  can we compute its invariant  subset     Following definition might help     Py       k     k E Y   A    BK zy     V  Vk  gt  0   4 21   Following iterative algorithm can be used to compute Py     Step 1  k   1  Wp   Y   Step 2  repeat   Step 3  V     2      E Wg   A    BK z     Wk   St
116. atter for the optimization problem which becomes    ming    HG    H  ie and we want to find the optimal H      a  Consider the case with 2 measurements  so G       column vector     gi   g  and H    h  hg   row vector   and solve the problem analytically  Also  compute the optimal norm  j      HG    H          b  Derive the result more generally for the scalar case with any number of  measurements  by making use of the definition of the induced 2 norm  sin         zT G h  gular value   which for a vector gives    G       VG  G      maxn         2    62 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke     note that for a vector the Frobenius norm  p and 2 norm  3  are the  same      c  Use the analytical formula presented below  to derive the general result  for the multivariable case  nu   ne  gt  1      Solution 2 1      a  Two measurements     HG     hiha  H   h  g     haga  scalar        P     HGY  H          h   h2    higi  h292      1 27   g1  292      where x   ha hi  Set d j   dx   0 to find the optimal x  After a lit   tle simplification x      1   x  go  g1   xg    0 which gives x   go gi   Conclusion    ho hi   92 91    that is  we prefer to control the measurements corresponding to large el   ements in G     Also find  7       1 4  g    g2  which we note is equal to  1  IG l     b  Any number of measurements  Let h   H    be a column vector  G    is  already a column vector  Since HG      hT G  is a scalar  it is equal to  its transpose and we have tha
117. aw   k2a k2b inv k2d  k2c    k2bw    zeros size k2b   k2b inv k2d     uz   size k2b inv k2d      k2cw   k2c    k2dw    k2d zeros uz       1 1 9 4 LOG Controller    Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh    LQG controller with integral action      Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh      Augment plant with 2 integrators    ny   size C 1      nx nu    size B     n 5  m 2   Zxx   zeros nx nx   Zxu   zeros nx nu     Zux   zeros nu nx   Zuu   zeros nu nu     Aint    A Zxu   C Zuu     Augment plant with integrators  Bint    B   D     Augment plant with integrators  at    plant output     states   5    use old system      gt  old number of states      Kalman filter  only for true states        not needed for integrators    Q    kw eye 2      R   kv eye 2     sys  d   ss A  B Bd  C   D D    4 D is zero anyway     kestold KFL P M Z    kalman sys_d Q R        LQR control    states     Q   5xeye states     R   1 eye 2     N   0      lqrK S e    lqr Aint Bint Q R     Shows that we only need    the A and B matrices    for LQR control    larKs   lqrK   1 nx     Plant state feedback part  lqrKint   larK   nx 1 nx ny   4 Integrator state feedback part    36    37    38    39    40    41    42    43    44    45    46    AT    48    49    50    51    52    53    1 Problems in Anti Windup and Controller Performance Monitoring 27  lqrKii   inv lqrKint       Aki   zeros 2 2      State space representation of two  integrators in parallel       Bki   eye 2    Cki   eye 2    Dki   1
118. ax Input applied   deviation variable   10      100s  1  Pressure    E  20s 1                Transfer Fen         gt  p P                Pressure   deviation variable     kp  u   x3  Gain  0    Pressure setpoint   deviation variable     Pressure controller output    1 a  x  i Tip s 1  Transfer Fcn2                                           Fig  1 29 Simulink implementation of model and control system  with anti windup    the controlled variables above their setpoints occur  T here is no appreciable  windup effect  and active control quickly switches to the other controller upon  reversal of the sign of the disturbance  For the inactive control loop  there  are still large deviations below the setpoint  i e   in the    safe    direction  This  is clearly unavoidable when controlling only one variable at the time    Comparing to the simulations without anti windup  we observe much bet   ter control of deviations in the controlled variables above the loop setpoints   Anti windup is therefore very important when the value of a manipulated  variable is determined by selecting between the outputs of several controllers      especially if good control in one direction is required for safety    The simulations also illustrates the error in the widely held belief that   the active control switches to the variable whose value is above setpoint     In  Fig  1 27 we can easily find periods where both controlled variables are above  the setpoint  and in Fig  1 30 we see that the active co
119. ble represents a valid controller object  which can be  further post processed or deployed as real time executable code as illustrated  in the previous section    In the sequel we present several examples illustrating how the concept of  adding new constraints can be used to achieve typical control tasks     4 5 4 1 Terminal Constraints    One way of ensuring that the MPC controller will provide closed loop stability  is to add a terminal state constraint xy   0  This requirement can be easily  added to the set of constraints by     gt  gt  C   C    V xfend     0     138 Michal Kvasnica                                                                                     Evolution of states Evolution of outputs  1 1  X        Y   0       H 0       JYX H  a  1 2 1     amp   on 2  Ven o  2   3  3   4  4  0 10 20 30 0 10 20 30  Sampling Instances Sampling Instances  Evolution of control moves Active dynamics  2  1 5  8  3 E  a o 1  s    a  0 5   1 0  0 10 20 30 0 10 20 30  Sampling Instances Sampling Instances    Fig  4 21 Closed loop simulation using the simplot function     where V xfend  represents the final predicted state zw  Another option is to  use terminal set constraints  i e  to require that xw     7 for some polytope  T    x   Hx     K   This type of constraints can also be introduced easily by     gt  gt  C   C    H V xfend   lt   K     4 5 4 2 Time varying Constraints    In the optimization problem  4 26   constraints  4 26d  and  4 26e  are time   invariant  To make
120. box provides easy to use access to  various tasks ranging from modeling of dynamical systems  through control  synthesis  up to verification and code deployment  The purpose of this chapter  is twofold  First  the toolbox is introduced and its functionality is explained  by means of simple  illuminating examples  Then  a set of advanced exercises  is provided for the reader to practice and master their skills     4 1 Multi Parametric Toolbox    Optimal control of constrained linear and piecewise affine systems has gar   nered great interest in the research community due to the ease with which  complex problems can be stated and solved  The aim of the Multi  Parametric  Toolbox  MPT  is to provide efficient computational means to obtain feed   back controllers for these types of constrained optimal control problems in  a MATLAB programming environment  As the name of the tool hints  it is  mainly focused on calculation of feedback laws in the parametric fashion in  which the feedback law takes a form of a PWA look up table  But the toolbox  is also able to formulate and solve MPC problems on line in the receding hori   zon fashion  i e  by solving the optimization problem for a particular value of  the initial condition at each time step     Michal Kvasnica  Faculty of Chemical and Food Technology  Slovak University of Technology  in Bratislava  e mail  michal kvasnica stuba sk    101    102 Michal Kvasnica    In short  the Multi Parametric Toolbox can be described as being a 
121. by  evaluating     f  Rv  5 13     where f is the perturbation vector  R is an input from the off line optimiza   tion  and v is a vector product re calculated at each sampling interval     5 Implementation of MPC Techniques to Real Mechatronic Systems 193    if  W2  gt   tol     dgemv_ chn   amp order  korder  amp mone R  amp order         Vec  amp onei  amp zero f  amp onei       The other option in the else construct is to evaluate for the unknown A  using the Newton Raphson procedure  This conditional statement launches a  while loop  which cycles through the NR procedure  until the floating point  absolute value of error is larger than the pre set tolerance    The first part of this code segment serves only to evaluate the matrices  used in the NR loop  These simplifications increase computational speed and  are based on the assumptions about function  A  and its i th derivatives    The second part of the following code segment is the Newton Raphson  algorithm itself  Here the first step is to evaluate the value of  A  and its  derivative  The ratio of the function value and its derivative is the error   which is subtracted from the result for A from the previous step     elsei   while fabs err    to1   1  descal  korder klamN Sm m    dediv_  amp order W1 m W1d     dediv    amp order Wid m Widd    fval ddot  korder vec konei Widd konei  W2   fderval 2 ddot    amp order Wid  amp onei Widd  amp onei    err fval fderval   lamN lamN err      Since the value of A has been acq
122. cal implementation details  while sug   gesting the simplest possible solutions  Therefore no customized on line  quadratic programming solvers or algorithms of multi parametric program   ming are discussed here  All methods will be implemented in Matlab Simulink   if possible using off the shelf solutions for off and on line solvers  Typically  the problem setup will be carried out in Matlab  while the on line problem  is running on an xPC Target platform system  We will begin our discussion  with introducing the experimental system used as an example     5 2 2 Brief Description of the Experimental Hardware    A clamped cantilever beam may represent many real life under damped flex   ible structures  such as helicopter rotor beams  antenna masts  manipulating  arms and solar panels on space structures  The experimental setup considered  as an example to demonstrate different MPC implementations may represent  the vibration attenuation of any of the aforementioned physical systems    The aim of the MPC based vibration control system is to minimize beam  tip vibrations  while respecting constraints set by the maximal allowable volt   age levels on the piezoelectric patches  Since piezoelectric materials are prone  to depolarization  maximal voltage input levels are set  Additional require   ments placed on the control system are the need for guaranteed stability and  constraint feasibility     5 Implementation of MPC Techniques to Real Mechatronic Systems 175    5 2 2 1 Hardwa
123. can be than computed as K   ys us  In  this example it gives   kom     Us 2 5   Modify the Simulink model to use the inverse process gain to control the   plant  Fig  9 11   Do not forget to add the input saturation in the model     8  9 1     300    C udag28LT_iov2    Elle Edit View Simulation Format Tools Help  DOBA  BmBe  551                                gt            Temperature                   Optical Thermal    Plant P  VO Interface 3    inienerfy                                               Fan current          Fan rpm    Peter Tap  k and Mikul     Huba    Light intensity    SB 0 9 9h    02    Time offset  0       Fig  9 10 Basic Simulink model for the udag28 LT plant    because the bulb voltage is limited from 0 V to 5 V  Add the setpoint signal    to the light intensity scope  Set the simulation time to infinity     Ele Edt View Semuahon Format Took Help    Optical Thermal  Plant  VO Interface    Fig  9 11 Static feedforward control          Light  intensity    9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 301    Make multiple setpoint steps in a wide operational range  It can be done  while the experiment is running     Light intensity       Fig  9 12 Experimental results     Light intensity scope    You should observe a steady state error in several working points  The  smallest steady state error can be seen around the point where the process  gain was measured  It is not difficult to conclude that the process parameters  vary throu
124. can speed up the transients processes  And  contrary  by increasing 71  when the pole is shifted towards the origin  we    7 Constrained PID Control Tasks for Coupled Tanks Control 249    can slow down them  In increasing the P controller gain we have to be careful  and speed up the transients only until certain limit        0 8        0 6     a   1 T   1  2   100    a   1 T   1  2   100                   0 4  J 0 4   0 2  J 0 2   0 0  0 1 2 3 4 5 0 1 2 3 4 5    Fig  7 1 Impact of the P controller tuning on the tranient responses    The limitations are mainly given by factors as nonmodelled dynamics   plant uncertainty  measurement noise and control signal saturation  For  shorter time constant 71  saturation of the control signal typically occur and  for T1     0 the control signal tends to rectangular pulse of the minimum time  control  Fig  7 1   P controller for integrator plant represents solution of the  dynamical class 0    If we increase the amplification of controller too much  the sensitivity of the  circuit to the measurement and quantisation noise will increase and this can  lead to system s destabilization  increased wear of active elements or damage      in this case  by switching the pump on and off over a too long period to  maximum or zero voltage    On the other hand  too small controller gain can slow down the transient  processes  or  in an extreme case  the pump will even not start to move  In  order to get some insight  which controller gain may be appli
125. ce and feasibility conditions  LMI are parsed  using YALMIP introduced by L ofberg  2004  to the SeDuMi optimization  software suite as formulated by Sturm  1999     The first portion of the off line code initializes the algorithm  Amongst  others  simulation stop time is defined along with the desired deflection  which  in the case of the vibration attenuation example is always zero  A linear time   invariant state space model is loaded from a file  Sampling time is also defined  as T s     Tstop 60    yd 0    load m2ss mat    A m2ss A  B m2ss B  C m2ss C  D m2ss D   Ts 0 01     Other types of settings and tuning parameters are also declared at the  beginning of the script file  Symmetric input constraints are stated as uh   State penalties are set as Q   CT C which includes the output deflection in  the computed cost  Input weighting is declared as the variable R     uh 120   Q C     C   R 1e 4   Prediction cost performance bound y is stated  which is necessary to be  limited in order to preserve numerical stability of the process  A tolerance    limit is also set  which is used to modify the behavior of YALMIP regarding  the handling of strict inegualities     tolerance 1e 8     5 Implementation of MPC Techniques to Real Mechatronic Systems 185    gamma 1e6      Dimensionality of the problem is determined  to allow the use of different  state space models for generating predictions     dim size An   dim dim 1 1     w dim  size B   w dim 1 3  w dim 1 1    w dim 1 4  w dim 1
126. cessary if integral action    20 Morten Hovd and Selvanathan Sivalingam    Output 1    15 1             L fi fi L L L L L  50 100 150 200 250 300 350 400 450 500    Output 2  2 T          f L L L i L L i  0 50 100 150 200 250 300 350 400 450 500                Fig  1 20 Response with PI controllers with anti windup        E  P gi2num s                                                                                                                          Transfer Fen      giinum s   yes i Transfer Fent  n mP       Ax Bu  e  yref ne Jaa ei y   Cx Du 1  k1  Hanus  0 01s 1  Fast lag  yi to break algebraic loop1  y     u u measured  pa qe 1  y v  gt  X   Ax Bu a    y   Cx Du 0 01s 1  k2 Hanus  Fast lag  g21num s  to break algebraic loop  a g22num s   7  y             Fig  1 21 Simulink implementation of inverse decoupler with anti windup for outer  PI controllers     is used in the controllers for the individual loops that result after decoupling  compensation  This is the common case  which also is used in this example   However  even if simple PI controllers are used in the individual loops  we  may can no longer use the simple anti windup scheme in Fig  1 1  Rather  we  have to calculate the range of manipulated  input  variable movement that is  available  after accounting for the action of the decoupling elements  This is  is illustrated by the Simulink implementation in Fig  1 21  Note that here the  anti windup of the PI controllers has been achieved using the so called Ha
127. ch depending on which region R      x t    Hix t      Ki   i 1     Nreg  contains the state x t      Theorem 4 1 suggests that the RHMPC feedback Un a t   can be con   structed off line and stored as a lookup table  which consists of the regions R   and the associated feedback gains F   G   The advantage of such an approach  is that value of Uw x t   for a particular value of x t  can be obtained by  simply evaluating the table  as captured by Algorithm 1  The algorithm tra     Algorithm 1 Sequential table traversal    INPUT  Regions R   feedback laws F   Gi  number of regions Nreg  state measure   ment x t   OUTPUT  Optimal RHMPC control input uo z t    1  for r 1      Nreg do  2 if H z t   lt  K  then  3 Un  x t     Fpa t    Gr  4  uo a t      I 0     0 Uv  lt  t    5 return uo z t    6 end if  7  end for    verses through the regions sequentially  stopping once it finds a region which    4 Multi Parametric Toolbox 133    contains x t   In such case the optimal control action is calculated by evalu   ating the corresponding control law and returned back  Clearly  in the worst  case  the algorithm has to search through all regions  But since the operations  performed in Steps 2 4 only consist of simple matrix multiplications and ad   ditions  for a large class of problems running Algorithm 1 is faster compared  to obtaining uo x t   by solving  4 26  on line as an LP QP MILP MIQP  using off the shelf solvers  The second benefit is that the explicit representa   tion of the f
128. controller_explicit is not contained in the regions of  inv_controller   To see that  we compute the set difference between the  regions of the two controllers      gt  gt  NI   controller_explicit Pn   inv_controller Pn   and we plot it       plot regions of the invariant subset in yellow    4 Multi Parametric Toolbox 161     4 and the states which are not invariant in red   gt  gt  plot inv controller Pn     y     NI     r        You should see the figure similar to the one below              Fig  4 28 Set of invariant states  yellow  and those which are not invariant  the two  small red patches in the upper left and lower right corners      With the invariant controller available in inv controller  we can return  back to stability analysis      gt  gt  L   mpt lyapunov inv controller     pwq       This time the Lyapunov function is found     mpt_getPWQLyapFct  SUCCESS   Found Piecewise Quadratic Lyapunov function     which shows that the explicit controller inv_controller will definitely ren   der the closed loop system stable  You can check this fact by running a bunch  of closed loop simulations using the point and click interface      gt  gt  simplot inv_controller     Since the controller is invariant and guarantees stability  do you expect to  find a starting point for which the simulation would fail     162 Michal Kvasnica    4 7 Solutions    Solution 4 11  for Exercise 4 11        it   s always wise to wipe the sysStruct variable  clear sysStruct      plant dynamics
129. created in the form of a Java applet inserted into a  Web page  For the testing purposes the installation is not needed because it  can be run directly from the installation CD by clicking the client html file  placed in the Client  Application folder    But the client application is aimed for a Web publication when it can  be accessible for all potential users  In this case it is necessary to upload the  content of the Client  Application folder to the desired Web server  Then after  setting the correct Internet address the client application is downloaded into  the Web browser window that enables running of Java applets     8 4 Running the Client Server Application    The run of a client server application must be synchronized  First it is  necessary to run the server part of the application  After the server has  been successfully installed it is possible to run it by a double click to the  RemLabServer exe file that is  after the correct installation  placed in the  CA RemLab Workspace folder  Depending on the server computer safety set   tings it can happen that the system will ask for confirmation of a trust to  the application     278 Pavol Bist  k    cx C  RemLabServer exe    connection   connection   t connection   connection     waits for client connection       Fig  8 2 Server application waiting for client connection    It can be noticed that the run of the server application invokes the run  of Matlab application automatically  After starting the server is held i
130. ct  that the air mass flow is measured as an absolute value  it was  necessary to integrate this amount during the particular time and express the  air and fuel quantity as relative mass densities  grams cylinder   Hence  the  air fuel ratio is defined  as       Malk   Liymg k   Where ma k  and my k  are relative mass amounts of air and fuel in a   cylinder and Lin   14 64 is the theoretical amount of air necessary for the   ideal combustion of a unit amount of fuel    Considering the A k  modeling  the engine has been divided into two subsys    tems with independent inputs  namely into     A k   5 15     air path with the air throttle position  as the disturbance input  and  fuel path with the input of fuel injector opening time     5 Implementation of MPC Techniques to Real Mechatronic Systems 207    ORAS 4       Fig  5 15 Case with converters and security circuits    Another disturbance like acting quantity were engine revolutions  implicitly  included in the engine model  particularly for each working point  The output  ratio of both paths is the value of A     208 Gergely Takacs et al    5 3 3 2 SI Engine Modeling using ARX Models    The engine modeling is based on the weighted linear local model with single  input single output  SISO  structure  Pol  ni et al  2008    The parameters  of local linear ARX models with weighted validity  Murray Smith and Jo   hanssen  1997   are identified to model AFR nonlinear dynamics  The prin   ciple of this nonlinear modeling techniqu
131. ct control quality     9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 323    FPI  T T  570 8       Light intensity                80 100 120 140 160 180 200 220 240 260 280  time  s   FPI  T T  970 6       52r 4    Light intensity             80 100 120 140 160 180 200 220 240 260 280  time  s   PP T T  970 06          52r 4       Light intensity          80 100 120 140 160 180 200 220 240 260 280  time  s   Fl  controller          RK c Cc  00 o N  T  1    Light intensity    BA  o          100 120 140 160 180 200 220 240 260 280  time  s           co  o    Fig  9 41 Experimental results detail     delayed system output  setpoint step    324 Peter Tap  k and Mikul     Huba                                                    FPI T T   0 8  52r 4  D  D     o  E     o       60 80 100 120 140 160 180 200 220 240 260 280  time  s   PP T T   0 6  52r 4  D  Ez      2  E  E  o       60 80 100 120 140 160 180 200 220 240 260 280  time  s   FPI  T T    0 06  52r J  D  5 o mnie erue darpa iaa  E      48r J  e       46r 1  60 80 100 120 140 160 180 200 220 240 260 280  time  s      controller  0  52      5 50  E    48  o       46             60 80 100 120 140 160 180 200 220 240 260 280  time  s     Fig  9 42 Experimental results detail     undelayed system output  setpoint step    9 Constrained PID control Tasks for Controlling the Thermo Optical Plant    PPI T T  9 0 8       38  3    Light intensity                1100    1040 1060 1080       1000 1020 1120 1140
132. ctric actuators  As in most real  systems  direct control feed through is not considered  therefore matrix D is  set to equal zero    The experimental procedure involved measurements in the frequency do   main  The system has been excited by an amplified chirp signal entering the  actuators PZT1 and PZT2  The amplitude of this signal has been set to reach  maximal allowable levels of  120 V  in order to minimize vibration caused  by the surroundings  Since the first eigenfrequency of the beam is 8 127 Hz   the chirp signal frequency started from 0 1Hz up to 20Hz  The measured  signal has been sampled 5000 Hz  and subsequently re sampled for different  models The predictions are generated by the following state space system  sampled by 100 Hz        5 Implementation of MPC Techniques to Real Mechatronic Systems 177    an 0 9981    1 2233 B  6 697 E 9    10 0021 0 9985      8 001E 6    C      0 5774     0 7069   5 2     5 2 8 Quadratic Programming based MPC    5 2 3 1 Introduction    This subsection will elaborate on the practical implementation of a dual   mode quadratic programming based MPC controller with stability and fea   sibility guarantees  The on line quadratic programming solver considered in  this application is called qpOASES and it has been introduced by Ferreau  et al  2008  and subsequently Ferreau  2006   This solution has been chosen  for its easy implementation properties and the fact that unlike generic QP  solvers  it has been fine tuned for MPC application
133. d     3 2 Simple excercise    Exercise 3 1  Cox 1992   Check whether the two polynomials f     2x     3x  1 and fo   7a    x   3 have a common root in C     Solution 3 1  The resultant is the determinant of the Sylvester matrix     Johannes J  schke  Department of Chemical Engineering  NTNU    Trondheim  Norway  e mail   jaschke chemeng ntnu no    Sigurd Skogestad  Department of Chemical Engineering e mail  skoge chemeng ntnu no    1 The software can be downloaded at www sop inria fr galaad software multires    91    a AB U NR    92 Johannes J  schke and Sigurd Skogestad    2070  3217  1331  0103    Res fi  fa    det   153   0  3 1     There exist no common root since the resultant is nonzero     Maple code for the Sylvester matrix example    with  LinearAlgebra      f1    2 xx 243 x4 1    f2   T x 2 x 3    Syl    SylvesterMatrix f1 f2    Res    Determinant  Syl       3 3 Isothermal CSTR Case Study    Consider a CSTR as in Figure 3 1  with a feed stream containing component  A and with two first order chemical reactions     A    B n kc  d  3 2   B    C ra   kocp     Of the products formed  B is the desired procuct  while C is an undesired  side product  The manipulated variable is the feed stream q  which can be  adjusted to achieve profitable performance  The operational objective is to  maximize the concentration of the desired product     CAF    2       L LY  A       CO  CA CB CO           q    Fig  3 1 Isothermal CSTR    3 Measurement polynomials as controlled variables  
134. d PV for data set 1 are shown in Fig  1 34  The  OP resembles the sawtooth shape  and PV resembles the square wave shape   that together are held to be typical of stiction    The cross correlation function for data set 1 is shown in Fig  1 35  This is  nearly an odd valued function  and this test therefore indicates the presence  of stiction     The OP     PV plot for data set 1 is shown in Fig  1 36  for approximately  two oscillation periods  Despite the imperfect trend removal  the plot clearly  shows the signals  oscillating around an open area     and sharp corners in the  plots  T his test therefore also indicates the presence of stiction     1 Problems in Anti Windup and Controller Performance Monitoring 37       OP          I L L 1 i L L L L  0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000  Time       PV                L L L L L L L L L  0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000  Time    Fig  1 34 OP and PV for data set 1     1500 T       1000 F al     500 F 4     1000r                1500 L L L L L L L i     1000  800  600  400  200 0 200 400 600 800 1000       Fig  1 35 The OP to PV cross correlation function for data set 1     The routines bicoherence m and glstat m are both run to detect the  presence of nonlinearity in the output  Default parameters are used for both  routines  Elements 5001 9096 of the PV data series are used  a data series of  length a power of 2 is used since these routines are based on the FFT   The  command   bic waxis NGI NL
135. d dele RP bo data Ena  LAS TONTOR ollm ncn elie k nhs See add aera  LELY    Sarlations 2  es data E sated  11 8  JAutiwindup i reikia bee eee   LLI Matlab Gaede wn liest cette  1 2  Anti windup with PI Controllers and Selectors               1 2 1 Introduction to Selective Control                   1 2 3 The Control Problem in the Assignment             1 2 9  PSO cocus E LT O E ER Re  12 4  OH 213 teat sooo ide lek e REISCRLSA  US hoo Deed  cae ein sae RAE TREE dU RE Rd  Lal ASAIO 2 2122  iessteeee RR OR EP P Reed  Lee OIM DIE  aereum RR Re Rex FRE REL  1450   MOS o hogtied ee ed  1 4 Controller Performance Monitoring using the Harris Index    1 4 1 Assignment eccesso eem eee  14 2 BOA 2216 eee Rene R ne bee a ed  PETR onus ie blbondce Su equ Pe eode de dob de ies eed a B    viil    Contents    Optimal Use of Measurements for Control  Optimization  and Estimation using the Loss Method  Summary of    Existing Results and Some New                      uussu  53  Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke   2 1  LubcducboH  lt  pei ee eked bebe Dia EEEE E 53   22 Problem Formulabiol   csset Rede 54   2 2 1 Classification of Variables                         54   22  Cost PBC cz ce ccs odd on  herr See dou A Red des 54   2 2 3 Measurement Model               0 0000 cece eee 55   22 4 Assumptions 2 6 i000  ncaon denna b Re gees eek 55   2 2 5   Expected Set of Disturbances and Noise            55   2 2960 Probl    le hm RE ER RR 56   2 2 7 Examples of this Prob
136. d only if      1     z t      1     Fig  4 23 Visualization of the lookup table for the control setup with the login  equivalence constraint     1  lt  z t      1         0 5     uo  lt  0 5      4 5 5 Analysis    The toolbox offers broad functionality for analysis of hybrid systems and  verification of safety and liveliness properties of explicit control laws  In ad   dition  stability of closed loop systems can be verified using different types of  Lyapunov functions     4 5 5 1 Reachability Analysis    MPT can compute forward N steps reachable sets for linear and hybrid sys   tems assuming the system input either belongs to some bounded set of inputs   or when the input is driven by some given explicit control law    To compute the set of states which are reachable from a given set of initial  conditions XO in N steps assuming system input u k      Uo  one has to call     R   mpt reachSets sysStruct  XO  UO  N      where sysStruct is the system structure  XO is a polytope which defines the  set of initial conditions  r 0      A   UO is a polytope which defines the set  of admissible inputs and N is an integer which specifies for how many steps  should the reachable set be computed  The resulting reachable sets R are  returned as a polytope array  We illustrate the computation on the following  example     Example 4 1  First we define the dynamical system for which we want to  compute reachable sets    142 Michal Kvasnica      define matrices of the state space object   A  
137. den s   Pl2             Fig  1 8 Implementation of PI controllers without anti windup     14          Morten Hovd and Selvanathan Sivalingam                                                          e2       gi2num s   gtinum s   kinum s    Transfer Fcn1  a  kiden s  1  Transfer Fcn3 0 01941  Fast lag  to break algebraic loop  u u measured je  k2num s  1     k2den s  0 01s 1  Transfer Fcn2 Fast lag  g21num s  to break algebraic loop  g22num s                                                Transfer Fen    Fig  1 9 Simulink implementation of inverted decoupler  without anti windup of PI    controllers    Int                              a O   lqrK In2  7 1  C 3  u    gt    C u    s  In3  B Integrator1 C  L Au  A       Fig  1 10 Simulink implementation of LOG controller  Input 1 are the values of the  augmented integrating states  which are available to the controller   whereas input 2  is the measurement vector          nnn          00       Square                0                                        Constant                                                P yref   gt l 1  E  gt  5  Integrator  Measurement  gt  y  nt om    jeasuremen   P  in2 Outt int  ig Out   gt  u  LQGint LV w saturation To Workspace  Measured input             Measurement    Fig  1 11 Overall simulation setup for LQG controller with integrating states     no anti windup is provided for the integrating states of the  augmented  LQ    regulator     1 Problems in Anti Windup and Controller Performance Monitor
138. der optimality constraints  Jac    Jacobian g  cA cB cC q     gradT    Jacobian  J   cA cB cC q         Calculate the null space of the constraints  N    NullSpace Jac   N    N 1        Transpose and mutlitpy   G    Transpose  gradT      NT    Transpose N       The reduced gradient is then    Cv    VectorMatrixMultiply  NT G     cv    simplify  numer  Cv 1       pick only numerator      Unknown variables to be eliminated  read   multires mpl       varlist     k2 k1 cB    unknown variables   polylist    cv gi g2 g3    optimality conditions   BigMat    spresultant  polylist varlist    Construct resultant matrix  LargeMat    det  BigMat      Calculate determinant    c    factor LargeMat     factorize the CV  save Jac grad N Cv cv c   invariant     save results    3 Measurement polynomials as controlled variables     Exercises    Comments     Remarks    97    98 Johannes J  schke and Sigurd Skogestad    Comments     Remarks    3 Measurement polynomials as controlled variables     Exercises    Comments     Remarks    99    100 Johannes J  schke and Sigurd Skogestad    Comments     Remarks    Chapter 4  Multi Parametric Toolbox    Michal Kvasnica    Abstract This chapter introduces the Multi Parametric Toolbox  MPT  for  MATLAB  which is a freely available tool for Model Predictive Control and  computational geometry  MPT simplifies and automates many tasks a control  engineer has to go through when designing and validating optimal control  laws based on the MPC principle  The tool
139. e 3 eye 2   A    with a small non singular D term to    make the Hanus form implementable    Ahki   Aki Bki inv Dki  Cki   Two integrators in parallel in  Hanus  form   Bhki    zeros ny ny  Bki inv Dki      Chki   Cki    Dhki  Dki zeros ny nu       hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh tlh h    Fast low pass dynamics to break algebraic loop in Simulink  Af    1000 eye 2       Bf   eye 2    Cf   1000 eye 2     Df   zeros 2 2      1 2 Anti windup with PI Controllers and Selectors    Selectors and    overrides    are often used in plants when operational objectives  change with operating conditions  Clearly  selectors makes the control system  non linear  and mistakes are easily made when designing such control systems   leading to sustained oscillations or even instability  It may reasonably be  argued that more advanced control techniques  specifically MPC  can be a  good alternative to regulatory control systems in which standard single loop  controllers  i e   PI  are combined with selectors  since changes in the set of  active constraints are handled relatively easily with MPC    This assignment will address a particular problem of windup when us   ing selectors  This windup is not caused by constraints in the manipulated  variable  but occurs for inactive   deselected   controllers  due to the absence  of feedback when the controller is not selected  In this assignment a simple  remedy to this problem is tested     1 2 1 Introduction to Selective Control    Selective contro
140. e Controller Computation    MPT Toolbox features rapid code deployment functionality  The controller  stored as a Matlab multi field variable and can be exported as a stand alone  C code by using the command mpt_ezportc ctrl   where ctrl is the controller  name  This C code can be then integrated into a given application    The MPMPC controller has been integrated into a custom S Function  block  The function code built through the S Function Builder takes the state  vector as its input and has a single output  the direct controller voltage  The  core code is very simple  and involves calling the routine supplied by the MPT  Toolbox in the form     double region   region   mpt getInput x0 u      5 Implementation of MPC Techniques to Real Mechatronic Systems 197                Fig  5 7 MPMPC controller regions plotted in two dimensional state space     where x is the state vector obtained through an observer block  u is the con   troller output  An additional variable region returns the index number of the  polyhedral region corresponding to the acquired current state measurement   For the correct functionality of the S Function block the sampling rate is  defined  so is the external function declaration of the MPMPC routine     extern double mpt getInput double   double      and a declaration of the C source file as well   mpt_getInput c    The process of associating a state with a region and the corresponding  PWL function is repeated at each sampling interval and is impleme
141. e by discretizing the continous   time model  sysStruct   mpt_sys syst  Ts        define system constraints  sysStruct ymax   10  sysStruct ymin    10   sysStruct umax   1  sysStruct umin    1       define the set of initial condintions as a polytope object  XO   polytope  0 9 0 1  0 9  0 1  1 1 0 1  1 1  0 1         set of admissible inputs as a polytope object  UO   unitbox 1 0 1     inputs should be such that  ul  lt   0 1     4 set of final states  the       unsafe       states   Xf   unitbox 2 0 1      0 2   0 2        number of steps  N   50       perform verification   canreach  Nf    mpt verify sysStruct  XO  Xf  N  UO      If the system states can reach the set X    canreach will be   rue  otherwise  the function will return false  In case Xf can be reached  the optional second  output argument Nf will return the number of steps in which Xf can be  reached from X0     Example 4 4  It is also possible to answer the verification question if the sys   tem inputs are driven by an explicit control law     4 Multi Parametric Toolbox 145      load dynamical system  Double_Integrator      compute explicit controller  expc   mpt control sysStruct  probStruct         define set of initial condintions as a polytope object  XO   unitbox 2 1     3 0       4 set of final states  the       unsafe       states   Xf   unitbox 2 0 1      0 2   0 2        number of steps  N   10       perform verification   canreach  Nf    mpt verify expc  XO  Xf1  N      4 5 5 3 Invariant Set Computat
142. e calculation of the con   troller regions  The main calling function takes the system and the problem  structure as an argument and outputs the multi parametric MPC problem     196 Gergely Takacs et al    ctrlex mpt_control sysStruct  probStruct     Regions of the controller can be determined by   regions length ctrlex       The controller can be saved in its original structure  so it can be later  loaded into the workspace or used in off line simulations via the standard  Matlab interface     save ctrlex mat ctrlex     The export of the controller into a C code is very simple and straightfor   ward  and it can be carried out using the following command     mpt_exportc ctrlex       One may need such data as the volume of the region of attraction  This for  example may be used to compare different controller designs or models  The  total volume of the region of attraction is the sum of the individual volumes   and can be simply calculated by     result areareach sum volume ctrlex Pn      The maximal absolute deflection of the beam can be calculated by creating  a convex hull around the region of attraction  transforming this into a vertex  representation and by multiplying the individual edges of the region of at   traction with the output matrix C we may get the direct output equivalents    The maximum of this is the maximal possible deflection at the beam tip      P Pn  hull ctrlex Pn    result V extreme P    result maxdef max abs sysStruct C result V         5 2 5 3 On lin
143. e case of the  fuel path     Malk  T mp    rlaus k    DIB  33   pl  r N       5  N IS     The chosen MPC approach utilizes the state space representation and its  structure uses a control deviation for the correction of the prediction    Due to a disturbance d k   the steady state values of u and x have to  be adapted so  that the assumption J   0 is valid  This problem solves an  explicit inclusion of the disturbance into the model    The fuel injectors are controlled by a fuel pulse width  what is at the  same time the control uy  The optimal injection time can be computed by  minimization of a cost function  5 32   which has after expansion by the fuel  path prediction equation  form     Ja               Ji      BE     reis    Op u  1    Lly k      m  s  9      Aur D    ple      ap  I    2     gt   5 33      r          An analytical solution of 4   0 of  5 33  without constraints leads to a    4  definition determining the change of fuel injector opening time in a step  k      5 Implementation of MPC Techniques to Real Mechatronic Systems 219    as   Au    QTR   Ir   pOT Qn        GT hu k      P803      LG      M  pO ANE  pote  9        Hence  the absolute value of the control action in a step k is given by a  sum of a newly computed increment in a control  5 34  and an absolute value  of the control in a step  k     1      uf  k    uj  k     1    Zur  k   5 35   5 9 5 Results of a Real Time Application of a  Predictive Control     The ability to control the mixture concen
144. e computational unit necessary for the real time implementation of the  MPC control is based on a powerful and freely programmable control system  based on dSpace and RapidPro units  or  Rapid Control Prototyping System    RCP    Fig  5 13  dSPACE GmbH   2009      It is built up on the processor board ds1005 and hardware in loop platform    204 Gergely Takacs et al    d52202 HIL     The main components are  Fig  5 12      e DS1005 PPC Board   processor module   e DS2202 HIL I O Board   module of input output interface   e DS4121 ECU Interface Board   interface for the communication with the  ECU    DS1005 PPC Board    DS1005 PPC Board is a core processor module of the dSpace system  It has  a huge computational power for the real time applications and creates an  interface between the input output circuits and the host computer  DS1005  is suitable for the systems with fast dynamics with a high computational  load    Basic features     e processor PowerPC 750GX  1 GHz  e fully programmable from Simulink environment  e fast communication between dSpace modules over PHS bus    Module DS2202 HIL I O Board    The DS2202 HIL I O Board module has been designed for the hardware in   the loop simulations in automobile industry applications  It supports mea   surements and and control of various peripheral devices typical for different  automobile systems    Module features     e 20 D A channels a 16 A D channels  e 38 digital inputs and 16 digital outputs  e supports 12 to 42V voltag
145. e eR eR dee 72  2 9 2 Data Approach 2  Loss Regression                 72  2 9 83 Modification  Smoothening of Data                75  294  Numerical Teste 2222222  eee  RR 76    2 9 5 Test 1  Gluten Test Example from Harald Martens  76  2 9 6 Test 2  Wheat Test Example from Bjorn Alsberg   Malivas  1800  sccsectecsehea cir kt pr ERE 77    Contents ix  2 9 7 Test 3  Our Own Example                         78  2 9 8   Comparison with Normal Least Squares            79  ol  BOUSS   co oid gee eee Aes eta he on   eed aa 80  210 1 Gradient Information   eaae dis 80  2 10 2 Relationship to NCO tracking                     80  211 Appendix   cece Eee gee ede ae a bade RI CD die 81  Referentes  DES 86  3 Measurement polynomials as controlled variables      Exercises 222 0622 ue Phe b RR EA COR ERR Pe a ee 91  Johannes J  schke and Sigurd Skogestad  34     Datrod  cti  t      coetus  Re eee 91  2 MPR exrcation rnaen daia iad Cena CIE dS 91  3 8 Isothermal CSTR Case Study                 cee eee 92  Oe   E MED  ELT 93  241 Component Balance  ouem c tr ERR edn 93  512 Optimization Problem          oce 94  3 4 3 Optimality Conditions                           94  3 4 4 Eliminating Unknowns k    k2 and ep               95  2445    The Determinant    uec kika REID RE 95  BAG  Maple Cade eccl Rad eu E Er eds 96  4  Multi Parametric Toolbox                        esse 101  Michal Kvasnica  4 1  Mlulti Parametrie Toolbox    suele yt 101  4 1 1 Download and Installation                       
146. e inner loop being faster than the  outer loop   otherwise performance may suffer when the plant input  in the  inner loop  is not in saturation  There is usually a clear timescale separation  between cascaded loops     1 1 2 4 Hanus    Self conditioned Form  Hanus    self conditioned form  Hanus et al  1987   Skogestad and Postleth     waite  2005   is a quite general way of preventing windup in controllers   Assume a linear controller is used  with state space realization         Apu T Bre  1 4          Cgu   Dre  1 5       where v are the controller states  e are the  ordinary  controller inputs  and     is the calculated output from the controller  desired plant input   The  corresponding controller transfer function may be expressed as    K s    esse   Ck sI     Ak  1 Bg   Dk  1 6     6 Morten Hovd and Selvanathan Sivalingam    The corresponding implementation of the same controller in Hanus    self   conditioned form is illustrated in Fig  1 2  where K s  given by    sol    ji    s BP i 1Ck  0 BrDy      Dg 0  1 7     Saturation       Fig  1 2 Illustration of anti windup with the controller K s  implemented in its  self conditioned form K s      From  1 7  we see that when the plant input u is not saturated  i e   when       u  the controller dynamics are given by  1 5   When the plant input is  saturated  the steady state controller output will be    y     Ck Ax     BKD Cg   u   De  1 8   If Be Dy Cp  gt  Ax  we get  unxut  Dre  1 9     and thus the plant input will sta
147. e is in partitioning of the engine   s  working range into smaller working points     A net of local ARX models weighted for a particular working point    is  defined  as     Y pn  OK  An  9    isi  Zm Pn  6  E  Bu a ulk    Yt Oen  e       O    defined by polynomials Aj and Bp     An g  2 1c aniq b       Gh nd         wl  Bn g    banata g   0         bh nupa go dh  5 17     where symbolics q  denotes a sample delay  e x  q   y k    y k     i   ah  and bh  j ap  are parameters of h th local function and dp is its delay  Pa   rameter nj  represents the number of local models    The p  denotes a weighting function for a particular ARX model  see  Sec  5 3 3 4  and e k  is a stochastic term with a white noise properties   The engine working point itself is defined by engine revolutions nen and the  throttle valve position tr  hence  6 k     nes  k   tr k       The absolute term  Cp of the equation is computed from the steady state values of the system  output Ye n and the system input wep  as     ny nu    h   Veh   Yen       hi     Ue  gt   bhy  5 18   The model output is computed from the eguation     ys k    35s Palok       R 5 19  ye   n iq  ys k    x 10 b  tan  2   u k      n         Introducing the estimated parameter vector 6p  and the regression vector  vlk   equation  5 19  becomes     k  V   pr o k  9n   V 7 pn  lk  en  5 20   h 1 h 1    5 Implementation of MPC Techniques to Real Mechatronic Systems 209    5 3 3 3 Model Identification    Parameters of the local ARX model
148. e is represented in Matlab by  one of the blocks udaq28LT_v1R13  Fig  9 7  or udaq28LT_v2R13 located  in the library matlabroot udaq udaq28LT  blks udaq28LT lib mdl  Double  clicking on the udaq28LT_v1R13 block brings up the block parameters menu   Fig  9 8     9 1 1 4 Measurement and Communication System    The inputs and outputs of the communication interface refer to these signals     Inputs    Bulb 0 5 V to 0 20W of light output  Fan 0 5 V to 0 6000 fan rpm  LED 0 5 V to 0 100  of LED light output  T D microprocessor inputs for the purpose    of calculation of the first light   light channel derivative  sample period  the microprocessor samples light channel  with     minimal possible value is 1 ms and  coefficient of actual sample for the    9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 297    Fan1    LED1    Ts_deriv1    D filtt             udag28LT v2R13    Derivative  of light intensity1    Fan current    Fan rpm1    Fig  9 7 Communication interface block in Simulink    Outputs  Ambient temperature  Temperature    Filtered temperature  Light intensity  Filtered light intensity    discrete filter of the first order with  accuracy of 3 decimal positions     sensor PT100   range 0     100  C   accuracy  better than 9996    1st order filter with time constant cca 20s      1st order filter with time constant cca 20s     Filtered derivative of the first light intensity channel  Current consumption by fan  0 50 mA   Fan revolutions  0 6000 rpm     
149. e shifting destroys the correspondence between the  effects of measurement noise in the OP and PV time series  Furthermore   since the measurement noise is here of significant magnitude compared to the  amplitude of the oscillations  it is also in this plot not possible to identify any    sharp corners in the plot     The routine bicoherence m returns a negative value for NGI and a posi   tive value for NLI  and therefore nonlinearity has not been detected for this    1 Problems in Anti Windup and Controller Performance Monitoring 43             I L L 1 i L L L L  0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000  Time                   L L L L L L L L L  1000 2000 3000 4000 5000 6000 7000 8000 9000 10000  Time    Fig  1 45 OP and PV for data set 4     PV time series either  Similarly  the routine glstat m finds no clear indica   tion of PV being non Gaussian  the probability of false alarm being estimated  to 1 0  None of these routines can therefore detect stiction in the loop     1 3 2 4 Data Set 4    The time plots of OP and PV for data set 4 are shown in Fig  1 45  Here both  OP and PV look like noisy sinusoidal signals  without any clear indication  of stiction    The cross correlation function for data set 4 is shown in Fig  1 46  This is  nearly an even valued function  and this test therefore does not indicate the  presence of stiction    The OP     PV plot for data set 3 is shown in Fig  1 43  The plot looks  like a smooth ellipsoid  when disregarding the obvious
150. e systems    Modul DS4121    Module DS4121 is an interface between the ECU or RapidPro unit and the  dSpace modular system  It has a support for two independent ECUs  The  flexibility of this solution allows to control the power stages of the engine   gearbox  or the valve train for a up to 12 cylinder engine     5 Implementation of MPC Techniques to Real Mechatronic Systems 205    Module features     e supports the communication with 8   16  and 32 bit architecture of micro  controllers   e has 2 LVDS channels for fast communication   e includes interfaces for MATLAB Simulink       Fig  5 12 Modules  DS1005  DS2202  DS4121     The RCP ensures sufficient headroom for the real time execution of com   plex algorithms  Arsie et al  2008   and lets all engine tasks to be controlled  directly  Also  the customized variants of the controller can be performed  immediately    Typical RCP system consists of     e A math modeling program  prepared in Simulink   Symbolic input output blocks   e A real time target computer  embedded computer with an analog and  digital I O    e A host PC with communication links to target computer   e A graphical user interface  GUI  which enables to control the real time  process    The RCP system enables to use a support in the form of embedded func   tions which make the preparation of algorithms easy and fast  It is a great  help  because one can then concentrate on significant problems  development  and debugging of algorithms  without the spending 
151. ear transformation Fz to polytope P can also be achieved  by multiplying the polytope by a  square  matrix F      gt  gt  Q   F P    Needless to say  all these operators can be combined together  i e     4 Multi Parametric Toolbox 109     gt  gt  Q   alpha F P   t    The inverse image of P under the affine map Fx   g  with F not necessarily  non singular  is given by    Q  x Fr geP    4 5   If P is given in its H representation  then  Q    z   A Fr  9   lt  b     z    AF z  lt   b    Ag    46   S   A b  The command to compute the inverse image in MPT is called domain     Q   domain P  F  g     4 2 3 3 Orthogonal Projection    Given a polytope P    x     R  y     R      A 7      b  C R      the orthogonal  projection of P onto the z space is defined as    proj  P      x     R    dy     R    st  A     lt  b    4 7        In MPT  the orthogonal projection of a polytope P on some of its coordinates  is achieved by calling the projection method      gt  gt  Q   projection P  coordinates  to project on     As an example  take a unit box in 3D  centered at the origin  and project it  on its 2nd and 3rd coordinate          P   unitbox 3    gt  gt  Q   projection P   2 3      It should be noted that computing projections is considered a hard problem   in general  MPT implements several projection methods and automatically  chooses the best depending on the dimension of P  An example of projecting  a 3D polytope onto a 2D plane is shown in Figure 4 3     4 2 3 4 Intersection    The int
152. easy to change in  a case of failure  they don t require any maintenance  they don t corrode and  water sediments don t attach to them  On the other hand  the measurement  depends on the surrounding pressure  thus it is recommended to perform  at least at the beginning of the measurement day  the calibration of these  sensors  It consists of the definition of offset and sensor s gain values  what  should be done for each liquid s level separately  The dependency is linear   The basic scheme of the conversion of raw signals on liquid s levels in meters  can be found in Fig  6 4   All the necessary parameters for signal adjustment  lay in one array denoted as calibParams  Array  pumps  contains the pump s  entrances  performance in   from 0  to 100   and field  valves  contains  the valves configuration 0     close  1     open  for each valve                            raw signal from sensor 1 in EU     loalibP arams 2   gt                             3 calibP arams 1     pumpstt   gt   gt  gt    offset 1 Gain 1    pumpi Saturationg   ain amp   tank 1                               M  m                                                                                                                                                                                                           um IEEE  pumps  gt  gt  raw signal from sensor 2 in EU  Gain3   le  pump2 Saturation3 Gain iba FP  calibP arams 3      valves t   __  tj      offset 2    Gain2  Het Two Pumps  Hydraulic UWZ  valves
153. ed by utilizing a Schenck  dynamometer  Fig  5 11   loading the engine and so keeping it at the desired  revolutions    The operation of a used brake is based on an eddy current principle  The  braking torque is excited by the electromagnetic induction of a coil  which  excites eddy currents in the brake   s rotor  The brake supports predefined  braking profiles  and also manual control of the braking moment  The brak   ing moment is measured by a tensometric force sensor fixed to an arm     Basic brake features     e maximal revolutions  10 000 rpm covered by a voltage output  0   10V  e maximal braking torque  750 Nm covered by a voltage output  0   10V    5 Implementation of MPC Techniques to Real Mechatronic Systems 203    The control unit of a brake is an independent device allowing the manual  brake control by analog voltage signals  It includes the following circuits     e    thyristor phase    control circuit  braking moment   e revolutions measurement circuit  e braking moment measurement circuit    The    thyristor phase    control circuit is based on the integrated circuit  IC   TCA785  Function of this IC is a phase control of a brake   s power stage  The  control voltage span is 0   10 V  corresponding to the braking moment  The  braking moment is used for the aim of     e regulation to constant revolutions  based on a discrete PI controller  e regulation to a particular braking moment       Fig  5 11 Engine brake    5 3 2 3 Rapid Control Prototyping System    Th
154. ed in the cost function and the controller will  regulate the output s  to the given references  usually zero  or provided by  probStruct yref    probStruct tracking  0     no tracking  resulting controller is a state regu   lator which drives all system states  or outputs  if probStruct Qy is given   towards origin  1     tracking with Au formulation  The controller will drive  the system states  or outputs  if probStruct  Qy is given  to a given reference    The optimization is performed over the difference of manipulated variables   u k      u k     1    which involves an extension of the state vector by nu  additional states where nu is the number of system inputs  2    tracking with   out Au formulation  The same as probStruct tracking 1 with the excep   tion that the optimization is performed over u k   i e  no Au formulation is  used and no state vector extension is needed  Note  however  that offset free  tracking cannot be guaranteed with this setting  Default setting is prob   Struct tracking   O    probStruct yref  instead of driving a state to zero  it is possible to refor   mulate the control problem and rather force the output to zero  To ensure  this task  define probStruct Qy which penalizes the difference of the actual  output and the given reference    probStruct P_N  weight on the terminal state  If not specified  it is assumed  to be zero for quadratic cost objectives  or Py   Q for linear cost   probStruct Nc  the control horizon  Specifies the number of 
155. ed without lead   ing to parasitic oscillations  it is necessary to approximate the non modelled  loop dynamics that can be characterized by equivalent dead time Ty  This  can be identified as the time between a control signal step and beginning of  the reaction of the measured output  Then  it is recommended not to use  shorter time constants     faster    poles  as those given by    T     eTa  o      1   e  T4   7 2     For the given hydraulic system  notice that the pump is reacting only to  positive values of the input voltage  So  its control is only possible in one way      to increase the liquid   s level in tank  That   s why it is necessary to empty  the tank before the experiment  or after it     250 Vladim  r   ilka and Mikul     Huba    7 2 1 PI controller    Now  let s consider situation with opened outflow valve characterized with the  flow coefficient c1  In this case the one level system will be in the form 6 1   This system does no longer behave as pure integrator  Let s try to control  it  at the beginning  with P controller  designed in the previous part  By  examining few operating point  we will realize that P controller can t control  this system without the permanent control error  It is no surprise  if we  take into account that the opened outflow requires permanent inflow  but  the zero control error leads to zero inflow  With zero control error generates  the P controller zero action  but considering the fact that the liquid outflows  from the tank  
156. eedback law allows to further analyze and post process the MPC  controller  For instance  as will be shown in the next section  lookup table   styled controllers allow stability of the closed loop system to be rigorously  analyzed by searching for a certain types of Lyapunov functions     4 5 1 Basic Usage    MPT is a MATLAB based toolbox which allows for user friendly design  sim   ulation  analysis  and deployment of MPC based controllers  Control design  is divided into two intuitive steps  At first  the model of the plant is entered  either in the LTI form  4 23  or as a PWA system  4 24   We will illustrate  the procedure on the double integrator example given by the state space rep   resentation x t   1     4 1  a t     9 s  u t   which is subject to constraints     5  lt  a t      5     1     u t   lt  1  The plant model can then be entered using  the command line interface        sysStruct A    1 1  0 1   sysStruct B    1  0 5    sysStruct C   eye 2   sysStruct D   zeros 2  1    sysStruct xmin     5   5   sysStruct xmax    5  5    sysStruct umin    1  sysStruct umax   1     With the prediction model at hand  the user then defines parameters of  the MPC optimization problem  4 26   the prediction horizon N  penalty  matrices Py  Q  R and the norm p     probStruct N   3   probStruct P_N    1 0  0 1    probStruct Q    1 0  O 1      probStruct R  probStruct norm   1    can be 1  2  or Inf    ll  m    Finally  the MPC controller is synthesized  To solve  4 26  explicitly f
157. egrator in the controller  and the controller state goes to Umar with a  time constant Tz  Thus  the integrating state does not wind up  Note also  that when the controller state has reached its stationary value of Umax  the    4 Morten Hovd and Selvanathan Sivalingam    controller output will stay at its maximum value until the measurement y  has crossed the reference value rej    This anti windup scheme is straight forward and simple to implement pro   vided any actuator dynamics is fast compared to the PI controller time con   stant Tr     1 1 2 2 Velocity Form of PI Controllers    The PI controller in  1 1  is in position form  i e   the controller output cor   responds to the desired position value of the plant input  Alternatively  the  controller output may give the desired change in the plant input    Whereas the equations for PI controllers in position form are often ex   pressed in continuous time  even though the final implementation in a plant  computer will be in discrete time   the velocity form of the PI controller is  most often expressed in discrete time  Let the subscript denote the discrete  time index  and ej   Yref     Yk be the control offset at time k  The discrete  time equivalent of  1 1  may then be expressed as    Aug   Uk     UR    Tea   K  ex        k   1   1 3   where T  is the sample interval  Here Aux represents the change in the plant  input at time k  If this change is sent to the actuator for the plant input   instead of the desired position
158. eld of active vibration attenuation  Due  to the nature of the problem very short sampling times are required  moreover  large actuator asymmetry can render the MPC problem quite formidable    If the control process is augmented with guaranteed stability and feasibility  requirements  the useful states are limited inside a portion of the otherwise  infinitely large state space  This portion of the state space is called the region  of attraction  If the expected deformations of under damped systems belong  to a wide scale region  we have to ensure a matching region of attraction    A good example of such and similar vibrational systems are for example  helicopter rotor beams or solar panels in a microgravity environment  This  chapter introduced a simple laboratory system  which emulated the physical  properties and dynamic behaviour of the aforementioned class of engineering    5 Implementation of MPC Techniques to Real Mechatronic Systems 199    Y           Fig  5 9 MPMPC cost function J  z      problems  Details have been given on the hardware implementation of this  laboratory test bench  so the if interested one may replicate the setup    This has been followed by the introduction of three different MPC imple   mentations  traditional dual mode infinite horizon quadratic programming  based MPC  pre computed explicit multi parametric programming based  MPC and finally a sub optimal method called Newton Raphson s MPC  AII  of these methods are computationally efficient in s
159. employment of neural networks  while Mao et al  2009  uses  for engine modeling CARIMA models    In the engine control itself became popular fuzzy logic  Hou  2007    neural  network control  Arsie et al  2008   and model predictive control  MPC  ap   proaches  Lorini et al  2006  and Muske and Jones  2006    General topics  on an issue of stability and robustness in MPC can be found in Mayne et al   2000b   or Zeman and Rohal Ilkiv  2003     Our approach  introduced in Pol  ni et al  2007  is utilizing an analytical  model predictive controller with a penalization of a terminal state  It uses  a multi model approach using a weighted net  sugeno type fuzzy logic  of    5 Implementation of MPC Techniques to Real Mechatronic Systems 201    autoregressive models  ARX  as a system model  The ARX models were  identified in the particular working points of the engine as black box mod   els  This method of engine modeling offers an easy way of  global nonlinear  system model    acquisition with subsequent utilization in the model based sys   tem control  The preliminary real time predictive control results presented in  this paper indicate that the proposed controller could be suitable alternative  toward the air fuel ratio control through the look up tables     5 3 2 Hardware Description    The engine test bench consists of several components  building up together a  flexible and freely programmable system  perfectly suitable for engine control  and research    One part of the test
160. en prior to  running the command    Now we move to plotting the associated feedback laws by    4 Multi Parametric Toolbox 159    close all  plotu controller_explicit     Again  such a graphical information is valuable to control engineers  because  it gives us an insights into the    internals    of the optimal solution to a given  MPC optimization problem  Specifically  we can see for which range of initial  conditions the controller responds by a saturated control action  To see this in  an even more clear way  run the view 2  command to watch the result    from  the top     You will see dark blue regions which represent all initial conditions  for which the optimal control action is saturated at u   umin    1  dark red  ones where u   umax   1  and the rainbow stripe in between with  1  lt  u   lt  1     Exercise 4 17  Visualization is not the only way to analyze explicit MPC  controllers  MPT provides a wide range of analysis functions  For instance   one can try to compute a Piecewise Quadratic Lyapunov function as a cer   tificate that the controller provides closed loop stability guarantees      gt  gt  L   mpt lyapunov controller explicit     pwq       When you run this command  you should see the following output     mpt_getPWQLyapFct  Partition is not invariant and  therefore it cannot be asymptotically stable       The reason for this is that the controller is not invariant  We have already  seen what invariance means in Example 6 of the MPT Polytope Library part  
161. en them  but  as more practical it seems to schedule the controller parameters continuously   This is usually done by the input output feedback linearization  In general   it is supposed a non linear system in the following form     i  f x  u   y   g x     where the state x     R     the input u     R     the output y     RP  Find  if  possible  a static state feedback    u  e  z     258 Vladim  r   ilka and Mikul     Huba    in such a way that the system would be from point of view of new input v  and output y linear  For the solution to exist  it has to be given that the  system s relative degree r  is natural number  The system s relative degree  ri is a natural number that defines the number of output   s derivations y  we  have to perform in order to obtain the direct dependence on the output u  In  case of non existence of such number  we say that the output has the infinite  relative degree     ays     ri   min k     N  Du   0        More information can be found for example in Conte et al  2007    For system  6 1  we may say      1  Y   5 v  7 6   1    that it has the relative degree 1  But also the system  6 2  has the relative  degree 1 because    y  gu     c2 sign z      22   z1     3      C121   ja   zu   c2sign z      23    z1    z3      Co   22  the basic condition is satisfied  The problem of the static state feedback lin   earization is solvable if     r1   re     o Yi es  Yp    u    rank  p    where r  are the relative degrees of outputs y   for i   1     p  
162. enotes the iterations of the Newton Raphson procedure    One may take advantage of expressing the matrix Q f as the an eigenval   ue eigenvector decomposition      Qi    RART  5 6     where R A is defined by the eigenvalue   eigenvector decomposition of Q f and  i is the i th power or inverse  Using the decomposition  5 6  we may denote  M as     M   Rdiag 1   1    AS    RT  5 7     where    diag  denotes a diagonalization operation  9  is a vector of eigen   values gained from A and    denotes the piecewise division operation  This  substitutes the inversion of the full matrix expression  I      Q f  in the on   line algorithm  This expression occurs not only in evaluating the perturbation  vector f  but also in the function   A  and its first derivative     Let my    1     AS   and m    diag 1  m       then     B A    cf Wim  Wor    Wa  5 8   d   X     a   2z1 Wam  Wore  5 9     5 Implementation of MPC Techniques to Real Mechatronic Systems 189    The equation yielding the perturbation vector f will successively transform  to    f   Atm Wiz   5 10     Matrices W1  W2  Ws can be calculated offline  therefore saving some time  avoiding unnecessary multiplications at every NR iteration and sample time   Matrix Wy can be calculated before the NR process for the actual sample  time initiates     Wi  Qas R  Ws    WF  Ws   WA     W       x1 W3 W2   z1Q r     1    5 2 4 8 Real time Code Implementation to C    The on line part of the NRMPC controller is simple  The algorithm does no
163. ents it was necessary to  wisely propose a PRBS  so that the air fuel mixture is always ignitable   The local ARX models can be subsequently determined from the measured  values of instantaneous A  k  and A  k  belonging to the air path and fuel  path  utilizing relative air and fuel mass densities  as     Malk    Ma e    Aa k   5 21     mf   myl    DERE  5 22     The final formula describing the aif fuel ratio dynamics is built up of local  linear ARX models of the air and fuel paths is in the form        ji  As k    ty  VZ  5  SRA Pan   K  b ant Dp Ay Pan  009  Ean  5 23   VF  k  ney Pan lOl  OF n  Der Pg n  0 R  6g  A  Where   y is the regression vector of system inputs and outputs  na isthe amount of working points  p is the interpolation function    9 is the vector of a working point    210 Gergely Takacs et al    0 is the vector of ARX parameters  c is the absolute term of an ARX model    In accordance with the general model structure presented  the key variables  used for the air  and fuel path are defined in the Table 5 1 and coupled with  the general variables used in the presented formulas     Table 5 1 Symbol connection between general expression and the model    general air path  fuel path operating    symbol model model point   y k  ma k    mj k    u k      tr k  uj k    Vk  Malk  14  k    On Oah O p n   pn  6  pan  9 5   py   06    Ch Ca h Cf h   sO  nd    The schematics of the engine identification  described above in this Section  is depicted in Fig 5 19  The 
164. ep 4  k k 1   Step 5  until V  Z V  1   Step 6 4    V     The only non trivial stage is Step 3  Remember the forward reach sets of  Example 4  Take a look again at  4 16  and you should spot some similarities   In fact  the set computed in Step 3 is the one step backwards reachable set   i e  the subset of Uz which remains in Y  for one time step  Since forward  reach sets were computed by Xx41   AX   we can compute the backward  set by X44   A 1 X5  intersected with Xj itself  i e     PSI k 1    PSI k   amp  inv A B K  PSI k      The rest of the solution should be clear  You will  however  need to replace  repeat until by a while end statement and negate the stopping condition  accordingly     Now it s your turn  compute the invariant subset of PSI and plot it     Note that many theoretical subtleties were untold in this story  One of them  being that the presented algorithm has no guarantee of finite time conver   gence  there you should place an upper limit on the number of iterations  10  is a safe choice     4 4 Solutions    Solution 4 1  for Exercise 4 1      1  Create a polytope P as the 2D unit box centered at the origin  i e  P     z1  z2       1 lt  1     1    1    x2 X L1     4 Multi Parametric Toolbox 123      convert all inequalities into the form  al a2   x1  x2      lt   b     x1  lt   1 i e    1 0   x1  x2   lt   1     x d  lt   1 i e    1 O   x1  x2   lt   1  y  xo  lt   f i e    0 1   x1  x2   lt   1    Kk  x_2  lt   1 i e    0  1   x1  x2   lt   1    now st
165. er using inverse or parallel plant model  Since the hydraulic plant  6 1     252 Vladim  r   ilka and Mikul     Huba    is stable  inversion of the plant dynamics may be directly derived also for the  nonlinear model as    U   M  01   Ciy Y    7 3     The input disturbance v may then be reconstructed by comparing the recon   structed plant input 41 and the controller output according to      j   Uu              7 4  n   175      v   and then compensated at the P controller output up  Such a compensation  may be treated as a special case of nonlinear disturbance observer in Fig  7 2   Besides of the P controller gain  the new tuning parameter Ty may be used to  increase system robustness against uncertainties and non modelled dynamics  and to filter measurement noise               Disturbance  Observer                         Fig  7 2 Rejection of the input disturbances v by correction of the P controller  output in the nonlinear PI  controller for system dy dt   g y  u   v      f y     You may test your integral controller by filling to different levels also the  second tank and then opening or closing the inteconnecting valve among the  tanks     The controller structure in Simulink is depicted in Fig  7 4  Control pro   gram  which work with results of automatic calibration and indentification is  listed below     7 2 2 1 Programs for Matlab Simulink    cle   clear all   close all     7 Constrained PID Control Tasks for Coupled Tanks Control    Pl1 controller   system outpu
166. erating  i e   with the selector    Comment on the results of the simulation    4  Simulation with anti windup  Implement the PI controllers with anti windup  and redo the simulation   Comment on the results and compare to the simulation results without  anti windup     1 2 4 Solution    1 2 4 1 Model Implementation    The Simulink implementation of the plant model  with the disturbance   and including PI controllers  without anti windup  and selector  is shown  in Fig  1 26    2  n addition  the variables are scaled  so not too much emphasis should be placed  on the magnitude of the variables    1 Problems in Anti Windup and Controller Performance Monitoring 31    1 2 4 2 Controller Tuning    Not much effort has been put into the controller tuning  For each of the  controllers  the integral time T  has been set equal to the  dominant  time  constant of the open loop  and a proportional gain of 1 is used  These tuning  parameters are found to result in reasonable responses to setpoint changes  for each individual loop     1 2 4 3 Simulation without Anti windup    The system has been simulated with the disturbance active  The response in  the controlled outputs are shown in Fig  1 27  We observe large variations in  the controlled variables  including variations where the measurement is larger  than the setpoint  0 for both loops   The corresponding controller outputs  are shown in Fig  1 28  We observe that the pressure controller winds up  so severely  that it needs a long t
167. ersection of two polytopes P     x     R      Aja     by  and Pa    x      R      Aga  lt  ba  of the same dimension is the polytope    Q   el  Alr lt   3      4 8      This operation is implemented in MPT using the overloaded  amp  operator     110 Michal Kvasnica          Fig  4 3 Illustration of orthogonal projection      gt  gt  Q   P1  amp  P2    Note that MPT only computes full dimensional intersections  Full dimen   sionality of the result Q can be checked by isfulldim Q   An example of the  intersection operation is shown in Figure 4 4              Fig  4 4 Full dimensional intersection of two polytopes     4 2 3 5 Convex Hull    The convex hull of two or more polytopes P   i   1     m is the smallest  convex set which contains them  i e           convh vert P1      vert Pm     4 9     4 Multi Parametric Toolbox 111    where vert P   denotes the extremal vertices of the i th polytope  Given an  array of polytopes  their convex hull can be computed as follows      gt  gt  Q   hull  P1 P2 P3 P4      An example of the convex hull operation is depicted in Figure 4 5                    i i i i i i i  25 i i i  2 1 o 1 2 4 5 D 1 2 4     b  Convex hull of the polytopes  yel   low       a  3 random 2D polytopes     Fig  4 5 Illustration of convex hull     4 2 3 6 Minkowski Addition    The Minkowski addition  also called set addition  between two polytopes P    and P is defined as    Pi    P2   zi cz   x   E    Pi  T2     Pa   4 10     and is implemented in MPT using the overl
168. es on an experimental laboratory model  This device is  basically a simple lightly damped mechanical structure  The algorithms con   sidered here include the traditional infinite horizon dual mode quadratic pro   gramming based MPC  QPMPC   pre computed optimal multi parametric  MPC  MPMPC  and the efficient albeit sub optimal Newton Raphson   s MPC   NRMPC     The control of automotive internal combustion engines is one of most com   plex control problems due to nonlinearities and variable time delays  This is  reflected in the time variability of the model parameters in different regions    5 Implementation of MPC Techniques to Real Mechatronic Systems 173    of the engine operating space  The section 5 3 analyzes the practical aspects  of real time implementation of a multi model MPC technique to cope with  the problem of nonlinearities and variable time delays in controlling of the SI  engine air fuel ratio    In both sections the main practical software and hardware aspects of the  suggested real time solutions are discussed in details     5 2 Implementation of Various MPC Methods for the  Vibration Control of Lightly Damped Cantilevers    5 2 1 Introduction    The algorithmic support of active vibration suppression applications is usu   ally limited to simple positive position feedback  PPF  or for example strain   rate feedback  SRF  control  Song et al  2002   Other essential strategies  include PID or linear quadratic  LQ  control  Preumont  2002   Because of  the si
169. espondingly termed anti reset windup  or simply anti windup     1 Problems in Anti Windup and Controller Performance Monitoring 3    Anti windup techniques remain an active research area  and no attempt is  made here to give a comprehensive review of this research field  The aim is  rather to present some important and useful techniques that should be known  to practising control engineers     1 1 2 1 Simple PI Control Anti windup    A simple PI controller with limited actuation range for the control inputs  i e    controller outputs   may be implemented as illustrated in Fig  1 1  Here  the  actual input implemented on the plant is feed back to the controller through  the low pass filter 1  rrs   1   If the actual plant input is not measured  it  suffices to know the range of actuation for the input  The actual input can  then easily be calculated     Saturation     Umax    Yref   Y u                        Kp          Umin          ct                                i  Tis 1                Fig  1 1 Simple anti windup scheme for a PI controller     From Fig  1 1  it is easy to see that when the plant input is not saturated   when        u   we get    TIS H 1  TIS       u  Ky  Yrej     v   1 1   That is  we get the normal behaviour of a PI controller  On the other hand   consider the case when the input is in saturation at its upper limit Umar     1    maxr 1 2  TIS   1  2          K yref    y    The internal feedback path in the controller is now broken  there is no open  int
170. f   z    for any allowed   c        lt  1 is equal to  c Ji G  W    and we want this as small as possible  From singular value  properties we have that the  A I    1 o  A   that is we want to maximize  smin Wz GJ 1     We have then derived the maximum gain rule  Under the assumption  that   c     X 1   the worst case loss is given by Lmax   SoG  where    G     1G8   2 33     and  S     W     diag 1  c      Copt il     S2   J i       Note that S   includes the sum of the optimal variation  as given by the F   matrix  and the expected measurement error  Thus  to minimize the loss we  should select c   Gu with a large minimum singular value of the scaled gain  matrix Gs    The only    non exact    step in deriving this rule comes from the assumption  that all   c        lt  1 are allowed  which means that we neglect some of the  variations in  c     Copt  that are correlated  Nevertheless  since the presence of  measurement noise means that there is always some uncorrelated variation   at least if we consider individual measurements  c   y  this implies that we  can safely exclude candidate c s with a small gain  that is  with a small value  of e G       70 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke    Note that Juu enters into the maximum gain rule  whereas it is actually not  required when H is the optimal full matrix  see  2 26   However  in general  Juu must be included  see case 3 in the discussion following  2 26      e Do we need the maximum gain rule  
171. f Measurement  Automation and Informatics  Faculty of Me   chanical Engineering  Slovak University of Technology in Bratislava  e mail   matus kopacka stuba sk    Michal Kvasnica    xiii    xiv List of Contributors    Institute of Information Engineering  Automation and Mathematics   Faculty of Chemical and Food Technology  Slovak University of Technology  in Bratislava  e mail  michal kvasnicaQstuba sk   Tomas Pol  ni   Institute of Measurement  Automation and Informatics  Faculty of Me   chanical Engineering  Slovak University of Technology in Bratislava  e mail   tomas poloni stuba sk    Boris Rohal    Ikiv   Institute of Measurement  Automation and Informatics  Faculty of Me   chanical Engineering  Slovak University of Technology in Bratislava  e mail   boris rohal ilkiv stuba sk   Peter   imon  i     Institute of Measurement  Automation and Informatics  Faculty of Me   chanical Engineering  Slovak University of Technology in Bratislava  e mail   peter simoncic stuba sk    Selvanathan Sivalingam  Department of Engineering Cybernetics  Norwegian University of Science and  Technology  Trondheim  Norway  e mail  selvanathan sivalingam itk ntnu no    Sigurd Skogestad  Department of Chemical Engineering  Norwegian University of Science and  Technology  Trondheim  Norway  e mail  skogeQ chemeng ntnu no    Gergely Tak  cs   Institute of Measurement  Automation and Informatics  Faculty of Me   chanical Engineering  Slovak University of Technology in Bratislava  e mail   gergely t
172. f a full laboratory setup  hardware implementation  details and practical issues regarding the use of MPC for the real time control  of air fuel ratio in automotive engines     5 1 Introduction    The merits of well designed control algorithms have been long recognized by  the industry  where a performance improvement of a fraction point leads to  significantly increased revenue or decreased production cost    Performance is not the only criterion to judge the qualities of a control  strategy  Every real actuator and process has inherent physical limits  which  are to be constrained in order to preserve safety  further influence production  output or to safeguard equipment  As claimed by Rossiter  2003   the only  control method capable of handling process constraints on an algorithmic  level is model predictive control  MPC   MPC has been used for decades in  applications  where sampling rates are in the order of several minutes or even  hours  for example in the petrochemical industry  Now the situation turns  to applications with very short sampling periods in orders of milliseconds  mainly in mechatronic systems    This chapter contributes to experimental implementation and real time  verification of chosen efficient MPC techniques applied for control of fast  mechatronic systems  namely laboratory vibration system  subsection 5 2   and internal combustion engine  subsection 5 3     The section 5 2 discusses the implementation properties of three differ   ent MPC approach
173. for finding the optimal H  it would be required for finding a numerical value  for the loss     The analytical solutions are useful  in particular for their insights they  yield  but for practical calculations it is usually faster and more robust to  compute the optimal H by solving the convex quadratic optimization prob   lems  In addition  the convex optimization problems do not need the require   ment that YY    is non singular  Based on the insight in Corollary 2 1  the  quadratic optimization in Theorem 2 1  Alstad et al  2009   can be further  reformulated to a more general form  Yelchuru and Skogestad  2010     Theorem 2 4  Generalized convex formulation   An optimal H for the  problem in  2 23  is    min    HY      H  2 26   st  HG     Q    where Q is any non singular ne x Ne matrix  for example       I  but Q must  be fixed while minimizing    HF    p     Proof  The result follows from Corollary 2 1  but can more generally be de     rived as follows  The problem in  2 23  is to minimize    J1   HGY    HY   S  P    X F    2 Measurements for Control  Optimization and Estimation 65    The reason why we can omit the ne x n  matrix X  is that if H is an opti   mal solution then so is H     DH where D is any nonsingular n  x n   see  proof of Theorem 2 1   However  note that the matrix X  or equivalently the  matrix Q  must be fixed during the optimization  so it needs to be added as  a constraint  O       The fact that Q can be chosen freely  Theorem 2 4  can be useful fo
174. formance of previous controllers     The PI  controller structure and Simulink model are in Figs  9 45  9 46   PI  may also be used for controlling unstable plant  To cover all stable and  unstable plants by one transfer function  it is necessary to use the pole zero  form instead of the time constant one and to express the plant as    K  G s        e Te  9 23    sca  For robust controller tuning  the performance portrait method could again be  used  For simple nominal tuning use the following rules based on the notion  of the so called equivalent poles a  of the proportional controller and ae r of    320 Peter Tap  k and Mikul     Huba    System output  Comparison of the delayed system output              60         FPI  T T  0 8  aeui  e FPI  T T  70 6         FPI  T T  70 06  Fl  controller  OST E          setpoint             Light intensity  wo  o    20              0    L L 2 1 i J  0 200 400 600 800 1000 1200 1400  time  s     Fig  9 38 Experimental results     delayed system output    the controller with disturbance compensation  I action      ae       1   aTy    4T4   9 24   Qer   Ae 1 3  9 25    P     aer   a  Ks  9 26   Ty   eTa  9 27     Plant parameters from FOPTD approximation  9 18  can be used  whereby  K    K T and a   1 T  The experimental results for the plant used in this  chapter are in Figs  9 47  9 48  9 49  9 49    Questions     e Which process gain used for controller tuning gave better control quality   What was the most obvious difference in control
175. free  MATLAB toolbox for design  analysis and deployment of MPC based con   trol laws for constrained linear  nonlinear and hybrid systems  Efficiency of  the code is guaranteed by the extensive library of algorithms from the field  of computational geometry and multi parametric optimization  The toolbox  offers a broad spectrum of algorithms compiled in a user friendly and ac   cessible format  starting from modeling systems which combine continuous  dynamics with discrete logic  hybrid systems   through design of control laws  based on different performance objectives  linear  quadratic  minimum time   to the handling of systems with persistent additive and polytopic uncertain   ties  Users can add custom constraints  such as polytopic  contraction  or  collision avoidance constraints  or create custom objective functions  Result   ing optimal control laws can either be embedded into control applications  in the form of a C code  or deployed to target platforms using Real Time  Workshop    MPT can also be viewed as a unifying repository of hybrid systems de   sign tools from international experts utilizing state of the art optimization  packages  The list of included software packages includes packages for linear  programming  CDD  GLPK   quadratic programming  CLP   mixed integer  linear programming  GLPK   and semi definite programming  SeDuMi   In  addition  MPT ships with a dedicated solver for computing projections of  convex polytopes  called ESP  a boolean optimizati
176. free control  moves in the optimization problem    probStruct Tset  a polytope object describing the terminal set  If not pro   vided and probStruct norm   2  the invariant LQR set around the origin  will be computed automatically to guarantee stability properties    Since MPT 2 6 it is possible to denote certain constraints as soft  This  means that the respective constraint can be violated  but such a violation is  penalized  To soften certain constraints  it is necessary to define the penalty  on violation of such constraints     4 Multi Parametric Toolbox 155    e probStruct Sx  if given as a  nx  x  nx  matrix  all state constraints will  be treated as soft constraints  and violation will be penalized by the value  of this field    e probStruct Su  if given as a  nu  x  nu  matrix  all input constraints will  be treated as soft constraints  and violation will be penalized by the value  of this field    e probStruct Sy   if given as a  ny  x  ny  matrix  all output constraints  will be treated as soft constraints  and violation will be penalized by the  value of this field     In addition  one can also specify the maximum value by which a given  constraint can be exceeded     e probStruct sxmax  must be given as a  nx  x 1 vector  where each element  defines the maximum admissible violation of each state constraints    e probStruct sumax  must be given as a  nu  x 1 vector  where each element  defines the maximum admissible violation of each input constraints    e probStr
177. gh the operational range  in other words the I O characteristics of  the non filtered light channel is not linear    The exnum command can be used to measure I O characteristics of the  plant and to obtain the process parameters in multiple working points  Choose  the experiment no 2 for I O characteristics measurement  The following fig   ures will give you the information on the I O characteristic  the process gain  and dead time through the operational range  Short delay in a light intensity  change can be observed after a bulb voltage step  The uDAQ28 LT device  converts bulb voltage steps into a steep ramp to prevent undesired distur   bances in the plant  Let us approximate this delay as a dead time  After  running the I O characteristics measurement plot the step responses from    302 Peter Tap  k and Mikul     Huba    which the I O characteristics of the light channel was obtained by the fol   lowing commands     stairs yl   1  yl   2     xlabel    t s        ylabel    light intensity       title    Step responses of non filtered light channel      Input output characteristic  70 T T T T       60  1    30r 1    20  J    10  J             Fig  9 13 I O characteristics measurement results    9 2 2 Io Controller    Tasks     e Add a disturbance observer to the feedforward control to compensate  steady state error    e Use the I O characteristics measurement results to tune the controller by  hand   Tune the controller using the performance portrait method   Make a step d
178. grators  must represent the range of movement available for the integrating states   i e   with the contribution from the  actual  state feedback removed                                                                             Controller  C     tice 7     Reference i    Integrator s  I K I  z w  anti windup re   Actual Measure   i  y input ments  i   ro Pa    Plant  gt   l       H Kstate l  i   Ka  m Y State   gt             estimator                                  Fig  1 5 Implementation of anti windup for state estimator and static state feedback  augmented with integral action     1 Problems in Anti Windup and Controller Performance Monitoring 9    Remark  Note that if Hanus    self conditioned form is used for the anti   windup  this requires a non singular D matrix  resulting in a PI block instead  of a purely integrating block  The size of this D matrix may affect controller  performance  depending on how and whether it is accounted for in the    state     feedback control design      1 1 3 Decoupling and Input Constraints    Decouplers are particularly prone to performance problems due to input con   straints  This is not easily handled by standard anti windup  because much of  the input usage can be related to counteracting interactions  Therefore  if an  output is saturated  but other outputs are adjusted to counteract the effects  of the    unsaturated    output  severe performance problems may be expected    One way of ensuring that the decoupler only tries to
179. gt                                                                                                               Gain3  u  P a     gt      Thermo optical  Step Saturation3   Eve  VO Interface  Fan  Gain1 1 o p  ni  rec meer  TransferFent  s LED Light                                        j    intensity1   3 IMs E t  Til s 1    Fig  8 11 Supplied block diagram          a                   The block diagram depicted in the Fig 8 11 can be found in the CA RemLab     Workspace folder after successful installation  The core of this block diagram    8 Remote Laboratory Software Module for Thermo Optical Plant 285    is created by the Thermo optical Plant I O Interface block that represents the  physical model of the uDAQ28 LT thermo optical plant  The blocks drawn  by the orange color are important for the correct operation of the remote  laboratory software module  These are input output blocks of this block di   agram and the client application is programmed in that way that it could  exchange the data with these blocks  The following three rules have to be  kept where the first two are related to input parameters and the third one to  input output parameters of the block diagram     1  The sampling period of an individual block as well as the whole block  diagram is given by the global variable denoted as T s  This denotation  must be kept everywhere  If a variable with this name is used in the initial  parameter file   m file  or somewhere in the block diagram   mdl file  its 
180. hat by designing the controller  we proceed from the system   7 5   which works with deviations from steady state  not with the absolute  varaibles  That   s why the controller is using them as well  i e  it holds    u    where AU1 s  and AE1 s  are Laplace transforms of the deviations of the  controller output  Au    ui     u1 and of the control error  Ae    e1     1   from steady states u1  a e1   Of course  for control error in steady state is     1    0  In this case Ae    ei  but at the controller output one still has  to consider deviation signal Au   The system  6 1   which we are in fact  controlling  has as its input directly u  So  we need to arrange the controller  output by adding the stabilized steady state value u1  and thus obtaining  directly u1    uy   Au    Ulo    The value u1  represents the stabilized value of the pump   s voltage  at which  the liquid   s level or liquid   s volume in the tank has the stabilized value x1    The numerical value u1  is  off course  needed at the implementation of the  controller  We   ll define it based on system   s  6 1   In a steady state all time  derivatives are zero  thus 34   0  After substituting into  6 1  we ll obtain  U1  defined as    Ulo   A161 X15    7 4 Exact Feedback Linearization    In this task  we would like to control the liquid   s level for different operating  points  By appropriate gain scheduling it is possible to have various operating  points and the associated controllers and then to switch betwe
181. he cable terminal  and finally the measuring card  The LASER system settings are controlled  via the host computer  using a proprietary settings software via USB pro   tocol  The control and measuring chain is demonstrated by the simplified  schematics in Fig  5 1    Note that the capacitive sensor is not utilized as a feedback signal in these  examples  a direct readout using the laser triangulation system is considered     176 Gergely Takacs et al           a  Laboratory test bench   b  Piezoelectric actuators     Fig  5 2 A photo of the laboratory test bench with the piezoelectric actuators bonded  on the beam     A photo of the laboratory test bench with the piezoelectric actuators  bonded on the beam is visible In Fig  5 2     5 2 2 2 System Identification    To predict future system behaviour  a second order linear time invariant  state space mathematical model of the vibrating system is considered  To  obtain this model  Lara et al  2003  used a direct phenomenological model of  the system  or for example it is possible to utilize the results of finite element  modeling  FEM  harmonic analysis to acquire the state space representation  as well  Dong et al  2006     An experimental identification procedure will be utilized to obtain a dis   crete linear time invariant state space system in the form     Tk41   Ary    Buk Yk   Cay   Duk  5 1     where yx represents the beam tip deflection in millimeters and uz is the high  level voltage signal directly fed to the piezoele
182. here implemented in two different ways  both as a     standard    decoupler W  s    G   s G s   where G s  is the diagonal matrix  corresponding to the diagonal elements of G s   and using the inverted decou   pler structure shown in Fig  1 6  Note that G s  here represents the transfer  function matrix from manipulated variables  only  to the measurements  i e      C4     Int X   Ax Bu  Saturation   6     y   Cx Du  Manual Switch Out1    State Space  Disturbance Y    Measurement noise                                                                Fig  1 7 Implementation of distillation column model in Simulink    1 Problems in Anti Windup and Controller Performance Monitoring 13    without the disturbance inputs  Note also that in order to invert G s   a full  rank D matrix is necessary  Small diagonal elements are therefore added to  the D matrix     and it will be necessary to check that these do not intro   duce right half plane zeros  which would lead to unstable poles after system  inversion    The Matlab Control Systems Toolbox allows using the command inv  G   to find the inverse of G s   Alternatively  a state space formula for the inverse  can be found in Skogestad and Postlethwaite  2005     The    standard    decoupler is simulated by simply putting the PI controllers  and the decoupler W s   represented by a state space model block  in series   The inverted decoupler with PI controllers is shown in Fig  1 9  Note that  anti windup of the PI controllers is not inc
183. hhhhhhhhhhhhhhhhhhhh    Dynamic decoupling controller    Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh  Gdiag    G 1 1  0     0 G 2 2       4 We need a non singular D matrix to calculate inv G      Find an approximate G using a new D matrix that does not    introduce poles in the right half plane  dd   1e 3 0     0  1e 3      Gapp   ss A B C dd     tzero Gapp    Check for zeros    W   inv Gapp   Gdiag   W minreal  W      Wa Wb Wc Wd    ssdata W      Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh    Anti windup for dynamic decoupling    Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh    Note that all elements share the same denominator   glinum giiden    tfdata sys 1 1      gilden   giiden 1     giinum   giinum 1       g12num gi2den    tfdata sys 1 2      gi2den   gi2den 1     gi2num   gi2numi1       g21num g21den    tfdata sys 2 1      g2iden   g2iden 1     g21num   g2inum 1       g22num g22den    tfdata sys 2 2      g22den   g22den 1     g22num   g22num 1          Using Hanus    self conditioned form for anti windup    of PI controllers    k2a k2b k2c k2d  ssdata k2      kla kib kic kid  ssdata k1       klaw   kia kib inv kid  kic    kibw    zeros size kib   kib inv k1id     uz   size kib inv kid      kicw   klic    kidw    kid zeros uz       46    AT    48    49    50    51    10    11    12    13    14    15    16    IT    18    19    20    21    22    23    24    25    26    27    28    29    30    31    32    33    34    35    26 Morten Hovd and Selvanathan Sivalingam    k2
184. i   1 rx   Amag  mag norm Xopt i         the magnitudes are about 0 8   end      noise   noisemag diag  mag      4Xoptnoise    Xopt noise        step 2  with artificial noise    semilogy svd X       semilogy svd  X X0      Hopt  loss  soc_avg Gy  Xoptnoise     D Hopt Gy inv G1      Hopt9 inv D   Hopt    resb Hopt9 X    resbO Hopt9 X0    a91 norm resb Y1     a92 norm resb0 Y10     method9       loss w noise           Summary of results    207    208    86 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke    methods  methodi method5 method6 method7 method4 method10  method9    a   all a12  a51 a52  a61 a62  a71 a72    a41 a42  a101 a102   a91 a92        For repeated case 1 and case 3   na na 1   aa aata    aaa aa na     For repeated case 1   end    Acknowledgements The authors are pleased to acknowledge the financial support  from the NIL I 007 d project and the Norwegian Research Council    References    Alstad V  Skogestad S  2007  Null space method for selecting optimal measurement  combinations as controlled variables  Ind Eng Chem Res 46 846 853   Alstad V  Skogestad S  Hori E  2009  Optimal measurement combinations as con   trolled variables  Journal of Process Control 19 1  138 148   Halvorsen IJ  Skogestad S  Morud JC  Alstad V  2003  Optimal selection of controlled  variables  Ind Eng Chem Res 42   Hori ES  Skogestad S  Alstad V  2005  Perfect steady state indirect control  Industrial   amp  Engineering Chemistry Research 44 4  863   867   Kariwala V  Cao Y
185. iable z as a Function of  Disturbances and Noise    We start from the loss expression in  2 8  with izlli where z   J     U    Uopr    We want to write z as a function of d and n  The first step is to write U    Uopr  as a function of c     Copt  We have c   Hy  so    c  Hy   HG u  HG  d  Cop   Hy   HG uop   HG d  Thus  c     Copp   HG     u     opt   or   u m Uopt      HG     c   Copt     where G   HG    is the transfer function from u to c   The next step is to express  c    Copt  as a function of d and n     From  2 4   we have that H  y  n       cs  constant   or    c  Hy       Hn     c     Here  c    0  since we assume the nominal point is optimal  From  2 12   we have that Cop   H Fd  Since the signs for n    and d do not matter for  the expressions we derive below  we can have both positive and negative  changes   we derive          C   Copt   H Fd  n     H FW d  W nun        HHFWa Wry  Fl    Note that W4 and W 4   are usually diagonal matrices  representing the mag   nitude of the disturbances and measurement noises  respectively     2 4 2 Loss for Given H  Disturbance and Noise   Analysis     In summary  we have derived that for the given normalized disturbances d   and for the given normalized measurement noises n    the loss is given by    60 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke    Le pa  2 14   where i    d  z   JV  u     top    Ji   HG   HY sv    2 15   M H   Y    FW4 Wn   2 16     2 4 3 Worst case and Average Loss for Given H    Analysis
186. ics  using low cost hardware  To push into this direction  the MPT toolbox can  automatically generate real time executable C code version of Algorithm 1   The export can be initiated by calling     gt  gt  mpt_exportC ctrl     target_filename         The function generates the files target filename cand target filename h  which will contain  respectively  the table evaluation code and the table data   the regions R  and the feedback gains K  and L   cf   4 27    The code can  be subsequently linked to any application written in the C language    Another option is to use the Real Time Workshop  RTW   which is a  de facto standard code generation tool supporting different types of digital  signal processors and other CPUs  MPT provides a RTW compatible C code  implementation of the Algorithm 1  which makes code generation and de   ployment a single click operation  To use this option  the controller is first  embedded into the Simulink environment using a provided block as shown  in Section 4 5 2  The block is subsequently connected to signals from A D  and D A converters to close the control loop  Then  one simply clicks on  the respective icon in the Simulink window to initiate RTW  which compiles  the overall control scheme including the lookup table and then automatically  downloads it to any supported target CPU     4 5 4 Advanced MPC using MPT and YALMIP    In the previous section we have shown how to formulate  solve  analyze and  deploy MPC controllers using the MPT to
187. ime to wind down again  and therefore  only is selected  active  for a short period during each disturbance cycle   This explains the long periods where the pressure measurement is above the  setpoint  There are also large deviations in the flow measurement  but since  the flow controller is selected most of the time  the deviations in the flow  measurement are quite quickly removed           Kf  Tif 1 5   Tits    Transfer Font Flow setpoint   deviation variable          0                         f                Flow              gt  uf  deviation variable   1    Flow controller output 20s 1  5 Flow disturbance                                  10s 1  Flow    M oo00  min  gt  ur 00    MinMax Input applied Disturbance   deviation variable                                      10                d     gt    100s 1  Pressure Ce 2 le Save disturbance  20s 1    Transfer Fen                                             gt  up P 4  Pressure   deviation variable     kp  Tip 1I   la n  Tip s  Pressure controller     Pressure setpoint   deviation variable                 Pressure controller output                                     Fig  1 26 Simulink implementation of model and control system  without anti   windup    32 Morten Hovd and Selvanathan Sivalingam    J       M       ab i li   tl ood     AN                 L L L L fi f f  0 200 400 600 800 1000 1200 1400 1600 1800 2000          I  Flow   Pressure  Disturbance jj                               Fig  1 27 Responses in controlled v
188. in  It was designed according  to   ilka  2007             a  Front view  b  Back view    Fig  6 1 Coupled tanks uDAQ28 3H2  Front and back view     6 Laboratory Model of Coupled Tanks 231    The system is easily connectable to the PC via USB interface  There is  no need of additional data acquisition cards hence the controlling is per   formed directly from the Matlab SIMULINK or Scilab Scicos environment   By switching the valves between the tanks and between the tanks and the  lower reservoir  it enables to create different configurations  e g  the one level  system  two levels system with one inflow and one drain  or the multi input   multi output  MIMO  system with several inflows and outflows and the mu   tual tanks    coupling    At the beginning we will start with the easiest model     we will imagine  only one tank where the level of liquid is influenced only by inflow from the  pump and drain from the valve  This valve is only two positions  open close    This kind of connection   s model can be seen in Fig  6 2        12   a  One tank system  b  Coupled Tanks    Fig  6 2 Models of tanks    The liquid   s level is denoted as x    with the liquid   s inflow u1  tank   s cross   sections A1 and the valve   s outflow coefficient c    This tank model can be  described by various differential equations acquired through the application  of the law of substance preservation  Thus it applies for the given tank that  the change in volume V is defined by the difference betwee
189. inal liquid   s levels after finishing the experiment and   15 as the duration  of the measured interval    It is important to mention that in case with the tank   s outflow orifice not  being exactly at the same altitude as the valve   s drain orifice  but lower   we  have to consider this difference  Then it is to consider that the real liquid   s  level in the tank producing the resulting pressure at the valve orifice is    T1   Litank   T1oflset    where zitank represents the hight of the water collumn in the first tank and  offset denotes the offset between tank orifice and valve outflow    The pump identification seems to be easier  It may be based on determining  time periods  in which the tank with closed valves will be completely filled  under consideration of different pump   s input voltage     A121  At         q        It is vital to choose various working points in whole pump   s working scale   Finally  since the pump is a reasonably nonlinear element  we approximate  the measured pump characteristic by the curve fitting methods  e g  with  the polynomials of third or fourth degree  The input output characteristic of  the first pump  the inverse input output characteristic of the pump and the  characteristic of the first valve are depicted in Fig  6 6     6 Laboratory Model of Coupled Tanks 235    6 2 2 Sensors Calibration     To measure the height of liquid s level in the plant in Fig  6 1 the pressure  sensors are used  These have several advantages  they are 
190. individual responses  When the rules for creation of block diagrams  Sec   tion 8 7  will be kept the blue curve will represent the input signal  the red  curve will be the control value and the green one is for the output value of  the real system    The two lower quadrants can be characterized as alphanumerical ones be   cause they serve for input and display of textual and numerical data of ex     280 Pavol Bist  k    periments  Beside this there is a group of buttons placed in the bottom part  of the interface that enables to control the whole client application    The lower left sector Settings assures the setting of the following experi   ment parameters  the name of the controlled model  model parameters  input   desired  value  sampling period  duration of experiment and the name of a  data file to which the state variables of the running experiment can be saved    The lower right sector Output displays the experiment outputs in the nu   merical form  If the user does not want to exploit the possibility to save data  into the data file it is possible to copy data from the field Output through the  clipboard to arbitrary program for further processing  Besides this the field  Output displays also the application state messages  whether the connection  has been successful  if no then why  the state of saving data to the external  file  etc     Further it shows warnings and error messages in the case they are  generated by the system    The buttons for the control of run
191. ine  NRMPC run has been expressed as Jyrupo   fT f which can be only true  in the case the augmented states are transformed to make the cost equivalent  with the original MPC formulation     Mx  Mc    dlyap PhiO   Q K     R K     dlyap A0     CO     R B     Mx B   CO       In order to minimize an equivalent transformed cost and still having the  same simple function  the augmented states z have to be transformed in the  on line optimization task     V D  eig Mc      d sqrt  max  diag D    tolerance       invT V diag 1  d  V   invTT blkdiag eye w dim 1 1   invT      Select parameters are passed onto the on line formulation  while some mi   nor practical operations are performed in the final code segment     Pt invTT  Qzi invTT     188 Gergely Takacs et al     R S  eig Pt dim 1 2 dim dim 1 2 dim     Sm diag S     021 Pt dim 1 2 dim 1 dim      5 2 4 7 The Newton Raphson Root Search Algorithm    The first problem in the on line formulation is to find A  For this  one needs to   use the Newton Raphson procedure  The underlying concept is very simple    Anstee  2006  and in relation to the NRMPC procedure it can be stated as   d   X  0     D X      Ec  ke 95     The procedure itself is also trivial and is represented by the following algo   rithm     At each sampling instant initialize with A   0 and perform an iteration  which calculates     P X   dB A  aX    Anti     n      5 5      lt        until the change in A is smaller than the pre determined tolerance  where  subscript n d
192. inearization we talk about approximation of the non   linear system    256 Vladim  r   ilka and Mikul     Huba    i    f zi ui     yi   g zi     by a linear system    Ax    AA    B  u   Ay   C Az      where Ax    T1     zi  Au1   U1     U1   Ay     Y1     yi  and T19  Ulo  yi  iS  our fixed operating point  It is to stress that the linearization is considered  around a steady state  state  input and output are replaced by deviations  from it as  Ax    Au  and Ay  and the matrices A  B and C are in general  given as     of of Og  6        1   2719 U1   U19    In case on one level hydraulic system  6 1 we get by such a linearization    s E  Aj 2    1o    AY    Az      We would like to point that  7 5  is not valid for 71    0  Taking into account  that our system  7 5  is linear  we can consider its velocity transfer function    mo 250 A  1 AU   s  ost ONT       Now for this system we propose PI controller  for the first order linear sys   tem   Transfer function of the controller should again be made in such a  way to yield an open transfer function 1 T1s what may e g  be achieved by  choosing          R     1 1 s  2     A1 Alc    s           YY o                              Tis Fi s  STs T 2T  T1 5  where   A  p l  Ti  A  f 101    2T    Tio    are gains of P  a I1 action of the controller  Note that the time constant  T   can be easily obtained from step response of the system  We should not    7 Constrained PID Control Tasks for Coupled Tanks Control 257    omit the fact  t
193. ing    state space realization   11 1  Teti    o 4  Te    g 5  Ue    Yk    1 0  Tk    which is subject to constraints    1  lt  uj  lt  1 and  5  sas        First step for you is to create the corresponding sysStruct structure for  such a system  make sure to run clear to wipe the workspace   When you  have that  create the probStruct structure  assuming the following assign   ment     158 Michal Kvasnica    e prediction horizon 5  e quadratic type of the performance objective  e Q    I  and R   1    Finally  create two controller objects  one called controller online and  representing an on line MPC controller  and the other one controller explicit  where the solution will be pre calculated    Hint  use either    online    or    explicit    string flags as the third input to  mpt control      Once you have both controllers  verify that they are indeed equivalent   Which control action does controller  online give for x0     3  0   And  what is the value of controller_explicit for the same state  Of course  the  two values should be identical  since the two controllers represent the same  optimization problem    The only difference is in the evaluation speed  To see it in a more prominent  fashion  fire up closed loop simulations for both controllers using the sim    command and with xO     3  0  as the initial state  In both cases measure  the execution time using tic and toc functions  What do you see   keep  in mind that this will measure the execution time of the whole cl
194. ing 15    1 1 7 Simulations    1 1 7 1 PI Controller    The responses in the controlled outputs  when no saturation is present are  shown in Fig  1 12  We observe that the setpoint changes are followed quickly   However  there is some interaction between the two loops  causing offset in  loop 2 following setpoint changes in loop 1  These interactions are counter   acted relatively quickly by the controllers    The corresponding responses when the input is constrained between  0 5  are shown in Fig  1 13  It is obvious that the saturation severely degrades  control performance        1 1 7 2 Decoupler    The responses in the controlled outputs  when no saturation is present  are  shown in Fig  1 14  The observed performance is good  and could probably  have been further improved by more careful design of the PI controllers   and  the decoupling is practically perfect  with no observable interaction between  the two outputs  Note that these results do not depend on whether a standard  or an inverted decoupler implementation is used    The response with the standard decoupler when the input is constrained  between  0 5 are shown in Fig  1 15  Clearly  performance is horrible  and the  interactions between the outputs extreme  Note  however  that the system  in       Output 1  1 5 T                L L L L L L L L  50 100 150 200 250 300 350 400 450 500    Output 2  2 T                   L L L L L L  0 50 100 150 200 250 300 350 400 450 500    Fig  1 12 Responses with PI controlle
195. ing parameter changes    e y all available measurements  will later call a subset of these for    in ac   cordance with statistics notation   The manipulated variables  MVs  often  the same as the inputs u  are generally included in the measurement set  y  This will allow  for example  for simple control policies where the inputs  are kept constant  Of course  the set y also includes measured disturbances   dm  a subset of d     e n    measurement noise  error  for y  Ym   y  n       e p  prices   weights that enter into cost function  do not affect y     2 2 2 Cost Function    The objective is to choose the input u to minimize the quadratic cost function  J u d   u  Q u 4 d  Q d  amp   u  Q4d  2 1     Note that for simplicity  we have not included linear terms in the cost func   tion  Any linear term in u can be removed by shifting the zero point for u  to be at the optimal point  On the other hand  a linear term in d cannot be  counteracted by choosing the input u  so excluding it does not change the  solution  The same applies to any constant term in the cost    If we compare  2 1   with a second order Taylor series expansion of the  cost  around a nominal point  u   d    then we have that    1     1    O   37 Q     Jia Qs   5 ad    2 Measurements for Control  Optimization and Estimation 55    and u represents deviation from the optimal point  u   d      0 0  at which  J   0     2 2 8 Measurement Model    A linear model is assumed for the effect on u and d on measurements 
196. ion    For controllers for which no feasibility guarantee can be given a priori  the  function mpt_invariantSet can compute an invariant subset of a controller   such that constraints satisfaction is guaranteed for all time     ctrl inv   mpt invariantSet ctrl     4 5 5 4 Lyapunov type Stability Analysis    In terms of stability analysis  MPT offers functions which aim at identifying  quadratic  sum of squares  piecewise quadratic  piecewise affine or piecewise  polynomial Lyapunov functions  If such a function is found  it can be used  to show stability of the closed loop systems even in cases where no such  guarantee can be given a priori based on the design procedure  To compute  a Lyapunov function  one has to call    ctrl lyap   mpt lyapunov ctrl  lyaptype     where ctrl is an explicit controller and lyaptype is a string parameter which  defines the type of a Lyapunov function to compute  Allowed values of the  second parameter are summarized in Table 4 3  Parameters of the Lyapunov  function  if one exists  will be stored in    lyapfunction   ctrl lyap details lyapunov    146 Michal Kvasnica    lyaptype Type of Lyapunov function     quad   Common quadratic Lyapunov function    gt sos      Common sum of squares Lyapunov function   pwa   Piecewise affine Lyapunov function    gt pwq     Piecewise quadratic Lyapunov function   gt pwp     Piecewise polynomial Lyapunov function       Table 4 3 Allowed values of the functiontype parameter in mpt_lyapunov     4 5 5 5 Complexity
197. ired     4 posun   offset of the output valve  difference between tank  bottom and    4 valve output orifice    4  RRS 1enals transformations      kkkokokokokok  h2m yr  y   yr v   4s hifting reference state to the origin    wi     beta2 betal2  2   wtposun   w     4 steady state level in tank 1    4 corresponding to setpoint reference level w in tank 2    posun   valve orifice offset    hi mic wit  1 mic   him    h2 m2c wt  1 m2c   h2m     4 hi h2  operating points for linearization of tank 1 and 2  4 mic m2c   waighting coefficients for specifying    4 operating points for linearization    4 mic m2c 0 correspond to exact linearization      i e  linearization around actual state   leading    4 to overshooting thanks to nonmodelled dynamics    4 mic m2c 0 correspond to linearization around reference state   4 too slow closed loop dynamics    4 recommended to work with m  c m2c gt 0  0 1 0 2     h12 abs h1 h2     z sign hi h2      a   betal2  2 S1 sqrt h12       b      betal12 2 1 2   2 beta2 h2 beta2 posuntbeta2 h1  beta12     h1 h2     1 2     h2 posun     1 2    1 2 beta2 2       4 transformation to the normal form for output y h2     real control ur of pump with constraints Qimin  Qimax    4 replaced by fictive input of a double integrator    4 with limits Q12 and Q11    268    Q12    Vladim  r   ilka and Mikul     Huba    a Qimax b     011   a Qimin b     limit values of fictive input signal of double integrator     xk  kkkkkkkkkkcontrol algorithm    kkkkkkkkk      contro
198. isturbance by a LED voltage step during the experiments     9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 303    Gain of open loop  18 T T T T T       16r    14     12                 0 10 20 30 40 50 60 70    Fig  9 14 Process gain in multiple operating points as function of the output variable    e Compare the results with various controller tuning      The disturbance observer can be added to the static feedforward control  to compensate the steady state error  To obtain a structure equivalent to  I controller  the pre filter with time constant equal to the observer time con   stant has to be added as well  Let us denote the controller as Io controller   Fig  9 17  and the controller with pre filter as FIo    Tuning of the Ip and FIg controller requires information on a process gain  and approximation of the non modeled dynamics     usually by the dead time   The approximation of the delay in this example is Tg   0 4  The filter time  constant of the disturbance observer is restricted by the parasitic time delays  of the non modeled dynamics in the process  Use following formula to set up  the disturbance observer filter time constant     Tri   eTa  9 2     Try to use multiple process gains for controller tuning  to improve con   trol quality  Use the lowest  the average and the maximum process gain from  Fig  9 13  Choose experiment no 3 with the exnum command to control non   filtered optical channel by FIo controller  You will be prompted for 
199. it decreases the liquid s level below the desired values  To  compensate the outgoing liquid we have to use more advanced controllers   The easiest way to compensate the outgoing water is to add parallel signal  to the output of the controller  Such constant signal set usually manually  was originally called as reset  offset   Later  this was replaced by automatic  reset denoted today as the integral action and produced directly by the con   troller  By this modification we will obtain the PI controller  The goal of  the integral action is to integrate the control error values multiplicated by  a suitable constant what will continuously increase the controller output      until the complete removal of the control error  The transfer function of such    PI controller is  I  R s  P    s    where P represents the gain of the proportional action of the controller and  I is the gain of the integral action    An easy experimental way to set up the PI controller s parameters may  be based on measured step responses of the system  The step responses of  the system contain information about the basic dynamic attributes of the  system and this is why it enables us to set up the controller s parameters  better than by the frequently used trial and error method  At the same  time  we have to realize that the step response method was developed for  the responses of linear system to a unit step  Our system  6 1  is  however  a  nonlinear one  We can t thus talk about the system s step resp
200. k  DH  D  DH  D   D  options    X1   k 1  A X1   k  B  U1 1 k      Yi k  C X1   k    end    where X1 is the matrix containing the states and Y 1 is the vector containing  the deflection data  The last two lines assume that there is no need for state  observation  this is to make the simulation simpler    If the cost is needed as well  one needs to include either one of the following  lines in the code     J k     U1C    EJ   H   U1     K 2   X10   k     F  U1C   K   X1 C    k2   G   X1   k    J2 k     X1   k  0 X1   k  U1 1 k   R U1 1 k      The optimization procedure can be fine tuned by     options   optimset    LargeScale       off       Display       off       TolFun      1e 12      It is also possible to substitute the Matlab built in quadprog function with  the qpOASES Matlab interface  After compilation the sequential qpOASES  solver can be simply called by using the following code     for k 1 run    0bj0A U2   k  yd status2 1 k   nWSRout2 1 k     gp0ASES seguence  i  H F X2   k  Ac          bO Bx X2     k  10    X2    k 1  A X2    k  B U2 1 k    Y2 k  C X2   k    end    5 2 3 6 Controller Loop in Simulink    The QPMPC controller loop is featured in Fig  5 3  The controller loop con   tains means for A D and D A conversion  state observation  data logging  and others  The block containing the QPMPC controller takes the actual ob   server state as an input  and outputs controller voltage  It may be required to    5 Implementation of MPC Techniques to Real Mechatronic Sy
201. l algorithm for constrained control    of double integrators with real    closed loop poles alfai  alfa2    if     Q11 Q12 gt 0    if  him h2m gt w w1   u Qimin    else  u Q1imax    end   ur u     else    if y gt 0  Q1j  else  Q1j   Q11   end    Q12     di 011 alfa1   d2 012 alfa1     if dr gt d2   amp   dr  d1   u   alfal alfa2x y   alfail alfa2  dr      linear pole assignment  else  u   1 alfa2  y 0 5  dr dr  Q1j  Q1j  alfai alfal    dr    01j      nonlinear pole assignment  end      constraining output  if  u gt 012    u Q12   end    if  u lt Q11   u Q11   end  4  kkkkkkkkkkinverse transformation       KKKKK   4 inverse transformation from the fictive    7 Constrained PID Control Tasks for Coupled Tanks Control 269      double integrator input u to    real input ur  ur    utb  a    end    out   ur     7 6 Conclusion    We have described the basic possibilities of control of available hydraulic sys   tem established by different configuration of one or two containers with one  or two pumps  It is important to mention  that in case of control of real sys   tem with the mentioned controllers we will not obtain the ideally supposed  results  Certainly  due to modelling errors we will register some deviations  between supposed and real transients  The control performance will depend  on the accuracy of identification and robustness of controller  As we will never  be able to define the system   s parameters with 100  precision  the system  wild never behave as the perfect integ
202. l is sometimes used when there are more than one candidate  controlled variable for a manipulated variable  For each of the candidate  controlled variables a separate controller is the used  and the value of the    28 Morten Hovd and Selvanathan Sivalingam    manipulated variable that is implemented is selected among the controller  outputs  A simple example of selective control with pressure control on one  side and flow control on the other side of a valve is shown in Fig  1 25   Normally one selects simply the highest or lowest value  A few points should  be made about this control structure     e Clearly  a single manipulated variable can control only one controlled vari   able at the time  i e   the only variable that is controlled at any instant is  the variable for which the corresponding controller output is implemented   It might appear strange to point out such a triviality  but discussions with  several otherwise sensible engineers show that many have difficulty com   prehending this  Thus  one should consider with some care how such a  control structure will work    e The selection of the active controller is usually based on the controller  outputs  not the controller inputs  Nevertheless the local operators and  engineers often believe that the selection is based on the controller inputs   or that    the control switches when the a measurement passes its setpoint      In principle  the selection of the active controller may also be based on  the controller input
203. l loop  Since the setpoint is 0  the mea   surement and control offset are equivalent    2  Calculate the Harris Index  or Normalized Harris Index  for the control  loop  Is there scope for significant improvements in control performance    3  Select a reasonable value for the desired closed loop dominant time con   stant  Instead of the minimum variance benchmark used in the Harris  Index  use a modified benchmark reflecting a desired closed loop time con   stant to assess control performance     The calculations involved are relatively simple  and appropriate Matlab  routines may be programmed by the student  Alternatively  the Matlab rou   tines ar and impulse may be useful     1 4 2 Solution    First the mean of the data series OP is removed with the command opd    detrend op    constant      Next  a 10th order auto regressive model from  the  unmeasured  disturbance to the controlled variable is identified using  the command mod ar opd 10   The routine ar   finds parameters for the  model    y k    ony k     1    agy k     2         a 10 y k     10    a k   1 12      A q    y k    d  k     where y k  is the measurement at time k  and a k  is the  unmeasured  distur   bance  Note that the leading coefficient of the polynomial A q7 1   a 0    1   The coefficients of the polynomial A q    are found in mod a  and the es   timated variance of a k  is found in mod NoiseVariance  The AR model  is converted to an impulse response model by simple polynomial long divi     1 Proble
204. l plants control  This may be just partially achieved  by computer simulations and the feedback received in such a way is never  complete  Therefore  it is important to acquire already during the university  studies some practice and experience related competences in designing and  testing of controllers on real systems    Due to the simple manipulation  easily understandable and observable pro   cesses and their time constants  one of many systems used at universities fre   quently as pedagogical instruments in control education the system of coupled  tanks has to be mentioned  The theoretical design of controllers included in  this publication comprehends two basic configurations  control of one  or of  two coupled tanks  In considering coupled tanks  one of possible configura   tions is the coupling in series with interaction  when the liquid   s level in one  of the tanks influences the other tank   s liquid   s level as the liquid may flow    Vladimir Zilka  Faculty of Electrical Engineering and Information Technology  Slovak University of  Technology in Bratislava  e mail  vladimir zilkaQ stuba sk    Mikul     Huba  Faculty of Electrical Engineering and Information Technology  Slovak University of  Technology in Bratislava  e mail  mikulas hubaQstuba sk    229    230 Vladim  r   ilka and Mikul     Huba    between the tanks in both direction  The other two tank consideration is the  cascade coupling with one way influence  where the tanks are placed one un   der another 
205. labFcn  following equation was made    c_ 12 sign u 1  u 2   sqrt  abs  u 1  u 2       6 2 1 Identification    For simulating or controlling the real system it is indispensable to know all  parameters of its mathematical model  While the measurement of the level  surfaces in tanks does not represent a serious problem  to determine the  values of the valve   s flow coeficient is usually a bit more difficult  By taking  the more detailed view on  6 1  or  6 2  we will realize that we can define  at least two approaches for determining parameters ci  co and c12  One is    6 Laboratory Model of Coupled Tanks 233    Sum              level4  Integrator 1  c1 sqri u     outflow from 1  tank         level2        Integrator 2    c2 sqritu     outflow    Fig  6 3 Coupled tanks   Simulink model     based on measurement with constant inflow  the other on experiment with  zero inflow     tank s emptying    In the first approach based on measuring steady state under constant in   flow the resulting state equation reduces to  6 1  is    1  A   Ciy Ti    U1    Ai mi    The second approach is based on evaluating transients under zero inflow      i e  during tanks    emptying  The flow coefficient c  of the valve can be easily  obtained from  6 1   If the pump is off  the state eguation  6 1  reduces to    t        aVT1    y         C     6 3     T    In this case  by integrating above equation  c   can be get as    u 2 Tlinit   2y T1 final    Ad  6 4     C1  where T1init represents the initi
206. lating the unconstrained linear quadratic optimal  gain  along with the terminal weighting matrix      K S e  dlqr A B Q R    K  K   Qe dlyap   A B K        Q K     R K        5 Implementation of MPC Techniques to Real Mechatronic Systems 179    The forced and free state prediction matrices are calculated through a set  of nested loops according to the following script     M2 zeros nc nx     for n 1 nc    M1  n nx nx 1 n nx      A7n      for na 0 nx  nc nx    na O0 nx   nc nx    m2 nx   n 1    na 1   nx   n 1     na nx   n    A   na nx    B     end    end   M2 m2 1 nx nc        where several other possible solutions may exist  These solutions can be equiv   alently good  and while their runtime may differ this should not be an issue  in an off line problem setup process    The last n rows of the matrices M1 and M2 are also selected     M11 M1 nx nc  nx 1  nx nc      M21 M2 nx nc  nx 1  nx nc        The next step is to create the cost prediction matrices  One has to begin  with initialization   H1 0   F1 0   G1 A70 Q     This is then followed by creating the cost prediction matrices H  F and G    first by running the following loop to get partial results     for i 0 nc 2  H1it M2 1 i nx i nxtnx      Q M2 1 i nx i nxtnx      H1 H1 Hit   F1it M2 1 i nx i nxtnx      Q M1 1 i nx i nxtnx      F1 F1 Fit   G1it M1 1 i nx i nxtnx      Q M1 1 i nx i nxtnx      G1 G1 G1t    end    And finally assembling cost prediction matrices H  F and G     H H1 M2  1   nc 1  nx   nc 1  nx nx       Qe
207. lations in the output are  small due to the low plant gain at high frequencies  Note  however  that  the oscillations in the valve position due to the stick jump are nevertheless  significant in magnitude  and may result in premature wear on the valve    4  Data set 4 is obtained with a sinusoidal external disturbance  and the  control loop itself is linear    We find that the cross correlation method therefore perform well on data  sets 1 and 4  and the OP PV plot  at least when allowing for time shifting  between the OP and PV data series  perform well on data sets 1  2  and 4   The methods using only the PV  bicoherence m and glstat m  failed to  detect significant nonlinearity for sets 1  2  and 3  while correctly finding no  indication of nonlinearity for data set 4  One should note  however  that    e  t is not really fair to compare a stiction detection method using only PV  to methods using both OP and PV    e Both bicoherence m and glstat m have tunable parameters that may  help in detecting nonlinearity in some  or all   of these cases  However  in  the absence of any clear recommendations on how to select these parame   ters  we have chosen to use default values throughout     None of the methods tested were able to detect stiction in data set 3  Logging  the actual valve position  which must be measured     at least locally     in order  to implement a valve positioner  would be very helpful for detection of stiction  when the stiction  in combination with the val
208. le 2 5 Our own example  8 data sets in each run  average of 500 runs     waoe   0 2934 0 9985 LS   PCR 8   0 5496 0 4931 PCR  tol 1  most cases PCR 5        Now  to show that the loss method does better when there is more data   Table 2 6 shows the average value of   Y1    HX   for 32 data sets after  running 300 times     Table 2 6 Our own example  32 data sets in each run  average of 300 runs     1 7700 0 2690 loss method  no noise   1 7700 0 2690 loss method  smooth y1   1 7703 0 2687 loss method  noise 0 5        The loss method is the winner  val   0 269  in spite of the fact that it has  no    tuning    parameters    Here there is little effect of adding artificial noise with the loss method   presumable because we have enough data     2 9 8 Comparison with Normal Least Squares    Normal least square solution  Problem  Find H such that the magnitude of     Y      HY     is minimized for the given set of data for Y   and Y   Solution  H   Y  pinv Y    This minimizes   Y       HY     and  for cases  where this JH is not unique  minimizes   H       This is the same as finding H to minimize     H Y au    which we know  is not the optimal solution    Proof  The data matrix is Yau    Y    Y  Assume that we seek Hau to  minimize    Han Y ai     We have degrees of freedom in Hau  so we set Hau    I     H   Then we want to minimize    Hau Y 1  Y          Y 1   HY    the  best solution is given by the pseudo inverse  H   Y ipinv Y   which is the  usual least square solution  O   
209. lem                         56   2 2 8   Comments on the Problem                        56   2 3 Solution to Problem  Preliminaries                        57   2 3 1 Expression fex told  oreco betrar tas tee ei 57   2 3 2 Expression for J around topla                    57   2 3 8 Expression for J  around Moving uopr d            58   2 3 4 Optimal Sensitivities               06 0026 eee ee 58   24  The Loss Method et bud etn eee pta RED Ba td eee dna 59  2 4 1 The Loss Variable z as a Function of Disturbances   and Noele oues pricei tinie DER deal ed bial acts doe  59    2 4 2 Loss for Given H  Disturbance and Noise  Analysis  59  2 4 8 Worst case and Average Loss for Given H  Analysis  60    2 4 4 Loss Method for Finding Optimal H               60  2 5 Reformulation of Loss Method to Convex Problem and  Explicit Solution cerise 22  meme eet eme 6 aeree 63  2 6 Structural Constraints on H               ee eee 65  2 7 Some Special Cases  Nullspace Method and Maximum  Gu Nod cies ke P can eva ae Ex A ER iE ERR 66  2 7 1   No Measurement Noise  Nullspace Method     full H     67  2  Na Dhsburbaneem   vesci sed rt eR Ree 68  2 7 9 An Approximate Analysis Method for the General  Case     Maximum Gam Rule     eee ee ae 68  2 8 Indirect Control and Estimation of Primary Variable        70  2 8 1 Indirect Control of Yy ooo met 71  2 8 2 Indirect Control of y  Based on Estimator          71  2 9 Estimator for y  Based on Data               0 00  cee ee 72  280  Data Approach I  c neu
210. load them and  have a model that will use them correctly  The basic program would after   wards look as follows     load    calibParams       offsets and gains of pressure sensors    load    valvel       parameters of drain valve from tank 1  load  valve2     parameters of drain valve from tank 1  load  valve12     parameters of valve between tank 1  amp  2  load    pumpi       pump 1 parameters   load    pump2       pump 2 parameters   A   0 001   4 tank area   T   0 25    sampling period    open  model mdl      open simulink model    Pump s subblock is depicted in Fig  6 7 where function block  U    QI1  con   tains     PU1 1  u 1  4 PU1 2  u 1  34PU1 3  u 1  2 PU1 4   u 1  PU1 5     This 4 degree polynomial enables linearization of the pump  The input for  this function is inflow from controller  in m  s     Function convert this input  to Volts  The  Gain4 changes Volts to 96  because the pump input in matlab  block is in 96    There is also treshold  For too small input  smaller than 10 9m  s    push  to output 0  This feaure respects the fact that the pump can not process  smaller inputs     6 2 4 Some Recommendation for Users    At the end we would like to add some recommendations that may help you  in keeping your plant in optimal work    Use always distilled water  even in the case you need to add just small  amount of it  In this way you may reasonably prolonged intervals between  clearings     240 Vladim  r   ilka and Mikul     Huba       Constant2  Switch     Fig 
211. lows     extern double ddot_ int   double   int   double   int      extern void dediv_ int    double    double    double        Element wise division of two vectors is performed by the following func   tion     void dediv_ int  n double  x double  y double  z       int i   0    for  i  i  lt   n  i          z il x il ylil         5 Implementation of MPC Techniques to Real Mechatronic Systems 191    where vectors x and y have a common dimension of n  Their elements are  indexed with the locally declared variable 7  The function takes the dimension  n and vectors x and y as its input  and places the result in vector z    After the unknown A is calculated by the algorithm  each element of vector  x is scaled by it  This simple scaling operation is extended by an additional  step for computational efficiency  Each scaled element of x is subtracted from  1  and the result is placed in the vector y     void descal  int  n double  lamN double  x double  y   1   int i   0    for  i  i  lt   n  i          y Ci   1  lamN x  i              The function takes scalar dimension n  vector x and scalar A as its input  The  output is placed in y  where the dimensions of both vectors are n  An inside  loop performs the formerly described simple operation  where the elements  are indexed with the locally defined variables i     5 2 4 10 The On line NRMPC Code in C language    A pre requisite for the correct functionality of this code is the correct call   ing of external BLAS functions and the 
212. luded in this figure  Note also  that fast low pass filters are introduced in order to break so called    algebraic  loops    in the Simulink simulation  Such algebraic loops are a problem only  in simulation  not in a physical implementation  If the low pass filters are  significantly faster than the rest of the dynamics in the system  they should  have little effect on simulation results  However  very fast low pass filters  could lead to a stiff simulation problem  causing long simulation times or  requiring the use of special purpose integration routines     LQG Controller    The Simulink setup for the LQG controller is shown in Fig  1 10  The Kalman  filter part of the LQG controller is designed with the physical model states   and the specified noise covariances  The LQ regulator part of the LQG con   troller is designed with a model that is augmented with integrators in order to  include integral action  The weights used in the LQ design are found by trial  and error in order to  approximately  achieve the specified closed loop band   width  The overall simulation setup  including integrating controller states   LQG controller and distillation column model  is shown in Fig  1 11 Note that  provided the Kalman filter is provided with the saturated input values  it will  provide good state estimates also when the inputs are saturated  However     kinum s   k1den s     A  O A m  Reference    k2num s     Measurement                   Controller  output                   k2
213. ly  She he is  informed by the message Connection timeout or network error occurred   Disconnected from server            Fig  8 8 Automatic disconnection    e Run     it serves for running the block diagram specified in the Model  Scheme parameter  First all parameters are sent to the server where also  the parameters from the file given in the Model Parameters field are read  into the Matlab and consequently the experiment starts with continuous  data transfer and visualization that takes until the time set in the Running  Time field is over  In the Output field the message Simulation starts    will  appear and the transfer data characterizing the experiment states begin  to be displayed  The button is available only after a successful connection  to the server    e Clear     its task is to clear display fields of the client application  namely  the Output and Graphs sectors  The application will be then prepared for  the next run within the existing connection to the server    e Save     this button is available after the duration  Running Time  of the  experiment is over  When it is activated the time sequences of the model    8 Remote Laboratory Software Module for Thermo Optical Plant 283             Fig  8 9 Experiment run    state variables coming from the just finished experiment begin to save into  the file specified by the Save to File parameter  In the Output field the  user is informed about the process and success of saving data  The format  of the saved file is
214. mand    A  b    double TV   A      0 7071 0 7071   0 7071 0 7071    106 Michal Kvasnica    O  1 0000  b   0 7071  0 7071  0    Notice that in this output all rows of A b have been automatically normalized  such that the 2 norm of each row is equal to one to improve numerics     4 2 2 Polytope Arrays    Instances of the polytope object can be concatenated into arrays  Currently   only one dimensional arrays are supported by MPT and it does not matter  if the elements are stored row wise or column wise  An array of polytopes  is created using standard MATLAB concatenation operators      e g  A     B  C  D     It does not matter whether the concatenated elements are single poly   topes or polyarrays  To illustrate this  assume that we have defined polytopes  P1  P2  P3  P4  P5 and polyarrays A    P1 P2  and B    P3 P4 P5    Then the following polyarrays M and N are equivalent     M    A B   N    P1 P2 P3 P4 P5     Individual elements of a polyarray can be obtained using the standard refer   encing  i  operator  i e   P   M 2     will return the second element of the polyarray M which is equal to P2 in this  case  More complicated expressions can be used for referencing     Q   M  1 3 5      will return a polyarray Q which contains first  third  fourth and fifth element  of polyarray M    If the user wants to remove some element from a polyarray  he she can  use the referencing command as follows     M 2          which will remove the second element from the polyarray M  Again  m
215. may also be successfully applied  to any stable plant  but in such situations it is no more possible to speed up  the control signal transient up to the step function  just to keep it monotonic  that guarantees that all such controllers may again be successfully treated  by the linear theory as well  In the second part  basic structures of the DC1  will be introduced that may already typically have one constrained period  in their control signal step responses  Here  control structures with integral  action based on disturbance observers will be introduced that do not exhibit  windup phenomenon and so enable simpler one step tuning that in the case  of traditional linear controllers extended by the anti windup circuitry     Peter Tap  k   Institute of Control and Industrial Informatics   Faculty of Electrical Engineering and IT  Slovak University of Technology  Ilkovi  ova 3  812 19 Bratislava  Slovakia  e mail  peter tapakAstuba sk    Mikul     Huba   Institute of Control and Industrial Informatics   Faculty of Electrical Engineering and IT  Slovak University of Technology  Ilkovi  ova 3  812 19 Bratislava  Slovakia  e mail  mikulas huba stuba sk    291    292 Peter Tap  k and Mikul     Huba    9 1 Thermo optical Plant uDAQ28 LT     Quick Start    This section gives a short guide to uDAQ28 LT plant  Get familiar with  thermo optical plant interface  For more information on the device please re   fer to the user s manual  This device offers measurement of eighth process  vari
216. mentioned file with date and  time     that way we are able to see the history at any time  We apply the  similar procedure at the other measurements as well    Basically in the same way we identify the valve between the tanks  After  the measurement is launched  the first tank is filled and the second emptied   the interconecting valve is opened afterwards and the measurement is per   formed until the leveling of two liquid s levels  Then we perform the second  measurement  the second tank is filled up and the first emptied  We iden   tify again the flow coefficient and we use those two measurements to define  the mean coefficient c12  We save the measured values  following the above   mentioned procedure  just this time the mat file will be named valvel2 mat      for the actual value and valvel2day time mat for archiving  We ll use the  identified coefficient for the simulation and we draw the comparison of model s  course and the real into the graph  In case of lesser compliance  we repeat  the procedure     238 Vladim  r   ilka and Mikul     Huba    The inverse i o characteristic of the pump 1    The Input   output characteristic of the pump and approximation with 4rd degree polynomial    x 10   and approximation with 4rd degree polynomial 14                                                                                              18 r         Real i o characteristic         Real i o characteristic    Approximation  16H     Approximation  12  14  Biz zs    S   i    a 9
217. methodi 2    LS      Hls   Yl pinv X     res Hls X    resO Hls X0    aii norm res Y1     a12 norm res0 Y10        PCR  vary tol      PCR  To find cut off to find no  of components  semilogy svd   X     method6      PCR     tol 1 e 4   Hpcr   Yi pinv X to1     npcr rank pinv X tol     no  of components used in PCR   res Hpcr X    resO Hpcr XO0    a61 norm res Y1     a62 norm res0 Y10        Weighted least squares  to get relative noise assumption  rather than additive noise    method5      weightedLS      rx cx  size X     mag        for i  1isrx   mag  mag norm X i         the magnitudes are about 0 8   end   Xs   inv diag mag   X    Hlss     Yi pinv Xs      128    129    130    131    132    133    134    135    136    137    138    139    141    142    143    144    148    149    150    151    152    153    154    156    157    158    159    160    161    162    84 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke    Hlss   Hlssi inv diag mag      ress Hlss X    ressO Hlss X0   abi norm ress Y1     ab2 norm ress0 Y10         pls   npls 35   4npls npcr    XL y1 XS YS beta PCTVAR    plsregress X Y1  npls       Note that PLS has an additional bias centering parameter   yfit    ones size X    1  1  X   beta    yfitO    ones size X0    1  1  X0     beta    a7i norm yfit Y1        a72 norm yfit0 Y10      method7   11 PLS        Loss method     step 1   Yall    Y1  X     u s v  svd Y1     Yalli   Yall v    r1 ci  size Yall     r2 c2 2size Y1    ny r2   G1 Yalli 1 ny i1
218. milar transients using both controller tunings  Fig  9 26    The 2 V LED voltage step was made at time 105s  Following table summarizes  the robust FIo controller tuning for various overshooting tolerances   Questions     308 Peter Tap  k and Mikul     Huba    Light channel output  45 T T T k              System output  40r be Setpoint                   N        O1 o c1  T  l    n  o    Light intensity          E  oa         o  T   L                   0 L L L L L  0 10 20 30 40 50 60    time s        Fig  9 21 Experimental results for K 10    Table 9 1 Controller tuning  ey  96  10 5 4 2 1 0 1 0 01 0 001 0 0    T K Q 1 724 1 951 2 0 2 162 2 268 2 481 2 571 2 625 2 703 2 718  q     2  amp  0 58 0 515 0 5 0 465 0 441 0 403 0 389 0 381 0 37 0 368    What type of plant is FIg controller suitable to control for    Which plant s parameter restricts the controller s dynamics    Was there any overshooting in the experiments    Why the performance of different controller tunings in Fig  9 26 is almost  the same     9 2 3 Filtered Predictive Ig Controller    Tasks     e Add a dead time to the non filtered light channel output   e Modify the Ip controller to compensate the delay   e Tune the controller using a performance portrait     9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 309    Control signal    3 5 T T T P           M  ol  T  L    N  T  L       Bulb voltage        oa  T  fi    0 54 4             0 L L L L L  0 10 20 30 40 50 60    time s        Fig  
219. mplicity of these approaches  no issues regarding computational imple   mentability arise  Even though these control schemes are often sufficient in  certain applications  the advantages of MPC cannot be overlooked in vibra   tion damping    Unfortunately the fast dynamics of vibration attenuation systems require  very short sampling times  which limit the use of computationally intensive  on line calculations usually associated with MPC  Traditional quadratic pro   gramming based MPC  QPMPC  has been successfully implemented by Wills  et al  2008   where the problems raised by the fast sampling were tackled by  implementing a machine code optimized quadratic programming solver on  a specialized hardware  While this algorithm handles process constraints  it  fails to address the important consequences of stability and constraint feasi   bility    The stability and constraint feasibility of model predictive control algo   rithms may be guaranteed through the deployment of terminal constraints   Maciejowski  2002   This unfortunately reduces the range in which the con   trol algorithm may operate  by assigning a region of attraction of all feasible  initial conditions in the state space  Amongst others  the size of this region  is dependent on the prediction horizon    Clamped cantilever beams actuated by piezoelectric strips are a very spe   cial case in the eye of the control engineer  Model predictive control with  guaranteed constraint stability and feasibility applied on s
220. ms in Anti Windup and Controller Performance Monitoring 47       0 5     Impulse response coefficient    0 2     01r                   0 L L L t     100  50 0 50 100 150 200 250 300 350  Time    Fig  1 48 Calculated impulse response    sion  or using the command  h t    impulse mod   The resulting impulse  response is plotted in Fig  1 48    It can be seen that the model is  as expected  semi proper  There is no time  delay from manipulated variable to the controlled variable  so the minimum  variance can be found from    OZ   h W  o   1 13     We thus find o       2 489 10    The actual variance of the output is found to  be o    1 95 10    We thus find a Harris index of HI   31 94 or a normalized  Harris Index of NHI   0 969  We conclude that there is a significant scope  for improved control performance    A frequently quoted rule of thumb is that the closed loop time constant  should be 2 3 time faster than the open loop time constant  However  this  clearly cannot apply to integrating processes  with infinite time constant    and in practice will depend on the available range and speed of actuation  for the manipulated variable  Nevertheless  the rule of thumb would indicate  that a closed loop time constant of 40 is reasonable  considering the open  loop dominant time constant of 100  This corresponds to a desired closed  loop  discrete time  pole of u   e  1 49   0 9753  The modified benchmark  variance therefore becomes      m    1 4       Omod    1   z  a2   5 103   
221. n contains the integration from net force acting  on the valve to the valve velocity  as well as the calculation of the friction    1 Problems in Anti Windup and Controller Performance Monitoring 35    force  based on the simple model described in Sivalingam and Hovd  2011    The submodel is shown in Fig  1 33  For simulations without stiction  the  submodel Intstiction is replaced by the simple integration  from net force  to velocity   with a positive kg in Fig  1 32 used to simulate viscous  linear   friction     1 3 1 Assignment    Prepare by downloading required software  if not already installed  and the  data series used in the assignment     1  Download the Higher Order Spectral Analysis  hosa  toolbox from Matlab  Central  and or the file bicoherence m from Dr  MAA Shoukat Choud   hury s website teacher  buet ac bd shoukat     2  Download the Matlab data files Setidata mat     Set4data mat from  http   www itk ntnu no ansatte Hovd_Morten NIL      Each of the Matlab data files contain three arrays of variables  i  OP  the  controller output  ii  PV  the process  measured  variable  and iii  tp  the  corresponding time index    For each of the data sets  do the following     1  Plot both OP and PV versus time  Do these plots indicate oscillations  caused by stiction    2  Use the cross correlation method to detect  possible  stiction  Comment  on the result    3  Use the OP     PV plot to detect stiction  If the plot is hard to interpret   try time shifting the data se
222. n the  state of waiting for the connection from the client  After the client connects  to the server it starts to fulfill client s demands  The server usually runs  without breaking  if the safety issues are covered   In the case it is necessary to  finish the server application  it can be done by closing the RemLabServer  exe  application window and closing manually the Matlab application    If the server starts successfully it is possible to connect to it from the client  application  To run the client application means simply to open the starting  Web page client html placed in the Client Application folder  Usually the  client application is installed on a Web server  Then it is necessary to set  the corresponding Web page address into the Web browser  Depending on  the Web browser safety settings it could be required to confirm a trust in  running the Java applets        http   www kar elf stuba sk  pbistak appletKE client html   Windows Internet Explorer EEK   G       E http   www kar elf stuba sk  pbistakfappletKEjclient htmi       X lel  File Edit View Favorites Tools Help   Google       VM search    der Bie CO sidewk   S  Orvo                  We Be   hpiiwewkar elf stubasklopbistaklappletkE dlent 5t deh      Page   C  Tools            Model Parameters   Input  Desired Value         Connect    Server IP      127001 j         e Internet       Fig  8 3 Start of the client application after downloading Java applets    8 Remote Laboratory Software Module for Thermo Optic
223. n the inflow and  outflow  If we know the inflow u4 and we define the outflow as uout then    AV   ui     Uout  V   1144  dx   ld   U1     Uout    To determine uou  we can use the Toricelli formula which defines the speed  of the liquid outflowing the tank   s aperture Vout  With the outflow  we have  to take into account the co actor as well u     for the water 0 63  Plus if we  already know the cross sections the valve s aperture Avo  we can put down  the following     232 Vladim  r   ilka and Mikul     Huba    Vout   V 29gX1  dai    Ar   uy     H  vo y 2gz1    Now by applying the substitution and defining the flow coefficient of the valve  C1    a y  M    The resulting differential eguation for the one level system would be    1  Li   A   CIV TI  y     11  6 1     In this way we can derive the differential equations for coupled tanks   System is then composed of two mutually interacting tanks with two possible  pumps  Each tank would have a separate inflow u1 a ug  separate outflow  depending on x  and x2 and the flow between the tanks specified by difference  of the levels and the constant c19  Such tank model can be then described by  differential equations      1     ty   au     c2 sign z      z2 4   x      z9      ei  21  1     1     to   Te   cig sign x       z2  y    1     x2      eo 2  2    yi   T  Y2   T2  6 2     The liquid   s levels in the first and second tank are denoted as T1  r9 and the  level surfaces as A1  Ag  For Simulink model see Fig  6 3  In block Mat
224. n the intervals in which the  process gain and the dead time range  The data from Fig  9 14 and Fig  9 15  can be used  In this example the dead time 74 ranges in interval  0 4 0 7   and the process gain ranges in interval  3 17   Now determine the interval in  which normalized variable  amp  ranges   amp  represents normalized variable    where Ko stands for the process gain used in the controller  K corresponds to  real process gain  which varies through the operational range  The goal is to  fit the uncertainty box into area of performance portrait  Fig  9 25  where the  controller gives monotonic transients  Try to use two limit values of process  gain for Ko  in this example it gives    which leads to  amp     3 17  1    For the maximal value of Ko    9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 307    Control signal  5 T T T       3 51 M          2 57 1          Bulb voltage                               0 10 20 30 40 50 60  time s     Fig  9 20 Experimental results for K   3    Ko   Kman   1T  9 5   it gives x    1  17 3      Q Ta Ts  9 6     Calculate filter time constant T  for both selections of Ko  For Ko  9 4  it  yields    NQ   0 0649  9 7   T    Ta      0 7 0 0649   10 7825  9 8   For Ko  9 5  it yields  Q   0 3679  9 9   Ty   Ta 2   0 7 0 3679   0 7e   1 9028  9 10     Verify controller tuning by real experiment for various setpoint steps  Add  a disturbance using a LED to verify input disturbance compensation  You  should observe si
225. ncorporate a contrac   tion constraint   v  1  p  lt  a  xx  p  which requires the controller to push the  predicted states towards the origin with some fixed decay rate 0     a  lt  1     for k   1 N 1  C C  norm V xf  k 1  1   lt   a norm V x k  1    end    Notice  however  that norm constraints are nonconvex and the resulting op   timization problem will contain binary variables  having negative impact on  the time needed to solve the optimization probStruct     4 5 4 5 Logic Constraints    Constraints involving logic implication and equivalence can be also formu   lated and automatically translated to a corresponding mixed integer rep   resentation by YALMIP  Take again the double integrator example of the    140 Michal Kvasnica    previous section  In order to make the controller less aggressive  one can re   quire the first optimal control move to satisfy    0 5  lt  ug  lt  0 5  but this  constraint should only be imposed if the state is contained in a small box  around the origin  If the state is outside of this interval  the control action is  to respect    1  lt  ug  lt  1  which is the default constraint already contained in  the sysStruct structure  To formulate such a control goal with MPT  one  can make use of the implies operator YALMIP provides      gt  gt  C   C    implies H V x 1   lt   K   0 5  lt   V u 1   lt   0 5      where H  eye 2    eye 2   and K  1 1 1 1  represent the area of inter   est  ie  the box  71   lt  a t   lt   1   When such a constraint i
226. ng library  to make it possible to choose whether the  saturation should be turned on or off for the simulations  The disturbance  input is modelled as white noise  independently normally distributed ran   dom variables  with variance 0 001  The measurement noise is white noise  with variance 0 0004    2  Controller design  Design three different controllers for the model        a  A controller based on two PI PID loops   b  A controller based on dynamic decoupling   c  A controller based on multi variable controller synthesis  LQG  H    Hoc      All the controllers should be designed to give zero stationary deviation   The dominant time constant for the closed loop should be around one  minute   PI PID controller design should be well known  The multi variable con   troller design method chosen is also assumed known     all the three con   troller synthesis methods proposed above are of the state estimator   state  feedback type  Decoupling is also a relatively common controller design   see Wade  1997  for a thorough description of decoupling for 2 x 2 systems  if necessary    3  Simulation  with disturbances   Simulate each of the three controllers in Simulink   Use the following reference signals   Yi ref  Square pulse  amplitude 1  frequency 0 005Hz  U2 ref  0  Simulate each controller design both without and with saturation in the  inputs  Discuss the results of the simulation    4  Anti windup  and simulation   Implement anti windup for all three controllers   Simulate
227. nguish two cases     1  All inputs are discrete  2  Some inputs are discrete  the rest are continuous    4 5 6 7 Purely Discrete Inputs    Typical application of discrete valued inputs are various on off switches   gears  selectors  etc  All these can be modelled in MPT and taken into account  in controller design  Defining discrete inputs is fairly easy  all that needs to  be done is to fill out    sysStruct Uset   Uset    where Uset is a cell array which defines all possible values for every control  input  If the system has  for instance  2 control inputs and the first one is  just an on off switch  i e  u1    0 1   and the second one can take values  from set     5 0 5   it can be defined as follows     sysStruct Uset 1     0  1   sysStruct Uset 2      5  0  5     4 Multi Parametric Toolbox 151    where the first line corresponds to u  and the second to us  If the system to  be controlled has only one manipulated variable  the cell operator can be  omitted  i e  one could write     sysStruct Uset    0  1     The set of inputs doesn t have to be ordered     4 5 6 8 Mixed Inputs    Mixed discrete and continuous inputs can be modelled by appropriate choice  of sysStruct  Uset  For each continuous input it is necessary to set the corre   sponding entry to   Inf Inf   indicating to MPT that this particular input  variable should be treated as a continuous input  For a system with two ma   nipulated variables  where the first one takes values from a set     2 5 0 3 5   and the 
228. ning the application are placed at the  bottom part of the interface and play the role of a connection establishment  or cancellation  running the experiment  saving the experiment data  clearing  the interface before running a new experiment  Besides the control buttons  there is also the textual field in the bottom part to which it is necessary to  enter the IP address before the connection is established     8 5 1 Settings    The following parameters can be set up using the lower left sector Settings     e Model Scheme     the name of the Simulink file   mdl  that represents the  block diagram model of the experiment  This file must be placed on the  server computer in the specified folder CA RemLab Workspace that was  created during the server installation  The block diagram must keep the  rules written in Section 8 7  The user should be informed about the existing  names of  mdl files that are available    e Model Parameters     the name of the parameter file that is represented by  Matlab  m file  Also this file must be placed on the server computer in the  folder CA RemLab Workspace  Usually it contains the values of constants  and calculations of initial parameters necessary for running the experiment   block diagram model     e Input Desired Value      input value of the block diagram that in the case  of controller represents a desired value of the output value  Because the  real system has limits included in the block diagram it has only sense to  set the desired v
229. nlinear model in a  fixed operating point  by the input output linearization in the actual state   exact linearization  and around a generalized operating point are developed  and verified for the one level and two level system     7 1 Introduction    A plant to be controlled may be modelled and identified in many ways  It is  e g  possible to derive mathematical models of the plant that for a given data  show nice matching but when used for the controller design  the resulting  performance will be pure  In case of inaccurate  or inappropriate mathemati   cal model  the resulting regulators would function only in simulations  That s  why we will be dealing from now with the description of the real plant  estima   tion of its model  identification of its parameters as well as with confrontation  of results achieved in control of the plant with the performance reguired in  the controller design    In the next paragraph  we will show some examples of simple P  PI and  PD controllers for different tanks  configurations  from the simplest one tank    Vladim  r   ilka  Faculty of Electrical Engineering and Information Technology  Slovak University of  Technology in Bratislava  e mail  vladimir zilka  stuba sk    Mikul     Huba  Faculty of Electrical Engineering and Information Technology  Slovak University of  Technology in Bratislava  e mail  mikulas hubaQstuba sk    247    248 Vladim  r   ilka and Mikul     Huba    system  with closed output valves  through one level systems with
230. nnels of uDAQ 28LT plant are going  to be controlled in this section  Simple alternatives to linear I controllers will  be practiced     9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 299       Fig  9 9 Basic electrical diagram of thermo optical plant uDAQ28 LT    9 2 1 Feedforward Control    Tasks     Identify non filtered light channel parameters    Control non filtered light channel using inverse process gain   Analyze the steady state error for various setpoint changes   Measure the I O characteristics of the non filtered light channel     Let us start with getting to know the light channel characteristics  The  non filtered light channel represents a very fast process which can be approx   imated as memoryless plant  In an ideal case static feedforward control with  inverse process gain should be sufficient for such process  Measure one point  of the I O characteristic to obtain the process gain    The basic I O Simulink model  matlabroot  udaq udaq28LT  examples   udaq28LT_iov2 mdl  can be used  As other alternative use the eznum com   mand and choose experiment no 1 which opens up basic I O Simulink model  of the plant  Set the bulb voltage to us   2 5 V and run the experiment for  2s  Put down the steady state value of the light intensity  By default it is  represented by the yellow transient in the light intensity scope  Fig  9 10     The steady state value of the light intensity in this example is approxi   mately ys   20  The process gain 
231. nsidered     e Worst case loss  Lwc   e Average loss  Lavg     2 2 7 Examples of this Problem    1  Identify controlled variables  c   Hy     squaring down      Then use feed   back control to adjust u such that cm   Hym   Cs    2  Find invariants for quadratic optimization problems    3  Obtain estimate of primary variables  c   4    Hy   Problem  Given that 4    Hy find optimal H such that magnitude of    y      Y1   is minimized for the expected d s and n    s     2 2 8 Comments on the Problem    1  The controlled variables are c   Hy and the objective is to find the  non square n  x n  matrix JH  note that n    nu   In general  H is a   full  combination matrix  However  it may also be interesting to consider  control of individual measurements  in which case H is a    selection    matrix  with n  number of columns with single 1 and the rest of columns are zero   mathematically HH    I     2  Minimizing  the magnitude of  the loss L is close to but not quite the same  as minimizing the cost J  In some cases they give identical results in terms  of the optimal H  for example  if we consider the average loss or cost for  given disturbances  because then the same cost function is subtracted    So it seems it is the same for the 2 norm  Frobenius  of M  see below    However  there will be some difference if we consider the worst case loss  or cost     2 Measurements for Control  Optimization and Estimation 57    2 3 Solution to Problem  Preliminaries    The objective is to de
232. nted in the  source file mpt_getInput c  a part of the MPT Toolbox  The controller look up  tables are included in a separate file referenced in this work as mpt_getInput_h  and declared within the function source itself    The block scheme implementing the MPMPC controller loop along with  data acquisition  D A  A D conversion and other functional parts is featured  in Fig  5 6    Fig  5 7 shows multi parametric MPC controller regions plotted in a two  dimensional state space  Controller partitions shown on the image belong  to a controller based on the second order model of the experimental device  and conforming to the example presented here  Prediction horizon here is  70 steps  The region of attraction is divided into 10099 polyhedral regions  with associated control laws  The figure shows partitions without additional  optimization or merging     198 Gergely Takacs et al          Fig  5 8 MPMPC controller input in volts     MPMPC controller action expressed in Volts is plotted against the state  space in two dimensions in Fig  5 8  Note how the control law is essentially  reduced to a switching behaviour  In fact many real and simple vibration  control systems utilize this highly simplified saturated effect    Fig  5 9 shows the plot of the quadratic cost function value J   related to  the polytopic controller regions in state space     5 2 6 Conclusion    This section has been dealing with the implementation of model predictive  control algorithms in the engineering fi
233. nter of the Chebychev Ball is not unique  in general  i e  there  can be multiple solutions  e g  for rectangles     Given a polytope object P  the center and radius of its Chebyshev s ball  can be computed by calling the chebyball function      gt  gt   xc  r    chebyball P   A sample Chebyshev   s ball inscribed in a 2D polytope is shown in Figure 4 2     4 2 3 2 Affine Transformations    Consider a polytope P    x     R    Ax  lt  b  and an affine function f x     Fx  g with F     R    and g     R     F non singular  Then the image of the    108 Michal Kvasnica                xi    Fig  4 2 Illustration of the Chebychev   s ball     polytope P under the function f x  is the polytope Q  Q   Fr  g   Ax  lt b    4 3     To see that Q is indeed a polytope  define y   Fx   g  For invertible F we  get x   Foty    F 1g  Substituting this expression into  y   Ax  lt  b  we get    Q    y    AF  y  lt   b  AF  g     4 4          Y  A b    which is again a polytope in the H representation  y   Ay  lt  b   Note that  dimensions of r and y are the same since F is assumed to be a square   non singular matrix  This  direct  affine transformation of a polytope can by  obtained by MPT using its range function      gt  gt  Q   range P  F  g     Two special cases of affine transformations are scalar scaling and translation   Scaling a polytope P with a scalar a     R is achieved by     gt  gt  Q   alpha P  Translation of P by a vector t     R    is obtained by   gt  O P t    Applying the lin
234. ntrol actually switches  when both controlled variables are below their setpoint  T his is of course due  to the selection of the active controller being determined by the values of the  controller outputs rather than the values of the measurements or setpoints     goog  00          Disturbance             d       Save disturbance    34 Morten Hovd and Selvanathan Sivalingam          I  Flow  Pressure    SIE Disturbance                             A JH l                                   fi L L fi L f  0 200 400 600 800 1000 1200 1400 1600 1800 2000    Fig  1 30 Responses in controlled variables  with anti windup           I T  Flow controller output  Pressure controller output   Input applied H                                              fi fi Ll fi i f f f L  0 200 400 600 800 1000 1200 1400 1600 1800 2000    Fig  1 31 Responses in controller outputs  with anti windup     1 3 Stiction Detection    In process control  valves are commonly used as manipulated variables  Stic   tion in control valves is a common cause for poor control performance  often  causing continuous oscillations in the loop  This assignment will study the  detection of valve stiction  using a few of the available stiction detection meth   ods  Background on stiction detection methods can be found in Sivalingam  and Hovd  2011     A Simulink model is used to simulate a simple control loop with a  possi   bly  sticking valve  A printout of the Simulink model is shown in Fig  1 32   The submodel Intstictio
235. ntroller design may now  be used as well  When the open loop transfer function was in the case of the P   controller design given as 1 T1s the closed loop had the transfer 1   Tis   1    Now  we will design controller to yield the same open loop transfer function  as previously  i e  1 T1s  what yields   1 1 Tins   1 Ti  1    R   v Z      Z    1 5  Tis Fi s  KiTis KiTi T KiTis       Thus the P and J actions will be          T  P     gt    Kin  1  n   Kin    After calculating and testing this tuning we recommend you to experiment  a bit and to track the influence of the changes of P  and J  on the control  performance  You may observe that the achieved dynamics is differnt from the  one possible pulse at saturation that was typical for the P controller design    This soultion represents basic part of the PI controller of the dynamical class  0  it should yet be completed by a prefilter with the time constant Ti      then  the control signal after a setpoint step exponentially increases monotonically  to its new steady state value   Attempts to achieve faster dynamics may be  connected with strong overshooting of the output signal     7 2 2 PI  controller    Improved dynamics for larger setpoint steps without producing windup effect  is possible to achieve by the so called PI  controller that typically has one  interval of the control signal at the saturation limit  This controller is based on  reconstruction of the equivalent input or output disturbances by appropriate  observ
236. nus  form  This could equivalently have been done using the scheme in Fig  1 1   The resulting responses when using the inverted decoupler with anti   windup are shown in Fig  1 22  Comparing to Fig  1 16  we see that the    1 Problems in Anti Windup and Controller Performance Monitoring 21    Output 1  1 5 T             L L L L L fi fi fi  50 100 150 200 250 300 350 400 450 500    Output 2  2 T    o             B    Ue      Ab 4                   L L L L i L L L  0 50 100 150 200 250 300 350 400 450 500    Fig  1 22 Responses with inverted decoupler with anti windup     responses are significantly improved  although far from as good as in the  unconstrained case in Fig  1 14     1 1 8 3 LQG Controller with Integral Action     The LQG controller with integral action and anti windup is implemented as  illustrated in Fig  1 5  The Simulink implementation is shown in Fig  1 23   Note the fast low pass filter used to break the  algebraic loop    in the anti   windup loop of the controller  Due to the order of execution in digital control  systems  this is not required in practice  but significantly simplifies numerical  integration in continuous time simulations  The time constant of these low   pass filters should be significantly shorter than any other dynamics in the  system     but very short time constants may lead to a numerically    stiff     system    When anti windup is included in the LQG controller with integral action   the results in Fig  1 24 are obtained  The resul
237. oaded    plus  operator    gt  gt  Q   Pi   P2    Illustration of Minkowski addition is given in Figure 4 6     4 2 3 7 Pontryagin Difference    The Pontryagin difference  also called set erosion or set dilation  between  two polytopes P   and P   is given by    Pi O Po    a1   21  22     Pi  V2     P3    4 11     In MPT  this operation is implemented by means of the overloaded    minus   operator     112 Michal Kvasnica             i i i i i i  15 i  Ais a    05 o 05 1 15 Ais 1     a  Polytopes Pi and P2  b  Minkowski addition Pi    Po           Fig  4 6 Illustration of Minkowski addition      gt  gt  Q   P1   P2    Important to notice is that  in general  the Pontryagin difference and the  Minkowski sum operations are not dual to each other  i e   P1   P2  P2    P     Graphical interpretation of Pontryagin difference is shown in Figure 4 7              EM i i i i i a i  s 1 5 D 05 1 15 s 1     a  Polytopes P   and P2          5 o 05 1 15     b  Pontryagin difference Pi O P     Fig  4 7 Illustration of Pontryagin difference     4 2 3 8 Set Difference    The set difference between two polytopes P   and 3 is the set    P     P2    x   x     P1         P2    4 12     and is implemented by the overloaded    backslash  operator      gt  gt  Q   P1   P2    4 Multi Parametric Toolbox 113    Note that the set difference of two convex sets can  in general  be non convex   In such a case the output will be an array of polytopes  An example of the  set difference operation is shown in 
238. ocess   Wo is a by product  resulting the logical simplification of matrix operations    The first code line creates a temporary vector  a result of the matrix vector  operation Q11xo while the second finishes the task by evaluating the rest     dsymv   chu   amp order  amp   one Q11  amp order         X0  amp onei  amp zero tempv2  amp onei    WO   ddot   amp order xO  amp onei tempv2  amp onei  1     In case the resulting vector will be Wo  lt  0  the following code portion  calculates the next by product  a vector re used in later code portions     v      RT Qai20   S  5 12     where v denotes the vector result of this operation  and    is an element   wise division  This operation is carried out in two steps  First  a general  matrix matrix multiplication saves the result of RT  s  into a temporary  matrix  Then the expression v is calculated by multiplying the result with  the negative of the current state measurement  and its elements divided by  vector S     if W0   0 1  dgemm  cht chn  amp order  amp order  amp order  amp one         R  amp order  Q21  amp order  amp zero tempm  amp order    dgemv   chn  amp order  amp order  amp mone tempm  amp order      X0  amp onei  amp zero W1  amp onei    dediv  korder W1 Sm vec      Another partial result is calculated  by evaluating a dot product of two  vectors and adding Wo to the result     W2    ddot   amp order vec  amp onei W1  amp onei   WO     where in case W2  gt  0  the perturbation vector can be directly calculated 
239. od for a given H   If we want to compare  analyze  alternative choices for H  for example  al   ternative choices of individual measurements  then the    maximum gain rule     is effective and gives considerable insight  The maximum gain rule has also  been used to find    optimal    H  especially for the case where one wants to  control individual measurements  and Yu and Kariwala have devised efficient  branch and bound methods for solving this problem     2 Measurements for Control  Optimization and Estimation 69    In the    maximum gain rule    one considers the scaled gain matrix G    HG    from u to c  To derive the maximum gain rule  we return to the loss  expression    1  J  27  a       where  z   Ju     us    JI2G  c     cop     c    Cop   H Fd  n    G   HG     Here  c     Copt may be viewed as the    optimal     or expected  variation in  the selected variables  c   Hy  caused by disturbances and measurement  noise  The magnitude of c     Cop   HFd   Hn    is obtained by adding  the magnitude of the contributions from JH F d and Hn     and we assume  in the following that c     Copp   W C where W  is a diagonal matrix for  the expected optimal variation   optimal span   in c and we assume that all  Ile    lt  1 are allowed  e    Copt translates into changes in the inputs  u     opt   by the transformation u   G  c and to a loss through the matrix J Ma We  want  u     Uopt  small  so we want the norm of G   small  More specifically   the largest  worst case  value o
240. oe IE      min      K  max                         20 40 60 80 100 120 140  time s     Fig  9 26 Real experimental results for FIo controller        Prefilter    Disturbance Observer    Fig  9 27 FPrlo controller    9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 313                                                                                                                                                                                                                                                            hh   ro      Taah ee PY    w ly  Temperature 1  Ri ti Saturati DA    Transport  EM Plant  a v F R  Gain1   an 1O Interface Do   rri   1   Transfer Font    gt  gu     le Tisi Step Bici  Y Gain2 Transfer Fcn2   Light    P a intensity  C3         x Mt i  Wy  K Tisi  Fig  9 28 FPrlo controller   Simulink model       Pri MO Yo Setp  e 0 01  Tf 2 3516  K0 17 4675  Td0 5 8065  IAEOmean 22 5849  6 T T T T T       55     4 5 TVOmean 0 00042767          Fig  9 29 Performance portrait     FPrlo controller    9 2 4 Plo and FPIg Controllers    Tasks     Identify the parameters of filtered light channel    Use PIo controller to compensate the delay of the filtered light channel   Tune the controller using a performance portrait    Make a disturbance by a LED voltage step during the experiments with  the filtered light channel     314 Peter Tap  k and Mikul     Huba    Pri MO yi Setp    20 01  Tf 4 2811  K0 14 1525  Td0 6 4865  IAE1mean 29 9608  6 T r T T  
241. of measurement  noise in the OP and PV time series  However  the sharp corners in the plot  are now Clearly identifiable  indicating the presence of stiction     1 Problems in Anti Windup and Controller Performance Monitoring 39       OP           f i L L L i L L L L  7000 7100 7200 7300 7400 7500 7600 7700 7800 7900 8000  Time                   0 L L L L L L L L L  7000 7100 7200 7300 7400 7500 7600 7700 7800 7900 8000  Time    Fig  1 37 OP and PV for data set 2     800 T       600    400    200     200     400     600              800 L L L L L L L L L   100  80  60  40  20 0 20 40 60 80 100       Fig  1 38 The OP to PV cross correlation function for data set 2     The routine bicoherence m returns a negative value for NGI and a posi   tive value for NLI  and therefore nonlinearity has not been detected for this  PV time series either  The routine g1stat m finds no clear indication of PV  being non Gaussian  the probability of false alarm being estimated to 0 8665   None of these routines can therefore detect stiction in the loop     40 Morten Hovd and Selvanathan Sivalingam    0 8       0 6  1    PV     0 2         0 4 4           0 6 1 1 l 1 L   1 5  1  0 5 0 0 5 1 15       Fig  1 39 OP PV plot for data set 2        0 8    0 6    0 4     0 2     PV k 30                 Fig  1 40 OP PV plot for data set 2  with the PV data series shifted 30 samples     1 3 2 3 Data Set 3    The time plots of OP and PV for data set 3 are shown in Fig  1 41  The OP  resembles the sawtooth sh
242. of this workshop  In simple terms  the problem is that there are some initial  states for which there exists a feasible control move at the beginning  e g      gt  gt  x     5  4    gt  gt  u   controller_explicit x     ed  but then the successor state       Ax   Bu becomes infeasible      gt  gt  xp   model A x   model B u    xp       2 0000  3 5000     gt  gt  u   controller explicit xp   MPT GETINPUT  NO REGION FOUND FOR STATE x     2 3 5     160 Michal Kvasnica         To see this graphically  run     gt  gt  x     5  4     gt  gt  simplot controller explicit  struct    x0     x      You will see that the closed loop trajectory leaves the colored area  which  means that constraint satisfaction is not guaranteed for all time for this initial    point    On the other hand  the state x     5  0  belongs to the invariant subset   as shown by the existence of the following closed loop simulation  also shown  on the figure below     gt  gt  x     5  0      gt  gt  simplot controller explicit  struct    x0     x      Closed Loop Trajectory for initial state     5 0           Fig  4 27 Closed loop simulation illustrating that the state x     5  0  belongs to  the invariant subset     To isolate the invariant subset of the given explicit controller  run   gt  gt  inv_controller   mpt_invariantSet controller_explicit     Ok  but what is the difference between the two controllers  Specifically   which part of controller_explicit was NOT invariant  i e  which sub   set of regions of 
243. oices  for c  and H  more exactly by computing the norm  Frobenius norm or max     singular value  of M    J rn  HY     Kariwala and Cao  2009  have    derived efficient branch and bound algorithms for finding the measurement  choice  optimal structured H  that minimize either the norm of M as well  as the scaled gain  c G    Although the computation times for minimizing  the latter are somewhat lower  the benefit is not sufficiently large to justify  using the maximum gain rule  provided we have the necessary information  available for the first method     2 8 Indirect Control and Estimation of Primary Variable    These two problems are very similar  and can be written as a special case of  the loss method  involving the same matrices     2 Measurements for Control  Optimization and Estimation 71    2 8 1 Indirect Control of y     The objective is to keep the primary output y  close to its setpoint  so the  cost function is    J    Yi     Vis     However  y  is not measured  but we have to use some other measurements  y  Thus  we want to achieve indirect control of y  by keeping c   Hy at a  given setpoint    To find the optimal    full    H using the loss method we need four pieces  of information  F G   W a  Wnv  In our case  the optimal sensitivity is F     dy P   dd     dy dd y  It may be obtained by simulations where we keep  y  constant for the various disturbances  Instead of using simulations  we  may write y    Gu   Gad  and then  Hori et al  2005  Ju    GiGi   Jua 
244. ol  action  Pol  ni et al  2008       5 Implementation of MPC Techniques to Real Mechatronic Systems 217    5 3 4 1 Predictive Model    The applied control strategy is based on the knowledge of the internal model   IM  of air path  predicting the change of air flow through the exhaust pipe   and consequently  setting the profile of desired values of the objective function  on the control horizon  In this case we will consider the state space  SS   formulation of the system  therefore it is necessary to express linear local  ARX models in parameter varying realigned SS model     z a py k  1    Aca  p  6  a  p   E    Bea  py  OUa  py  Kk   Ths  a  f   K    Cla  f t a f     5 26     The weighted parameters of a multi ARX models are displayed in matrices  Aa f and Ba f for both subsystems  This is a non minimal SS representation  whose advantage is  that no state observer is needed  The    fuel pulse width  control  is tracking the air mass changing on a prediction horizon from IM of  the air path  by changing the amount of injected fuel mass  Due to tracking  offset elimination  the SS model of the fuel path  5 26   index f   with its  state space vector xf  is written in augmented SS model form to incorporate  the integral action     amp g k   1    Ag Q ig k    By b  Aus  k   5 27   rp k 1   _   Ash  BrP  x5  k     uj k    zi 0 1 Ph       k Auy k     ms  p k      y  y k    DyAug k   5 28     ms r k     Cg Dg   amp  k    Dp Aus  k     The prediction of the air mass  ma  on the p
245. ol Systems Technology 16 1  3 12   Zeman J  Rohal Ilkiv B  2003  Robust min max model predictive control of linear  systems with constraints  IEEE International Conference on Industrial Technology   pp 930     935       224 Gergely Takacs et al    Zhai YJ  Yu DL  2009  Neural network model based automotive engine air fuel ratio  control and robustness evaluation  Engineering Applications of Artificial Intelli   gence  22  171U180   Zhai YJ  Ding WenYu  Hong YuGuo  DLYu  2010  Robust air fuel ratio control with  adaptive DRNN model and AD tuning  Engineering Applications of Artificial In   telligence  23  283 289    5 Implementation of MPC Techniques to Real Mechatronic Systems 225    Comments     Remarks    226 Gergely Takacs et al    Comments     Remarks    5 Implementation of MPC Techniques to Real Mechatronic Systems 227    Comments     Remarks    228 Gergely Takacs et al    Comments     Remarks    Chapter 6  Laboratory Model of Coupled Tanks    Vladimir Zilka and Mikul  s Huba    Abstract This chapter gives introduction into work with frequently used  hydro system of coupled tanks  The chapter explains analytical modelling  for one and two level systems of coupled tanks  including the experimental  identification of system   s parameters and sensor   s calibration     6 1 Introduction    To be able to use their knowledge in solving practical tasks  for graduates it is  important to develope skills in applying control theory related to linear and  non linear systems to rea
246. olbox  The control design was based  on two main input objects     the sysStruct structure  which contains infor   mation about the system dynamics  and the probStruct structure  which  defined parameters of the MPC optimization problem  4 26     Although intuitive and easy to use  the command line interface outlined  in Section 4 5 1 only allows for basic MPC design  In particular  the MPC  problem to be formulated and solved can only be adjusted by changing the  prediction horizon or the penalty matrices in  4 26a   In this section we de   scribe a new addition to the Multi Parametric Toolbox which allows more  advanced MPC setups to be formulated easily and with low human effort    The new framework for advanced model predictive control utilizes the  YALMIP package  which is a versatile modeling language for construction of  generic optimization problems in MATLAB  The design procedure goes as    4 Multi Parametric Toolbox 137    follows  First  given the model and problem structures  MPT formulates the  basic MPC problem  4 26  using YALMIP symbolic decision variables by a  single function call      gt  gt   C  obj  V    mpt_ownmpc sysStruct  proStruct     which returns constraints  4 26c     4 26e  in the variable C and the objective  function  4 26a  in obj formulated using symbolic variables V x and V u   These variables represent the prediction of systems states and inputs through  the finite horizon N stored as cell arrays  i e  V x k  denotes x  1  and  V u k  stand
247. ollers  the input to the plant u  is modified by a nonlinear function that  can be denoted as the saturation function    Uz u gt U2 gt 0  u  t    sat  u t     sat u   qu U  lt u lt U   7 10   U  u lt U   lt 0    In the classical period of control  up to late 60s in the 20th century    the constraints in the control were treated by a huge amount of papers   Then  in the subsequent decades in the main stream of the control theory    7 Constrained PID Control Tasks for Coupled Tanks Control 261    the problem of constraints practically disappeared  Just a limited number  of authors dealing with the anti windup design continued to investigate this  important feature  Today  the problem of constraints is again in the focus  of the research activities and it is hardly possible to give here just a brief  overview of different approaches    For the sake of brevity  we will show here briefly one possible approach  to controlling the coupled tanks combining constrained pole assignment con   trol Huba and Bist  k  1999   Huba  1999   Huba et al  1999   Huba  2001   2005  2006  2010  2011a c  with extended exact linearization method that is  based on transformation of the existing nonlinear system by  7 9  into the  double integrator one and in controlling such double integrator system by the  PD   controller that fully considers the existing control saturation limits    Let us start with considering the double integrator system    dyt   dt     For y  y     w   w being the reference inpu
248. ome way or other  either  by design or by implementation details    A thorough detail is given on all three methods  Although their imple   mentation is connected with the vibration detail  this section may be used as  a guide to create a functional MPC controller for any application  Not only  the on line part of the algorithms is discussed in detail  but the off line part  as well  The approach utilized in this chapter is down to Earth and simple   lacking any sort of over complicated theoretical discussions  Moreover  espe   cially in the case of the QP and MP based implementations  if possible off  the shelf and freely available solutions have been preferred     200 Gergely Takacs et al    5 3 Implementation of Predictive Control of Air Fuel  Ratio in Spark Ignition Engine    5 3 1 Introduction    A run of a spark ignition engine  SI  is highly dependent on the mixture of  the sucked air and injected fuel present in the cylinder  waiting to be ignited  by the spark  Incorrect ratio of this two components may lead to the poor  engine power  ineffective functionality of the catalytic converter resulting in  higher level of emissions polluting the environment and in the extreme case  this can lead to the engine stoppage  Due to this reason it is crucial to keep  the air fuel ratio  AFR  at the stoichiometric level  which means  that both   the air and the fuel are completely combusted  Due to above mentioned rea   sons and all the time tightening emission standards the car p
249. on package ESPRESSO   as well as with the HYSDEL modeling language    The main factor which distinguishes this toolbox from other alternatives  is the big emphasis on efficient formulation of the problems which are being  solved  This means that the toolbox provides implementation of novel control  design and analysis algorithms  but also offers the user an easy way to use  them without the need to be an expert in the respective fields  MPT aims  at providing tools which can be used in the whole chain of the process of  successful control design  It allows users not only to design optimization   based controllers  but also to formally verify that they behave as desired   investigate the behavior of the closed loop system  and to post process the  resulting feedback laws in order to simplify them without loosing prescribed  design properties     4 1 1 Download and Installation    MPT is freely available for download from the project web site at http    control ee ethz ch   mpt   After download  follow the installation instructions and add all MPT s sub    directories to MATLAB path  To start off  check your MPT installation by   running the following command      gt  gt  mpt init    4 Multi Parametric Toolbox 103    which should provide the output similar to this one     looking for available solvers     MPT toolbox 2 6 3 initialized       LP solver  CDD Criss Cross  QP solver  quadprog  MILP solver  GLPKCC  MIQP solver  YALMIP  Vertex enumeration  CDD    Any questions  sugges
250. one should note that there is little additional complexity involved  in also having limited range of actuation of the valve  e g   to the range  1    A simple model of the plant is given as    E     TF   u s    ku d s   1 11     p s  100s F1       20s 1       30 Morten Hovd and Selvanathan Sivalingam    where f is the flowrate  p is the pressure  u is the valve position  and d is  the disturbance  Note that these variables  as always when using transfer  function models  are expressed in deviation variables  and thus both negative  valve positions  pressures and flowrates do make sense        1 2 3 Assignment    1  Model implementation  Implement the a model of the plant in Simulink  The two controllers may  both be given the setpoint zero  The disturbance should be modelled as a  square wave with period 500    2  Controller tuning  Tune each of the PI controllers  without taking saturation or the selector  into account  Any tuning methodology could be used  this should not  be very difficult anyway  since the plant in each of the loops is Strictly  Positive Real   However  completely unrealistic tunings should be avoided   i e   for asymptotically stable plants like in this example  the closed loop  time constant should not be orders of magnitude faster than the open loop  time constant     3  Simulation without anti windup  Implement the resulting PI controllers in Simulink     without accounting  for windup  and simulate with the disturbance active and both controllers  op
251. onses for the  whole scope of liquid   s levels  The obtained information will depend on the  choice of concrete operating point  in which the step will be measured  For  the PI controller design having the best attributes in the most ample areas   it may seem to be useful to choose the operating point approximately in the  middle of the working area    In the surroundings of chosen operating point we will approximate our  non linear system  6 1  by the first order linear model  This will be obtained  by the step response method from step responses measured firstly by setting  up by appropriate input pump voltage the liquid s level approximatelly to the  the middle of the tank hight and here to stabilize it for some time  optimally  few centimeters under the middle  When the liquid s level will be stabilized     7 Constrained PID Control Tasks for Coupled Tanks Control 251    we will switch the pump input to higher voltage by approximately 1V step  and wait again for the liquid   s level to stabilize  it should stabilize few cen   timeters over the middle   From the measured step response we will find out  by constructing tangent at the origin the approximate value of time constant  Ti  and the value of the approximative plant gain K1   Ay Au    So  in a close surroundings of the operating point corresponding to the  input voltage about uj   4V the system may be approximated by linear  transfer function    K      F   s    Tepi    Then  in the previous paragraph mentioned P co
252. ontroler cessent REI ESCRITO R e dhs 302  9 2 3 Filtered Predictive Ig Controller                   308  9 2 44     PIg and FPIp Controllers                0 0 eee 313  9025 Ply ecoucollir   cos REDIMERE SERE 319  9 2 6 Filtered Smith Predictor  FSP                     321    eferem  ed 12lseseedeem quee O ree RR MER C RA PPP PPPSIS 327    List of Contributors    Pavol Bistak   Institute of Control and Industrial Informatics  Faculty of Electrical  Engineering and Information Technology  Slovak University of Technology  in Bratislava  e mail  pavol bistak stuba sk    Jozef Csambal   Institute of Measurement  Automation and Informatics  Faculty of Me   chanical Engineering  Slovak University of Technology in Bratislava  e mail   jozef csambal stuba sk    Marek Honek   Institute of Measurement  Automation and Informatics  Faculty of Me   chanical Engineering  Slovak University of Technology in Bratislava  e mail   marek  honek stuba sk    Morten Hovd  Department of Engineering Cybernetics  Norwegian University of Science  and Technology  Trondheim  Norway  e mail  morten hovd itk ntnu no    Mikul  s Huba   Institute of Control and Industrial Informatics  Faculty of Electrical  Engineering and Information Technology  Slovak University of Technology  in Bratislava  e mail  mikulas hubaAstuba sk    Johannes J  schke  Department of Chemical Engineering  Norwegian University of Science and  Technology  Trondheim  Norway  e mail  jaschke chemeng ntnu no    Matus Kopacka   Institute o
253. or  all possible initial conditions  one would call     gt  gt  ctrl   mpt control sysStruct probStruct  explicit      For the double integrator example and the MPC setup as above  the MPT  toolbox constructed the explicit representation of Uy as a function of x t     134 Michal Kvasnica     cf   4 27   in just 0 9 seconds     generating 50 regions  If  instead  the aim is  to design an on line MPC controller  the calling syntax is     gt  gt  ctrl   mpt_control sysStruct probStruct     online         In both cases the result is stored in the ctrl variable  which represents  an MPC controller object  The object oriented philosophy of the Multi   Parametric Toolbox then allows to process the ctrl object in a number of  ways  The basic one is to ask the controller to provide the optimal value of  the control action uo for a given initial condition x t   In MPT  the controller  object behaves as a function  which allows for the following intuitive syntax      gt  gt  x     4  1     measured state   gt  gt  u   ctrl x     evaluation of the controller    If the ctrl object denotes an explicit MPC controller  the optimal control  action u is calculated by traversing the lookup table  For the example above   the MPT implementation of Algorithm 1 only takes 2 miliseconds to execute    If  on the other hand  the object represents an on line MPC controller  the  optimal control input is obtained by solving  4 26  as an optimization problem   in this case an LP  with x being its initial
254. osed loop  simulation  More interesting is the average execution time of one simulation  step      Exercise 4 16  Probably the best way to understand an explicit MPC con   troller is to visualize it  We just quickly remind that such an controller consists  of several polytopic regions with associated affine feedback laws of the form  u   Kjx  Li    We start by inspecting the controller   s regions     close all  plot controller_explicit     This figure tells us two important properties of the underlying MPC formu   lation  First  we see how many regions there are in total  Quite intuitively   the higher number of regions  the more complex the MPC problem is and  the more computationally demanding is its implementation in real time  But  even more important is the portion of the colored area compared to the white  space surrounding it  Any point from within of the colored patches is a feasible  initial point  i e  one for which there exists a solution satisfying constraints for  the whole prediction horizon N  On the other hand  any point from the white  areas is infeasible  Again  this information is quite important for real time  implementation  as you can easily reject    bad    initial conditions    Let   s verify these statements by running u   controller_explicit  x0   once for x0     4   1  and the other time for x0     4   2   Do the re   sults support our claim about feasibility  What would happen if we use u    controller online x0  instead  Can you give an answer ev
255. owing  FlIo controller tuning     Ko     max K   Ty   e    max T1   9 22     Make several setpoint steps  make a LED voltage step as well when the  system output is settled  Do not forget to keep more time between setpoint  steps when using Io controller  It is useful to make a simulation first to deter   mine setpoint step time interval sufficient to settle the system output between  them  The experiments results are shown inf Figs  9 38  9 39  9 40  Compare  the overshooting for setpoint step and disturbance step  The detailed view  on these transients is shown in Figs  9 41  9 42  9 43  and 9 44    Questions     e What type of plant are PI    and FPIp controllers suitable to control for   e Analyze the amount of overshooting in the experiments   e Which controller performed better in disturbance rejection     9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 319                               PPI  u TV   VSM PPI   TV  2    TI 2  T  1 8r 1 8   1 67 1 6   1 4  1 47 o 1  o 1 2  1 2     i  E  FE  n         l    0 8  0 8 t 1  0 6  0 67 al  0 4  0 47  Q4 4    S  0 2 ANN I   N 2 A  0 5 1 1 5 2 0 5 1 1 5 2      gt  WT      WT    Fig  9 37 Performance portrait of the FPIo controller     e Was there any advantage of using FIo over FPIg     e g  in noise sensitivity     9 2 5 PI  controller    Tasks     e Control the filtered light channel output by PI  controller   e Analyze the control quality for various controller tunings   e Compare results with control per
256. particular identification results of the air  and  fuel paths are shown in Fig  5 17 and Fig  5 18  respectively  The figures show  static characteristics of both engine paths  defining the relative amount of air  and fuel flowing through the engine as a function of throttle valve opening  angle  or the injector opening time  in the case of fuel injectors  at specific  engine revolutions  The step responses of both engine subsystems for various  engine revolutions are depicted  as well    The identified model parameters are situated in Tab  5 2 and 5 3  These are  at the same time the final results of the identification and they used for the  prediction of future states of the system in the controller     5 Implementation of MPC Techniques to Real Mechatronic Systems    211       21 5 T    21        20 57    Throttle valve position  mN  o  T                                                             18 5 l  200 205    210    Time  s      a  Excitation PRBS signal    215       Lambda                 measurement    model  fit 74 61              200 205       210  Time  s     215     b  Response curve of the simulated system to the PRBS excitation    Fig  5 16 ARX identification at a particular working point  air path     212    Gergely Takacs et al       Relative amount of air  mg cylinder                                                      1500 rpm  100 vy 2000 rpm  O 2500 rpm  80      i i  18 21 22 23 24  Throttle valve position  deg    a  Static characteristics of the air 
257. path  15 T T T T  4      TL Mear aP ieme CES  NE SEM lei nn LL  ee UE  10   mi  g  d  A  p  lI  EJ  B  a  3  B  3 i   OPI  13 44mg cylinder    1500rpm      OP2  09 84mg cylinder    1500rpm                 P3  07 12mg cylinder    1500rpm    OP4  12 52mg cylinder    2000rpm      OP5  11 39mg cylinder    2000rpm      OP6  09 41mg cylinder    2000rpm           OP7  10 50mg cylinder    2500rpm        OP8  10 41mg cylinder    2500rpm                  P9  09 17mg cylinder    2500rpm  0 1 1 n n 1 1  0 0 5 1 5 2 2 5 3 3 5  Time  s     Fig  5 17 Results of the air path identification     b  Response curve of the air path in the operating points          5 Implementation of MPC Techniques to Real Mechatronic Systems             O 1500 rpm    D 2000 rpm    O 2500 rpm    Relative amount of fuel  mg cylinder                 5 5 5 6 6 5 v   75 8 8 5 9  Injector opening time  ms      a  Static characteristics of the fuel path                               1 6 T T T T T  14r  12  1 k  0 8L        OP1  1 54g s    1500rpm     l        OP2  1 36g s    1500rpm  0 6         OP3  1 32g s    1500rpm     i            OP4  1 42g s    2000rpm      OP5  1 42g s    2000rpm  0 4         OP6  1 29g s    2000rpm     an OP7  1 12g s    2500rpm  0 2       OP8  1 21g s    2500rpm 1         OP9  1 15g s    2500rpm  0 L L 1 l L  0 1 2 3 4 5    Time  s      b  Response curve of the fuel path in the operating points    Fig  5 18 Results of the fuel path identification    213    Table 5 2 Air path model parameters 
258. pects of Controller Performance  Monitoring  CPM   an area that has seen rapid developments over the last  two decades  CPM techniques are important in particular for engineers work   ing with large scale plants with a large number of control loops  Such plants  are often found in the chemical processing industries     1 1 Anti Windup  Control of a Distillation Column with  Input Constraints    This assignment lets the student apply three different controller design meth   ods to the control of a 2 x 2 distillation column model  Subsequently  the con   troller implementations should be modified to account for input constraints     Morten Hovd  Department of Engineering Cybernetics  Norwegian University of Science and Tech   nology  e mail  morten hovd itk ntnu no    Selvanathan Sivalingam  Department of Engineering Cybernetics  Norwegian University of Science and Tech   nology  e mail  morten hovd itk ntnu no    2 Morten Hovd and Selvanathan Sivalingam    1 1 1 Notation    Consider a linear continuous time state space model given by    t   Ax   Bu  y   Cz   Du       where z is the state vector  u is the input vector  and y is the output vector   and A B C D are matrices of appropriate dimension  The corresponding  transfer function model is given by    G s    C sI     A  B D    The following equivalent shorthand notation is adopted from Skogestad and  Postlethwaite  2005   and will be used when convenient    eo     1 1 2 Some Background Material on Anti windup    In virtually
259. posuni     betal ci   beta12   0   beta2   0   Qmin 0     Qmax q_max1     7 Constrained PID Control Tasks for Coupled Tanks Control 255    w11 0 10    setpoint values for tank 1 level   3 steps  w12 0 20    w13 0 10    Td   0 996   4 dead time   Ks   1 81    plant gain   h10   w11    operating point choise    a   betai  2 sqrt hi0 posun     linearization around operating  point    alfae  0 2    directly given closed loop pole    alfae    exp   1 a Td   Td a     closed loop pole based on dead time  estimate    alfae     1 a Td exp 1 ax Td    Td exp 1 a Td      Kr     a alfae  Ks    P controller gain  Tfil   1 alfae   4 obsever filter time constant    ci    beta1  2x sgrt  h10 posun       tf  Ks    1 c1     inputdelay     Td     plant model around the operating point c   a    Gp    sim C PIireal2 zilka mdl      str datum   num2str floor clock      str datum    strrep str datum  7  yuu                 file name   sprintf    reg_PI1  s     str datum    eval      save       file name       7 3 Linearization around a fixed operating point    Analytical linearization around a fixed operating point shows one of the sim   plest ways of designing controller for the one level system  Linearized model  may be determined directly from the system s equation  6 1   For a chosen  working point and its closest environment  the non linear system will behave  as linear and therefore we can use this as the basic possibility for deriving  linear controllers  e g  the PI one    While making this l
260. prediction model and  possibly an initial state for Kalman filtering or simulation purposes  In this  example the model is loaded from a saved system identification file     load n4s2A   A n4s2 A    B n4s2 B    C n4s2 C   nx length A     X1   1  zeros 1 nx      Penalization for the inputs and states needs to be stated as well  The input  penalization can be determined by direct experimentation with the algorithm   or simply evaluating different linear guadratic controllers in simulation and  determining a good balance between controller performance and aggressive   ness  In this case the input penalty has been found by using an LO controller  with the settings R   le    4 and Q   C  x C  while balancing the input  somewhat above the constraints     R 1e 4   Q C    C     5 2 3 3 Prediction Matrices    It is possible to pass the information to a stand alone function  This custom  function uses the system model  penalty matrices  the constraints  a hori   zon and possibly a system order information  Its output are the properly  formulated prediction matrices and possibly the re formulated constraints      H F G Ac bO Bx Ki Nc    predmodelqp A B C R Q umax nc nx      Now let us begin with examining what such a function may do  in order  to generate the prediction matrices and cost function prediction matrices for  the on line run    As in most vibration damping applications  this implementation assumes  a symmetric constraint on the input     ul  uh      This is followed by calcu
261. put  for the current process measure   ment     1 Provided appropriate scaling of variables is used  the auctioneering control structure  may be a better alternative to using selective control with the selection based on  controller inputs     1 Problems in Anti Windup and Controller Performance Monitoring 29    Flow Pressure  controller Low select controller  mE C WW Disturbance  Flow     Pressure    transmitter transmitter       X       Valve    Fig  1 25 Schematic of simple plant with two controllers and a selector  Note that  the applied control signal is fed back to the controllers     For PI controllers  the simple PI anti windup scheme in Fig  1 1 may be  used     1 2 2 The Control Problem in the Assignment    Consider the small plant depicted in Fig  1 25  In normal operation  the flow  controller should be active  but the pressure controller should take over if  the downstream pressure becomes too high  This is achieved by selecting the  lower of the two controller outputs  and applying that as the valve opening   A downstream disturbance affects both pressure and flow  and can cause the  pressure control to take priority over the flow control    In Fig  1 25  solid arrows indicate process flows  in pipelines   dashed lines  indicate signal transmission  and the dash dotted lines indicate    feedback     from the signal actually applied to the valve back to the controllers  for  avoiding windup  In this assignment we will only study the effects of the  selector  but 
262. r  numerical reasons  or finding improved bounds for cases with constraints on  H  see below     Once we have found an optimal H using any of the Theorems above   we can use the non uniqueness of optimal H to find another H1     DH  with desired property or structure  For example  one can select D such that  G   HG    I  Alternatively  one can specify selected elements in H1  for  example  H        K   In the latter case  write H    H H   and assume  H  is full rank  then H        K     DH   DH   and we find dy   Hy  and K   Hj 1H      Required information    To find the optimal    full    H using the loss method we need four pieces of in   formation  First  for the measurements we need the optimal disturbance sen   sitivity  F  and input sensitivity  GY   These are obtained from the model   Next  we must specify the disturbance magnitudes  W4  and the noise magni   tudes  Wx   The matrix Juu is not needed except when there are structural  constraints  as discussed in the next section    Note that changes  disturbances  in the prices  parameters  in the cost  function do not change the optimal H  based on the assumption that we still  have a quadratic optimization problem with constant weights  However  as  given in  2 22  the setpoint for c needs to be adjusted  c    HF pp and for  this we need for the measurements the optimal price sensitivity  Fp  which  can be obtained from the model     2 6 Structural Constraints on H    In the previous section we considered the normal c
263. rames       a combined solid and wireframe plot cannot be achieved    by a single command  therefore we split it in two steps   opts   struct    wire     1     linewidth     3     plot Q4     y        hold on  plot Q     r     Q3     m     opts   hold off          i fi Ll fi i i i   1  0 8  0 6  04  0 2 0 0 2 04 0 6 0 8 1        04 L y    Fig  4 9 Intersection of polytopes Q3 and Q     Now practice  Plot the intersection of Q  Q2 and Q3   Hint  you can use  amp  in a chain  i e  Q  amp  Q2  amp  Q3     Exercise 4 4  The set difference operation between polytopes P and Q is  defined as  PVO    x  x     P  x         In MPT  this is achieved by using the V operator     D Q3   Q   plot D   g    hold on  plot Q     r     Q3     m     opts   hold off    4 Multi Parametric Toolbox 117    Notice that the set difference between two convex sets is not necessarily con   vex  In fact  the example above illustrates such case and we have D represented  as an array of two polytopes     D  D   Polytope array  2 polytopes in 2D    The number of elements of D can be determined by length D  and its com   ponents can be accessed using standard MATLAB indexing  e g     Di   D 1    D2   D 2    D3   D end     same as D 2     You can also create a polytope array on your own  e g   polyarray    D 1  Q D 2  Q3     Now practice  Plot the set difference between Q and Q3  notice that ordering  makes a difference   How many polytopes define the difference     Exercise 4 5  The Minkowski addition operation
264. rator and P controller will not assure  the necessary quality of control  That   s why we propose to design the robust  controllers having sufficient robustness against influence of disturbances  un   certainties and measurement noise  At the same time  these controllers should  also respect the available system   s limits  Such proposals for one level system  can be found for example Huba  2003   Pan et al  2005   Hal  s  2006   Almu   tairi and Zribi  2006   Zilka et al  2009   Further development of the above   mentioned procedures  as e g  the disturbance decoupling problem of coupled  tanks was studied in Zilka and Halds  2010  and non interacting control of  coupled tanks in Zilka and Hal  s  2011      Acknowledgements The work has been partially supported by the Slovak Grant  Agency grants No  VG 1 0656 09 and VG 1 0369 10  It was also supported by a  grant  No  NIL I 007 d  from Iceland  Liechtenstein and Norway through the EEA  Financial Mechanism and the Norwegian Financial Mechanism   This project is also  co financed from the state budget of the Slovak Republic     References    Almutairi NB  Zribi M  2006  Sliding mode control of coupled tanks  Mechatronics  16 7  427     441   Conte G  Moog C  Perdon A  2007  Algebraic Methods for Nonlinear Control Systems   Theory and Applications  2nd edn  Communications and Control Engineering   Springer Verlag  London   Hal  s M  2006  Quotients of noncommutative polynomials in nonlinear control sys   tems  In  18th European
265. re Description    The beam is made of aluminium marked by the designation EN AW 1050A   Its dimensions are 550x40x3 mm  The four piezoelectric patches bonded to  the beam surface are identical  of the make MIDE QP16  Wafers marked with  PZT1 2 in Fig  5 1 are connected counter phase and are used in actuator  mode for control  The rest of the patches are short circuited and are not  utilized in the upcoming implementation examples         Capacitive LASER CPU LASER  Mounting proximity sensor and filtering Triangulation  base FEAR  and clamp Control  PZT 1 amp 2    xPC Host    Fig  5 1 Simplified schematics of the control and measuring chain applied to the  vibrating clamped cantilever beam     Piezoelectric actuators are connected to 20V  V gain MID   EL 1225 power  amplifiers  which in turn receive low level analogue voltage input from a cable  terminal fed to a high speed National Instruments PCI 6030E measuring  card  This measuring card is a part of a computer running Matlab xPC  Target real time control environment  Development of the control algorithms  and measuring tasks is carried out using a host computer running Matlab  Simulink  and is connected to the target computer via Ethernet    Beam tip deflection is measured using a KEYENCE LK   G 82 industrial  LASER triangulation system  indicated as  Laser triangulation  on the figure   Digital low band pass filtering and signal processing is realized in a propri   etary unit  which outputs an analogue voltage signal to t
266. rediction horizon  JV  is solely  dependent on the throttle position   tr  and is computed as    Malk    Tuld ra k    246  1   k     1   5 29     where the x  denotes the state space vector of the air path    Due to the unprecise modeling  IM strategy   biased predictions of the air  mass future trajectory and consequently biased fuel mass might occur  This  error can be compensated by the term L mp k      ms     k   in the fuel mass  prediction equation  m     218 Gergely Takacs et al    my p k    THOE    Oz  Ask 1   E    L my k      ms s k    The matrices of free response Ia  I s and forced response Na  Qf are  computed from models  5 26  and  5 27   respectively  Maciejowski  2000     Since there is only A k  measurable in equation  5 15   the value of ma k   needs to be substituted using IM of the air path  then  l Msalk     iri Um XE   5 31        The estimate p k  is used to compensate for possible bias errors of pre   dicted m p k  in  5 30      5 3 4 2 Cost Function     The main part of a cost function is a sum of deviations of predicted outputs  from a set point  i e  a weight of a future control deviations  Its another  elements are a penalization of control increments r  and a p penalizing a  deviation between a predicted and desired end state    To eliminate a the steady state control error  the criterion  5 32  is defined  through the control increments  That guarantees in a steady state  that Jx    0 also for the system with no integration properties  what is th
267. ries relative to each other  Comment on the  result                                                                                                                                                              Outi i  d Vary P  s   Vonka  gt    ues  Integrator To Workspace  Intstiction  procoum       4                     34  To Workspaced onou    00     Sawtooth signal  PID j   O  contout  1  To Workspace   rence             Fig  1 32 Simulink model for simulating simple loop with sticky valve    36 Morten Hovd and Selvanathan Sivalingam                                                                                                                                                 intinput  Out  To Workspace2  1  C1  CO  gt  c P  velocity  Ini  Integrator To Workspace  p  Sign  MATLAB     Function  Fs MATLAB Fen  Fs Fe  Fc      P posinput     dout  To Workspace3             To Workspace1    Fig  1 33 Simulink submodel for calculating friction force and valve velocity    4  Use glstat m  from the hosa toolbox  and or bicoherence m to detect  stiction  Comment on the result     1 3 2 Solution    The data series contain an initial setpoint change  from 0 to 1   It may  therefore be advisable to select parts of the data series after the PV has  come close to the setpoint  The length of the selected data series should  contain multiple oscillations  You may also use the Matlab function detrend  to remove any linear trends in the data     1 3 2 1 Data Set 1    The time plots of OP an
268. rive the solution to the above problem  It has been  previously been known as the    exact local method     but we will here call it  the loss method  However  first we need some preliminaries    2 3 1 Expression for Uopt d     We want to find the optimal input u for a given disturbance d  Expanding  the gradient J    around the nominal point  u   d      0 0  gives    Ju  I   Jinu t Jiad   M 4  J53 H  Ww    where J    J  u  d     0 because the nominal point is assumed to be  optimal  To remain optimal  u   Uop  d   we must have J    0 and we  derive   topt      J aI uad  2 6     where we have dropped the superscript    either because we consider small  deviations or because we assume that the problem is truly quadratic      2 3 2 Expression for J around Uop  d     Consider a given disturbance d  Then expanding the cost J around a    moving     Uopt d  gives  1  J u  d    J uopt d   d    Ju  u    opt    zlu     uopt   J uu u     uopt   2 7     Jopt d   0    Here J     0  since we are expanding around an optimal point   so we get  the following expression for the loss    1 1  L u d    J u  d      Jon d    5272   5 elle  2 8     where  z   JY   u     uopr d    2 9     58 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke    2 3 3 Expression for J  around Moving Uop  d     A similar expansion  but now of the gradient gives    Ju   Ju  opt  4 Juu u     Uopt    Juu u     Uopt   2 10            0  Combining this with  2 9  gives z   J   expression    for the loss     2J u
269. rmulas  see earlier    Step 2  Find the optimal H by solving the convex optimization in  2 26   with Y   X opt and the constraint HG    G1      4 Loss method      step 1A  Yall    Y1  X      step 1B     u s vl svd Y1      Yalli   Yall v    r1 ci  size Yall     r2 c2  size Y1     ny r2    G1 Yalli 1 ny 1 ny    Gy Yalli ny i ri 1 ny     Xopt   Yalli ny ti ri ny i c1        step 2    4Hopt    pinv Xopt Xopt     Gy      Zanalytical expression   Hopt  loss  soc_avg Gy  Xopt      D Hopt Gy inv  G1      Hoptloss inv D   Hopt     74 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke    Comments    e Alternatively in step 2  provided Y Y  has full rank  we may use the  analytical expression H7    Y Y 7  1G  in  2 25  and then    rescale  H  to get a new H     DH which satisfies H1G    G1  which gives H      Gi HG     H  If Y Y  does not have full tank one may use some pseudo  inverse  similar to PCR   This adds degrees of freedom to the method  It  has not been tested out but some preliminary results are promising    e The method seems a bit similar to PLS in that we use the data for y  to  affect the x data  we get Xo  from X by using the SVD of Y i  and also  use G    when minimizing H X opt     2 9 2 1 Modification for Case with Too Few Experiments  e g   Spectroscopic Data     If we start with a model  then the data matrix Y    FW 4  W ns  is a    fat     matrix  this is clear since the noise magnitude matrix W ny is a square matrix   usually diagonal   Thus  there exis
270. roducers are  improving the control of the air fuel ratio    Traditional control of air fuel ratio is based on a feedforward control using  predefined tables determining how much fuel has to be injected into a cylin   der  based on the information from the mass air flow meter  This fuel amount  is subsequently corrected using the information from the lambda probe  so  the stoichiometric mixture can be reached  Due to a lambda probe position   at the engine exhaust  a delay arises  causing an improper feedback cor   rection at the unstable engine regimes  like acceleration  or deceleration  On  the other side  this kind of control guarantees stability and robustness at all  conditions and therefore is still preferred by car producers  despite its disad   vantages in control    The academic field have started to publish other kinds of air fuel control   mostly model based ones  The model based approaches are bringing good  quality of control  but are also more sensitive to the model precision and is   sues with stability and robustness appear  A survey through popular  mean  value engine modeling  is described in Bengtsson et al  2007   This analytical  way of engine modeling is very clear  but requires exact knowledge of the sys   tem and the model error has to be taken into account explicitly  Other ways  of a model acquisition are based on the experimental identification  black box  modeling   Works of Zhai et al  2010   Zhai and Yu  2009  and Hou  2007   are specialized in 
271. rs  in the absence of saturation     16 Morten Hovd and Selvanathan Sivalingam    Output 1       2 T          L L L L L L L L  0 50 100 150 200 250 300 350 400 450 500    Output 2  2 T               och P  LL          4 d k    map           2 L L L i L i L L L  0 50 100 150 200 250 300 350 400 450 500       Fig  1 13 Responses with PI controllers  with saturation in the inputs     Output 1  2 T             L L L L L L L  0 50 100 150 200 250 300 350 400 450 500    Output 2  2 T                L L L L L L L  0 50 100 150 200 250 300 350 400 450 500    Fig  1 14 Responses with decoupler  in the absence of saturation     this case  remains stable     although the responses leave the window displayed  in the figure    The corresponding response with the inverted decoupler are shown in  Fig  1 16  We see that the performance is much better than with the stan   dard decoupler  although there is still significant interactions between the  outputs  These responses still suffer from the absence of anti windup for the  PI controllers used for the individual loops     1 Problems in Anti Windup and Controller Performance Monitoring                                              17    Output 1  2 T T T T  0   2   P   el   8 L L L L L L L L L  0 50 100 150 200 250 300 350 400 450 500  Output 2  2 T T T T  aL O m 4  ims   ac 2l   A L L L L L L L L L  0 50 100 150 200 250 300 350 400 450 500  Fig  1 15 Responses with the standard decoupler  with saturation in the inputs        Output 1       2
272. ruct xmax     u   ctrl  0  12 5    u    NaN    Here  the NaN output indicates that the MPC problem was infeasible for  a given initial condition  In fact  the second element of z 0  violates the  second state constraint      0  12 5   lt   sysStruct umax    3  Plot the closed loop evolution of system states and control inputs for 10  steps  starting from the initial condition z 0      7      closed loop simulation   x     5   10     initial state    X  xX       store for closed loop states  U        store for closed loop inputs  for k   1 5  u   ctrl x     obtain optimal control action  x   mpt simSys sysStruct  x  u   4 simulate the system  X    X  x    WU ul   X   xX          plot the results    164 Michal Kvasnica    tx   O size X  1  1   figure  plot tx  X    tu   O size U  1  1   figure  stairs tu  U      Solution 4 14  for Exercise 4 14   By enlarging the input penalty  the  regulation process is slowed down  i e  it takes longer for the states to reach the  zero levels  Conversely  by enlarging the probStruct Q penalty  the controller  will react more aggressively     Solution 4 15  for Exercise 4 15      clear      prediction sysStruct for the double integrator  sysStruct A    1  1  0  1      sysStruct B    1  0 5    sysStruct C    1 0    sysStruct D   0      4 constraints  sysStruct umin    1   sysStruct umax   1   sysStruct xmin     5   5    sysStruct xmax  5  5        objective function  probStruct N   5   probStruct norm   2   probStruct Q   eye 2    probStruct R 
273. ructor returns a polytope object which can be processed in  multiple ways  Let us start by simple plots     figure  plot TH     r         figure  plot TV     g                 Fig  4 1 Plot of polytopes TH  left  and TV  right      The output of these commands is shown in Figure 4 1  It appears that the  two polytopes are equal  But how to check this in an automated fashion   Easily  use the standard equivalence    MATLAB operator     ans      1 See help polytope for more information     4 Multi Parametric Toolbox 105    1    Other supported operators include P  lt   Q  which checks whether the poly   tope P is a subset of Q  and P  gt   Q which checks whether P is a superset of  Q    Another frequent operation is to check whether a given point is contained  in the polytope  The isinside function provides a YES NO answer to this  question     x    0 5  0 5       is this point contained in our first triangle   isinside TH  x    ans      1    of course  the function also works for V polytopes   isinside TV  x   ans        now try a point outside the triangle     x    10  10    isinside TV  x   ans     0    Regardless of whether the polytope was constructed using inequalities  or vertices  it is always possible to extract both the H  as well as the V   representation  To compute the extremal vertices of a given polytope  use  the extreme function  see also help polytope extreme      E   extreme TH     ans    0 1   1 0    1 0    To extract the H representation  use the double com
274. s    The C program is contained within this S Function  which has been created  using the S Function Builder  In addition to the specified parameters includ   ing their data type  input and output ports are declared  Here the input is the  estimated state  and output the scalar controller variable  Discrete sampling    190 Gergely Takacs et al                                                                                           Estimated    PCI 6030E  Defl  stately og Kalman eflection lNational Instr  Filter  Analog Input  Kalman Filter LASER PCI 6030E AD  Deflection  gm File Scope  Id  2  TET  xPC Target Data Logginc  TET  1 PCI 6030E     lNational Instr  I  x0 enrmpc z nput Analog Output                     iterp Unit Delay amplifier PCI 6030E DA    Compensation       NRMPC  Colntroller    Fig  5 5 Block scheme of the NRMPC controller in Simulink  for the active vibration  cancellation application    time depends on the application  The NRMPC block provides voltage output  directly  therefore have to be compensated by the amplifier gain     5 2 4 9 Custom C functions    In addition to the main C code and BLAS functions  there are two additional  custom C functions  One performs element wise division of two vectors  while  the other one is an algorithm specific operation  scaling the elements of a  vector by a scalar value and subtracting it from 1  Both of these functions  have to be declared similarly to the BLAS routines as externals  Function  declarations are as fol
275. s   Some type of scaling will then often be necessary   in order to compare different types of physical quantities  e g   comparing  flowrates and pressures     e If the controllers contain integral action  a severe problem that is similar  to    reset windup    can occur unless special precautions are taken  The con   trollers that are not selected  should be reset  for normal PID controller  this is done by adjusting the value of the controller integral  such that for  the present controller measurement  the presently selected manipulated  variable value is obtained  Commonly used terms for this type of function   ality are    putting the inactive controllers in tracking mode    or    using a  feedback relay   This functionality should be implemented with some care   as faulty implementations which permanently lock the inactive controllers  are known to have been used  On a digital control system  the controllers  should do the following for each sample interval     1  Read in the process measurement    2  Calculate new controller output    3  The selector now selects the controller output to be implemented on the  manipulated variable    4  The controllers read in the implemented manipulated variable value    5  If the implemented manipulated variable value is different from the con   troller output  the internal variables in the controller  typically the integral  value  should be adjusted to obtain the currently implemented manipu   lated variable value as controller out
276. s  The problem setup   creating prediction and cost prediction matrices is carried out in the Mat   lab scripting environment  The final problem parameters are passed onto the  Simulink interface of the qpOASES solver    Stability in the traditional QPMPC formulation is guaranteed through  suitably formulated state feedback and terminal cost function matrices  The  deployment of dual mode predictions is the part of the formulation as well  the  first mode considers n  free control moves  while the second mode assumes the  LQ control law  Chen and Allg  ver  1998  Mayne et al  2000a   Feasibility of  process constraints is ensured beyond the prediction horizon by the inclusion  of a constraint checking horizon    First let us begin with the setup of the problem  For this  the code shall  be implemented in the Matlab m script language     5 2 3 2 Setup    First it is required to specify certain parameters for the QP controller  Some  of these parameters are  the sampling period T s  if it is an off line simulation  a stop time is required as well  and it is also essential to state the prediction  horizon nc  In case symmetric bounds on the input are assumed  the con   straints are set using umaz  This is basically the polarization voltage of the  piezoelectric transducers     Ts 0 01   T 0 5  nc 70   run T Ts     178 Gergely Takacs et al    umax   120     where run is the runtime in case an off line simulation is needed    In the next step  it is required to load and specify a 
277. s 2 1 and 2 4 do give the nullspace method as a special case    Comment  In general  with measurement noise included or with few mea   surements  so ny  lt  Nu   Na   it is not possible to make HY zero     Explicit Expression for H for Nullspace Method    The following explicit expression applies for H  Alstad and Skogestad  2007      H    J uu Jua   G   2 29     Proof  Here is a proof which is much simpler than that given in  Alstad and  Skogestad  2007   Want to find c   Hy with zero loss     68 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke    1  Measurement relationship  y   eu H   Inverting this     H    G  ly  2 30   2  Optimality condition  NCO    Ju  0  2 31     3  First order expansion of gradient     Ju   Fut Teste Had    Fou Fe      where we use J      0     4   2 30  and  2 31  then give   Juu JualG  y   0 and it follows that  H J   Jual G       O       2 7 2 No Disturbances    The case with no disturbances has limited practical significance  but is nev   ertheless and interesting limiting cases    We assume there are no disturbances  W 4   0  and we scale the measure   ments y so that they all have unity measurement noise  W    y   I  From the  analytical expression  2 25   we then have that an optimal solution is    HT   G     2 32     This gives the important insight that we prefer sensitive measurements     2 7 3 An Approximate Analysis Method for the  General Case     Maximum Gain Rule       The maximum gain rule is an approximate analysis meth
278. s added to  the control setup  an explicit MPC controller can be calculated by ctrl    mpt ownmpc sysStruct  probStruct  C  obj  V  as a lookup table  Re   gions of the table and a PWA representation of the optimal feedback law are  depicted in Figure 4 22    Notice that the implies operator only works one way  i e  if x t  is in the  box delimited by Ha t      K  then    0 5     uo     0 5 will hold  To restrict the  control action to stay within of these limits if and only if x t  is in the box   the iff operator can be used      gt  gt  C   C    iff  H V x 1  lt  K  0 5 lt  V uf 1  lt  0 5      The lookup table corresponding to such a constraint modification is visualized  in Figure 4 23     Controller partition with 111 regions  Value of the control action U  over 111 regions           5  lt A  3  2  1 0 1 2 3 4 5     a  Regions of the lookup table con   b  PWA function uo x t   Notice   sisting of 111 regions  that the control action stays within  the interval     0 5  0 5  if    1  lt  x t   lt   1     Fig  4 22 Visualization of the lookup table for the control setup with the one way  logic implication constraint     1  lt  a t   lt  1   gt      0 5     u  lt  0 5      4 Multi Parametric Toolbox 141    Controller partition with 115 regions  Value of the control action U  over 115 regions          1 2 3 4 5   a  Regions of the lookup table con   b  PWA function uo x t   Notice  sisting of 115 regions  that the control action stays within  the interval     0 5  0 5  if an
279. s for u        for some index k    Subsequently  the user can modify the MPC problem by adding or custom  constraints and or by changing the objective function  To illustrate this con   cept  consider again the double integrator example of the previous section   The closed loop profile of control actions shown in the lower left of Figure 4 20  reveals an abrupt change of the control signal from u     0 8 to u     0 at time  instant t   2  Such a large change can be mitigated  for instance  by adding a  constraint which only allows the control signal to change by a certain quantity   say by 0 5  from step to step  This can be achieved by adding the constraints     0 5      uk     ug441   lt  0 5 to the MPC setup  4 26   In MPT  this is achieved  by using a standard YALMIP syntax      gt  gt  C   C     0 5  lt   V u k    V ufk 1   lt   0 5     with k   1  N  More examples of constraint modification are presented in  the seguel    Once completed  modified constraints and performance objective are passed  back to MPT  which converts them into a valid controller object      gt  gt  ctrl   mpt ownmpc sysStruct  probStruct  C  obj  V  type     If the object should represent an on line MPC controller  then type     online      If type    explicit     then an explicit representation of the solution to the  optimization problem represented by constraints C and objective obj is pre   computed for all possible initial conditions and stored as a lookup table  In  both cases the ctr1 varia
280. s have been estimated from the data  acquired from the exhaust gas oxygen sensor and an air flow sensor  The  identification has been designed so  that the dynamics of the air path and  fuel path stayed uncoupled  Dynamics of both paths were measured indi   rectly    The first experiment started at the stoichiometric value of A4 in the opera   tion point     To excite the air path dynamics  the throttle valve position was  oscillating around its steady position according to a pseudo random binary  signal  PRBS  Fig  5 16   while the fuel injectors were delivering constant fuel  mass Mf  e  The change in Aa value has been recorded  During the experiment  the engine had been braked at constant revolutions    The PRBS signal is a signal changing its value binary  that means from one  level to another with a pseudo randomly changing period  Fig  16 a    This  period has to be chosen with respect to the identified system so  that for  even smallest change in PRBS a clear system response can be noticed  This  condition has to be ensured  to excite the entire system dynamics and con   sequently to perform a relevant system identification  The Fig  16 b  shows  an example of a correctly identified system with a good fit  compared to the  original data  system output      The identification of the fuel path dynamics has been done similarly  but with  the fixed throttle valve delivering a constant air mass Ma e  The PRBS is vary   ing the fuel injectors    opening time  In both experim
281. s valve12         266 Vladim  r   ilka and Mikul     Huba  load        basics pumpl      T   0 25     sampling period    S1 0 001  4 tank area  posun   posun2    offset 2    mic 0 12  m2c 0 12   beta1 0 beta12 b12 beta2 c2    valves flow coeff     Qimin 0   Qimax q  maxi     w11 0 05    w12 0 10    w13 0 05      setpoint values for tank 2 level   3 steps   D 0 996      considered dead time   c 1    alfae  0 321  c D       closed loop pole choice c gt 1 is used for PID2 controller  tuning    Tfil  1 alfae    Tfd Tfi1 10    4 Time constants for Disturbance Observer filter and derivative  filter    alfal alfae alfa2 alfal     tuning for controller with real poles    sim     PD2_REAL_zilka mdl         str datum   num2str floor clock       str datum    strrep str datum   j               file name   sprintf    reg_PD2  s     str datum    eval      save       file name       Finally  also PD2 algorithm  PD2 m      function out   PD2 dr yr w him      4 constrained pole assignment controller for double integrator  plant     dr   dh2 dt   estimated according to the first state equation    7 Constrained PID Control Tasks for Coupled Tanks Control 267      yr   h2   measured level in tank 2   4 w   reference value for tank 2   4 him hi   measured level in tank 1    global alfai alfa2 Qimin Qimax mic m2c betal beta12 beta2 posun  S1     alfai  alfa2   closed loop poles     Qimin Qimax   limit values for the pump input    4 betal betal2 beta2   valve coefficients  just betal   beta12  requ
282. sal so it can be easily modified to create  an user interface for remote control of other real plants  This has been suc   cessfully tested for hydraulic plant  magnetic levitation system and rotational  pendulum     8 Remote Laboratory Software Module for Thermo Optical Plant 287    Comments     Remarks    288 Pavol Bist  k    Comments     Remarks    8 Remote Laboratory Software Module for Thermo Optical Plant 289    Comments     Remarks    290 Pavol Bist  k    Comments     Remarks    Chapter 9    Constrained PID control  Tasks for Controlling the Thermo Optical  Plant    Peter Tap  k and Mikul  s Huba    Abstract Tuning of simple controllers respecting input constraints will be  considered in this chapter and verified by controlling simple physical device  of thermo optical plant  The chapter starts with short user s manual and  installation guide to the uDAQ28 LT device which will be used as a real  plant to apply the control on  In the introduction  several fundamental con   trollers of the Dynamical class 0  DCO  will be considered that avoid control  saturation by guaranteeing monotonic transients among steady states at the  controller output  Processes of the DCO are typically met in situations  where  the dynamics of transients may be neglected  i e  it is not connected with a  reasonable energy accumulation  In such cases  the ideal control response  following a setpoint step may also converge to step function  not having a  saturation phase   Controllers of the DCO 
283. se it to derive a simplified analytical solution     64 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke    Theorem 2 3  Simplified analytical solution   Under the assumption  that Y Y is full rank  another analytical solution for the problem in  2 23   is   H    VY   G   2 25   Proof  This follows trivially from Theorem 2 2  since if HT is a solution then   a   so is HT   H7 D and we simply select D    GY  YY7  1G   1JV     Ji  Gv  YYT  1G   which is a ne x ne matrix  D       Note that the analytical expressions in Theorems 2 2 and 2 3 require YY   to be full rank  This implies that they generally do not apply to the case with  no measurement error  Wny   0  but otherwise they apply for any number  of measurements  One exception  but not so common in practice   when the  analytical expressions for H do apply also for WY   0  is when ny  lt  na   because YY    then remains full rank     Corollary 2 1  Important insight   Theorem 2 3 gives the very important  insight that Juu is not needed for finding the optimal H  provided we have  the normal case where H can be any ne x ny matrix    This means that in  2 21  we can replace I  by any non singular matriz   and still get an optimal H  This can greatly simplify practical calculations   because Juu may be difficult to obtain numerically because it involves the  second derivative  On the other hand  we found that F  which enters in Y   is  relatively straightforward to obtain numerically  Although Juu is not needed  
284. second one is continuous  one would set     sysStruct Uset 1   sysStruct Uset 2       2 5  0  3 5     Inf Inf     4 5 6 9 Text Labels    State  input and output variables can be assigned a text label which overrides  the default axis labels in trajectory and partition plotting     i  u  and yi   respectively   To assign a text label  set the following fields of the system  structure  e g  as follows     sysStruct xlabels       position        speed       sysStruct ulabels     force      sysStruct ylabels       position        speed         Each field is an array of strings corresponding to a given variable  If the user  does not define any  or some  labels  they will be replaced by default strings   xi  u and yi   The strings are used once polyhedral partition of the explicit  controller  or closed loop  open loop  trajectories are visualized     4 5 7 Problem Structure probStruct    Problem structure probStruct is a structure which states an optimization  problem to be solved by MPT     152 Michal Kvasnica    4 5 7 1 Quadratic Cost Problems    In case of a performance index based on quadratic forms  the optimal control  problem takes the following form     N 1    min z N T Pyz N    u k   Ru k    z k T Ox k   k 0    z k  1    fayn x k   u k   w k    Umin  lt  u k   lt  Umax   Amin S ulk      u k     1      Aumax  Umin  lt  Gayn x k   u k    lt  Ymax  x N      Tia    If the problem is formulated for a fixed prediction horizon N  we refer to  it as to Constrained Finite Time Op
285. sets     Exercise 4 8  Given an autonomous linear discrete time system x k   1     Ax k   the set of initial conditions z 0      X  and a target region X  the  following question is of imminent importance when investigating safety  will  the system states hit the target region in N steps  We will employ the MPT  polytope library to give a yes no answer to such a question by computing  forward reachable sets   The set of states x k   1  which are reachable  in one time step  from  x k      Xy is given by  Xk 1    Ax   rc Xx   4 16     When X  is an H polytope given by X     x   Ma  lt  L   Xy41 is represented  Xp    x   MA  lt  L   4 17     In MPT  given a polytope Xk  the one step reachable set Xk1 is easily com   puted by applying the affine matrix transformation    Xk1   A Xk    120 Michal Kvasnica    Assume the following input data     A    0 5   0 75  0 75  0 5     Xi   unitbox 2     3  0     unit box centered at  3  0    Xf   O 5 unitbox 2    4 box with sides of     0 5   4 centered at  0  0     N   10  Now answer the following questions     1  Will the system states  starting from Xi  hit the target region in N steps   2  If no  by how much would N need to be increased   3  Plot the initial set  the terminal region and the reachable sets     Hints     e Apply  4 17  in a loop for k   1 N starting with X1   X    e Use a growing array to store the intermediate results  e g   R   polytope   for k   1 N    compute polytope P  R    R P     add P at the end of the array  end 
286. sign  John Wiley  amp  Sons Ltd  Chichester  England   Wade HL  1997  Inverted decoupling     a neglected technique  ISA Transactions 36 3     10    1 Problems in Anti Windup and Controller Performance Monitoring    Comments     Remarks    49    50 Morten Hovd and Selvanathan Sivalingam    Comments     Remarks    1 Problems in Anti Windup and Controller Performance Monitoring    Comments     Remarks    51    52 Morten Hovd and Selvanathan Sivalingam    Comments     Remarks    Chapter 2    Optimal Use of Measurements for  Control  Optimization and Estimation  using the Loss Method  Summary of  Existing Results and Some New    Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke    Abstract The objective of this chapter is to study the optimal use of mea   surements and measurements combinations  c   Hy in optimization and  estimation based on the loss method     2 1 Introduction    In this paper we consider a  steady state  unconstrained quadratic optimiza   tion problem with linear measurement relationships  The main objective is  to find a linear measurement combination  c   Hy  such that control of  these indirectly leads to close to optimal operation with a small loss L  in  spite of unknown disturbances  d  and measurement noise  error   n     If the  original optimization problem is constrained  then we assume that any ac   tive constraints are kept constant  controlled  and we consider the lower   dimensional unconstrained subspace  Depending on the disturbance
287. slava     NTNU Trondheim  pp  48 53    4 Multi Parametric Toolbox 167    Comments     Remarks    168 Michal Kvasnica    Comments     Remarks    4 Multi Parametric Toolbox 169    Comments     Remarks    170 Michal Kvasnica    Comments     Remarks    Chapter 5    Implementation of MPC Techniques to  Real Mechatronic Systems    Gergely Takacs and Tom  s Pol  ni and Boris Rohal    Ikiv and Peter  Simon  i   and Marek Honek and Mat     Kopa  ka and Jozef Csamb  l and  Slavom  r Wojnar    Abstract This chapter is focused on the implementation details of model pre   dictive control for mechatronic systems with fast dynamics  From the very    Gergely Tak  cs   Institute of Measurement  Automation and Informatics  Faculty of Me   chanical Engineering  Slovak University of Technology in Bratislava  e mail   gergely takacsAstuba sk    Tom     Pol  ni  Institute of Measurement  Automation and Informatics  Faculty of Mechanical Engi   neering  Slovak University of Technology in Bratislava  e mail  tomas poloniAstuba sk    Boris Rohal  Ilkiv   Institute of Measurement  Automation and Informatics  Faculty of Me   chanical Engineering  Slovak University of Technology in Bratislava  e mail   boris rohal ilkiv stuba sk   Peter   imon  i     Institute of Measurement  Automation and Informatics  Faculty of Me   chanical Engineering  Slovak University of Technology in Bratislava  e mail   peter simoncicQstuba sk    Marek Honek  Institute of Measurement  Automation and Informatics  Faculty of Mech
288. so possible to use optimal merging based on boolean minimization     ctrl simple   mpt simplify ctrl     optimal        Note  however  that the optimal merging can be prohibitive for dimensions  above 2 due to an exponential complexity of the merging procedure Geyer   2005   See clipping method  Kvasnica et al  2011a  in Textbook and ap   proach based on separation functions  Kvasnica et al  2011b  in Preprints  for alternative ways with better convergence properties and larger reduction  ratio     4 5 6 System Structure sysStruct    LTI dynamics can be captured by the following linear relations     x k  1    Aa k    Bulk   4 28a   y k    Ca k    Du k   4 28b     where x k      R   is the state vector at time instance k  z k   1  denotes  the state vector at time k   1  u k      R     and y k      R v are values of the  control input and system output  respectively  A  B  C and D are matrices of  appropriate dimensions  i e  A is a nz x n  matrix  dimension of B is n  x Nu   C isa ny x nz and Dany x n  matrix    Dynamical matrices are stored in the following fields of the system struc   ture     sysStruct A  sysStruct B  sysStruct C  sysStruct D    ool  Jawe    Example 4 5  Assume a double integrator dynamics sampled at 1 second     z k 1    i l l bos  u k   4 292     P k i a k    H ui   4 29b     In MPT  the above described system can be defined as follows     148 Michal Kvasnica    sysStruct A    1 1  0 1    sysStruct B    1  0 5    sysStruct C    1 0  0 1    sysStruct D   
289. software  prototyping interface    The computationally efficient NRMPC formulation with guaranteed stabil   ity and feasibility of constraints has been first introduced by Kouvaritakis et al   2000   In this approach the on line optimization task is performed through  the Newton Raphson root search algorithm  Although this is a sub optimal  approach  its application to vibration suppression systems is attractive     184 Gergely Takacs et al    Optimality levels may be enhanced by extending NRMPC by a simple  explicit additional optimization  as introduced by Kouvaritakis et al  2002    The further development of NRMPC introduced by Cannon and Kouvari   takis  2005  proves to be essential for systems with a significant asymmetry  in actuator capabilities and deformation range   The optimization of predic   tion dynamics formulated by Cannon and Kouvaritakis  2005  recovers the  maximal possible ellipsoidal region of attraction    The algorithm described by Kouvaritakis et al  2000   Kouvaritakis et al   2002  and Cannon and Kouvaritakis  2005  serves as a basis for the practi   cal implementation applied to the active vibrating system  For more details  on the theory behind the NRMPC approach  the reader shall refer to the  aforementioned publications    Let us begin with initializing the off line part of the NRMPC code     5 2 4 2 Initialization of the Off line Code    The controller structure is obtained by evaluating linear matrix inequalities   LMI  defined by the invarian
290. some sense is good  but on the other hand it does not  offer any extra degrees of freedom     76 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke    2 9 4 Numerical Tests    The Matlab files for these tests can be found at the home page of S  Skogestad   and the commands are also listed in the Appendix    The objective is to find H  called beta in PLS Matlab  such that y   Ha   Note that PLS in all cases has an extra degree of freedom because it fits  y   Hx   ho where ho is nonzero  This may help for the fitting  but not for  validation  In any case  all the data is centered  so we can assume ho is close  to 0     2 9 5 Test 1  Gluten Test Example from Harald  Martens    Data  GlutenStarchNIR   1 y   gluten   100 x  NIR absorbents   100 data set     This data has no noise on yj    We first chose to use the 50 first data set for calibration and the 50 last  for validation  Table 2 1 shows the fit   Y       HX  p to calibration and val   idation data  The best result for the traditional methods is PCR with 33    Table 2 1 Spectroscopic Example  Calibration and Validation data    Val     00000   3471  POR AI  tol Le4      T0  60       09470     PLS 6       principal components  corresponding to a tolerance of 2e 4 when taking the  pseudo inverse   which gives a validation fit of 0 3142  PLS can use much  fewer components  but the fit is not as good  validation error is 0 3445  as  PCR  As expected  the minimum loss method given perfect fit to the data  and gives re
291. spects like optimality may also be consid   ered at this point   In most real plants values of manipulated variables are  restricted and these constraints have to be taken into account in controller  design procedure  These limitations are usually saturation constraints and  can be captured by min   max bounds  In MPT  constraints on control input  are given in     sysStruct umax   inpmax  sysStruct umin   inpmin    150 Michal Kvasnica    where inpmax and inpmin are n  x 1 vectors     4 5 6 5 Constraints on Slew Rate of Manipulated Variables    Another important type of constraints are rate constraints  These limitations  restrict the variation of two consecutive control inputs  du   u k      u k     1    to be within of prescribed bounds  One can use slew rate constraints when  a    smooth    control action is required  e g  when controlling a gas pedal in a  car to prevent the car from jumping due to sudden changes of the controller  action  Min max bounds on slew rate can be given in     sysStruct dumax   slewmax  sysStruct dumin   slewmin    where slewmax and slewmin are n  X 1 vectors     Note 4 2  This is an optional argument and does not have to be defined  If it  is not given  bounds are assumed to be  oo        4 5 6 6 Systems with Discrete Valued Inputs    MPT allows to define system with discrete valued control inputs  This is  especially important in a framework of hybrid systems where control inputs  are often required to belong to certain set of values  We disti
292. stem  MPT Controller    Fig  4 19 MPT controller block in Simulink     plot of the closed loop trajectories as can be seen in Figure 4 20  Note that  the simulation model simmodel can be different from the prediction model  used to design the MPC controller  This allows to verify the controller   s  performance in situations with model plant mismatch                                                        Evolution of states Evolution of outputs  1 1  X         0 X M 0     Yo Isl  a  1 2 1  g  amp   on  gt   92 o  2   3  3   4  4  0 10 20 30 0 10 20 30  Sampling Instances Sampling Instances  Evolution of control moves Active dynamics                                  8         a o 1  s    a   0 5   0   0 10 20 30 0 10 20 30  Sampling Instances Sampling Instances    Fig  4 20 Closed loop simulation using the simplot function     4 5 8 Code Generation and Deployment    As discussed in Section 4 5  if the MPC problem  4 26  is solved off line and  the explicit representation of the feedback law Uw x t   is obtained as a    136 Michal Kvasnica    lookup table  the optimal control action can be obtained at each sampling  instant by Algorithm 1  As the algorithm only performs trivial arithmetic  operations  it can be implemented using any high  or low level programming  language  Simplicity of the individual operations also allows the table to  be traversed using low computational power  This makes the approach of  high practical relevance when applying MPC to systems with fast dynam
293. stems 183    output such variables as iteration data or cost function  but that is reserved  for diagnostic purposes  The state observation in this example is carried out  via a product default Kalman filter    The subsystem marked as QPMPC in Fig  5 3 is featured in its full detail  in Fig  5 4  Here it is visible how the predicited cost matrices calculated in  the problem setup stage are parsed onto the qpOASES interface  One shall  refer to the qpOASES documentation for details                  Estimated  i PCI 6030E  Defl  state X est Kalman 7 eflection  5 41 National Instr  Filter  Analog Input                      Kalman Filter Laser Setting PCI 6030E AD       Deflection       Input    File Scope  g Irdi  2    TET       x u   xPC Target Data Logging  2 TET    QPMPC control Unit Delay    PCI 6030E  1 National Instr  I  aput Analoq Output    Amplifier Compensation PCI 6030E DA                                                                Fig  5 4 Block scheme of the QPMPC controller in Simulink  for the active vibration  cancellation application    5 2 4 Newton Raphson   s Suboptimal MPC    5 2 4 1 Introduction    This subsection will introduce the practical implementation of the Newton   Raphson MPC algorithm into the vibration attenuation of lightly damped  structures  As with the other cases  problem setup will be carried out using  the Matlab script language  while the on line part of the algorithm will be  implemented in the C language  combined with the xPC Target 
294. structural constraints   it can be reformulated as a  constrained quadratic programming problem  Alstad et al  2009     min    HY         2 23   st  HG    Jl     Proof  From the original problem in eguation  2 21   we have that the optimal  solution H is non unique because if H is a solution then H     DH is also a  solution for any non singular matrix D of size ne x ne  This follows because    J    H G     HY   JI   HG  D  DHY   J    HG     HY    One implication is that we can freely choose G   HG   which is a ne x ne  matrix representing the effect of u on c  c   Gu   Thus  in  2 21  we may  use the non uniqueness of H to set the first part of the expression equal to  the identity matrix  which is equivalent to setting HG      J 1 2  This identity  must then be added as a constraint in the optimization as shown in  2 23    IN       The reason for the non uniqueness is that since n   gt  ne  H is    fat    ne x n   matrix  with more columns than rows      Theorem 2 2  Analytical solution   Under the assumption that Y Y T is  full rank  an analytical solution for the problem in  2 23  is  Alstad et al   2009     HT    YYT  G G   Y YT  Gv  i2  2 24     Proof  The result is proved in  Alstad et al  2009  and is based on first vector   izing the problem and then using standard results from constrained quadratic  optimization    The analytical solution in Theorem 2 2  results in a H satisfying HG       J y2  However  recall that the optimal solution H is non unique  and we may  u
295. suitable and applicable for the SI engine  control  Proposed flexible design of a predictive controller offers easy tuning  possibilities  extension of the global engine model to other working regimes  of the engine and implementation of constraints  This fact also indicates the  next project step  which is the overshoot elimination in the A   control by the  identification of wider net of    local engine models      Acknowledgements The authors gratefully acknowledge the financial support granted  by the Slovak Research and Development Agency under the contracts LPP 0096 07   LPP 0075 09 and LPP 0118 09  This research is also supported by the grant from  Iceland  Liechtenstein and Norway through the EEA Financial Mechanism and the  Norwegian Financial Mechanism  This grant is co financed from the state budget of  the Slovak Republic     References    Anstee R  2006  The Newton Rhapson Method  Lecture notes   Arsie I  Iorio SD  Noschese G  Pianese C  Sorrentino M  2008  Optimal air fuel ratio   dSpace Magazine  1  20   23   Bengtsson J  Strandh P  Johansson R  Tunestal P  Johansson B  2007  Hybrid model   ing of homogenous charge compression ignition  HCCI  engine dynamics  a survey   International journal of control 80 11  1814 1847   Cannon M  Kouvaritakis B  2005  Optimizing Prediction Dynamics for Robust MPC   IEEE Transactions on Automatic Control 50 11  1892   1597   Chen H  Allg  ver F  1998  A quasi infinite horizon nonlinear model predictive control  scheme with guar
296. sults identical to least squares  Thus  noise has to be added  and  a noise level of 2 e 4 gives an error to the validation data  0 3115  which is  even better than the best PCR   Use of smoothened y  data has no effect  which is expected as the fit to  the calibration data is perfect     2 Measurements for Control  Optimization and Estimation 77    Table 2 2 Spectroscopic Example  Calibration and Validation data  with sets inter     Cal  Val     0000     1687 73  PCR 12  tol    e       changed     o n o   PLS 7  MUS xe min loss w noise 5 e 4       Table 2 3 Spectroscopic Example  Calibration  99 measurements  and Validation  data  1 rotating measurement     Cal  ove   0 0000  3 0681 Least squares  ls    min loss    0 2689  0 3609 PCR  tol   5 e 4   0 2769 0 3129 PLS 7  0 2471  0 3556  min loss  w noise 5 e 4       However  if we interchange the calibration and validation data set  then the  results are very different  see Table 2 2  The best is now PLS 7  val 0 2357    whereas minimum loss with noise is at 0 3798    Finally  one data set was excluded at a time and used for validation  The  average norm of the calibration fit and the norm of the validation fit for the  100 runs are given in Table 2 3  Again the PLS method is best  val 0 3129    whereas the minimum loss method with noise is the second best  val 0 2556      2 9 6 Test 2  Wheat Test Example from Bjorn Alsberg   Kalivas  19977     Data  wheat spectra   2 y    701 x  100 data set    The calibration data contains 5
297. t                                  0 25     0 2  E 0 15       gt   2  0 1  0 05  0 1 1 1 1 1 1 1  0 50 100 150 200 250 300 350  time  s   x10   Pl1   controller output  1 5      e     s       o  o   o   E  2  20 5  0 1 1 1 1 1 1  0 50 100 150 200 250 300 350    time  s     253    Fig  7 3 Typical setpoint and disturbance steps in the loop with PI  controller con     tain one step at saturation after setpoint steps                                                                                                                                                                                                                                                                                                                                                           ur rozsah  w H  f u      e Pu m  gt    Constant Saturation Q  gt U Saturation1 hi  Subsystem  1  Tfil s 1  oe 1 sta        Ks Tfil s 1    S1 beta1 sqrt u 1  posun   ur rozsah  2   y  w i   Kr eco   f u   gt  7 100 12 U m  Constant Saturatign  Y Q  gt U Saturation1 hi  1 Subsyst   gt   ystem  Tfil s 1  w  z          y      LP S1 betat sqrt u 1  posun  4  n    1 a                                     s  Integrator          Fig  7 4 Control structure for linear and nonliner PI1 implemented in Matlab    Simulink    load          basics calibParams         b XL E 7    load        load        load        load            basics valvel       basics valve2         basics valve12         basics pump1      T   0 25     S1 0 001   posun   
298. t  contain full matrix inversions  only essential piecewise inversions  Matrix and  vector operations within the NRMPC on line algorithm are performed using  the Basic Linear Algebra Subprograms  BLAS  package     The Simulink scheme implementing the NRMPC controller gains its feed   back signal directly from a block reading the analogue input of the measure   ment card  The scheme is visible in Fig  5 5  The output from this block is  scaled according to the current settings of the LASER head  so its output  is given directly in millimetres  The File Scope block ensures real time data  logging onto the xPC Target PC hard drive  which can be later re used for  measurement processing    Feedback measurement passes through a product default Kalman filter   a part of the Signal Processing Blockset toolbox  MathWorks  2007   The  Kalman filter is always enabled  and the number of filters is set to one  Initial  condition is assumed to be zero    The estimated state  conforming to the dimensions of model considered  when creating the NRMPC controller  is passed onto a custom S Function  block implementing the on line NRMPC code in C language  This block takes  parameters R T  Sm  Q21  Q11  K and Co as its set up and starting param   eters  All of these parameters are the result of running the Matlab script  responsible for initialization and off line NRMPC algorithm evaluation  The  S Function block has the core C program and two custom functions  See  5 2 4 9  specified as module
299. t  x t     y t   d t    d   dy dt  the system state and         K    t   7 11     u K t  U     K U  i 1 2  7 12     being the normalized control  it can be described in the state space as    TO   a t    butt   A  hoo  b   1  cam    The linear pole assignment PD controller is given as       wens r    ro r          u Ks  7 14     The PD   controller is composed from the linear pole assignment controller  used for the relatively low velocities and given as    at  aol   A   ro      Qa1Q2   T     Q1   Q2  7 16     For d      d   dg  the corresponding constrained pole assignment controller  is again given by  7 15    7 16  and with limiter  7 10   For higher velocities  d the nonlinear algorithm is used that moves the representative point in the  state space towards the so called Reference Braking Trajectory and guaran   teeing braking with dynamics specified by one of the closed loop poles and  without overshooting  The controller for the double integrator is then given  as    262 Vladim  r   ilka and Mikul     Huba       u  d U   7 17   u    sat  u K    7 18   j    3   sign  y    2  7 19     When controlling the nonlinear system  7 9   it is at first necessary to  transform by means of inverse equation to  7 9  the existing saturation limits   e g  0 and 5 V  into the limits valid for the fictive controller input v1  Then   using information about the plant state and the new saturation limits con   sidered in  7 19   the fictive control signal v   is computed by means of  7 15   
300. t HG      G  h  Our optimization problem  then becomes    er    1    max 2    1   G       X  All  g    min j   min  H h              Gn    We have here made use of the induced 2 norm and the fact that both the  Frobenius  and 2 norm are the same for a vector  Thus the optimal j is  the inverse of the 2 norm of G     which generalizes the solution found for  the case with two measurements  The optimal h   cG     where c is any  scalar since only the relative magnitudes matter   that is     HT   cG       which generalizes the result above     c  Multivariable case  c is no longer required to be a scalar   From  2 25  we  derive with Y   I  F   0 and measurement noise of magnitude 1 for all  outputs  that an optimal solution is    HT   G       which generalizes the results above  Thus  for the case where only mea   surement noise is a concern  and all the measurements have the same noise    2 Measurements for Control  Optimization and Estimation 63    magnitude  the optimal is to select the measurements according the gain  matrix G     This means that    sensitive    measurements  with large elements  in G  are preferred for control     2 5 Reformulation of Loss Method to Convex Problem  and Explicit Solution    We consider here the    normal    case where H is a    full    matrix  with no  structural constraints      Theorem 2 1  Reformulation as a convex problem   The problem in  equation  2 21  may seem non convex  but for the normal case where H is  a  full  matrix  with no 
301. t file in the following format    valveValvenumber year month day hour minute second mat    For example  valvei 2009 12 20 16 26 43 mat and so on  We don t  consider the first and the last measurement sample  from the other values  with the step approximately 1 5cm     we use each sixth sample  define the  value c  as well as the possible offset value of the valve of f seti    At the end we define the mean value of offset and of flow coefficient and  we save those two values together with the time course of emptying into  the valvel  valve2 and valve3 mat  We apply them directly to the proposed  model  we simulate the emptying and we draw the comparison of simulation    6 Laboratory Model of Coupled Tanks 237    MENU       ES  Your choice     Calibration test    Calibration    Valve 1    Valve 2    Valve 1 2    Valve 3    Valve 2 3    All valves    Pump 1    Pump 2    Both pumps    All params    End of identification      Fig  6 5 Menu of the software module for calibration and identification                    and real data into the graph of emptying characteristics such as Fig  6 6  This  procedure allows us to check visually quality of the valve s identification on  the graph  The registration to the actual mat file allows us to read variables  in the program according to our choice  at the direction of the model or at  the work with the real system    The previous identification may sometimes look better than the new one      that s why the measurements are stored in the 
302. t lev level of optimality    Table 4 4 Mandatory fields of the problem structure probStruct     4 5 7 4 Level of Optimality    MPT can handle different setups of control problems  Specifically     1  The cost optimal solution that leads a control law which minimizes a given  performance index  This strategy is enforced by    probStruct subopt lev   0     The cost optimal solution for PWA systems is currently supported only for  linear performance index  i e  probStruct norm   1 or probStruct norm    Inf    2  Another possibility is to use the minimum time setup  i e  the control law  will push a given state to an invariant set around the origin as fast as  possible  This strategy usually leads to simpler control laws  i e  fewer  controller regions are generated  This approach is enforced by    probStruct subopt lev   1    154 Michal Kvasnica    3  The last option is to use a low complexity control scheme  This approach  aims at constructing a one step solution and subsequently a PWQ or PWA  Lyapunov function computation is performed to verify stability properties   The approach generally results in a small number of regions and asymp   totic stability as well as closed loop constraint satisfaction is guaranteed   If one wants to use this kind of solution  he she should set     probStruct subopt_lev   2    4 5 7 5 Optional Fields    Optional fields are summarized next    probStruct Qy  used for output regulation  If provided the additional term  llQ y     Yref   p is introduc
303. the pro   cess gain value and the delay time constant  In Fig  9 18 there is the Simulink  model which should pop up when the correct experiment starts  The exper     304 Peter Tap  k and Mikul     Huba    Dead time  0 75 T T T T I T l       0 7    0 65    0 6    Td    0 55    0 5    0 45                5    Fig  9 15 Dead time in multiple operating points as function of the input variable    Step responses of nor filtered light channel Step res pons es of ncn filtered light channel                T                               m T T T  19  45  aop 1 el  35  BO 4 2 7    ai 1 i 16  Bal   b  15k 4 15  0L 4  sl u  0 n 1     1 A i n   1 i  o 5 10 15 20 25 30 35 15 155 18 16 5 T7 17 5                ts  tis     Fig  9 16 Step responses of the non filtered optical channel     overview and a detail  of one step response  These are the responses to 0 5V bulb voltage steps made in 3s  intervals     9 Constrained PID control Tasks for Controlling the Thermo Optical Plant 305        Prefilter    Disturbance Observer    Fig  9 17 FIo controller  structure equivalent for Tp   Ty to I controller    iment will run with multiple setpoint steps  Feel free to modify the model  to make your own setpoint steps sequence  The goal is to achieve quick non   overshooting transients        m   gt    R u  del  gt   Tied p  gt L L Temperature1    Repeating Saturationt   Beg Transfer Fen3 P regi i   Terapia  Ly lan   Gaint 1 o   Fan VO Interface   ni rec  m  TransterFont ji       Tfil s 1 TED          
304. the saturation limitations  for the individual loop controllers k  s  are time variant     1 1 4 The Plant Model used in the Assignment     The model used is the detailed LV model of a distillation column given in   13 19  of Skogestad and Postlethwaite  2005      A B Ba  s  vl    wear d  1 10     0 005131 0 0  0    0 07366 0  A  0 0    0 1829  0 0 0  0  T 0  dis  0 0 0    0 9895    0 4620     0 629 0 624    0 055    0 172  B    0 030    0 108     0 186    0 139     1 230    0 056  c       70 7223    0 5170 0 3386    0 1633 0  2 ho sit     0 8913    0 4728 0 9876 0 8425 0  xe 00     0 062    0 067  0 131 0 040  Ba    0 022    0 106    Dj     D     0 188 0 027     0 045 0 014    where the two measurements are the top and bottom product concentrations   the first input is the reflux flowrate at the top of the distillation column  the  second input is the boilup rate at the bottom of the distillation column  the  first disturbance is the feed flowrate  and the second disturbance is the feed  composition  The time scale in the model is in minutes  For further informa   tion about the model and the scalings applied  please refer to Skogestad and  Postlethwaite  2005      1 Problems in Anti Windup and Controller Performance Monitoring THE    1 1 5 Assignment    1  Model implementation  Implement the LV model in Simulink   Use saturation blocks  found in the discontinuities library  of  0 5  for the inputs to the LV model  You may use manual switch blocks  found  in the signal routi
305. the www javasoft com and  install it     8 Remote Laboratory Software Module for Thermo Optical Plant 277    The proper installation of the uDAQ28 LT thermo optical plant is another  preposition  The installation should be carried out according to the guide on  the installation CD  To check if the control of the real plant works locally  it is possible to run one of the predefined experiments from the installation  CD    In the case the above mentioned requirements are fulfilled the server ap   plication could be installed  Open the Server folder on the installation CD  and double click the server install bat file  During the process of installation  there will be a new folder called RemLab Workspace created in the root di   rectory of the C  drive  Necessary Matlab files will be copied into this folder   Moreover the server application RemLabServer exe will be copied into the  RemhLab Workspace folder  Before running the server application it is recom   mended to check the setting of the serial port  in supplied block diagrams  that are placed in the directory CA RemLab Workspace     Warning  Do not delete or move the folder CA RemLab Workspace  This  folder is fixed working directory of the server application  The RemLab   Server eze application file can be moved from the CA RemLab Workspace  folder to any different place and it is also possible to create a shortcut placed  at the desktop in order to run it quickly     8 3 2 Client Installation    The client application is 
306. then fill it up  by given input up to the fullest state  or during 60 seconds  That s because  at the lowest levels of input  the filling up would take too much time  After  the last measurement     for full input  we define the maximum inflow of the  pump as well  We put the given inflows and power tensions into the field and  save them  at the end of experiment  by same way as valves  into the mat  files  The first pump s name will obviously start by pumpl and the second  one by pump2     6 Laboratory Model of Coupled Tanks 239    During the individual steps  we include into the measurement the artificial  break of 40s  to prevent the changes in pump   s parameters  its heating or to  partially isolate the previous measurement from the actual one  We draw the  measured IO or inverse IO characteristics into the graph and compare them  with the approximations acquired thanks to curve fitting functions    As the buttons    names indicate  by the above described procedures we can  identify all valves  both pumps and all system   s parameters    To clean the older data  in order to delete the measured and saved val   ues more easily  we can use the script cleaning which will preserve only the  measured values and will delete all the mat files that contain the date in the  name  That   s why one has to be very careful when using it  We should use it  only if we are sure  that we don   t want to archive the older values    After we get all the required parameters  we only have to 
307. tic  Program  QP  if p   2  or as a Linear Program  LP  if p      1 00   Finally   if the predictions in  4 26c  are governed by a PWA system  the optimization  problem can be stated as a mixed integer QP  MIQP  for p   2  or as a  mixed integer LP  MILP  for p   1 or p   oo  see e g  Borrelli  2003     MPC is usually implemented in the receding horizon  RHMPC  fashion   At each sampling instant t  measurements  or estimates  of x t  are obtained  first  Then  the optimal control sequence Un  x t   is calculated by assuming  x t  as the initial condition for problem  4 26   Subsequently  only the first el   ement of the sequence is extracted  i e  ug z t      1 0      0 Ux and uo x t    is fed back to the plant  The whole procedure then repeats at subsequent time  instants ad infinitum  This introduces feedback into the scheme    As explained in the introduction  numerical values of Uy can be obtained  by solving  4 26  as a corresponding LP QP MILP MIQP problem on line  at each sampling time for a particular value of x t   An alternative is to    pre   calculate  the optimal solution to all possible values of the initial condition    x t      Theorem 4 1  Borrelli  2003    Consider the MPC optimization prob   lem  4 26  with f      in  4 26c  being either linear as in  4 23   or piecewise  affine as in  4 24   Then the optimizer Un  x t   is a piecewise affine function  of x t   i e    Un  a t     Fiz t    Gi  Va t      Ri  4 27     where different feedback gains F   G  swit
308. timal Control  CFTOC  problem  If NV  is infinity  the Constrained Infinite Time Optimal Control  CITOC  problem  is formulated  Objective of the optimization is to choose the manipulated  variables such that the performance index is minimized     4 5 7 2 One and Infinity Norm Problems    The optimal control problem with a linear performance index is given by     p NSB Met Ye a Mp   lQx F lIp    a k  1    fayn a k   u k   w k    Umin  lt  u k   lt  Umax   Amin S u k     u k    1      Aumar  Umin  lt  Jayn a k   u k    lt  Umax  z N      Ty    4 Multi Parametric Toolbox 153    where   u vector of optimized control inputs    N prediction horizon  p norm indicator  can be 1  2  or Inf   Q weighting matrix on the states  R weighting matrix on the manipulated variables  Py weight imposed on the terminal state  Umin  Umax constraints on the manipulated variable s   Aumin  dUmax constraints on slew rate of the manipulated variable s   Umin  Ymax Constraints on the system outputs  Tet terminal set  the function fayn x k   u k   w k   is the state update function and is dif   ferent for LTI and for PWA systems  see Section 4 5 6 for more details      4 5 7 3 Mandatory Fields    In order to specify which problem the user wants to solve  mandatory fields  of the problem structure probStruct are listed in Table 4 4     probStruct N prediction horizon  probStruct  Q weights on the states  probStruct R weights on the inputs  probStruct norm 1  2 or Inf norms in the cost    probStruct subop
309. time on not so important  tasks  how to handle features of RCP system at low level programming      The RCP is equipped with many input and output ports implemented on   the terminal board  Fig  5 14   managing the whole communication  between  the main computational unit and the engine   To the RapidPro is directly connected the knock sensor and the broadband  lambda probe  The crankshaft and camshaft sensors are attached through  a converter case  developed during the project lifetime  It is utilized by air  temperature and pressure sensor and the cooling water and oil temperature  sensor  as well  Among other functions it indicates correct functionality of  injectors  igniters and oil pressure sensor  Actual battery voltage is displayed    The security circuits protect the engine by switching off the power stages and  the fuel pump  if an error occurs     206 Gergely Takacs et al           Ateos     Ea    RapidPro  Power Unit    Master        Unit C ion B  RapidPro  His us RCP system    SC Unit             Unit Connection Bus   UCB     Host PC RapidPro  with ConfigurationDesk    Control Unit    KJ CJ 90  ve               IVDS link             USB for configuration    ASPACE Link Board  DS8 1 9 or slot CPU    Fig  5 13 Rapid control prototyping scheme    5 3 38 AFR Model Design    5 3 3 1 Air Fuel Ratio    The model of the air fuel ratio dynamics A of a spark ignition engine is based  on the mixture  defined as mass ratio of the air and fuel in a time step k  Due  to the fa
310. tions and or bug reports should be communicated to  mpt control ee ethz ch     4 2 Computational Geometry in MPT    4 2 1 Polytopes    First we introduce the computational geometry features of MPT  MPT con   tains a rich library for manipulating convex geometrical objects known as  polytopes     Definition 4 1  Convex Set   A set C C R  is convex if the line segment  connecting any two points in C lies entirely in C  i e  021    1     0 x9 C C for  all zj z2     C and0     R  0     0    1     Definition 4 2  Polyhedron   Convex set represented as the intersection  of a finite number of closed half spaces aZ x  lt  bj  i e  P    x     R      Ar  lt  b   with   di bi    A    b     4 1     is called a polyhedron   Definition 4 3  Polytope   Polytope is a bounded polyhedron     In general  polytopes can be described in two possible representations     1  The H representation  i e  P    x   Ax     b   where the input data A and  b are matrices representing the defining half spaces ala  lt  bi  or   2  the V representation  i e  P   convh z1        m   where convh denotes  the convex hull operator  i e  convh z1        m     x   v   Aui       Amtim  0     A      L 35A    1   Here  the input data are the vertices  71      Zm of the polytope     104 Michal Kvasnica    In MPT  polytopes are constructed using the polytope constructor      A    1 1   11  0  1     bib 1  0     TH   polytope A  b    xi    1  0   x2     1  0   x3    0  1    TV   polytope  x1 x2 x3         Calling the const
311. to    186 Gergely Takacs et al    the set of constraints defining the SDP problem  Input constraints are defined  by     if  isempty uh    F   F   set  uh 2  K Yq M K Xq      K Yg M K Xq     Invi   gt  0     end    5 2 4 4 Solver Setup and Off line Solution Initiation    Options are passed to the LMI parser and also to the solver  in this case  SeDuMi  Strict inequality constraints are relaxed and perturbed by the shift  setting     ops   sdpsettings     verbose     0    ops   sdpsettings ops     shift     10 tolerance     ops   sdpsettings ops    solver       sedumi       sedumi eps     0     Solution of the above defined SDP problem is initiated by the solvesdp  YALMIP command  The LMI defining constraints are passed onto the solver  as the variable F  options are contained in the ops parameter    The aim of this optimization problem is to maximize the volume of the  ellipsoids defining the region of attraction and target set  This can be carried  out by utilizing the fact  that the volume of an ellipsoid is proportional to its  determinant    maxe       detP      5 3     where P is the optimization parameter in general and m is the dimension  of P  In this case optimization objectives and parameters are Yq and Xg   defining the projection and intersection of the augmented ellipsoid into x  space  It is desirable to maximize the volumes of ellipsoids defined by Y q and  Xq at the same time  by including them in a block diagonal construct    Optimization parameters Y q  X q 
312. to the client  In this  case the button Run must be pressed repeatedly    7  When it is required that data from the just finished experiment have to  be saved set the name of the data file into the Save to File field and press  the Save button  It is necessary to wait for the end of the saving process  that is announced in the Output field  Fig  8 10   Then it is possible to  process the data saved in the specified file using another application    8  In the case of repeating the experiment with new parameters clear the  Output and Graphs fields by pressing the Clear button and repeat this  procedure starting from the point 5    9  Press the button Disconnect when it is not desired to continue working  with remote experiments  This will free resources of the remote laboratory  for other users  To finish the client application close the corresponding  window of the Internet browser     8 7 Rules for Creation of Models in Simulink    Remote laboratory administrators can create new block diagrams and placed  them  together with initial parameter files  on the server in the fixed given  folder C  RemLab Workspace  Thus remote users can have more possibilities  to select the type of the experiment when choosing the corresponding names  of files   mdl and  m files  in the Model Scheme and Model Parameters fields   To assure the application is working correctly several simple rules must be  kept when creating these new block diagrams                                                  
313. to this real system  The server part of the software is created by the  program application written in the Java programming language  The server  application should be installed on the computer that directly controls the  real plant  The client part of the software is realized in the form of a Web  page with embedded Java applet  This provides a user friendly environment  to carry out remote experiments     Pavol Bist  k  Institute of Control and Industrial Informatics  Slovak University of Technology in  Bratislava  e mail  pavol bistak stuba sk    275    276 Pavol Bist  k                                         REAL PLANT i   SERVER    o       f     A i  a i   i       ites een ees ee een M        Remote Control    Fig  8 1 Remote laboratory overview    8 2 Technical Requirements    8 2 1 Server    Windows operating system  XP  Vista  Seven   Java Virtual Machine   Matlab with Simulink   fixed IP address   free port No  23    8 2 2 Client Computer    e Internet browser with Java applet support    8 3 Installation    8 3 1 Server Installation    First it is necessary to check whether a Java Run Time  JRE  environment is  installed on the server computer  By default Java is installed into the Program  Files folder  To check the Java installation you can also open the Command  Window  Start Run cmd  and type    java    command to see whether the Java  installation exists or no  If there is no Java installed on the server computer  you should download the installation file from 
314. ton Raphson s Suboptimal MPC               183  5 25  Multi Parametric MPC                  0005 194  Bee     COONODBSIOR Loose RR E Rp i bodn   drt   SS 198  Gu AFR trl 15e O eee haan ieee 200  Dal TONG  e eni Eun pL  duc petes 200  5 3 2 Hardware Description       0 020 4 ceca eee dis 201  5 8 8 AFR Model Design                  0 0 eee eee 206  5 3 4 Predictive Control 5 212 socius 216  5 8 5 Results of a Real Time Application of a Predictive   OMRON C Beda kes aged ane ey au odd uza ea 219  5 2300  Copclu  ion coss deme RR RR Rae ges ks 222  BieferemdeH csooocacde el bed ood ahead a ib qe per dde und 222  Laboratory Model of Coupled Tanks                       229  Vladim  r Zilka and Mikul  s Huba  6 1        Dabduelii vec IDEE dace dla aie ble ade DERE ERRORS 229  6 2 Coupled Tanks   Hydraulic Plant                         230  Dal Identification osuere m erem 232  6 2 2 Sensors Calibration 2 22 22 2g dol li leri 235  6 2 3 Automatic Calibration and Identification             236  6 2 4 Some Recommendation for Users                  239  ilg  RD  241  Constrained PID Control Tasks for Coupled Tanks  COUPON Lolo ila eor nace ER D UR ne ur a a e UR RES 24T  Vladim  r   ilka and Mikul     Huba  Tok atrodom 22 eg eee bet ovl eens ba van k  OR RS 247   2 Basie Pand Pl controllers    z occ  ccc ven Land Rl eis 248  Gal   PilEeanuolek llli1zlzkiencig3 vue ie bade aah 250  pc Ply controlat PRPRRCOTOTRTOITERPTENMPRUE 251  7 3 Linearization around a fixed operating point         
315. tope P A res Fa onto the z   space  cf   4 7   Your task is to implement this projection based procedure  and compare its output to MPT   s native algorithm  available by running    P1 P2  Assume the following input data      gt  gt  P1   polytope   1  1   1 1  1  1  1 1     gt  gt  P2   polytope   0 1  0 1  0 1  0 1  0 0 1      Exercise 4 7  The Pontryagin difference operation discussed in Section 4 2 3 7  was so far defined under the assumption that C and B in  4 11  are single  polytopes  However  the operation is also well defined when C is a polytope  array  i e  C   Uj C   In such a case  the difference G   C O B can be obtained  by the following procedure     1  H   convh C     2 D HOB  3     H C  4  F  E     B   G  DNF    The algorithm is explained graphically in Figure 4 11  Assume the following  input data      gt  gt  C1   gt  gt  C2    polytope  0  2  0 2  2 4  2  4  4 2  4  2    polytope   4  2   4 2   2 4   2  4  0  2  0 2      4 Multi Parametric Toolbox 119     gt  C  C1 C2    gt  gt  B   0 5xunitbox 2     and implement the procedure above using MPT   s basic operators summarized  in Table 4 2  Compare the output to the default implementation of C B            a  Polygone C     U C   b  Convex  hull H    c  Set D HOB   and polytope B  convh C        wu      F       X          R 5  B  1   sE   1  al   i 4   5 s a    ro 1 2 3 4 ro 1 2 3 4        d  Set E  C   e  Set F 2E 8   B        Pontryagin Difference  G D F     Fig  4 11 Pontryagin difference for non convex 
316. tration at stoichiometric level us   ing MPC is demonstrated through the real time SI engine control  Fig  5 21     This has been performed using the AFR predictive control strategy described    Combustion    Engine    MPC    Controller       Fig  5 21 Control scheme    in the previous section  designed in Matlab Simulink environment and com   piled as a real time application for a dSpace platform  It has been applied  to the VW Polo engine  Fig  5 10   1390 cm  with 55kW 5000rpm  not  equipped with a turbocharger or an exhaust gas recirculation system  The    220 Gergely Takacs et al    control period was 0 2s  The result of an identification are 9 local linear mod   els  LLM  for each  air and fuel path  dependent on a throttle valve opening  and engine revolutions                                     2500 E  a         real                desired    2000  I i i i i po N    20 40 60 80 100 120 140 160 180                      Inj  time  s     o       1 i 1 i i 1 i 1  20 40 60 80 100 120 140 160 180  Time  s        Fig  5 22 Results of a real time control of the SI engine  without    desired final state   penalization     The primary target of a control  Fig  5 23  was to hold the air fuel ratio  in a stoichiometric region  A   1   in the worst case to keep the mixture  ignitable  0 7  lt  A  lt  1 2     During the experiment  the change in throttle valve opening  between 21 and  22 degrees  Fig  5 23  variable t   and the change of engine revolutions  Fig   5 23  variable nen
317. trol input  associated to a given initial state by running     gt  gt  uopt   ctrl x   Now answer following questions     1  What is the optimal control action for z 0      755     2  Which input corresponds to z 0      2    Can you give the answer even  before running the code in MATLAB   hint  take a look at state constraints  in sysStruct xmax    3  Plot the closed loop evolution of system states and control inputs for 10  steps  starting from the initial condition z 0      75     Exercise 4 14  Assume again the setup from the previous exercise  but   change the probStruct R penalty to 10  Run again the closed loop simu    lation and explain what has changed   We also have a good news for you  MPT provides a simple command to  visualize a closed loop simulation     simplot ctrl  x0  number of simulation steps   If you only want to compute the numerical data  use the sim command      X  U  Y    sim ctrl  x0  number of simulation steps     Exercise 4 15  Now we will practice with explicit MPC controllers  In the  explicit approach the MPC problem is  pre solved  and the optimal control  action is computed for all possible initial conditions  The solution then takes  a form of a look up table  which consists of polyhedral regions with associ   ated affine feedback laws  Evaluation of such controllers then reduces to a  mere table lookup  which can be performed much faster compared to on line  controllers    We consider control of the double integrator  described by the follow
318. ts are drastically improved  compared to the case without anti windup  and are quite similar to what was  obtained for the decoupler with anti windup above     10    11    22 Morten Hovd and Selvanathan Sivalingam    1 1 8 4 Conclusions on Anti windup    The results obtained clearly illustrate the benefits of anti windup when the  manipulated variables saturate  for all three controller types studied in this  assignment     1 1 9 Matlab Code    1 1 9 1 Definition of Model and External Signals    Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh            Assignment  Controller design       and anti windup   Solution             Model and signal definitions    hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh  clc    clear all  close all                                                                                                                                           P yet  nnn  00  Square  X   Ax Bu  y   Cx Du  9 Parallel integrators  Constant in Hanus  form  x   Ax Bu     lorkii     y  CDu   R  Fast low pass Gain  to break algebraic loop   lgrkKs  x  Ku    A    Measurement t  gt   y  Outt m  wins LO   Measureme  In  ous Py int  md aput Out     u  Out2  Ing LV w saturation To Workspace  LQGint states  Measured input                      Fig  1 23 Simulink implementation of LV distillation column with LOG controller   The LQG controller has integral action  shown separately from the rest of the LOC  controller  and anti windup     12    13    14    15    16    17    18    19   
319. ts no matrix H such that HY   0    However  if we start with data and have many measurements  e g   spec   troscopic data   then Y   Xop is likely a thin matrix  and there will exist an   or actually  infinitely many  H such that HY   0  Since the experimental  data Y contains measurement noise  this means that H is    fitting    the noise   The proposed method will then be very similar to least squares  although  the constraint H G      G can make it different  as seen from the numerical  examples below     Extra step 1C  To fix this up  one may add  artificial  measurement noise  to get a better representation of the actual measurement noise  Since there  will always be some independent noise for each measurement  it is suggested  to add a diagonal matrix W 4v to the original data    X extended    X opt Wa     where X opt was found in Step 1B above    The problem is now to choose Wy    One approach is to estimate it from  the data using a preprocessing step  For example  one may do some prelimi   nary regression and from this obtain an estimate of the noise    A very simple approach  which is tested on some applications below  is to  assume that the measurements have been scaled  for example  by the norm  of the variation in each measurement   such that they have similar expected  magnitudes  Thus  we use W ny   w4 Y where wn is a scalar     noise   wn eye rx    Xoptnoise    Xopt noise     Hopt  loss  soc_avg Gy  Xoptnoise       2 Measurements for Control  Optimization and 
320. ttings skoge My Documents   MATLAB    NN E     Test case 1  Martens data    load GlutenStarchNIR     X  Variablene 13 112 er NIR absorbanser  log 1 T  fra  850 1048 nm       yi  Variabel 4 er kvantitiv analytt konsentrasjon  gluten       Matrix  100 rows 112 cols  regular MATLAB matrix     VarLabels  112 rows 17 cols  MATLAB character string    4 ObjLabels  100 rows 7 cols  MATLAB character string   Yall Matrix       XX   Yall 13 112       YY   Ya11 4       X   XX   1 50     X0  XX   51 100     Y1  YY   1 50     Y10 YY   51 100       4 repeated Martens    4 100 times where I take out data each time    for nsis 1 98   4X   XX    1 nsis nsis 2 100    XO   XX   nsist1     Y1   YY    1 nsis nsis 2 100    Y10   YY   nsis 1     4 Two end cases are handled separately   4nsis 0   4X   XX     Insis 2 100     XO   XXC  nsis 1     4Y1   YYC    nsis 2 100     Y10   YY   nsis 1    4nsis 99   4X   XX    1 nsis    XO   XX   nsis 1     4Y1   YYC   1 nsis    Y10   YY   nsis 1     34    35    36    37    38    39    40    41    42    43    44    45    46    AT    48    49    50    51    52    53    54    55    56    57    58    59    60    61    62    63    64    65    66    67    68    69    70    71    72    73    74    75    82 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke      Jump to   MATLAB code starts here    E o ee    4 Test case 2      Bjgrn Alsberg data  epost 15 11 2010    load wheat spectra      Your variables are    4X Y idxcal idxval moist protein   Xwheat X     
321. uator  control of the vibrations of a cantilever under axial load  Composite Structures  62 423   428   L ofberg J  2004  YALMIP  A toolbox for modeling and optimization in MATLAB   In  Proceedings of the CACSD Conference  Taipei  Taiwan   Lorini G  Miotti A  Scattolini R  2006  Modeling  simulation and predictive control  of a spark ignition engine  In  Predimot  ed  Predictive control of combustion  engines  TRAUNER Druck GmbH  amp  CoKG  pp 39 55   Maciejowski J  2002  Predictive Control with Constraints  lst edn  Prentice Hall   Maciejowski JM  2000  Predictive control with constraints  University of Cambridge   Mao X  Wang D  Xiao W  Liu Z  Wang J  Tang H  2009  Lean limit and emissions   improvement for a spark ignited natural gas engine using a generalized predictive   control  GPC  based air fuel ratio controller  Energy  amp  Fuels  23  6026   6032   MathWorks T  2007  Matlab signal processing blockset v6 6  r2007b   Software    Mayne DQ  Rawlings JB  Rao CV  Scokaert POM  2000a  Constrained model pre    dictive control  Stability and optimality  Automatica 36 789   814   Mayne DQ  Rawlings JB  Rao CV  Scokaert POM  2000b  Constrained model pre    dictive control  Stability and optimality  Automatica  36  789 814   Murray Smith R  Johanssen TA  1997  Multiple model approaches to modelling and   control  Taylor  amp  Francis   Muske KR  Jones JCP  2006  A model based SI engine air fuel ratio controller  Amer   ican Control Conference  Minneapolis  USA   Pol  ni T  Roh
322. uch and similar  systems raises not only questions associated with algorithm speed but also  with minimal useful prediction horizon length  Due to the stability require   ment  the useful range the stable MPC controller can operate is severely lim     174 Gergely Takacs et al    ited  calling for extremely long prediction horizons  Takacs and Rohal    IIkiv   2009     This is partly caused by the large relative deflections compared to the max   imal possible control effort by the piezoelectric actuators  and short sampling  times  Optimization of prediction dynamics introduced by Cannon and Kou   varitakis  2005  offers a remedy to this problem  as it maximizes the region  of attraction which defines the useful controller range  however this idea is  executed for for a computationally efficient albeit sub optimal MPC approach  called Newton Raphson   s MPC    This subsection describes the practical implementation of different MPC  methods onto systems of active vibration control with under damped dynam   ics  Three MPC methods are introduced here     e traditional dual mode quadratic programming based MPC  QPMPC  with  stability and feasibility guarantees   e a computationally efficient sub optimal control strategy introduced by  Kouvaritakis et al  2000   Kouvaritakis et al  2002  and Cannon and Kou   varitakis  2005   called Newton Raphson MPC  NRMPC    e and finally an optimal multi parametric programming based MPC ap   proach  MPMPC     This section places focus on practi
323. uct symax  must be given as a  ny  x 1 vector  where each element  defines the maximum admissible violation of each output constraints      The aforementioned fields also allow to specify that only a subset of state   input  or output constraint should be treated as soft constraints  while the  rest of them remain hard  Say  for instance  that we have a system with 2  states and we want to soften only the second state constraint  Then we would  write     probStruct Sx   diag  1 1000    probStruct sxmax    0  10     Here probStruct sxmax 1  0 tells MPT that the first constraint should be  treated as a hard constraint  while we are allowed to exceed the second con     straints by at most 10 and every such violation will be penalized by the factor  of 1000     156 Michal Kvasnica    4 6 Exercises    Exercise 4 11  Consider a model of two liquid tanks given by the following  discrete time state space model     x t 1       y t     0 1  x t     0 0315 0 0 0769  0 0315 e a    0  ew    where the state vector z t    Bal represents the deviations of liquid levels  from some steady state levels and u t  is the deviation of the liquid inflow  from the steady state value  The state  input  and output variables are as   sumed to be constrained as follows    e  z2   lt 2   lt   33    e    17 lt  u t   lt 3   e    21  lt  y t   lt  3 5    Perform following tasks     1  Create a sysStruct representation of such a system by filling out the  structure fields as described in Section 4 5 6    2  
324. uired in the previous step  the only task  left is to evaluate for the perturbation vector f  which in this case can be  also stated as     f    TRWia  5 14     This single mathematical operation is divided into three parts for the C  code  First the value of A is negated  then a temporary vector is created from  the product of viemp     ARWia  The final step is to calculate f by multiplying  this temporary vector by T from the left  f   T vtemp     lamN  lamN    dgemv_ chn  amp order  amp order  amp lamN R          amp order Wid  amp onei  amp zero  amp tempv  amp onei     dsymv   chu   amp order  amp one T  amp order         tempv  amp onei  amp zero f  amp onei       With the perturbation value calculated in the previous step  the final task  is only to evaluate the current control move according to u   Kao   Cof   This is performed in the C code by summing up results of two vector dot  operations     u 0    ddot   amp order K  amp onei xO  amp onei       194 Gergely Takacs et al     ddot   amp order CO  amp onei f  amp onei       The other option implies that the loop is already optimal  thus the pertur   bation f     0  There is no need for optimization  this is part of an  if   than    else    decision  In this case the fixed feedback matrix is used to calculate the  control move from the observed state by evaluating u   Kao  This is again  a simple vector dot product     elsef   u 0    ddot   amp order K  amp onei xO  amp onei       5 2 5 Multi  Parametric MPC    5 2 5
325. ultiple  indices can be specified  e g     MC 1 3     0    will erase first and third element of the given polyarray  If some element of a  polyarray is deleted  the remaining elements are shifted towards the start of  the polyarray  This means that  assuming N    P1 P2 P3 P4 P5   after    4 Multi Parametric Toolbox 107    MG 31    2    the polyarray N    P2 P4 P5  and the length of the array is 3  No empty  positions in a polyarray are allowed  Similarly  empty polytopes are not being  added to a polyarray    A polyarray is still a polytope object  hence all functions which work on  polytopes support also polyarrays  This is an important feature mainly in the  geometric functions  Length of a given polyarray is obtained by   1   length N   A polyarray can be flipped by the following command   Nf   fliplr N     ie  ifN    P1 P2 P3 P4 P5  then Nf    P5 P4 P3 P2 P1      4 2 3 Operations on Polytopes    Next  we review some standard operations on polytopes     4 2 3 1 Chebyshev Ball    The Chebychev   s ball of a polytope P    x     R    Ax  lt  b  is the largest  hyperball inscribed in P  i e  B     e     x     R           xe       r   such that  B      P  The center and radius of such a hyperball can be easily found by  solving the following LP     max r  4 2a   subj  to Aize   r   Ai  o  lt  bi   4 2b     where A  denotes the i th row of A  The polytope P is empty if and only if  the LP  4 2  is infeasible  If r     0  then the polytope is lower dimensional   Note that the ce
326. umentation is available at   http   control ee ethz ch  mpt     5 Implementation of MPC Techniques to Real Mechatronic Systems 195    n4s2 C   0     sysStruct C  sysStruct D    The process is followed by naming the state variables and setting con   straints on the inputs  Output constraints are set to infinity  therefore prac   tically they are neglected     sysStruct StateName 1   sysStruct StateName 2   sysStruct umin    120   sysStruct umax   120   sysStruct ymin    inf   sysStruct ymax   inf     x1 5  x2      Sub optimality level is zero  this means that the software generates an  optimal controller with a quadratic cost function   the norm is set to 2  Input  and state penalties are defined as well along with the controller horizon     probStruct norm 2   probStruct subopt lev 0     probStruct Q sysStruct C    sysStruct C   probStruct R 1e 4     probStruct N 70           Estimated                                                                                                          T PCI 6030E  State X est c Zi Position   1 National Instr  Analog Input  I LASER  Kalman Filter Gain PCI 6030E AD  PCI 6030E   K   gt  National Instr  Analog Output  Input Amplifier PCI 6030E DA  E M 1 Compensatio  d     Lplco mpmpc z Input pFile Scop  rp Unit Delay     Id  2  Data Logging  MPMPC Colntroller xPC Target  TET    Fig  5 6 Block scheme of the MPMPC controller in Simulink  for the active vibration  cancellation application    The next step is the most important of all  that is th
327. ve positioner  results in such  fast oscillations     1 4 Controller Performance Monitoring using the Harris  Index    In large scale chemical plants  the number of control loops is simply too high  for operators or engineers to continuously monitor the performance of each  loop  Studies show that disappointingly many control loops perform poorly    The need for automated tools to assess control performance is therefore clear   In this assignment  one of the most popular performance monitoring methods   the Harris Index  will be illustrated  More background on the Harris Index  and its modifications can be found in Sivalingam and Hovd  2011     In this assignment the Harris Index is used to assess the performance of  a simple control loop  The sampling interval of the loop is 1  time unit  and  the open loop dominant time constant is estimated to be around 100  the    46 Morten Hovd and Selvanathan Sivalingam    knowledge of the dominant time constant is not known for calculating the  Harris Index  but is used in one of the more common modifications of the  index   The plant is strictly proper  but there is otherwise no time delay from  input to output  i e   h 0    0  h 1  4 0 where h k  is the impulse response  coefficient for lag k  The plant is open loop stable and has no zeros outside  the unit disk     1 4 1 Assignment    1  Download the Matlab data file cpmsim mat from  http   www itk ntnu no ansatte Hovd_Morten NIL   The file contains  the measurement  OP  of a contro
328. w on the Fig  9 4    When the device has been installed   virtual  serial port is available on  the list of hardware devices  labeled as USB Serial Port  One can get to its  settings through Device Manager  Start   Settings   Control Panel   System    Hardware   Device Manager   if Ports  COM  amp  LPT    USB Serial Port is  selected  Fig  9 5   The port has automatically assigned by the system one of  com port numbers  which is not in use   If the assigned number is bigger than  4  it is necessary to change it to different com port number from the range  1 4  which is not in use at the moment  It is possible to perform on the tab  Port Settings   Advanced   COM Port Number  Fig  9 6   The last action  after installation to be done is setting parameter Latency Timer  msec  on  value 1  which minimizes data loss during data transfer  Parameter Latency  Timer  msec  is available on the same tab as COM Port Number  Fig  9 6    In the case that all com port numbers from the range 1 4 are already in use by    9 Constrained PID control Tasks for Controlling the Thermo Optical Plant    Found New Hardware Wizard    Welcome to the Found New  Hardware Wizard    Windows will search for current and updated software by  looking on your computer  on the hardware installation CD  or on  the Windows Update Web site  with your permission      Read our privacy policy    Can Windows connect to Windows Update to search for  software     O Yes  this time only  O Yes  now and every time   connect 
329. xPC optimized BLAS code library   The two external custom functions described in 5 2 4 9 are also needed to be  present and properly declared at compilation time     At the on line control process  the following real time NRMPC algorithm  is called on and evaluated at each sampling interval     Local variables are declared at the beginning of the code  The BLAS func   tions require character variables  where for example transposition of matrices  is controlled by N and T   as in not to transpose and transpose  Some of  these functions also require to mark  whether the upper or lower triangular  portion of a symmetric matrix is to be read in     The order of the system is declared  just as some common values as zero   one or minus one  The value of A is set to zero at starting time  tolerance and  error thresholds are also stated  Finally local matrix and vector variables are  declared as well     char  chn  N   cht  T    chu  U    chl  L    int onei 1  order 2    double one 1 0  mone  1 0  zero 0 0  lamN 0         tol 1e 5  err 2e 5     192 Gergely Takacs et al    double WO  W2  fval  fderval   double tempv 2   tempm 4   vec 2   tempv2 2         W1 2   Wid 2   Widd 2   m 2      2      After the local variable declarations are expressed  the following mathe   matical operation is performed in two steps     Wo   x Quo    1  5 11     where xp marks the current observed state  and Qj  is a partition of the  matrix defining the invariant ellipsoid  as calculated in the off line pr
330. y   deviation variables     y G u Gid G      2 2     2 2 4 Assumptions    e No constraints  u spans unconstrained subspace    e We want to find as many controlled variables as there are degrees of free   dom  ne   dim c    dim  u    nu  Then HG    is a square n  x n  matrix   e We use at least as many measurements as there are degrees of freedom   Ny    Ny   Ne     2 2 5 Expected Set of Disturbances and Noise    We write d   W4 d  where W is a diagonal matrix giving the expected  magnitude of each disturbance and d  is a normalization vector of unit mag   nitude    Similarly  n      Wn  ny    where W 4   is a diagonal matrix with the mag   nitude of the noise for each measurement  and the vector n    is of unit mag   nitude    More precisely  the combined normalization vectors for disturbances and  measurement noise are assumed to have 2 norm less than 1      lt 1  2 3     d   al    1  nY          The choice of the 2 norm  rather than  for example  the vector infinity   norm  is discussed in the Appendix of Halvorsen et al  2003      56 Sigurd Skogestad and Ramprasad Yelchuru and Johannes J  schke    2 2 6 Problem    Given that  H y n      c  constant   0 nominally   2 4          Um    find the optimal H such that    magnitude    of the loss  L   J u d      Jop  d   2 5     is minimized for the    expected    d and n     The    expected    set of the disturbances and noise is defined above    The    magnitude    of the loss still needs to be defined  Two possibilities are  co
331. y at its limit until the corresponding element  of Dre changes sign    Clearly  the use of this anti windup methodology requires Dx to be invert   ible  and hence also of full rank  Thus  the controller must be semi proper   The rate at which the controller states converge towards the steady state so   lution  when in saturation  is given by the eigenvalues of Ax     Bk Dy Cx   This matrix obviously has to be stable  A small  but non singular  Dx will  generally make the convergence fast    In Hanus et al  1987   self conditioning is presented in a more general  setting  potentially accounting also for time varying or non linear controllers   However  only in the case of linear time invariant controllers do the resulting  controller equations come out in a relatively simple form     1 Problems in Anti Windup and Controller Performance Monitoring ri    1 1 2 5 Anti windup in Observer based Controllers    Many advanced controllers are  or may be  implemented as a combination of  static state feedback controllers and a state observer estimator  This is the  case for LQG  Hz optimal controllers as well as H   optimal controllers    For such controllers  anti windup is achieved by ensuring that the state  observer estimator receives the actual plant input that is implemented on the  plant  This is illustrated in Fig  1 3    State    feedback Saturation  Umax       Measurements   y         ci  c       K Plant                                State  estimator    observer              
332. y be a temperature  control system  where the temperature control loop is the outer loop  and  the inner loop is a cooling water flow control loop with the valve opening  as the plant input  In such an example  the maximum achievable flowrate  may depend on up  and downstream pressures  which may depend on cooling  water demand elsewhere in the system    Possible ways of handling anti windup of the outer loop in such a situation  include    e Using conservative estimates of the available range of actuation  with the  possibility of not fully utilising plant capacity in some operating scenaria    e The controller in the inner loop may send a signal informing the controller  in the outer loop when it is in saturation  and whether it is at its maximum  or minimum value   The controller in the outer loop may then stop the  integration if this would move the controller output in the wrong direction    e Use the velocity form of the controller  provided the reference signal for  the inner loop is calculated as present plant output   change in reference  from outer loop  If the reference signal is calculated as    reference at last  time step   change in reference from outer loop     windup may still occur    e For PI controllers  use the implementation shown in Fig  1 1  where the   plant input    used in the outer loop is the plant measurement for the inner  loop     Note that the two latter anti windup schemes above both require a clear  timescale separation between the loops  th
333. y water  As it was  however  mentioned above  in case of regular  maintenance and storing such problems will not occur     Acknowledgements The work has been partially supported by the Slovak Grant  Agency grants No  VG 1 0656 09 and VG 1 0369 10  It was also supported by a  grant  No  NIL I 007 d  from Iceland  Liechtenstein and Norway through the EEA  Financial Mechanism and the Norwegian Financial Mechanism   This project is also  co financed from the state budget of the Slovak Republic     6 Laboratory Model of Coupled Tanks 241    References    Zilka V  2007  Nonlinear controllers for a fluid tank system  Master   s thesis  Fac   ulty of Electrical Engineering and IT  Slovak University of Technology  Bratislava   Slovakia   in Slovak     242 Vladim  r   ilka and Mikul     Huba    Comments     Remarks    6 Laboratory Model of Coupled Tanks 243    Comments     Remarks    244 Vladim  r   ilka and Mikul     Huba    Comments     Remarks    6 Laboratory Model of Coupled Tanks 245    Comments     Remarks    Chapter 7    Constrained PID Control  Tasks for Coupled Tanks Control    Vladim  r   ilka and Mikul     Huba    Abstract This chapter treats basic issues of linear and non linear controller s  design applied to control of hydraulic plant of availabe three tank system   Controllers based on approximation of the given non linear system by the  first order linear system by step responses are proposed and compared with  controllers based on the analytical linearization of the no
    
Download Pdf Manuals
 
 
    
Related Search
    
Related Contents
Cours SPIP 3 pour rédacteur 1. Qu`est ce que Spip  Cinomose Ag Teste  7” Open Frame User Manual  e-SUS Atenção Básica Manual de Utilização do Sistema Prontuário  android user manual  Idioma-tic en ligne: mode d`emploi concis Ouvrir un chapitre  Specification Sheet PDF  PRESS RELEASE  User`s Manual - Broadway Limited Imports  Tecumseh AKA4475YXDXW Performance Data Sheet    Copyright © All rights reserved. 
   Failed to retrieve file