 At the final method of controller tuning and this time we will be talking about a method which falls in the domain of robust controller and this will be a method based on frequency response. So, we will look at frequency response based controller tuning and as I said this is under the domain of robust control design. So, what we are interested in is let us say our process has a transfer function of this form and you can use any of the heuristic method or any direct synthesis method or criteria based method to design a controller. So, you use this model to design or tune a controller. In reality if Kp changes to let us say Kp increases by 5 percent or your dead time was wrongly calculated and actual dead time is 10 percent extra of this under such scenarios would the controller still perform. So, we are looking at the robustness of the controller that if some of the process parameters in the presence of certain errors or variations in the process parameter would the controller still perform the way it is supposed to or would it still maintain the stability of the closed loop system. So, if your controller is able to handle such a large variation in terms of process parameters then you can say that the corresponding controller is robustly designed if not you will say it is not robust to modeling errors or errors to parameter values. Because these models are typically obtained from data and they may not capture the reality to the great extent. So, there is always a possibility that some errors might happen within these parameters. So, your controller should be able to handle any variations in such kind of parameters. So, when you want to do a design such that it allows you a certain freedom in terms of variations in the process parameters that particular method will be known as a robust controller design and we will be we will see how such a controller can be tuned by using frequency response. So, for that we will revisit what is frequency response and what is its role in terms of stability and its relation to stability. So, we have seen that frequency response is if you have a process you subject it to a sinusoid then your output will also be a sinusoid with a different amplitude ratio and different phase than the input. So, when you capture this as a function of omega which is the frequency of sinusoidal oscillation you will get the frequency response and how is it related to stability. So, for stability or I will say marginal stability the limiting stability stability limit what we calculate is a crossover frequency such that when amplitude ratio is when phase is equal to minus pi amplitude ratio is equal to 1 that will give you a marginal stability. So, that point into this AR phase and omega plane which are the based on these 3 parameters if you select if you find a point where phase is minus pi and amplitude ratio is my amry request is ratio is equal to 1 then that system is at the limit of stability. So, in order to ensure stability there are 2 possibilities there are 2 options. Option 1 is at phase equal to minus pi you can make AR to be less than 1. So, automatically you can ensure that the system is stable. There is another way of ensuring stability that when your amplitude ratio is equal to 1 your phi should be greater than minus pi. So, this is based on an assumption that monotonous nature of AR and phi. So, if your amplitude ratio and phase are monotonous functions of omega which is also a requirement of a body stability criteria based on which this particular condition is designed. Then you can say that when your amplitude ratio is equal to 1 at that frequency if your phase is still away from minus pi by the time it reaches minus pi amplitude ratio would have fallen below 1. So, both these conditions are sort of equivalent when you say both these are monotonously decreasing functions of omega and you can use any of these conditions to ensure stability. So, these 2 conditions will give rise to 2 design parameters in terms of frequency response base design. So, 1 is known as a gain margin. So, gain margin is defined as an inverse of amplitude ratio when phase is equal to minus pi. So, it tells me that so, if gain margin is equal to 1 then I have AR at phase equal to minus pi equal to 1. So, that means, it is a stability limit. If the gain margin is greater than 1 you have closed loop stability and we can show that higher the gain margin more is the tolerance in terms of control process gain errors in the process gain. So, typically gain margin is selected beyond 1.7. So, which will ensure that if only process gain has certain uncertainty then up to 70 percent uncertainty can be accommodated by ensuring again by keeping gain margin of 1.7. So, even if the gain increases by 70 percent the controller would still remain stable. So, that is the primary notion of what is a gain margin. So, it tells you how much additional safety you are putting in. So, whatever beyond 1 is the safety which we are putting in to in order to counter any uncertainty in the process gain. Similarly, we can also define a criteria based on the phase. So, that is known as a phase margin. So, phase margin is defined as pi plus phase when amplitude ratio is equal to 1. So, when phase margin is equal to 0 we have phase at amplitude ratio minus 1, amplitude ratio equal to 1 is minus pi. So, again that is the limit of stability. If the phase margin is positive what we have is at AR equal to 1 your phase will be greater than minus pi and therefore, you will ensure stability and higher the phase margin higher is the tolerance to error in dead time. So, this deals with any uncertainty in terms of dead time calculation. So, if the process has a lot of variability in terms of dead time then we can go for a higher value of phase margin. And you can know that these gain margin as well as phase margin as they are dependent on amplitude ratio and phase calculations they are also functions of controller parameters. So, by selecting a particular gain margin and phase margin we will get equations based on the controller parameters which will be kc tau y and tau d. And then we can accordingly select the values of controller parameters which will ensure a certain minimum gain margin and the minimum phase margin. Typically, phase margin of greater than pi by 6 or 30 degrees is quite common. So, let me show you how these are related to uncertainties. So, let us say our process transfer function for which we have designed a controller is this. So, this is the transfer function used for design and let us say the actual transfer function is as certain error in terms of gain tau remains the same and certain uncertainty in terms of dead time. So, this can be uncertainty or error in gain this is uncertainty or error in dead time. So, now if we see what is the amplitude ratio of the G actual is equal to amplitude ratio of your original GP because this is not going to cause any contribution towards the amplitude ratio 1 plus epsilon. So, 1 plus epsilon is equal to amplitude ratio of actual over amplitude ratio of the controller transfer function the transfer function which is used for controller design. So, for stability when omega is equal to omega cross over we want ARG actual to be less than 1. So, we want or at marginal stability G actually equal to 1. So, you can show that 1 plus epsilon is equal to 1 over AR of GP at omega cross over which is equal to 1 over AR of GP when phase equal to minus pi which is equal to the gain margin. So, gain margin is related to any uncertainty which we can tolerate in terms of the process gain value. Similarly, we can make a case for phase margin. So, if we say phase of G actual is equal to phase of GP minus delta omega cross over and now we want to say that or at omega. So, we want to say that at for stability limit when P is equal to minus pi AR equal to 1. So, we can say that minus pi is equal to phase of GP when AR equal to 1 minus delta omega. So, delta omega is equal to pi plus phase of GP when AR equal to 1 which is equal to the phase margin. So, you can say that whatever phase margin we choose higher the phase margin, higher will be the tolerance in terms of the dead time of the process. So, by using all this by this method we can specify a certain gain margin or a phase margin and accordingly we can find out the controller parameters. Let us now see how we can use this frequency response tuning method for a simple example. Let us consider that your process is first order less dead time and we are going to control it by using a proportional controller because it simplifies the analysis and for simplicity we will also assume that these two transfer functions are also unity and we have already seen how we can make this assumption. So, let us now see the overall open loop transfer function for this process would be 2 k c over 3 s plus 1 here is to minus 0.5 s. So, we are trying to find the k c and the goal here is to design a controller so that we have at least gain margin of 2 and phase margin of at least pi by 6 or 30 degrees. So, let us see if that is our goal in terms of design how do we go about finding the value of this controller parameter k c which is our single parameter here. So, let us first find out what are the corresponding amplitude ratios and the phase equations. So, a r in this case will be equal to k p k c over under root of 1 plus tau square omega square which is actually equal to twice k c over root of 1 plus 9 omega square. In the phase will be equal to minus tan inverse tau omega minus T d of s which in this case is equal to minus of tan inverse of 3 omega minus of 0.5 s. So, we have now equations for amplitude ratio and phase. So, in order to let us first see how we can design it for the gain margin. So, gain margin we know is the reciprocal of amplitude ratio when your phi is equal to minus pi or at your cross over frequency. So, let us first try to find out what is the cross over frequency for this system. So, we will have to equate this to minus pi that will give us the omega cross over. So, if you solve this equation you will get omega cross over is equal to 3.3405 radians per second. So, now this value of omega cross over what we want is we will have the phase of minus pi. So, we want to see what is the amplitude ratio in this case and that amplitude ratio we want to be at least 2. So, by using this what we get is your amplitude ratio at phi equal to minus pi will be equal to 1 over 2 which we already have calculated that it is going to be equal to 2 kc over root of 9 omega cross over square. So, by substituting the value of omega cross over here we can find out kc. So, the kc for gain margin comes out to be 2.5178. So, if I use again controller gain of 2.5178 then my gain margin will be equal to 2. So, for achieving gain margin of at least 2 my kc should always be less than equal to kc of gain margin. So, if I use any controller gain which is less than this then I can ensure that my gain margin is going to be at least 2. Let us now see the second part which is the phase margin design. So, for phase margin design what we have is phase margin is equal to pi plus phase at a r equal to 1. So, what we are interested in is we want to find out what is the corresponding phase when a r is equal to 1. So, we will use the phase margin of pi by 6 is equal to pi plus phase at a r equal to 1. So, that gives us phase at a r equal to 1 comes out to be minus 5 pi by 6. So, now we have the equation for phase. So, we will write that minus 5 pi by 6 will be equal to minus of tan inverse 3 omega at a r equal to 1 minus 0.5 omega a r equal to 1. So, we can again solve this equation to get omega at a r equal to 1 which in this case comes out to be 2.373 gradients per second. So, now we have this new value of a r omega at which a r is equal to 1. So, we know a r is twice k c over root of 1 plus 9 omega square. So, when I say a r equal to 1 this will be equal to 1. So, by substituting the value of omega a r equal to 1 into this formula we will get k c for phase margin comes out to be 3.5944. So, to ensure that phase margin is at least pi by 6 my k c should be less than equal to k c of phase margin. So, we have now found 2 limits on the controller gain one is based on the phase margin and one is based on the gain margin. So, in order to satisfy both these constraints. So, to satisfy our goal of gain margin greater than equal to 2 and phase margin greater than equal to pi by 6 our k c should be less than equal to the two conditions which we have one was 2.5178 and k c should be less than equal to 3.5944. So, the k c which we will use would be 2.5178. So, that it is it satisfies both these equations. So, if you calculate if the controller gain is this what you get is your gain margin is 2 and your phase margin in this case is 54 degrees which is definitely greater than 30 degrees. So, this is how you can design a controller by using frequency response base criteria like we used here in terms of phase margin and gain margin. So, to summarize we have seen this entire feedback control design system what we have seen is it consists of 3 sub problems for the first problem is about the synthesis where we want to identify what are the control variables manipulated variables and how do you pair them. The second part of the problem is a selection problem where we depending on what needs to be controlled what type of a simple controller has to be used whether it should be a p controller, pi controller or a PID controller. And then lastly we looked at four different methods in which we can select the parameters for the kind of feedback controller those are based on performance based tuning it can be a heuristic based tuning it can be a direct synthesis based tuning or just now what we looked at is a frequency response based controller tuning. And that is how you would end up selecting the values of controller parameters. So, we will stop here. Thank you.