 Hello everyone. So welcome to the fourth lecture of non-linear control. This is the final week of this course and we have been talking about control methods that allow for some kind of finite time convergence behavior. So we've already covered a decent bit of material on finite time stability and finite time control design and we had just started off talking about sliding mode control. So as we mentioned, sliding mode control though has features of finite time stability and control as you will see subsequently. The way it is sort of posed is in the form of a variable structure controller and the primary requirement as we mentioned is for some kind of a disturbance rejection. So this is somewhat of a lumped disturbance, lumped nonlinearity if you may and the aim for our objective of a sliding mode control design is to develop this controller that will actually help achieve asymptotic convergence or asymptotic stability while there is a disturbance that is acting on the system. And the assumption is of course that the disturbance is uniformly bounded for all time and for all values of the state x1, x2, a potential in some domain. Now as we already mentioned it is a rather difficult requirement to have unbounded disturbances for all states. So even if you look at basic polynomial or even linear examples of such functions you will find that there is no boundedness for all values of states. However, one can always claim that in a compact set of the states this function, this nonlinear function can be bounded and there are results which are more modern in sliding mode theory. So this sort of helps you to get more advanced results in sliding mode. But what we will look at in this series of lectures is the more classical version where you are actually assuming uniform boundedness on this nonlinearity. So this is the sort of double integrated type of a system that we start off with and we are looking to design a sliding mode control. Now if you look at a more basic asymptotic controller or basic asymptotically stabilizing controller these controls as you know and as we have been studying until now will typically ignore these kind of disturbances and so your control will typically be designed as u is minus k1 x1 minus k2 x2 for some positive gain k1 k2 and in the absence of disturbance obviously will drive your states to zero. However in the presence of disturbance you would expect something like a oscillatory behavior and I mean you will expect that you will get some kind of a residual set kind of a behavior you will never expect you will never get to exact convergence. So that is the whole point no exact convergence in the presence of these disturbance functions. So then the question is what more can be done. So first is we introduce a sort of a nice differential equation if you may that we want to follow right. So that is what we say we you know we introduce what we typically call as a sliding mode but we will define these things a little bit later. But suppose we want some kind of a compensated dynamics and this is essentially desired right this is essentially desired this is not actually the case but is actually a desired dynamics and we say this is x1 dot plus cx1 equal to zero for some positive c and it's easy to see easy to understand that this quantity is actually x2 itself because of how our dynamics is right. So therefore that's how it's chosen. So this is actually x2 plus cx1 and what one can also understand from here is that from from here it's evident that x1 goes to zero exponentially which means x2 also goes to zero exponentially right. So that's sort of what we understand right. So this if you are able to follow this kind of a dynamics even in the presence of disturbance if you understand that this will guarantee asymptotic convergence of both states x1 and x2 right. So we call this sort of a function s sigma x1 x2 and you can see it is usually a function of all the states. So both states in this case right and this is what is called a sliding mode yeah essentially what does it do it essentially it gives you a for this two-dimensional system right because you have two states yeah for this two-state system we reduce the evolution to a single one-dimensional line right because x2 plus cx1 is a straight line in the state space in the phase plane it's a straight line in the phase plane right. So I hope that's clear right something like x2 plus cx1 I can even draw something like this right let's say here right so x2 plus cx1 equal to zero would be something like this right so this is what will be yeah it's a straight line passing through zero right so this is what is the sliding surface depending on whatever the value of c is the inclination of this line may change and so on but essentially that's what it is all right so this is what is a sort of a sliding mode if you may right now how do we ensure that our system follows this so first we write apologies first we actually write the dynamics of the sliding variable right sigma right so so what is sigma dot yeah and so what is sigma dot it is x2 dot plus cx1 dot and x2 dot from our dynamics is just this guy right it's u plus fx1 x2 comma t plus cx2 because x1 dot is in fact x2 right and you have some sigma zero equal to sigma sub zero right so you now are working with a different looking dynamics and we are just working with the sigma dynamics right and now our aim is to push the sigma dynamics to zero right that's what we want to do so aim push sigma to zero right because if sigma is going to zero you understand that x1 and x2 are both going to zero all right so so what we will try to do is we'll try to make sigma go to zero infinite time right so how do we do that we take a v which is half sigma square and we get a v dot which is sigma sigma dot which is nothing but sigma u plus fx1 x2 t plus cx2 right now i hope you understand that this disturbance is obviously a disturbance so it's not known to us it's not like you can cancel it using the control however we can certainly cancel this guy right we can certainly cancel this guy so what is it that we want to be you already know that you know you you want to have something like a you want to follow from our finite time stability what do you want you want for finite time convergence you want v dot plus k v to the power alpha less than equal to zero so i mean and you can choose alpha to be anything right you can choose alpha to be anything that's our call right but alpha has to be within zero one and k has to be positive right that's our requirement so based on that if i actually just try to substitute that here what i would do is i would simply try to choose u as minus cx2 plus some v some small v right which we don't know yet okay so if i do that then what do i get i'll add a page here then what do i get i get um v dot so v was half sigma squared let's remember and v dot is sigma times v plus f x1 x2 t right now we'll do a little bit of an inequality right um we already know that this is going to be less than equal to absolute value of sigma absolute value of v plus absolute value of sigma absolute value of x x1 x2 t and we know that this is less than equal to l right we know this is less than equal to l so what do we do so we know that this is less than equal to absolute value of sigma times absolute value of small v this additional control plus l plus l okay so so now what do we do what do i how do i work this out uh how i work this out is i take my v as the small v that we have here here as some rho sine function of sigma right or also written as rho sigma of sigma okay so sigma is just the sine function it is um so sigma of x to 1 for x greater than 0 minus 1 x less than 0 and obviously 0 when x is 0 right actually this is fine and sigma 0 is can be anything in the minus 1 1 range yeah so sigma of 0 can be anything in this range all right so uh if we take actually as minus rho yeah then what we get is v dot is equal to absolute value of sigma times rho uh let's see if i want to do this i think i probably jumped a few steps ahead uh and i probably did not need to do that uh what we will do is we will choose the v in advance here and these i think i will move to later yeah all right so yeah so basically yeah basically what we are doing is we are actually selecting the v term first right we actually select the v term first right and what happens is when i substitute this in the v dot uh what i will get from here is v dot is um minus rho times sigma times sigma of sigma plus sigma times f x 1 x 2 t and this quantity sigma times sine sigma is already equal to the absolute value of sigma okay this is what we are yeah this is what we want to use that sigma multiplied by sine of sigma is actually the absolute value of sigma itself right um so what we have here um i think i can erase these safely and redo this again so this is v dot is now i do the bounding it's because this remain the first term remains the same minus rho absolute value of sigma okay plus sigma times l why because absolute value of f less than equal to l and so there will be a absolute value of sigma here as well so now if i take the absolute value of sigma common then this is um absolute value of sigma with the negative sign rho minus l okay so this is v dot so if i take rho as um well i mean for example as equal to l plus 2 then v dot turns out to be minus ah sorry l plus half turns out to be minus half absolute value of sigma right and that's basically saying that this is v dot is less than equal to minus um let's see let's see let's be careful here i'm going to be very careful here 1 over root 2 and 1 over root 2 and this is minus v to the power half right okay and this is very similar right through what we wanted right if i take k equal to 1 so same as a finite time convergence with k equal to 1 and alpha equals half right so we are allowed to choose alpha anything from 0 to 1 therefore we've chosen alpha equal to half and k equal to 1 so obviously we have finite time convergence so we know that the sigma dynamics converges to 0 in finite time right so sigma goes to 0 in finite time and the cool thing is in the this happens in the presence of disturbance all right so you have actually rejected the disturbance why do i say it happens in the presence of disturbance because we did not neglect the disturbance in the analysis we actually put in a term that is the rho has this l value which is basically going to compensate for the disturbance yeah so we have something that compensates for the disturbance using the bound itself all right so we have a disturbance compensated convergence right that's pretty interesting that's very interesting okay so so what is our control now so our actual control is u is if you may it was here let's see yeah the control was here it's minus cx2 plus v and v is chosen in this way right so therefore our control is minus cx2 minus rho sigma sorry rho sigma of sigma so that is x2 plus cx1 right right all right so that's the control and as you can see the control has uh switching on the sliding surface right i hope you understand that this control switches on either side of the sliding surface so so how the how will this work this will be actually evaluate to equal to minus cx2 minus rho when x2 plus cx1 is positive and this will evaluate to minus cx2 plus rho when sigma is x2 plus cx1 is negative all right so there is actually a switching across this sliding surface there's a switching along the sliding surface so the sigma equal to x2 plus cx1 equal to 0 is actually the sliding surface so there's a switching sort of a thing happen okay so therefore you can imagine you can imagine that what will happen is you know if you look at the plots for example right what you will see is the sliding variable of course right will behave in a very very nice way right i mean it will it will actually converge in finite time right i mean it will just do this it will just do this right beyond some finite time your sigma will converge okay so you expect some really nice plots on the sigma variable however and then similarly i mean x1 x2 is obviously converging asymptotically right converging asymptotically so so this this sort of if you may the time right in which in which you have in which you have basically this reaching yeah so this until this time my apologies is called the reaching phase and this beyond this is called the sliding phase okay now the problem with this controller is pretty obvious right the problem with this controller is pretty obvious because of the disturbance i mean if you look at this sort of a plot on what happens you know very close to the sliding surface right so you will start to see some kind of a zigzag motion happening right so so this is the sliding surface i mean we already know that it probably looks apologies we already know that it looks something like this right so that's the sliding surface and there is of course i mean this is x1 this is x2 there is a sort of a sliding phase sorry a reaching phase which is finite time and then there is a sliding phase yeah but this is there is small zigzag things here yeah there's small zigzag things here right why because what what will sort of happen is that you have because of the presence of disturbances what happens is and you are not exactly compensating for the disturbances as you notice right i mean you what you're trying to do is you're simply dominating them in some sense using this l right and the disturbance are bounded by l so it's not like you're at every instant in time you're exactly canceling the disturbances no you're not you cannot do that because you don't know the value of disturbances to do that so what happens is once you get to this sort of place where you're on the sliding surface what tends to happen is you will get thrown out of the sliding surface a little bit right and then you will and then the control of switches right i mean the you will go from one side of sliding surface to another side another side to one and so you tend to do a lot of these high-frequency switches why because your control law is in in the finite time convergence kind of idea at sigma equal to zero the control is not lipships right it's not smooth right so there's some high-frequency activity happening so that's exactly the thing here here the sigma equal to zero is essentially the sliding surface so on the sliding surface you have non-smooth behavior and because in this case the sliding surface is not actually the origin of the equilibrium of the system so you are still moving on the sliding surface not like you go to the sliding surface and you stop right continue to move and there is disturbance so what happens is you tend to overshoot undershoot and there's a lot of these high-frequency chatter happening because of the non-lipschitz nature of the control this this is actually this phenomenon is actually termed as chattering and in fact the control also right the control also in the same sort of timeline i mean if you see the control will be really nice sigma comma if i put the control as well and this is the sigma and also the control here so the control looks really nice here but then once you reach this place it will be oscillating very fast yeah there will be very high frequency oscillations in fact i'm making it very nice and clean it will be much worse than this yeah and this is a phenomenon that is not particularly great right so so the problem is in first order sliding mode why is it first order sliding mode first order means sliding surface is one dimensional okay first order sliding mode leads to chattering okay and though there is disturbance rejection and a lot of these nice properties this is not considered particularly nice property to have okay so what we want to look at is what one can do about avoiding the chattering phenomenon okay and that's what we will look at in the subsequent next