 So we have been looking at multivariable interactions and in particular we are looking at interactions between single loop PID controllers, why single loop PID controllers because most of the systems today seem to use multiple PID controllers for controlling achieving desired control. Now what is the problem with multiple PID controllers, I said it is like having multiple drivers in your car, multiple drivers who do not talk to each other, who do not coordinate. Now this can lead to poor control because of lack of coordination between different controllers. So what is the strategy, well most of the large scale systems like chemical refineries or power plants where companies have already invested into single loop PID controllers, they obviously want to continue with that, it is a historical baggage that we carry that we also there are other issues like even though they might have bought a computer control system or DCS still lack of awareness of how to implement advanced control, multivariable control would mean that they continue to use multiple PID controllers which interact and then the way this problem is handled in practices to have programmable logic controllers PLCs together with PID controllers. These PLCs are something like you know they act like a boss, if there is some problem they take some ad hoc actions which are based on experience on some logic derived from experience. If this variable is high and if that variable goes low then shut down the steam or whatever. So there will be logical you know elaborate logic statements which will try to handle safety constraints by some kind of if then else XOR or and so on those kind of blocks and actually designing a system which is interaction between this multi loop PID controllers and this logic is a very complex business it is not so easy and that is because the plant is multivariable everything you know many things affect many outputs, many inputs affect many outputs and the controllers are actually trying to solve this problem using simplistic multiple single loop controllers which is causing problem. There are two solutions to this problem one is try to choose PID controller pairing in such a way what is pairing will come to that try to choose pairing in such a way that there is minimal fight okay after having done that okay tune PID controllers see we know methods of tuning PID controllers for a single loop that is single input single output systems kind of you know back off from tuning which is there for single input single output design a detuned controller okay I am not going to go detail into the detuning of the controller I will just mention it and the third option is of course discard them and go for advanced control to go for multivariable control okay. So this example I was discussing in my last class this is the four tank system quadruple tank system we have actually I think simulink model for this was Krishna you had shared the simulink model for this right and then you can actually if you have access to MATLAB you can run the simulink model there are two PID controllers or there is a PID controller design given in the paper which I have put on the net okay in moodle okay just implement those two PID controllers you will see what happens in simulink it is just take a PID block attach it to this and see what happens when you try to control the system using two PID controllers you can actually simulate and see what happens. Now here this is a multivariable system both the inputs affect both the outputs there are two outputs level in tank one and level in tank two there are two inputs and we know that both the inputs affect both the outputs so how to pair if I do I measure level one and manipulate wall two or wall one okay that is the question now there are two control walls u1 and u2 okay here I have shown you one possible scheme okay there is one there are two possible schemes here one possible scheme here is y1 and u1 now why u1 and u1 right now I am just explaining some concept so numbering is arbitrary what is y1 and what is u1 is so right now so do not think that I have paired one and one that is what I want to convey okay so it did not be that one should be paired with one and two should be paired with two it is not like that so right now I am showing you one scheme other possibility is of course measure y1 and manipulate u2 and measure y2 and manipulate u1 so that is on the scheme which one to choose and why okay so that is the question now as I was explaining to you in the last lecture when there is another loop okay see the difficulty with this kind of a configuration when there are two independent controllers which do not coordinate between each other okay is that they can they can end up you know working against each other they can fight each other see that is because if there is some action planned by the first controller its effect is transmitted to the second loop okay so the second loop gets disturbed as a consequence of manipulated variable action of the first loop and you know it comes back so you put up this loop you unknowingly this PID controller see let us assume that everything is perfect right now both the levels are at steady state somehow level one diverges from the set point what the reaction of the proportional controller PID controller here proportional action will immediately get into action it will start changing the manipulated variable so now there may not be an immediate effect felt because it has to go through this dynamics so initial action is what this direct action is there okay well after sometime the effect of this M1 which is transmitted to Y2 because you change M1 level 2 gets disturbed level 2 gets disturbed controller 2 will come into action now action of controller 2 will come back through G12 to Y1 and this is a loop okay so and you can imagine if you have multiple such PID controllers which are not talking to each other you know this retaliatory actions of other controllers can be quite drastic okay so we have to get some kind of an idea okay if I if I have what is the change in the behavior what is the change in the behavior of Y1 when this loop is open that means that means Y2 is not controlled and when Y2 is controlled okay that is a logical way of going about analyzing the system okay that is what we are going to do in the interaction analysis okay so first thing which I am going to assume that the system is an open loop okay system is an open loop and I am going to do this experiment I am going to give a step change in U1 okay I am going to give a step change in U1 by giving some magnitude change of delta U okay and then I will record output delta Y1 okay the second experiment right now think of this as a thought experiment we are not actually going to perform it in the plant okay we will find some way of doing calculations using just the gain matrix I am looking at right now steady state interactions steady state effects I am kind of ignoring the dynamic component I am looking at large time component steady state behavior okay so if I give a step change in the input the output will go and saturate somewhere in open loop this all of you know okay then what I am going to do is that I am going to close the other loop see I have been looking at interaction between Y1 U1 okay looking at interaction between Y1 U1 what happens to Y1 U1 loop when Y2 U2 loop is closed okay and I want to come up with a major of not just Y2 U2 loop is closed all other loops are closed see suppose you have a system in which there are 5 PID controllers okay I am going to look at Y1 U1 I am going to look at one pair okay and then look at the open loop gain and then look at so called closed loop gain what is this closed loop gain here is that all the other loops closed except Y1 U1 okay all the other loops closed except Y1 U1 so the effect that comes the effect that comes okay when the other loops are closed I am going to call it as a retaliatory effect of the other loops okay retaliatory effect of the other loops so what is my first thing and then I am going to take a ratio of these two I want to find out a ratio of open loop change see this is open loop change when all the loops were open this is change in Y1 total change in Y1 okay when all the loops except Y1 U1 were closed okay every other loop is closed except the one the loop which is under consideration except that loop everything else is closed now I look at a ratio of these two effects okay this ratio is called as relative gain okay so what we are going to do is we are going to find out relative gain for each input and output pairing okay and make use of this relative gain make use of this relative gain see this is delta Y1 divided by delta U I have given same change in both the cases delta U delta Y1 by delta U and this is delta Y1 plus delta Y1 R by delta U delta Y delta Y gets cancelled okay we have those pens well I am calling this one one because we have done pairing of Y1 and U1 if we had done pairing of Y1 U2 I would have called this one two I will come to this little more details now see basically this equation you should look at as delta Y1 by delta U divided by delta Y1 or let us say delta U1 and divided by oh sorry delta Y1 plus delta Y1 R divided by delta U1 now delta U1 delta U1 cancels okay so this and this will cancel and you will get this to be delta Y1 upon delta Y1 plus delta Y1 R so this is retaliatory effect this is the open loop effect linear system they we can just show that the two can be just added okay so and then this index we are going to use for deciding the pairing okay so it is a measure of loop interaction and it can be very useful in pairing it is defined as lambda ij okay relative gain lambda ij is defined as if you do a pairing Y i Uj okay ith output jth input in general you will have a system which have multiple inputs multiple outputs okay and you want to do a pairing which is let us say you choose a pairing there are multiple possible pairings right if you have five inputs five outputs how many pairings you can think of five to the power or five factorial five factorial pairings some of them might be some of them you can eliminate just by logical thinking that from engineering view point some of them are meaningless okay but even if you do all that five factorial is a huge number if you want to screen five factorial even for a five cross five system it is not it is not an easy thing okay to screen so you need some systematic way of screening these multiple options okay so that is why we are coming up with this measure so what we are saying is that this is a relative gain this is between output Y and input Y i and input Uj the gain in the open loop divided by the gain between these two this input output pair with all other loops closed we are not worried how those are closed what is the pairing all other loops are closed perfectly working nicely other loops are closed and only this loop is open okay so when other loops are closed okay so let us see calculation of RGA for a two cross two system very very easy task what is the if I give a step change here in delta U1 okay open loop system this is the steady state equation the steady state equation okay if delta U2 is zero and if delta U1 is changed what will happen see delta Y1 delta Y1 will change because of this equation delta Y1 will be K11 okay and delta Y2 will change which is not equal to zero because because you know you have given change in delta U1 but delta U2 is zero okay but right now we are worried about gain between Y1 and U1 okay so open loop gain delta Y1 to delta U1 is K11 okay now my second situation is this how will you do gain calculations can you do it I have given you this model I have given you this model okay now what if there is a PID controller what will happen if there is a PID controller here if I give a step change in delta U1 what will happen see controller will make sure if it is a PI controller or a PID controller there is no offset okay so the PID controller will act PID controller will act and it will make sure that delta Y2 become zero okay can you calculate the gain for can you calculate the gain between delta Y1 and delta U1 right you know you have this equation you have this equation now because of PID controller is there delta U2 will not be zero delta U2 will be non zero in this case how will delta U2 change as to keep delta Y2 zero so find out and then you find out what should be the gain between delta Y1 and delta U1 under this situation so first you have to solve for delta Y2 equal to zero you have to solve for delta Y2 equal to zero delta Y2 equal to zero will give you delta U2 substitute that in the first equation and then you will get gain between Y1 and U1 you will get delta U2 in terms of delta U1 substitute that in the first equation what do you get what is the answer yeah so if you do this calculations if you do this calculations of delta Y2 equal to zero and put it back okay you will get this particular equation so you can see that the gain the steady state gain when the other loop is closed is different from the steady state gain when the loop other loop is not closed okay so this part this part is coming because of the retaliatory action other loop is reacting and that is what is giving you know that is what is making delta Y1 different now this could be this could be in any we do not know how this is going to be okay sometimes delta Y1 might be smaller sometimes delta Y1 might be larger it all depends upon all these terms K21 K11 K22 and so that so on okay so if I calculate the relative gain so what is what is delta Y1 by delta U1 when the other loops is closed it just given by this value and if you divide K11 open loop by all other loops closed then this is what is the relative gain that you get okay so for a 2 cross 2 system you can very easily show that it is enough to calculate one element all the other elements if this is lambda this will be 1-lambda this will be 1-lambda and this is lambda this can be shown very easily for a 2 cross 2 system okay so this is relative gain for which pairing Y1 U1 this is relative gain for Y1 U2 this is U2 Y1 okay and this is Y2 U2 okay so we have calculated relative gain for each possible pairing okay and now we are going to take a call using values of this relative gain there is one very very nice thing about relative gain see the gains themselves depend upon scaling or the units chosen to represent a variable right a gain would depend upon but relative gain does not depend upon its gain independent it is the unit independent it is scaling independent because it is ratio of 2 gains since it is ratio of 2 gains okay or ratio of gains let us say because 2 is here well in this case yeah ratio of 2 gains in the same units actually whether it is multi variable or single variable it is ratio of 2 gains and it is scaling independent that is very very important this is a measure which is not depending on any which way you represent your variables okay so this is a scaling independent measure and that is why it is very popular well I do not know how much of it is still used in the industry but it is a historically this is a very important development in. So let us look at a simple example again now this is one of the benchmark problems in process control literature this is called as this is a transfer function matrix for a distillation column in which you know mixtures are separated into using relative volatility you separate mixtures of you know lower volatility and higher volatility mixtures are separated so well from a control engineering view point you can look at it as 2 input to output system the purity of the product at the top and the purity of the product at the bottom okay well simplest distillation would be you know you want you have mixture of water and alcohol and you want to get alcohol separated from water okay obviously you are worried about the purity of alcohol which is product which has to be sold in the market. So the top distillate composition let us say it is alcohol and bottom product is water then you have what ethyl alcohol of course I do not know about ethyl alcohol ethyl alcohol also is will come as a top product right ethyl alcohol will be a top product and water will be a bottom product so you are worried about the compositions because you want to sell it to the market okay there are 2 inputs to the system one is reflux that is some part of the product is put back into the distillation column to get good separation good purity and you provide heat input to the system there is a reboiler at the bottom where you provide heat so there are 2 inputs and 2 outputs what should be the pairing okay. So if I do if I take the steady state gains and find out RGA for this relative gain array it turns out to be 2 and minus 1 okay what is the meaning of minus 1 and what is the meaning of 2 how do you interpret let us go back to this definition let us look at this if this ratio is negative what does it mean just try to interpret see let us take you change the input let us take the level case okay I change the wall position okay if I if I increase the flow what should happen to level it should increase okay but suppose RGA for the particular pairing that we have chosen it comes out to be negative means what if I increase the level wall then the level is actually decreasing it is going in the reverse direction okay so when the other loop is present it is completely changing the behavior you know from positive gain it is going to negative gain something which is quite dangerous you do not want this kind of a pairing okay what is the meaning of this going positive but higher value it means that retaliatory action is in the opposite direction but not too much opposite direction you know it is still smaller than the so delta y1 is larger than delta y1 plus delta y1 R retaliatory action is reducing delta y1 okay is reducing delta y1 but then you know it is not so harmful as negative pairing or negative RGA negative RGA means it is changing the direction completely here all that we are saying is that when it is higher than 1 okay so definitely I do not want a pairing in which the gain is changing sign okay so I immediately reject this okay the only possible pairing for this is these two okay so only way I can pair this is okay I have given the pairing here yeah pairing here is the top composition is to be controlled using reflux ratio the bottom composition is to be controlled using or is to be controlled using the bottom flow rate as a manipulated variable okay bottom draw as a might variable so this is what comes out from this analysis okay here I have given some PID tuning parameters do not worry about them right now okay this is just a demonstration of what happens if what is the effect of occurrence of the presence of the other loop see this is this is the this is the control loop see let us look at these two control loops what are the two control loops that we have x d and R x b and R okay now if you do an experiment in which x d and R the loop for the top composition is closed other loop is open if I give a step change in the set point okay if I give a step change in the set point what happens here okay the you know it settles to the new set point within you know seven minutes okay if I repeat my experiment with the other loop closed see what happens if my other loop is closed the settling goes to 35 40 minutes okay so if I do this experiment one loop you know first loop is closed the second loop is open I give a change in the first loop okay the first loop seems to behave very nicely but then this tuning is not going to work okay this tuning is not going to work it is not a good tuning why because because when the other loop is present you know the settling time of seven minutes becomes 35 minutes five times increase not a good idea okay so so what I want to stress here is that I may have obtained this tuning just looking at one loop see what we do in your first course in control you look at tuning methods for single input single output okay we do not worry about what is there in the other loop if I just look at one one loop and tune it without worrying about the other loops okay then when all the loops start working together this will happen okay the same thing happens about the second variable the second variable also very well tuned you know it is a very nicely tuned when it when the other loops are open okay but moment I close the second loop okay then you start getting this behavior oscillator behavior it is no longer settling in five minutes or ten minutes or whatever it is okay so so to nicely tuned controllers tuned individually when they are put together in this particular case because of heavy interactions they start fighting what tells you there is a heavy interaction this RGA this value is 2 this value is minus 1 there is lot of interaction between the loops so now how do you take a call based on RGA values okay so there are some rules to decide about that so just RGA of 2 is causing so much of change in the behavior from you know individually tuned controllers to all controllers working together okay so you can imagine what will happen in a Nemo process well this particular part this particular slide has lot of little bit of complex looking algebra and you can go back and look at it more carefully I am going to go over it very quickly it is a simple derivation how do I calculate RGA for a multiple input multiple output system okay this derivation is for a square system okay it is for a square system there are number of inputs equal to number of outputs so 5 x 5 x 6 x 7 x 7 whatever okay open loop gain of course is given by if you have a steady state gain matrix the open loop gain is given by Isaac element of that matrix okay now if K is the gain matrix okay then K inverse is the gain inverse matrix I am going to call it as K tilde here okay instead of calling it K inverse I am going to call K tilde K tilde is K inverse okay now we want to find out a scenario where why I use a why I use a this loop is open and all the other loops are perfectly controlled am I correct how do you find out relative gain you find out the gain between why I use a in open loop open loop gain is this okay now I want to find out gain between why I use a when why I use a loop is open all the other loops are perfectly closed so why should be 0 except why why I write input no no here I have taken I j I output and j no no no K I j is do why I by do you j no why is the output yeah output I so I want output I to be all but output I to be perfectly controlled so ith output will be non-zero all other will be zero because we are assuming that there are PI controllers controlling all the other outputs or this first one oh yeah this one is yes yeah this is j and I yeah this is steady set between output input j and output I yeah okay so now I want to find out this okay now to find out this see to find out what is the effect of u when all the other loops are closed I am going to use this inverse equation I am going to use this inverse equation together with this particular this particular vector okay so the way I am going to do this is I am going to find out do you by do you I do you j do you by do you j why do you by do you j why I want to find out this matrix vector because when other loops are closed see when other loops are closed you 1 you 2 you 3 or whatever u j plus 1 u j plus 2 u j plus 3 all of them are going to change in response to change made in u j I want to find that out okay so essentially I want to find out do you by do you j okay yeah at steady state I am looking at only steady state why no no we have PID controllers no open loop they will be 0 not in the closed loop we are looking at looking at a situation where all the other loops are closed yeah except why I u j other loops somehow are been paired and have been closed we do not ask how they have been closed they are perfectly working all of them are PID controllers so no offset okay see this is a thought experiment this is not we are never going to perform this okay we can just we just want to find out an index using gain matrix okay so this is my so do you agree with this you agree with this just look at the derivation all that I have done is do you by do you j I have used this equation here okay I use this equation and then finally you know you have to do a little bit of manipulation and then you get this you get this column which is nothing but a call appropriate column see in this why all are 0 except why I okay so you will get the column of this matrix corresponding to the ith output okay we will get ith output column corresponding in the inverse matrix and what you can show this go over this slide again you can derive it yourself it is not so difficult this one slide derivation that is all I will give you the final formula which is given in the next page okay so how do you find out relative gain array of a particular system if you are given a gain matrix I will tell you the algebraic formula okay algebraic formula is take the gain matrix okay take the gain matrix inverse transpose okay and then do what is called as Hadamard product is a sure product sorry sure product sure product is you know element by element multiplication do element by element multiplication this is the algebraic formula okay so what I am saying here is something like this see you have this gain matrix you have this gain matrix you know K 11 K 12 K 21 K 22 okay then find out let's define let's define K tilde is equal to K inverse see this is my this is my K and this is my K 11 tilde K 12 tilde so this is K tilde which is same as K inverse okay and then deck element by element product which means K 11 K 11 tilde K 12 K 12 tilde or you need to transpose this say sorry you need to transpose this and then take oh yeah so so so we write K 11 K 12 K 21 K 22 K 11 tilde K 12 tilde and then RGA is simply K 11 K 11 this is element by element product okay very funny product we do not use this in matrix multiplications normally this is element by element this is called sure product or also I think it's called Hadamard product or there is a subroutine in MATLAB which you just give two matrices and ask it to do element by element multiplication it will just do it for you okay there is one very nice property of this matrix is that all the elements sum to one okay all the column sum to one so this is very nice property of RGA matrix and the nice thing is RGA is independent of scaling whichever way you are used to compute the gains it does not matter okay you get a scaling independent measure of interactions okay I am just giving you some rules of how to use this RGA to do pairing okay if what if RGA is let us take a 2 cross 2 system let us go back to 2 cross 2 system if lambda 11 is 1 what does it mean that means the other loop is not making any difference okay it is not interacting okay so ideal situation is lambda 11 is one other loop whether it is present or absent is making no difference okay ideally it should be equal to one but that may not happen it should be close to one okay so what we should do is we should look for that pairing okay in which RGA element is close to one because if RGA element is close to one other loops are not bothering this loop okay that is what it means what if it is less than one but greater than zero if it is less than one but greater than zero it means that the other loop is acting in the same direction okay it is increasing so retaliatory action is suppose the you know original action if you give a change in the flow rate the level increases the retaliatory action further increases the level and that is why you know the RGA is smaller is less than one there is interaction but we roughly say that interaction is strong if it is between zero and point eight okay between point eight and one we say that the interaction is low it is not it is not making too much effect on the so this is little bit there is a heuristics coming in here if it is zero what is the meaning of zero interaction is very strong other loop is nullifying the effect of I do not want to choose this okay if other loops are present it is almost nullifying the effect of the action of you know you want action is getting nullified by the presence of other loops I do not want this pairing what if it is greater than one the retaliatory action is in the opposite direction okay yeah it is reducing the effect of open loop okay but still it is not bad as having negative okay it is not so strong so if it is less than zero we do not want that pairing okay we just reject that particular pairing we do not want that and so lambda is less than zero we do not use this so I am just going to show you this for a little more complex case this is there are a refinery distillation column there are four four measurements top composition of the top product side there are in a in a refining system when you let us say you have a crude oil coming and you are refining it into different products the top product could be you know light hydrocarbons a little below that in the huge column little below that will be petroleum then you will get kerosene then you will get aviation turbo fuel then you will get heavy oils and so on from the same same column you draw different products of different volatility so these are the draws they are called as side draw side product so there are four compositions which are important and you have four manipulated variables you have top flow rate bottom flow rate and two side flow rates there are four flow rates which are manipulated for compositions which are controlled look at this as a look at this as a as a control engineer it is a system with four inputs four outputs you want to put four PID controllers okay you have let us say you are given steady state gain matrix okay you are given steady state gain matrix now if I do RGA calculations for this particular system it turns out to be this now can you tell me how should I choose pairing what about y1 I should choose I should choose y1 u1 okay because this is this is very very close to 0 okay this is very close to 0 I do not like this there will be lot of vitality effects if I choose if I choose y1 u2 pairing or y1 u3 pairing okay there will be strong interactions y1 u4 of course is completely ruled out it is negative okay so I should choose y1 u1 what about y2 y2 should be y2 should be u4 okay y2 should be u4 y3 we have no choice but to go for only positive pairing there is lot of interaction but we cannot help it all others are not acceptable okay and here this is closest to 1 okay now how many possible pairings you can think of for this system 4 factorial that is how much 24 possible pairings okay from that you have arrived at one possible pairing okay you are at one possible pairing just using this simple analysis look at the power of this simple method okay it can tell you what is what is that choice of pairing which will give you minimum fighting between the loops okay this does not mean the fighting does not exist because look here this is going to cause problem for you this is going to cause problem for you nevertheless this is best possible pairing this is the least fighting or least interacting loop pairing that you can think of so this method is quite powerful very simple method based on just gains and then you can choose pairing so question is should we go for multiple multivariable controller or multi loop controller in a plant if you do not have a choice if you have to go for 4 PID controllers your employer says well I do not believe about model based control and observer and all that you are talking about I want to go to the market by 4 PID controllers and put them you know then you should choose that pairing which is which is giving you least interaction it can be also used for screening options see suppose I have 3 inputs and 2 outputs okay I have 3 inputs and 2 outputs why 1 why 2 other 2 outputs and you 1 you 2 you 3 or 3 inputs can I use RGA to screen out I can use 2 PID controllers okay I can use 2 PID controllers because PID controllers you know 1 input 1 output so which one to use so in general for a bigger plant this problem is much bigger the Tennessee Spun problem which I showed you there are 12 inputs and there are 54 outputs okay which subset of which 12 among the 54 there are see how many combinations are there and that one thing which I showed you the Tennessee Spun plant is a small section of a chemical plant there are many such units each one will have you know many inputs many outputs and the pairing problem is a huge problem it is not a simple problem so what I will do is I will find out RGA with respect to each possible pairing okay so I can take y1 y2 you 1 you 2 y1 y2 you 1 you 3 and y1 y2 you 2 you 3 okay which one is which one you will go for you will go for this pairing see because here this 0.76 is higher interaction than 0.84 okay in this case this is negative and this is too high okay so you do not accept this okay so so it is very very in this particular case it is easy to say that this is the best pairing okay you can notice one thing here if you add the columns they will add to one if you add the rows they will add to one okay same thing is here just check here if you add the columns column will add to one if you add the rows they will add to one it is a nice property helps me to give a problem in the in the exam I can give you an RGA with missing elements you have to fill in just know that summation of row or summation so suppose you the but this is not just the thing of giving a problem in the exam in a plant suppose you know some gains partially okay some gain elements are known partially and if you are able to compute RGA elements for some of the if you have just partial RGA information you can fill in the matrix by using this property it is very okay now this is one major one big problem about RGA is that you know you are just using steady state information you are not using dynamic information there have been attempts to extend this to dynamics in frequency domain I don't want to get into that right now but it becomes very complex when you go to frequency domain analysis using RGA kind of framework it is not so straightforward well when you actually do this pairing it is not when you have a multi variable plant and when you are trying to put multiple PID controllers it's a difficult problem you cannot just rely on one major that is RGA we use one more major which is singular value decomposition okay it's a powerful analytical tool it can be also used for robustness analysis I am just giving you some idea about this what is the singular value of a matrix do you remember a transpose a or a transpose eigenvalues of a transpose a or a transpose these are called as so here what we do is we find out eigenvalues of eigenvalues of K transpose K okay you take the gain matrix and for the gain matrix you can find out singular values okay now singular value singular value you know what is the condition number what is the condition number the ratio of the maximum magnitude singular value divided by minimum magnitude single value okay square magnitude of that is called as a condition number a system which is as high condition number from linear algebra what do you know it is difficult to it is difficult to inverse right it is difficult to solve does does control inverse control controller design does it involve inverse inversion somewhere let us look at steady state forget about forget about the dynamics look at the steady state okay look at the steady state what is delta y delta y is the output and what is delta u u is the input okay when you design a controller you give a set point what do you give a set point on output you give a set point on the output and what do you want the controller to do you want the controller to find that input which will take the system to the desired output so if you forget about the dynamics look at the problem only as a steady state problem actually you want to solve this problem you want to solve this problem given delta y find delta u right very simple way of looking at the you know control problem that given delta y I want to go to certain set points okay find the inputs that will take me to the set points okay which means well if k square what does it mean k square what is the u that will take you to that delta y k inverse k inverse into delta y that is the u that will take it to that now k inverse okay very very practical application of you know condition number well you have seen in the numerical methods it has lot of you know meaning in terms of stability of numerical systems here difficulty in control can be quantified using condition number okay if the gain matrix has high condition number which means you know your system is ill-conditioned okay a system is ill-conditioned difficult to control okay well there is only one trouble with this with this analysis it is condition number is dependent upon the scaling of or choice of scaling that is used for gain my gain calculation so this is not a gain this is not a scaling independent measure nevertheless this gives you a good idea about how good is your so for example I yeah no no no it is not it is ratio of eigenvalues it is ratio of eigenvalues depend upon scaling it is ratio of the eigenvalues but the eigenvalues themselves depend upon the scaling see you have different gain elements in the matrix each yeah so each one you can have different scaling and if you change the scaling this ratio will change it is not independent that is not a case about RGA see RGA you are doing point-to-point calculations here you are not doing point okay so so for example in this particular case I could have compared this just like I compare them using RGA I could have compared them using condition number okay which which subsystem is well conditioned in terms of inverting okay I can check that so condition number is a useful measure so you can actually find out that subset of variables which is well conditioned in terms of control using the condition number that is a larger condition number implies you know you have trouble difficulty in the sense that good determinant is all well not determinant is singular it means that inversion is difficult okay inversion is unreliable okay in computationally it means that when you try to invert the answers that you get so see it is to be taken little bit of qualitative interpretation okay you think of it that designing a controller is like inverting the gain matrix okay now when you try to realize gain matrix inversion numerically okay because of gain matrix is ill conditioned okay computation of it inverse can get into numerical trouble you can get spurious answers okay I can show you some example maybe I can put those notes on the model where you take simple 3 x 3 matrix or 4 x 4 matrix 3 x 3 matrix okay and if it is ill conditioned if you find it inverse using matlab matter will give you something with a warning saying that this inverse is not reliable if you multiply the two you will not get identity matrix you will get some arbitrary things okay so trying to invert of ill conditioned gain is inherently difficult is what one has to realize okay so one can face problem in realizing a controller that is what it indicates okay see for example I am just giving you a simple example here this is a of a furnace look at it as a black box as a control engineer there are two inputs air flow rate and fuel flow rate okay and what is important is the temperature of the hydrocarbon which is measured okay inside the temperature of the furnace or hydrocarbon is being heated here now you have a furnace in which you are burning fuel and you are heating up some hydrocarbon to some temperature and you monitor the exit see you are burning fuel you monitor the exit concentration of oxygen okay in the in the flue gas you monitor the exit oxygen concentration okay so the other two control outputs okay exit concentration of oxygen in the flue gas and you are heating some fluid some hydrocarbon in the furnace so the output temperature of the fluid the transfer function for this particular system is given by this simple system there are time delays and your gains are given to you okay with reference to two flows you can appreciate here the gain values you know are quite magnitudes are quite different that is because see this is temperature this is concentration okay these are two flow rates one is air flow rate other is liquid flow rate let us say you have liquid fluid to fuel other is liquid flow rate so the values can be completely different and a gain values will depend upon the choice of units that you choose okay so if you look at the RGA here see you should not use only one measure you have to use multiple measures to do screening of variables RGA shows that there is huge interaction okay these two loops interact a lot but RGA of course gives you pairing what is the pairing it tells you that you should never pair the temperature with with air air flow rate you should pair with you know only with the fuel flow rate that is the other pairing is not allowed okay and in this case in this case singular value analysis also indicates difficulty in control because you know you get this condition number which is very high 7000 a condition number above 100 is considered high okay 7000 is very high which means you will have difficulties in realizing the controller here yeah what can be deceptive condition number can be deceptive but you know it is like at least some systematic way of thinking about the problem yeah so what you try to do normally is that you try to find out each element in the gain matrix something like a dimensionless you know you have to do lot of what I would say of your gain matrix before you can you know so what I would do in such a case to find the gain matrix instead of using direct units I would say percentage change by percentage change okay so you know depending upon whatever is a measuring device okay let us take its maximum and minimum and then define a percentage with respect reference to that so try to make it as unit independent as possible and then but what do you say is right it can be this singular value analysis can be deceptive it depends upon the gain so another example where you have six your four outputs and six inputs okay and in this particular case if you see there are different sub subsets of the different subsets of manipulate variables taken okay and then for each subset you find out the condition number outputs are same there are four outputs I have to choose four inputs which four input to choose okay see so this can be used as a prescreening in this case these two are see this one is definitely not this one definitely not a good combination because this is 60,000 this is you know 1,16,000 this is 9,000 so these three are ruled out okay among these three these three are competing okay now I can use RGA on these three okay see I have to use it is like you know it is like some bags of linear algebra tools that you have and then you are trying to somehow come up with some simple measures yeah why should I so we are not going to use this only thing know we are going to use multiple so there are for example you know doctor asked you to do some when there is a malaria or this thing he asked you to do a blood test some of those blood test are deceptive still you they are asked to do it right because they give you some indication okay see they give you a relative measure they give you a relative measure once you have chosen set of way of tuning gains they give you a relative measure so even if you even if you what is important to note here is that even if you rescale your gains these these relative things are not going to change the values of singular values might change okay but the fact that this particular combination has higher singular value that will not change too much okay so it is a tool that you have to use in a complex scenario with no larger condition numbers it will not happen that you know see this condition number actually depends upon some orientations of the you know eigen vectors of and it will not fundamentally you know it will not change so much that so as a relative measure to you know check between multiple things it is it is a it is a good indicator I am not saying you should rely completely on this okay so just because blood test is deceptive at times particularly when you want to check for malaria does not mean you do not do blood test you also do blood test you also do something else okay so not that you completely rule out because it is deceptive all this it will proportionally shrink yeah it is proportional saying so comparative it is many times useful yes comparative it is useful okay there are many such measures which were developed in the literature because people wanted to deal with you know loops which are interacting and this is one of them neither Linsky index you know you have multiple input and multiple outputs and then you want to distinguish between you know you want to find out whether something there is something called integral controllability of a system okay so well these measures have survived probably because they are simple okay on some simple information just gain matrix you know you can come up with some pre-screening okay you have to use this pre-screening together with your intuition as okay or to together with your understanding of the system as an engineer physics of the system this is just a tool to help you okay it is not it is not the solution okay and it is good because it is not the solution so that I keep saying in every course that if it was those the solution Matlab would solve it for you then you and me are not required right so good these tools are fuzzy and then you know you need somebody a human being to say take the final call what is the right thing to do so now what you do in this neither Linsky index another index that tells you whether the system is whether it is possible to control the given system using multiple controllers that have integral action okay so this is a ruling out test whether it is possible or not possible are you doing something fundamentally wrong by putting up multiple PID controllers that you can find out using this neither Linsky index okay so you rearrange the matrix in such a way the transfer function matrix such that your chosen pairing appears on the diagonal see you have already done pairing let us say using RGA okay RGA did not consider any anything about stability it just told you you know pairing which way to do and it rejected pairings which can potentially lead to instability negative element pairings can lead to instability so those were rejected it does not say anything about it is whether it is possible to control okay so what you do here is this is again a gain dependent index which you can find and you know it shows that if this particular index okay this index is first thing that you have to do is to rearrange the system the transfer function matrix in such a way that the pair variables appear on the diagonal okay and then you compute this index okay I am giving you this without a proof if this index is negative system cannot be controlled using multiple PID controllers okay that is what it tells you so it is a screening test these are all screening test and you have to use them as you know bunch of tools to analyze a multivariable system I will just go back to this furnace example in this furnace example RGA showed us this particular pairing okay and I am now reorganizing see what is required once you have chosen the pairing you reorganize this transfer function matrix such that the paired variables appear on the diagonal okay so I have what I have done is see here air and fuel was there I have changed the matrix to fuel and air okay so the paired variables appear on the diagonal so T hydrocarbon and fuel this is the 1-1 element and O2 and air this is 2-2 element okay this is the paired so I have reorganized this matrix and then I just applied this Nidolinsky index to this particular matrix the Nidolinsky index is positive which means it tells you that you can control the system using to two controllers that have integral action okay if this index had come out to be negative then we can so where do you use all these things see suppose you have a very complex plan and you come up with two or three possible ways of pairing okay now how do I screen out further I check integral controllability for each one of those possibilities then I can screen further you know so there are systematic ways of reducing your options okay to and come up with her so what you do is multi loop PID controllers after selection of the pairing one can design individual PID loops okay and in the presence of interactions there are different ways of dealing with the interactions okay one of them is I don't want to get into this details I am just going to touch very very briefly there are different methods given in the literature that you know you can tune one loop then close that loop tune then close the other loop and tune the second loop with one loop closed then you know loop one loop two closed you tune the loop three and so on there are different approaches given in the literature to do this tuning this details of this biggest log modulus tuning you can see in the notes and well my my intention in this particular course is to go to the multi variable controllers this is just that the some exposure to the multi loop controllers that you need that is because when you go out in a in a field you will find multiple PID controllers and you have to deal with them you should at least know something about that situation okay so you can have a look at the notes for this there is one method called biggest log modulus tuning and you can have details are not important and the details you can see from this notes so I want to just skip this and then I have given some example where if you do this detuning procedure follow this detuning procedure you can come up with reduction in the interact interaction between the loops if you want a summary of this it's something like this you individually design each controller okay and then put some factors so that you reduce the gain and increase the integral time in such a way that the loop interactions become smaller okay this is the iterative design method which there are sequential tuning methods so you tune one loop keep the plant open to one loop close it with one loop closed tune the second loop close the second loop okay with one and two closed tune the third loop go on doing it sequentially and so on okay what I am interested in talking about is this idea of decoupling okay and this decoupling is finally going to lead us to multivariable controllers so now I am getting into the area of multivariable controllers so look at this diagram here see till now we were talking about 2 PID controllers okay and the process part had interactions okay now can you have a controller which is slightly different so this controller this controller has one more leg here which provides some kind of compensation here okay the same thing is here there is one more compensatory element so this controller together is not this and this it is GC1 GC2 T21 and T22 there are two more elements cross links that I am introducing now so this is a multivariable controller it will try to simultaneously change if if I change the set point it will change u11 through this route but it will also try to change simultaneously u12 if I give a set point change in 1 and do not change the set point to what should happen the set point the level 2 should remain constant only level 1 should change okay if this has to happen then then there has to be simultaneously you know you have to take simultaneous action of u12 such that only u1 changes only y1 changes okay and y2 does not change this this to happen I need this cross links okay so these cross links are called as dynamic decouplers okay this cross links are called as dynamic decouplers and this decoupling elements help you to eliminate the interactions okay now this decoupling kind of controllers can be implemented through modern DCS or PLCs okay while they can be implemented through these modern computer control systems which are commercially available people just do not know about it so they still continue to use two PID controllers while it is possible to do this because now when you implement a controller it is a piece of software right actually when you are when you are implementing this PID controller I will be giving you this programs now I will be formulating and a problem for you to solve in that you will realize PID controller or any of these controllers it is just a piece of software okay you are solving some different equations online okay so if I am solving one difference equation I might as well solve ten different equations does not matter okay so now implementing a multi variable controller is not a big deal it is just solving some more equations okay which is very easy with given the kind of computing that power that we have today so developing such complex controllers cross link controllers is not at all difficult it is very very easy it just that people do know about it that using existing hardware and software which is there in the DCS distributed digital control system or computer control system or PLC it is possible to do this okay so we will stop here I can see a lot of people getting bored beyond this point and what I want to do is can I can I do this okay I will just so this lecture next lecture I want to use to do a transition from multi loop control to multi variable control okay so I will start with multi variable control but this is what I want to do can I introduce can I introduce two extra elements okay can I introduce two extra differential equations or difference equations computer control system will be difference equations or continuous time system will be differential equations such that effectively system behaves like this as if there are two decoupled loops okay is it possible to do that this is called decoupling okay using extra blocks I am going to separate the effects I am going to view them as to separate things so how do you do this if you have a transfer function matrix we will look at it very briefly okay and then we will move on we will move on to state space state feedback controllers I will go on talking about observers Kalman filtering quadratic optimal control and so on okay so now what I want to do now which is the course is going to become more intense now because now we will start doing compute the computing assignment okay so we will set up this examples by Friday I want to form groups roughly three students in a group okay and there will be three main components of this assignment okay so you can choose to solve it whichever way you want one person takes lead in one component other person takes lead in other component so three component are the three components of this course one component is parameter identification model identification whatever we detail mid-sem so you take this plant simulate its dynamics collect data okay and use it to develop a model from system identification toolbox of matlab that is part one part two is observer design what I am going to cover next part three is the controller design so whatever we learn as a part of this course you implement it on this particular thing make it into a project okay this is going to be a very very important component about 25% of the marks okay so you can choose your partners okay I am going to we are going to put five problems and if you think you can bring a problem from your domain like you want to do from automotive domain fine okay you can bring bring a problem from your domain just a contact us show it to us and we want to monitor this in three stages so we will have three valuations of this and I will give you a demo program okay there will be a basis from which you can write your own programs okay so and using this you should modify to suit your case and then you should write closed loop control so a complete case study okay of whatever we do in this course okay system identification state estimation and control a mock case study on a simulated system which has at least let's see depending upon the situation it could be multiple input multiple output a single input single output so we will try to set up will partially give you the code beyond the point you have to write your own codes okay