 So, passivity by output selection is a possibility as long as your system is stable in the sense of Lyapunov. So, great. So, there is at least some hope. Now, like I said, what happens when you do not have a stable in the sense of Lyapunov system. Then you go for what is called feedback passivation. You try to use the feedback to get passivity. That is the idea. So, what is the deal? We are now not making any assumptions on this guy. What we are saying is you have this input output system. We are already specifying the output also in this case. The output of course, might come from here the previous method itself. But now we are no longer saying that there is some kind of stability in the sense of Lyapunov for this system. Because, which is what we assume for the first case. But we assume there exist some feedback. So, what are we going to do? We are going to sort of plug in a feedback in the system. Now, the question is what is this feedback doing? Of course, we have to ask. Once we plug this in and again this material is sort of taken from Khalil. But there it is a lot of it is stated as theorems and proofs and all that. I am not doing that. I am doing it more in a step by step way so that we figure out what is happening. So, as usual we assume all the Lipschitz smoothness and all the nice things. Then what am I doing? What I am doing is I am going I am just proposing some feedback. If you notice this is a pretty general structure for a feedback. There is nothing very specific or special about it. What did I do? I broke the feedback into one term and then another term which contains some additional thing that I can play with. I can sort of prescribe later on. So, I have taken this control and I have reduced it to this control. But as far as we are concerned these are pretty much equal as general as it gets. It is some function of x another function of x multiplied by new control. Now, what is the advantage? Of course we are as usual assuming some more Lipschitz and smoothness and all that for I mean just to keep things simple let us assume everything is smooth anyway. If you substitute this control back here you are going to get this sort of an expression and I have done nothing but substitute the control here. Now, if it so happens that this system is passive in V y then the system is said to be feedback passive. But again looks very general and looks like it is not going to help us at all. But it is because we are just trying to generalize this situation. We are going to use this control somehow to sort of give a feedback term. This will sort of you know plug in a feedback term and this feedback term is potentially going to make this you know Lipschitz sorry make this stable. And then you can sort of choose this y and so on. So, this is one step beyond what we have here that is the idea here that is the idea. And this is called feedback passivation is more like a definition if you may that after plugging in some feedback which is very very general if the system turns out to be passive with this y and with this sort of drift system then and with this new control V not the old control U but the new control V then the system is feedback passive. And to illustrate this we actually look at now one rather serious and useful example. This is the control of robot dynamics in joint space. I mean you are already you can very quickly get into the controlling a robot and this is like a manipulator any robotic manipulator will have this sort of a dynamical system. We will spend you know couple of minutes trying to understand what the terms are anyway some of you might have seen this sort of model is typically arrived at by using Lagrangian. Those of you who have done any kind of robot modeling will know so this sort of model is arrived at using the Lagrangian method or Hamiltonian but typically Lagrangian. Q is what is called a generalized coordinates so if you have a robot let me see if you have a robot which is like as a revolute joint like this and then here there is no revolute joint but how do I say. If you look at this picture what do you see there are 3 sort of degrees of freedom if you may or 3 sort of in the sense coordinates not let us call them coordinates what is this in order to specify this robot I will need to specify this angle alpha 1 then this angle alpha 2 so it is like shoulder this shoulder and this alpha 1 and alpha 2 but here which I cannot do the third thing I am saying that my wrist can sort of move in and out it is a linear joint linear actuator linear actuator on one of the arms you can see that this is possible I mean you can make it out with this guy so this is a robot yeah this is one angle this is the other angle and this thing can move also yeah you can imagine I can make a robot like this I mean for many reasons yeah just for fun if nothing else yeah all right now what is funny or odd about this is that all coordinates are not angles are all or x y so they are not in the same type of coordinates if you may yeah they are either angles or positions and so on and so forth yeah but when you do Lagrangian modeling you can actually look at them all together and you call them generalized coordinates yeah they can be positions they can be angles they are all combined in one vector and this is called generalized coordinates okay that is the reason for naming them generalized coordinates because they can be positions angles and so on and so forth no problem okay again in the mechanical system context you again electrical system it can be well sorry voltages currents and different things yeah completely different things different units yeah they are combined in one yeah so and q dot is of course generalized velocities right so in this case it alpha 1 dot angular velocity and x dot which is linear velocity yeah so and then you have the system matrices which is the first and the more important most important one is the m of q which is the inertia matrix called the inertia matrix and not difficult to sort of compute it's it's sort of actually captures the inertia of the robotic system if it moves around this origin then what is the mass distribution typically this will be a function of the coordinates itself yeah very very in very very unusual circumstances will it be independent of the coordinates yeah mostly it will be a function of the coordinates but it will be symmetric positive definite inertia is always symmetric positive definite matrices okay then you have the c q q dot which are the centrifugal and Coriolis forces okay again because robot and mechanical system so you know exactly what these are yeah and then there is d which is the viscous damping this is like you know if you have these joints and then there is damping on the joints yeah or there is damping in the linear actuator right then here then there is some viscous damping and that depends that sort of always scales the velocity and then finally you have the g which is the gravity term okay so this is standard notation I don't think even books will change more if you go from one text to the other I don't think even they will even change the symbol of the or the letters also thankfully this is one of the most standard notation m will always signify the inertia c will always be the Coriolis and the centrifugal and or centripetal whatever then you have the d and the g which is the damping and the gravity and then you have the control finally yeah control of course can be you know you can actually maybe have a motor here here and you can have you know some linear actuator here pneumatic actuator or whatever okay so this is the control okay so this is the this is the system that we are looking at yeah and one of the things that's known for because we have arrived at this via lagrangian modeling is that m dot minus twice c is a skew symmetric matrix okay this is known for this robotic type system it will always hold yeah this is nothing very unusual system property and what does it mean for a if this if a matrix is skew symmetric then the corresponding quadratic form is always 0 okay this is again a property of skew symmetric matrices okay so again whenever we deal with practical real systems then we have to identify these properties of the system so typically somebody who's been working on these systems for a while they will know these yeah so whoever designs controllers for these systems will always know this there is no two ways about it yeah so m dot minus 2c skew symmetric therefore any quadratic form using m dot minus 2c turns out to be 0 yeah okay what is the objective tracking we until now not done any tracking problem okay so this is the first tracking problem okay what is the objective track a reference q of r again this reference and we are doing everything in the joint space by the way yeah in reality you might be you know applied guys might be interested in the position of this guy the world position yeah what is called the end effector position yeah not this x not this x but the world x y z okay you might be interested in applications on that okay but you can always reduce it to some trajectory in alpha 1 alpha 2 and x yeah by using the inverse kinematics yeah for any robot this is possible again we have not we are not going into that much detail but the idea is any world space problem can be converted to a joint space problem yeah and so we are doing the control in the joint space only not in the world space yeah now if I want to track a constant reference then I construct an error like this okay and what happens yeah we write the dynamics of the error it comes out to be this guy okay do you believe me that it comes out to be this guy huh what is it go ahead there's a g-term there yeah what are you saying okay I made this simplified problem okay I will I have basically chosen a constant reference so qr is actually a constant so I am I am actually doing an easy problem here yeah actual trajectory tracking would be it's a time varying trajectory in that case the trajectory also will have to satisfy an equation like this typically anyway we will go there later on not right now yeah not right now right now we are doing an easier problem the reference is a constant my angles are at some constant value my linear position is at a constant value I want to go term I want them to go to another constant value that's it okay now if you look at this again q minus qr qr is a constant so any derivative so left hand side contains only derivatives right so any derivative e double dot is actually q double dot e dot is q dot and gq is just gq nothing changes okay just because I chose a constant reference yeah just to make my discussion in class simple yeah otherwise it'll take a long long time to reduce the problem itself okay so what we want is e equal to 0 to be globally asymptotically stable okay so you see that the dynamics of e and the dynamics of q are the same just because we have a constant reference nothing magical I didn't do anything yeah you are right if there's an actual reference then we'll have to do gravity will cancel okay we have to do all those funny things yeah but we're not going there now what are we claiming we are claiming that this kind of a control we'll give us feedback passivation what is feedback passive means that after I plug in the control and with some output I will get passivity so my claim is that this control gives me feedback passivation it's obvious that the first term is just to cancel this guy so let's not even worry about it is going to if I plug in you just going to cancel this guy yeah then there is a nice negative term in the error we love these terms right always it's the proportional control yeah if you may and then I have some new control that I will figure out later on yeah but my aim is to get passivity in this case okay I just want to get passivity let's plug in and see what happens yeah if I plug in this is what I get gravity cancels out and the KPE went from here to here so I just have this system okay now I consider this storage function V as this guy okay this is a very standard construction yeah it is just taking notice by the way I have not written this in state space form all of you should always be watching these things I didn't write this in state space form I'm directly working with the double second-order dynamics technically it'll be nicer if you wrote this in state space form and so on but because it's just pre-multiplied by an M it's a little bit painful but you can always do that you can just write this as even dot is e2 and M q e2 dot is whatever okay this would be the state space form yeah where even is equal to e and e2 is equal to e dot okay if I choose that I would get a state space form let's not worry though yeah pretty easy all right great now I'm saying that this is a very standard construction for a Lyapunov candidate for the robotic system very standard construct if you get a robotic system try this Lyapunov function Lyapunov candidate okay great why why is this a nice candidate first of all M is symmetric positive definite okay for all q therefore this is already a nice positive term Kp was chosen to be positive definite obviously I mean I don't know if I wrote this here really hope oh disappointing Kp in the general case yeah this positive definite matrix symmetric matrix okay therefore this is also a positive choice nice choice so this is actually a quadratic right just a quadratic form yeah and both are positive definite matrices so it's almost like x1 squared plus x2 square yeah or k1 x1 squared plus k2 x2 square where k1 and k2 are both positive numbers it's just the matrix vector extension of that okay standard Lyapunov function yeah and this is you should get used to this sort of a construction if I take the derivatives now of this guy what happens this is just e dot mq e double dot yeah I'm using the product rule so e dot transpose times mq times e double dot because it's a vector I'm just being careful of the transpose and all that I'm not allowed to change orders of things and all that mess otherwise it's the same and the second term is e dot transpose half e dot transpose m dot q e dot and because there is there is derivative of this also okay you could have done this twice half e double dot transpose mq e dot and half e dot transpose mq e double dot but it turns out to be the same things right because of scalar transpose of scalar is scalar yeah which I made you write yeah this is a scalar quantity so I can keep taking transposes so this is also scalar quantity okay and then again derivative of this is e transpose kp e dot yeah because this is scalar I can keep flipping no problem same thing comes out okay great this I want to be less than equal to v transpose y all right this I want to be less than a v transpose y okay I need you to do this as you can see it's the exercise now you see I have to plug for e double dot here right which is this actually sorry I have to plug for n q e double dot here which is this guy yeah brings in the v wings in the control new control v and then there is e transpose kp e dot yeah which is actually very nice you will see that it's a nice term so basically this term contains the new control v and now what I want you to do as an exercise is choose a output anything is output y such that this quantity is less than equal to v transpose y where v is this new control and then basically you would have achieved feedback passivation not just that I also want you to after you find the output y I also want you to show zero state observability of this system for this v y pair okay so is a very very nice and obviously a relevant example you already moved into something real yeah and you will also be doing simulations on this okay with some real numbers that I will give you yeah so please look at this carefully you'll have enough time it will be the next homework so you'll have enough time look at this carefully understand it very well if you have any doubt you ask me but make sure you understand it very well so that you are able to do this exercise yeah I mean if you can crack this theory part okay because once you have this output y and this new input v you know that the control can be just minus phi y right because of the theorem that we have already yeah it's all set so all you have to do is this show that this is less than equal to v transpose y for some output artificial output that you choose it doesn't have to be you know real okay but again check and see what comes out yeah you will see that something very nice comes out on the left-hand side yeah the system this the apnoff candidate and the system is very nice properties yeah which is why controlling robots is actually I mean designing control control for robots is readily easy yeah so please sort of start on this exercise just get yourself a warm start try to understand you know what's going on with these terms and so on yeah and see how you can use these properties yeah to complete this analysis so once you can compute the left-hand side properly that's all you need to do once you compute this left-hand side properly and carefully after substituting the double dot you will yourself have some structure like this and then you just have to choose a y because otherwise it will be difficult right you should have a structure that looks like this here okay all right okay cool thank you