 Welcome to yet another session of our NPTEL on nonlinear and adaptive control. I am Shrikan Sukumar from Systems and Control IIT Bombay. So we are into the sixth week of our course. So we are sort of at the, almost at the halfway monk. And we have already covered quite a few different tools for analyzing on linear systems. And also adaptive systems and also parameter identification laws and their convergence. Thank you. So starting this week, we are going to look at how to actually design adaptive controllers. So this is sort of the plan. And of course, as always, we have this very nice motivational background of this SpaceX satellite orbiting the earth. And the hope is that the algorithms that we design and develop will help drive systems such as these autonomously. So what we were, we had sort of started looking at last time was an introduction into the first adaptive control problem for this course. All right. So, so thank you for your patience. And of course, you would have probably hoped to see an adaptive controller, which is the topic of the course, which is the name of the course. Sooner maybe, but well, I mean, we of course had to cover quite a bit of preliminary material in order for us to be able to understand and design adaptive controllers. So great. So we had just started with our scalar first order system. So I'm in fact going to mark this piece as lecture 6.1, just for a reference. So we had looked at sort of an introduction of what we want to typically do in adaptive control. We looked at this first order scalar system, where we have a constant unknown parameter appearing linearly in this system. So X is a X and U and F are all scalar value. All right. And this and this theta star constant, which is unknown appears linearly in this system. And we have the control objective of the state X of T, tracking a smooth bounded trajectory. And we also stated the standard assumptions that are prevalent in all adaptive control designs. Yeah, at least most adaptive control designs and definitely the ones that we are going to focus on in this course. All right. So this is where we are. And this is where we will start a lecture 6.2. This is the second lecture of this week. Yeah. So the first thing that we do is design an error system. So, so why do we do that? Why do we design an error system? We are almost always interested in driving things to zero. If you remember when we were sort of talking about stability of nonlinear systems in the sense of Lyapunov, we eventually started assuming at all points that, you know, the equilibrium is the zero or the origin is the equilibrium. And that's why we, whenever we are given a tracking problem, for example, where a signal X has to track a signal R, we simply construct an error signal, which is X minus R, so that whenever this E goes to zero, we know that X goes to R. Right. So this is essentially the aim of constructing an error signal. And once we have an error state, if you may, we write the error dynamics just by taking a derivative, of course, and substitute for X dot from our original system dynamics, we get something of this form that is an equation 2.8. All right. So here, the first two pieces are essentially the same as what you have in the system dynamics. And you just have a minus R dot corresponding to the reference trajectory that we are trying to follow. So it should be sort of obvious to you that if you want, if your reference is a constant, that is, if you want to move to a constant value or to zero value, then R dot is zero. And therefore, this piece is also similar. All right. So whenever you're trying to track a constant reference, then it's typically, this is called the, if R of T is constant, it's called the regulation problem. Yeah. The tracking problem is when R is a function of time. The regulation problem is when R is a constant. And if R is zero, if R equal to zero, it's called the stabilization problem. So three kinds of problems. One is if R is a function of time, just like we have written here, then it's a tracking problem. If R is a constant value, then R dot is zero, and it's called the regulation problem. And if R of T is in fact zero, that is, you just want to go to the origin, just want the stage to go to the origin. Then it is called the stabilization problem. All right. So there's just nomenclature for you. So anyway, so this is what are the error dynamics. So this is the error dynamics. This is the system that we will work with. This is the system that we will work with. So the first step in any adaptive control design is to design a controller, assuming that the parameter is known. Of course, this is called the known parameter control design. Okay, so this is the first step. Again, sort of, this is the very standard sort of thing that mathematicians and applied mathematicians do. We've already talked about this. You try to solve the simpler problem first so that you get some nice ideas to solve the more complicated problem. All right. So that's really what we're trying to do. The simpler problem is when this parameter T does that is just assumed to be known. And the question is, can you construct a controller U so that E is asymptotically stabilized? All right. So how would you design this feedback? So one of the simplest ways to do this is to imagine or to sort of specify a target system. All right. So then the standard question that arises is what is a good target system? So it should be obvious that any target system should be set that the, in that it is for the target system, the error is converging to 0 as state of infinity. And also it's asymptotically stable. And so your target system should be nice. It should do what you wanted to do. In our case, you want the variable E to be asymptotically stabilized to 0. And so therefore you should have a target system which is asymptotically stabilizing to 0. And second, you should ensure that the target system has some similarity to the original system. Right. For example, if this is a first order system, just like it is, it would be sort of ridiculous to consider a second order target system. Because I will never be able to compare this and this. So things like that. So the target system should sort of match the original system. And it should have nice properties of asymptotic stability that you desire from the original error system. Okay. So in this case, what do we choose? We choose a target system. Maybe E dot is minus K E. Why? We know the solution for this. It's a scalar system. So I know that this is in fact exponentially stable. Right. So it's a good, it has good behavior of E of K. Okay. The second thing is it should be close. It should match. What do I mean by matching? I mean that by choosing some control here, I should be able to match this right hand side with this right hand side. And yes, it is in fact possible by choosing a control of this kind. All right. So this is an important thing to remember. So I'm going to repeat it. The target system is chosen to be E dot is minus K E. The first sort of principle of choosing a target system is that it should behave well, which in this case means E is asymptotically stabilized for the target system, which it does. In fact, exponentially stable. The second is it should sort of match the original system. What is this match? It means that by choosing an appropriate controller, I should be able to match this right hand side with the target system right inside. Okay. Yeah, this is these two are important. And in this case, indeed, I can do that just by choosing U to be of this form. So the second term here cancels the term corresponding to the trajectory. The last term cancels the dynamics. Notice that we have assumed theta star is known. Otherwise, this control is not implementable. All right. So if theta star was unknown, I cannot implement this control. Yeah. So this is not an adaptive controller. It was just a controller in the case of the known parameter. Yeah. So this just cancels the nonlinear dynamics. So this cancels the trajectory component. And the first term helps with the matching. The first term is essentially what helps with the matching. So now that we have this, we know that this is exponentially stable. And we also can very, very easily construct the Lyapunov function, which is just the basic one half E squared. That's the simplest possible choice. Which is, in fact, radially unbounded in all the nice jazz, which you look for in a Lyapunov candidate. Yeah. And further, if you take V dot, so this is the closed loop system. Now, if you take V dot along this closed loop system, I get minus scales. And therefore V dot is also negative. So in fact, you get global asymptotic stability. Yeah. In fact, you get global exponential stability. Why do I get global exponential stability? Because V is just half E squared. So it is bounded on both sides by this class K infinity function, which is half E squared itself. You can take half E squared itself. And further V dot is also, you know, V dot minus V dot is also upper bounded by a class K infinity function of the same magnitude. They can use just K squared here. Because it's the same order of magnitude class K infinity function. Therefore, this is in fact globally exponentially stable equilibrium. So E equal to zero is globally exponentially stable. So this is in fact more than what we're looking for. But well, in this case, we are able to do that. Okay. So what have we been able to do? We've been able to design this controller, right? For this known case. Yeah. For this known case, we have been able to design this controller. Yeah. With this, of course, K has to be a positive constant. Yeah. And that your error exponentially decays to zero and is asymptotically, in fact, exponentially stable equilibrium. And zero is an exponentially stable equilibrium of the error system. So essentially everything that we want. Yeah. So, I mean, so, so for the known case, we are, I mean, it's a scalar system. Of course, I mean, it was not very hard work to be able to construct a stabilizing controller. Right. As you would have imagined. Yeah. So for the known case, we are able to do all the book things. Excellent. And as we should, we are very happy about it, but not a big deal. Still a scalar system. Right. Great. Now, the next step now is to design the controller for the unknown parameter case. That is when theta star is unknown, what do we do? How do we construct an adaptive controller? And this follows a very, very simple logic and this logic is stated in the form of the certainty equivalence principle. So the certainty equivalence principle says that in order to design the controller for the unknown case, we retain the same controller structure as in the known case and replace the actual values of the parameters by the estimates. Okay. So the certainty equivalence principle, so certainty means that when the parameter values are known equivalence means that the structure of the controller remains exactly the same. The only thing you change is replace the true value like this, that is the theta star by its estimate, which is denoted by theta hat. Okay. This is very important. So we always use the theta hat to denote estimate of theta star. So the hat operator denotes the estimated value and the tilde is the theta minus theta hat or theta star minus theta hat is the parameter element. This is very standard notation that we will continue to use throughout this course. And so please get used to this notation. Theta hat or the hat notation always indicates an estimate. The tilde notation always indicates the parameter element or the estimation error. Okay. So what do we do? We pick up the same control law as 210 and we replace this theta star by its estimate theta hat because everything else remains the same. Notice that we are yet to prescribe how theta hat is calculated. Okay. So this will come subsequently. But for now, all we do is we replace the true value theta star by its estimate theta hat and this is what the certainty equivalence principle dictates. Yeah. So now the important thing to note is that because theta hat may not be equal to theta star as would be natural because you don't know the value of theta star. So you cannot possibly have an estimate which exactly matches the theta star. Right. So when you write the error dynamics, there's a small change. The first term and remains the same. But then there's an additional term which arises because of the parameter error because this theta hat is not equal to theta star and error term shows up here. And this is the theta tilde that we are talking about. Okay. So one of the things that should have already come to your notice is that I have very carefully put in a time argument on the estimate. Okay. Although my original parameter was a constant, my estimate of the parameter is an evolving object. All right. It is always evolving or changing. Yeah. Over time. Therefore, it is a function of time. It is not a constant. Yeah. Because there is literally no logic to having a constant estimate for another constant because if your estimate is wrong, you never get to sort of improve it. Because you chose a constant estimate. Yeah. So if you chose an estimate which was off by, you know, 10 units, then it remains off by 10 units all the time. You can never improve the performance. You cannot expect to cancel the effect of the unknown parameter if you did not choose a time-vary estimate. Okay. So there is no point in having a constant estimate for another constant. So although our true value is assumed to be a constant to the entirety of this course, the estimate will always be a time-dependent quantity. All right. Great. So now we have a different closed-loop system, which is this guy. Yeah. Which contains the parameter error node. Right. So, so what do we do? We now do what is called Lyapunov redesign. Yeah. And what is this? Which basically we use a Lyapunov candidate in order to come up with an update law. This is a very standard method. Right. So what is the idea? Idea is use Lyapunov candidate to derive theta hat dot update law. Yeah. So the expression for theta hat dot, that is the expression for evolution of the update is called the update law. It's the natural name. So what's the idea? I first guess a Lyapunov function. I don't guess a theta hat dot. I don't start by guessing a theta hat dot. I start by guessing a Lyapunov candidate. Okay. And what's the simplest Lyapunov candidate? I pick the original candidate, which was half east point. For the known case, if you know, if you remember, it was half east point. So I choose the original piece, but then I know that there is now another state. Why is there another state? I introduce the parameter error, which appears in the dynamics as a state. Okay. And therefore I add a term corresponding to that state. Okay. This is something like one over two. Right. One over two gamma theta tilde square where gamma is just some positive constant. Okay. Where gamma is some positive state. All right. Excellent. Excellent. So it's a very, very simple choice. Standard, simple quadratic choice. Yeah. Nothing too complicated. I chose whatever was already there. It's just one half east point. Added to it a quadratic term in the new state, which is the parameter error. Yeah. And that's with some positive gamma. So now for this system with theta tilde and E as our states, this is in fact, positive definite. Yeah. So, so in fact, V is radially unbounded, not just positive and definite. Right. It's just quadratic sum of two quadratics in the two states. Okay. So what do we do? Well, I mean, of course, gamma is what is called the adaptation again. It will show up soon in the update law and you will understand why it is called the adaptation again. So what do we do? We take the derivative of V. We take the derivative of V and we substitute from the error dynamics here. Okay. So what is the derivative? It is simply E E dot minus gamma theta tilde theta hand on. Okay. So the question is, why did we get a minus sign? This is because of how we define theta tilde. So theta tilde is equal to theta minus theta cap. And so theta tilde dot is equal to minus theta hand on those theta star is a constant. And this derivative is, of course, zero. So this is how you get the negative. Okay. So all that we have done is taken the derivative of this week. And now for E dot, we substitute the dynamics. So we do nothing for theta hand on because we have not even specified the dynamics for theta hand on. So we do not do anything, but we plug in for E dot from the dynamics. And once we do that, yeah, and you just expand it out, you will get the first term minus K E squared. Notice there's a nice negative term already. So we like this term. We're not going to mess with this term because K is positive. And so this is a minus K square, nice negative. All right. And then you get the term corresponding to the parameter error. So this term would not have existed if the parameter was known. So this is there only because there is a parameter estimation error. And that is simply theta tilde F times E. Okay. So the first two terms are just coming from here. And the last term is copied as it is. Last term is copied as it is. Now, behold this magic. Yeah. What is this magic? Both these terms have theta tilde in it. And both these terms have theta tilde in it. And so what do I do? I take the theta tilde common. Right. See, if there was no theta tilde in one of these terms, for example, there was no theta tilde here. It would have been a difficult challenge to specify theta hat dot because this theta tilde is multiplying theta hat dot. So in order to specify a theta hat dot, I would have had to have theta tilde in the recipe profile. And this creates all sorts of problems. First, theta tilde is not known. Theta hat is known, but theta tilde is not known. Therefore, having theta tilde in any kind of update law doesn't make any sense. It's no longer feasible. Yeah. And secondly, you never want to design any controller or update law with states in order. Yeah. Because if they go close enough to zero, then things will blow up for sure. Yeah. So you don't usually have ever design update laws or control laws with denominators containing the states. Yeah. So this is something that you should be very careful about. Okay. So this is a rather nice coincidence, if you may, although this is just an outcome structure of the candidate app on a function that both these terms are theta tilde, which can be nicely taken out. And then what we are left with is these things. Now notice gamma is strictly positive. So can be divided now. Yeah. So not a big deal. So what do we do? We do the best thing we can. Yeah. Because this is a mixed term. I don't even know what this is. I cannot have a theta tilde in theta. Because like I said, theta tilde is not implemented. Theta tilde is not known. Yeah. So this is very important. Theta tilde is unknown. Many, many students make these mistakes. Theta tilde cannot appear in the control or update. Law. Because it's important. Yeah. If you ever designed an adaptive control and your theta tilde or the parameter error appears in the update law or the control law, then you did it wrong. Yeah. Because you cannot have an unknown. Yeah. Because it doesn't implement. It's as simple as that. Right. So what do we do? So we do the best thing we can. We simply cancel this one because it's a non-definite, indefinite quantity. We don't know what to do with it. We simply make it, try to make it zero. And that's what we do by choosing this end of the theta hat dot. All right. And once we make this choice, this term goes away. And we are left with just this. Okay. Now look at this carefully. I say that this is negative semi-definite. All right. Why do I do that? For the known case, if you notice, I had the same expression for V dot, although the V was different. I had the same expression for V dot. And I said it was negative definite. But here I say it is negative semi-definite only. Why? Simple because the system now has two states, not just like in the known case, but also theta tilde, that is a parameter error. And I have said this quite a few times that any Lyapunov candidate or its derivative, if it does not contain all the states, it cannot be definite. Okay. For a function to be definite, it has to contain all the states. There are no two ways about it. Now, V dot does not contain all the states, but it is definitely non-positive. Therefore, it is negative semi-definite only. Right? It's only negative semi-definite. So what do we know? We can, as always, apply the Lyapunov theorems. And what will I get? Yeah. I will get that the system that is the errors dynamics or the E theta tilde dynamics is uniformly stable at 00 equilibrium. Whenever I talk of stability, it is important to specify the equilibrium. Right? So we only get uniform stability from the Lyapunov theorems. Yeah. We cannot get anything more. Why uniform? Because, of course, your V and V dot do not depend on time explicitly. And therefore, you have uniform stability. Okay. So, which is nice, which is a nice property, which means the straight trajectories are going to behave well. Yeah. Not start to blow up and stuff like that. However, we cannot guarantee that they converge to the origin. Right? Syntotic stability has two pieces, right? It is stability and convergence. Right? We got the stability. We don't have the convergence. All right? So in order to go analyze the convergence, we need additional tools. And what is this additional tool? This is, of course, the Barbalance learning. And what is called signal-chasing units. Yeah. And this is what we will sort of start with next time. Right? So, great. So, what did we look at today is that we started to discuss an adaptive control design for a first order scalar system. We first designed the controller for the known case. And then using the certainty equivalence principle, we obtained a controller for the unknown parameter case. In order to derive an update law, we guessed a Lyapunov function first or a candidate Lyapunov function first and then took the derivative in order to guess an update law. And until today, we have been able to prove that the system is uniformly stable using the Lyapunov theorems. But we, of course, want to move in sort of claim mode. Yeah. Which is what we are going to look at in the next section. All right. So, this is where we start today. Thank you for tuning in.