 So, we start with our example now for development of control. So, we will develop some of these concepts here mainly based on you know differential equation kind of analysis and that discussion and also with the through this discussion we will develop some of the interesting concepts what how do we kind of see what can be considered as a control input. So, let us begin with these dynamics of pendulum. So, for this system if you see the model that we have done already in previous classes and previous courses you all are know very much familiar with this model ok. So, that helps because you already have some kind of understanding of this pendulum. Maybe I will just get a pendulum along so that I can demonstrate you some of these things. I have a pendulum here for you to watch also. So, you can see the motion ok. So, you all know about this, but the some of these kind of control aspects we can see through like you know some kind of examples we will do here ok. Experiments. So, this pendulum you can get a model if you have not done already by doing freeway diagram or kinematic kinematic analysis of you know circular motion of a point mass. So, I am not getting into the details there ok. So, you can see this model of a pendulum here ok. So, this model is giving you this full nonlinear form of a equation considering theta which is the angle of the pendulum here to be more than like you know small angle approximation. So, with this model you can see that this has a harmonic kind of a behavior and that too without damping, but if you see the actual pendulum this you know the oscillations damped down ok. If I keep on holding and like you know letting it go then the oscillations slowly damped down ok. They come down to 0. There is some kind of a damping that is existing. So, we will consider that damping into the system and you know then that will be more appropriate kind of a representation of the system. So, so this what is missing here is this damping and we incorporate this damping term into the system at c theta dot term and then convert those forms of equation into again like you know the standard form. So, see we always seek to get the system in the standard form of second order system which you remember s square plus 2 zeta omega ns plus omega n square ok that is a term for the standard form of a you know second order transfer function 1 over this omega n square over this kind of a term. So, we seek that kind of a form to have for the equation also and that form in the equation turns out to be where s square term does not have anything multiplying it. So, whatever is multiplying this theta double dot we divide by that entire other parts of the equation and then like you know see the see these terms accordingly. So, 2 zeta omega n multiplying theta dot ok this term will be 2 zeta omega n multiplying theta will be now we do not have theta we have sin theta term here, but for the low theta approximation this sin theta is equal to theta this is a term this will be like a omega n square kind of a term ok. So, that is how like you know we try to seek in wherever possible you know many systems this may not be possible to seek some kind of a normalized form of the equations. So, so that we can see through some of the details for example, if zeta is found to be some value here we know that this is this pendulum system is some underactuated system with this zeta value and that speaks about its nature. So, this is about dynamics now one can kind of do some experiments to see what is a how do we get damping factor zeta. So, you can think about like ok if I time out ok how much time it takes to get amplitude to some half of its original value something of that sort then one can odd number of oscillations based kind of a counting of change of amplitude that kind of a thing will give you a bi logarithmic decrement what is this damping factor zeta. So, this can be these kind of things can be carried out by studying the dynamics of the system and carrying out appropriate experiments to get the parameters. Now the this is mainly again so, this is like a dynamics without any input to the system and then now if you have a input to the system what you will consider as input. So, if you think ok I want to apply some kind of a torque on the bob or kind of a force on the bob. So, in which direction you can apply the force you can apply that needs to be in that in the direction of theta to have like know it represented up here or if you apply something else what will show up here that those kind of things we need to discuss and figure out. If you see this is also like you know similar to the system that you had with the hard disk drive arm. In that arm we had a case where the head moves on the disk in a horizontal fashion it moves on the disk, but one can see if that disk is not there only head is there and at the place of the head we have a big mass attached. Then like in the vertical plane this will act as a pendulum kind of a system and at the back side you had the coil and the magnet that is actuator which is giving some torque on this system that is a kind of a pendulum system that we can have ok. So, that is a one of the actuators possible in the direction of theta. So, but that is little bit cumbersome to create such system. So, or based on like you know your actual practical requirements there may be some other kind of a consideration that may be coming in place for input. So, we consider here that pendulum is mounted on a cart and the end of the pendulum is movable by the cart ok. So, if you have this pendulum it is mounted on the cart means like you know this point where it is hinged that point is kind of like you know is moving by the cart ok. The cart is able to move that point ok. So, if it is initially in motion now I can like you know affect the motion by actually the moving the top point ok. So, that is how my input I am giving to the pendulum ok. So, I am not really applying any force here, but I am just kind of moving the top point to give the input to the pendulum ok that is a kind of idea. So, we can consider these kind of inputs to the system and when this input is considered here like you know the hinged point motion by putting this hinged point on the cart and then the say you can say I apply force to the cart or I can say ok I am directly applying this displacement to the hinge of the pendulum. So, these are like you know different ways I can define my control input. So, although I have a cart here and I can apply some force on that cart I may choose to define you know that control be let the control be input x here or input x double dot here ok. So, this choice of what I define to be a control input to my system has somewhat flexibility that I can have. So, this is very important concept here ok. So, I can say for the system say there is a cart actually here for the system, but I am ignoring the cart dynamics and I am saying that I am applying this control input in such a way that somehow I am able to maintain whatever desired position for the cart to be x and I apply that as a control input to my pendulum system ok. So, as you will see later for such a definition there are some good advantages that happen here. So, you can see what those advantages are by saying putting these equations together here. So, this equation now with this input here I will not get into the details of this how this has come, but like you can check out by using the branch formulation or using your simple Newtonian approach you can simply see these terms. So, you can see here for the same system which was there previously of course, there was a damping here that we can add anyway for that this x double dot term appears here ok. So, this x double dot upon L entire of this term is some input which is in the direction of the generalized coordinate theta because this is a theta equation theta generalized coordinate equation ok. So, by doing this kind of a input to my system I get a term for my control which is directly in the direction of theta as if I am giving a torque on this string. So, normally giving this torque on the string is not possible, but because I am like now able to apply this a desired acceleration it is as if I am giving a torque to the string in the direction of theta ok. And then this helps us to develop a nice controller snator. So, with the with this term considered as acceleration is considered to be an input to the system and further the damping is considered in the system you get now this kind of a equation ok. So, this is now a simple spring mass system you can see the second order spring mass system with some kind of a force external force applied on this system. And with this force now I see I can define a control problem that developed this u in such a way that this theta goes to 0 or initially oscillating kind of a pendulum theta goes to 0 in some you know given amount of time ok. Normally the pendulum is going to take a lot of time lot of oscillations it will carry out and after some oscillations it will stop ok anyway. And I want to kind of go to this final point in a in a very short amount of time and how do I carry out that job ok. So, where is this kind of utility of such systems just one things comes to my mind you know where we have this overhead cranes ok. They are carrying some big amount of chunk of mass from one place to other place which is hanging out of the string and there is a cart which is on the top of the overhead crane you might have seen this construction cranes they have this. So, you do not want this mass which is like you know with the long string attached and it can by the way it can kind of oscillate it can have some kind of a motion possible. We do not want that motion to happen its oscillation should be damped down ok otherwise it may be dangerous for the for the personal or like you know life so, so in that case this control could be kind of very useful. So, what we do here is now for such a pendulum kind of a system we demand that ok we do not want any oscillation or even there are any oscillation they should get damped down very fast. So, how do we do that now so, how do we so, so this is our control and control problem defined and suppose we find such a input ok you then how do we drive the cart such that this u is applied to pendulum ok that means like you know we need to satisfy this equation. So, u is there and then x desired now this is not x here x desired we can make it as x desired here. So, my x desired double dot should be that u and I integrate this u twice with scaling factor L then I will be getting like know the actually the x desired as a function of time trajectory ok and that x desired if I go along the trajectory x desired then I am guaranteed to apply this u that is that was desired here. So, u itself if you see will be a function of time as we propose some kind of a control of which will be function of this theta which is in turn that the function of time and then you integrate that twice to get x and that x is what I will say my hinge of the pendulum will be moved along that x that is how I can plan my whole control implementation ok. So, from control design we will get u and we would like to like our x double dot to match these. So, we consider trajectory to have the same x double dot so this x t double dot then we find x t double dot from that x t double dot is equal to something by twice integration of u I have missing the scaling factors here can put those scaling factors ok. So, now we can like know control force f suppose there is a card pendulum card also is there in addition then I can kind of use this force on the card to be f by some means we can apply that force by say pda, pda, pdc controller to track the trajectory which is coming out of this equation ok. That kind of idea can be possible for implementation there are quite a bit of advantages of this kind of implementation which we will not discuss for now here, but later on maybe you know if you are interested I will kind of show very very good advantages of such a implementation rather than considering directly this force to be my input and considering my force applied on the card and card in turn is having a pendulum ok. So, there is a card here and the force f is on the card and card in turn is carrying this pendulum along. So, that is not a very great you know practically good strategy to implement because there will be a friction between the card and its wheels and other places ok it is sliding in part ok. So, this is a kind of a way we implement is we propose to do this kind of a control ok. So, this is a discussion about why f is not directly designed and implemented because of this friction that is there in the systems in eBay ok. So, you can do some kind of equations development of you know what will happen in the presence of friction how I consider you know control with friction in the case of card pendulum system and then like no things will unfold little bit what I am saying here. The friction is major cutlet to you know faithfully implement f that will make my control better ok. I can tell you something physically here ok. See if the friction had not been there then any pendulum motion here ok if the pendulum motion happens here and if there is a card without friction that is there some mass is there of course. Then the card will respond to the motion of this pendulum as a reaction forces the acting on the card at this point will start moving the card here and there and imagine the worst possible case when the friction is so high that it cannot move at all. Then even if you know the motion happens here the card is not moving so if the card is not moving at all then like no your feedback is somehow lost there like no this so you cannot affect pendulum or pendulum is not able to affect the motion of the card in some way ok. And that is a big hurdle for you know getting any kind of a feedback based on this force implemented faithfully ok. That much I can tell you as a physics part but to really get to this you will need to write the equations in the form of this pendulum card total system so that will be 2 degree of freedom system with the card degree of freedom and the pendulum degree of freedom theta and the force considered as a input so single input but 2 output kind of a system will be there and with the approach that we are discussing here right now those all complications of under actuation will be gone here if I consider u to be this kind of input and I implement this u by using the using this double integration and some say some kind of a PRD controller. Now there are some kind of a mathematical questions that one may pose that ok how do you guarantee that we will be able to track this xt trajectory very well by using some PRD controller with those kind of you know more kind of a finer mathematical aspects would be there which we are not I mean we say that ok we are PRD controller is fast enough to do that control so that it is able to kind of follow the desired trajectory in a in a very appropriate sense ok. So this is what is this discussion about this force here ok so we come back to this system now in this standard form it looks like this and then you can say write a transfer function of it and then see the open loop poles are here then now we can propose some controller to move these poles around anything like that ok so that those all all kind of things can be done now so we propose a PD control or P controller all these kind of different controllers can be done some some discussion that you can find here it is pretty simple to follow through. So the control problem is defined to have some say we just want to settle down faster than what it is its natural damping would allow it to do so we may propose like the derivative control or like no complete proportional plus derivative kind of a control to achieve the task here we have two parameters available for us to tune and so we are now seeing entire thing all this development only in the differential equation kind of a domain ok. So you see we are we have chosen to do this it is up to you to kind of consider that ok if you want to kind of do it on the the plas domain you can do that and see ok now for the new pole locations what should be this kd and kp again so that I can move my poles to appropriate location based on you know choice of kd and kp. So this is the final form of the equation in the differential equation domain see this is error equation because theta itself is our error because we do not want theta we want theta to get damped out so theta should be desired to be 0 then like the error equation is same as the equation in theta. And with this we can now plan like you know what we want how fast we want to be chosen omega new based on that and so this is our omega new here omega new square and this is our new two zeta omega n complete term. So we have some kind of a choice in both the cases to affect and we can choose these gains to kind of have whatever desired you know omega new and zeta new and based on that our system response will evolve. So you can use the standard system second order system specifications to design these values and like your problem will be solved here ok. And once we get this zeta then your u I mean zeta and this your kp and kd are sized appropriately then this is final u and then you can get this no this is sort of with the theta d is equal to some value but so you get the u in this in this form here and then implement it by like no taking double integration of this and matching it to mapping it to x desired and now x desired is like my motion of my hand here ok. So if you see here let me change this view so I have this pendulum mob here you can see I will use a shorter length. So with this you know if it is initially in motion and I want to stop this motion I need to kind of move zeta like you know it stops immediately otherwise it will continue a lot of oscillations to move. I move this my hand in such a way that you know it gets to the stop condition very fast. So I am doing something in my head to do that you can also try out and you will be able to also do. So whatever is happening in my head in some way is getting captured in the in the mathematics that you see on the slides ok. So I can kind of like move this quickly to do the job. So I will not be able to do as quickly as for example these equations can do for a for a tuned gains ok. So that is a beauty of like you know using the mathematics to do some kind of a nice way developing control over such a kind of a phenomena ok in one of the examples ok. There are many such examples one can kind of start developing and do that and this has immediate practical applications in overhead grains kind of a you know cart that moves in overhead grains ok. So let us move on from here to the other example. So you can get to more detestive theta desired was not 0 then like we have some difficulties here ok. So now one can see this whole in the in the Laplace domain how things will be represented and with this one can kind of see this is a feedback some kind of a unity feedback here with KPKDS here. Then you can as we have discussed you know one can do root locus analysis of such a system ok and that also kind of helps to kind of tune the gains or see the things in the different kind of a approach ok. So this is another example about the simple PD control for like regulation purpose. So this is much simpler form which we have already seen. So it is just again PD control applied here and you can see this in the error form here ok. So the idea here if you see from this error dynamics what happens is that there is a virtual spring as if virtual spring is attached to this mass which will have equilibrium at the desired reference position ok that is what is. So one can interpret this control as if we are actually attaching some virtual springs and damper to the system ok to get some kind of a physical insight into ok. So this is the same kind of a discussion a little bit in the domain of this example. Now when we introduce this integral part ok whenever we have the steady state error not going to zero that time we introduce this integral part. So you have seen in your simulation of the simple you know single link attached to motor kind of a system that when you try to oscillate this pendulum it does not kind of come to the vertical position because of the friction ok. The friction is what is not allowing it to settle into desired position or in the vertical position ok. So this friction is causing some kind of a steady state error in the system ok and even if you if this system is to move in the horizontal plane ok the same things would happen as you know would happen for this mass which is in the horizontal plane without the spring and damper case ok. So these are anyway the spring and damper are actually the virtual springs and damper that are put in the system ok. So if in the presence of this virtual dampers in the system one can see that if I keep this mass oscillating it will stop at some point which is not really matching this r completely in the case when there is a friction ok. So friction in the system will not allow it to reach r it will have some finite error that will be there in the system that is a kind of a point. So in the case of that kind of a error then you introduce this integral control action ok and the system has this steady state error ok. You see the response to the PD controller and you see that there is some kind of a steady state error then you introduce the integral control action ok. So we will talk about this integral control action part I think this main kind of I think or maybe we can give you summary of like you know when to use these different kind of a control actions in general in the system. So this will be good to kind of know and then as we have seen like we use this make use of this standard first and second order system responses which we have seen already I am just flashing the same slides here actually. So these are the standard first and second order system responses with like you know this is this information should be handy to us for application in several cases and then we will have this formulae for the second order system behavior formulae ok for you know maximum overshoot settling time this should be also handy to you ok. So that as we saw in the pendulum problem for example we can use them to to set up like you know these omega n and zeta to have a desired value or when you do the pole placement problem the two dominant poles which we are placing close to the imaginary axis they can have some values taken by this thing ok. So these are the typical for you know parameters that that we define ok. So this is this is a formula this given in the slides you can just go through them to make use of them in in the pole placement problem or in simple second order system problem ok. These are some of the general guidelines that one should be aware about that proportional control action will typically make the response faster increase the overshoot and increase the settling time ok. So if you use this k p gain higher and higher it amounts to increasing the settling time also ok all the response is faster it will settle in time also increases. So for the settling time to decrease we will use the k d gain ok. This derivative action decreases the overshoot and decreases also the settling time and but the response is little bit sluggish ok. So the combination of k p and k d would give you some kind of a you know nice response possibility and integral control action again it makes a response faster it actually introduces some zero close to the origin in the in the controller transfer function ok not really for the system thing but controller transfer function will have a zero ok. So it may amount to have a zero in the system also we but we do not know it prepare for the kind of a form of a system in a closed loop. Ok so it makes the response faster increases the overshoot and settling time but it takes care of the steady state error ok. So imagine if you have a steady state error like this here and integral control action is there derivative because theta dot is zero derivative control action is stopped proportional control action this theta is constant so proportional control action will keep still keep going but it is not changing ok k p times this error will be a fixed kind of a amount of input that will be going into system but that input is doing nothing to the system because say for friction for example like you know even if apply a force the system is not moving that kind of a case will happen here. So in this case the integral control action will help because if you put a integral control action if you see from this point just like the integral is starting starting from this point you can see the integral control action will be the area under this you know error curve or in between these two lines will be the integral control action that area key will keep on building up at some point like now it will exceed the friction value and depend upon gain that you have used and this error will be taken care of. So there is a chance that with this integral control action in the presence of friction this this build up happens so quickly that with sudden application of that force the system moves on the other side ok and again there this integral control action will have to come in picture to move it further back and there are there are certain zones for this process that system will keep on hunting between the two values rather than settling into some final value ok. So one and one needs to be careful about choice of the integral gain to prevent this hunting ok. So how that is to be avoided and those kind of things are like more kind of a mathematics can be worked out for for such a kind of a case ok by considering say your friction model or there are many other techniques also available. So you use this friction model and use something called describing function method to come to what is the frequency that is that your system will be keep hunting in both. So that these are not the matters of our discussion here but one can use these methods for such phenomena if at all you find somewhere in your future application of control this thing is happening ok. So this integral control action can have a possibility of system getting into hunting ok. And how do you tune this PID gains typically is given in this procedure called Ziegler-Nicholas procedure it just a matter of some kind of a steps that you follow you can see these more different details at this there is no point in getting into and explaining those steps I mean it is a simple information you just kind of follow the steps and your gains will be tuned ok. So you do look at this for practical tuning of this it is based on only like you know the experimental system is ready and I am now going to tune the gains or your simulation system is ready and I am going to tune the gains this is a way you can tune the gains you can try it out on some of the systems that we are discussing as a part of assignment in the class ok. So this is I think we will stop here for this discussion and this implementation aspects we have already covered some of them and there are some more issues listed here sampling time we have seen already then effect on system due to sampling we are here to see and filters these are all related to like your sampling and then speed of computation or how much is a computation that we need to do that is also important consideration that we should finish computation of control within the sampling time and speed of various interfaces also is a matter of things action that has to be completed within the sampling time ok. And so these are many like some of the aspects we have seen we have not so but you should have this list you know to see or check or put like a check mark ok you have taken this aspect into consideration this as this is a kind of a checklist you can do for you know controller implementation we have considered all these aspects are not you can check that ok. So maybe we will stop here for now.