 So, in the last class, we have seen concept of how do you get going about selection of actuators and sensors for a mechatronics system and now we will just get more familiarity developed into the concept of feedback. The sensors that we used in mechatronics systems are mainly for feedback. Now how do we process this feedback or sensor input to further drive the control application or to get a desired kind of application going that is what we are going to see now in the next part of the course. Although this might be somewhat familiar to you, some of you might have already seen the feedback in the context of your MAC course or any other automatic control fundamental course. It is important to get firm grip on this concept of feedback so as to kind of use it in the case of the systems that we have not yet been exposed to. For example, this nonlinear systems or Lagrange formulation based systems or any even linear systems but added with the nonlinearity of the friction or backlash. So, in such cases how do you think about using like the tools that you have learned already say for example Laplace transform. Laplace transform if you say they will not be applicable because they are valid only for the linear systems case. So, then how do you go about doing such a analysis. So, that is where like we need this fundamental understanding of this concept of feedback so that you can apply it with the tool of this ordinary differential equation to many different kind of systems. I mean maybe it is nonlinear or nonlinear or nonlinear and get to know what is a way you can think about in the case you are not given that the system is linear and the tools in the linear domain what you have learned are probably not applicable. So, let us develop this understanding further now. If you see what we are going to see is basically the what is feedback how do you kind of what is called as feedback and open loop versus closed loop kind of a systems. You may feel this is like a trivial thing but nonetheless you should go through some part of it or like know make sure that all the parts of these are understood so that you can apply them in the cases of nonlinear systems as well. So, how do you process the feedback variable to achieve desired goal that is another kind of a very what you say more like a design question. So, there are many different ways in which one can process feedback variable to achieve what goal that is given to you. Some part we have already some kind of a feel based on our intuition or based on our common sense. So, to say we know how do you process this variable but how do you convert that understanding into some sense of mathematics and use it further. This is another question that we need to bother about as we go along like know we will start story unfolding answers to this kind of questions. So, now let us take an example but before that we need to be sure about like given a learnt what are the inputs and outputs you will be very sure about this is my input or this is my output based on input and output like the kind of development of control and its properties may have a lot of changes that will happen. And then established relationship between input and output which is what we saw I mean mathematical modeling will give you that and once we have that relationship and we know these inputs and outputs we are kind of more or less ready to kind of delve into this development of control algorithms. And there are several representations that can be possible for system but right now we are going to look at mainly this ordinary differential equations kind of a representation which is a most fundamental form for the representation. The state space transformation they are valid only for the linear systems case for non-linear systems you may have a state representation of a system that we will consider later for control development in a different way. But ordinary differential equations are the most fundamental form of representation that one can use for analysis of or propose any control and then do the analysis or synthesize the control based on the equations. How do we do that we will see soon. So, let us take this example of block lying on the these are our standard example this block with mass m on the surface horizontal surface and it is currently at this position and it now this f is applied on the block. So, let us assume for now that there is no friction between the block and the surface and under such scenario we want to drive this block to the desired position shown. So, what is the quantity of interest here quantity of interest is x the desired position. So, position is a quantity of our interest. So, x is a quantity of our interest which is output and quantity that you can dictate is input to the system is like force f. So, force f is can be any value that we we want to apply. Of course, I mean when we talk of a mechatronic system this f we have some certain saturation limit, but right now theoretical discussion we consider whatever value of f is desired we are able to apply. So, this f is something that we want to dictate in such a way that we reach the final desired position. So, we see first the relationship between input and output which is standard f is equal to m x double dot and now under such relationship if we want to kind of pose this question to take the mass to the desired position x t what should be the applied f. So, there are many solutions to these problems. One simple way if you remember we had done some kind of a planning for the trajectory if you recall the trapezoidal plan for the trajectory that I will move start moving the block in along some kind of a trapezoidal trajectory such that the final point of the trajectory is taking me to this desired position mind this desired trajectory trapezoidal trajectory is in the voltage I mean is in the velocity it is not voltage it is in the velocity x dot. So, you plan x dot along that trapezoid such that you accelerate first you move with constant velocity and then you decelerate and you are reached in the final desired position with the velocity in the final position 0 and we also begin with the 0 velocity in the starting position. So, if we plan such a trajectory we get some x desired dot first and then we get if you differentiate that you will get x desired double dot. So, if you see along the trapezoidal trajectory these are just a pulse of acceleration. So, you see trapezoidal trajectory velocity means if you take a derivative of this then initially the velocity the derivative will be positive is a positive slope of the trapezoid and then for some time duration whatever the time duration then you apply 0 x double dot and then you apply like x double dot which is reverse. So, that is how that the trapezoidal trajectory will define the desired acceleration. Now, if we know this desired acceleration x d double dot which now will be in terms of these pulses which are coming. So, these two pulses one is for the beginning of the trapezoidal trajectory and which is positive pulse x double dot and then at the end of the thing it is like a negative x double dot. So, these two pulses are to be applied as f like they will be scaled by mass m and if you apply these pulses we hope that with these the desired position would be reached. So, this is one of the many kind of trajectories of f that can take you to the final desired position. So, this particular way of doing things where you are really not using any information about where I am at the moment along the track if there is no dependence of f at all on x it is directly function of x desired and x desired is what is I have planned. So, this is important to know that this f has no any kind of a dependencies on x explicitly. So, under such scenario this f will be an open loop control. So, can you see what is the problem with such a solution where you have just an open loop some kind of a force that is applied here I am not looking at what is my current x position and I am still keeping on applying whatever f I have computed based on the knowledge of the system and I am hoping that I will be taken to the final position. So, this is some kind of an open loop based control and we can immediately see that in the presence of friction or in the presence of some other disturbances that are there around here we may not be reaching the final position. So, that is a issue with this kind of a solution that we have developed. So, now then the question comes that look here I mean I mentioned the same thing no feedback. So, we have not used the feedback of our input output variable x here. So, we would not know if we have really achieved the task. So, we have given this input friction and forgotten about it and then now if we look we find we are not at a desired position. So, then like we will have to do something. So, we are not really looking at whether we have achieved the final goal or not in real time. So, we need some sense of current position and make use of the same develop this f to be applied. So, mathematically this question can be posed. See for example, if you are given this kind of a scenario with your eyes open and you are saying ok I want to you apply force whatever you want to to this clock or your mobile for example, x mobile to take it from one position to other position. What you would think of doing? See what force you will apply? You will see ok I have applied some force the masses moved and like you know I keep on kind of monitoring ok it has it reached the final position as it reached the final position if not I apply a little more force. If I apply a little more force and it has over-suited the final desired position I will apply opposite force to bring it back ok. Can you see this kind of a common kind of a common sense kind of a way things will be happening inside your head to get it to the final desired position. So, the question is how do you now convert this whatever you are thinking to get it to the final desired position inside your brain to give it some kind of a mathematical form ok. So, this is what is the whole synthesis of control algorithm is all about this question ok. So, you feel ok oh look if I like look at this position or if I am monitoring this desired monitoring this current position how far is away from my desired position I do apply some things inputs such that you know I would go to the final desired position in some way in some way. So, if you see what exactly would do suppose somebody ask you ok look there is a competition and you the person who takes this block from current position the desired position the fastest possible way would get gold medal ok. So, this competition is there. So, now so now you are you are thinking now like ok suppose I do like no. So, initially if the error is high I would apply like large force but if I apply large force I go fast, but then I have a danger of overshooting this. I need to apply like some kind of a force which is again reduced as I come closer and closer. So, this is kind of a thinking that you would carry out in your mind ok or in some place I may have to apply I may have to accelerate first and before I reach desired position I need to start decelerating so that I can control myself to kind of make sure that I do not overshoot. With this kind of a you know things may be happening in your mind or when you you are participating in such a kind of competition. So, the question is how do we convert this you know this whatever knowledge that we develop as a commonsensical thing into some kind of a mathematical form. So, the question is like you know what is a function f of f of like you know some function which is a function of x such that ok. So, this is not a function of time explicitly it is implicit function of time through x ok. So, f should be what kind of a function of x such that we achieve the desired goal ok. So, pause here and like to propose some function ok and then like knows we will try to kind of see what we can do with that kind of a function ok. So, this function should be involving x in some way. So, the simplest kind of a solution one can come up with is make sure like know see that error as I said like know error between current x and x d and make f to be some function of this error. So, we want f to be 0 when error is 0. So, once you go to the final position we do not want to apply any force ok you will agree with me with on that right you do not want to apply any force once I am at the final position. But now if I just do this ok that apply f proportional to this error ok error between current position and final desired position then what would happen think about that ok. Will I really reach the desired position and then f would be 0 there although f is 0 will I stay there forever ok those kind of questions that we need to ponder over ok that is one way of thinking. Other way of thinking is to see like know if I put in some kind of a virtual system of springs and dampers such that the equilibrium position for such a spring damper spring and damper is my final desired position ok. So, that is so this is another kind of a maybe philosophical order I may be conceptual thinking that one can do ok. So, you you say ok why if I if I put some kind of a damper and this is like a more kind of physical way of looking at things that I throw in some springs and dampers in a virtual way like they are not there in a practical system, but I am thinking of they are putting them as a virtual kind of a elements in the system which will finally try my system to my desired goal ok. So, these are the two ways one can think about and in either way like you know one has to kind of do the analysis to make sure that we verify or validate that whatever we are proposing is indeed doing the job that we would like finally to happen ok that is this our goal place mass at the desired position ok. So, here again this is like a regulation problem if we have we have discussed the regulation problem that we are not interested in path along with this mass moves ok all the straight line in time it can be different paths. So, but we are kind of interested only in like you know reaching the final position. So, let us propose something ok say we will be propose some function then we need to know how this f could work towards you know getting your whole achieved. So, let us propose this. So, this f that is proposed here this is some kind of a error multiplied by some proportionality constant which you may be familiar with the proportional kind of a control action that is happening. So, k p times e is giving you the final form of f proposed ok and which when you use this how do you validate that this will work or not work if you see if you put this expression into this equation of dynamics ok that is going to give us what is going to happen ok. So, I put this f into the equation of dynamics and we find the equations which govern the error dynamics ok. This is a very important step that you find what is the equation that is governing the error dynamics once you propose some value for some function for f ok some function for control input if it is given then what is the final you know error equation that will get is very important to kind of get to this equation. Now by observing this equation we can see here this is a harmonic system ok. So, the error there is no damping in this system. So, initial error suppose it is e 0 ok the final error will keep on oscillating between the values e 0 to minus e 0 ok. So, the error will oscillate that means like you know that your mass is going to kind of oscillate around this desired position continuously. Can you see that with this equation that is happening and once I apply this kind of a force like although the force gets 0 at desired position the inertia built in the system is such a way that it is kind of pushing me pushing my system at a velocity is not yet 0 here. So, my system is getting pushed on the other side and again it will come back again it will go back the other side it will come back like that it will keep on oscillating around the desired position. So, how do you take care of this? So, now you can observe this equation and see what we want this equation desired form for this equation to be. So, we need some kind of a additional element which is a damping here. So, we put that additional element in this desired form. So, this is my desired form I would like to have then if I would like to have this kind of a desired form what is a control input which will give me this form or what is my f which will give me this form eventually ok. So, this is how one has to think about in the space of ordinary differential equations to analyze systems. So, I am taking this very very simple example to not like to get a concept across this can be extended to whatever complicated dynamics that we are looking at ok. So, this is a pure kind of a differential equation kind of a form of analysis. So, even if you do not know what are 0's poles nothing no concepts are known you can just do this kind of a simple analysis to get to the thing. In the prisons especially in the presence of friction in other place other kind of non-linearities if you do this analysis that will kind of like you know give you much nicer insights into the into what is going to happen than you have the plastic form or the other like linear forms of analysis that you might be aware about ok. So, we can use those forms also it is not a big it is not that ok we have to use this. So, what I am saying is like we should be aware that whenever those forms are failing or they are unable to give you enough information especially in the presence of non-linearities we need to have some backup tools available to us to carry out this analysis. Ok. So, now you can think about this expression for f is not much difficult to think about it is just a simple mathematics if you work out and you work it out actually and then see what is a form for that f that you get you will find that you get it is your like you well known kind of a PD control that you probably had aware about in your Mac courses. Ok. So, this is what is a main concept now like now let us we will see some kind of I will pose you some of the problems here and then you can think about those do some kind of analysis and if you have any answer questions about that we will we will take up that ok. So, you can look at this this is a PD as I said this is a PD kind of a control feedback. Now, you know based on the beauty is like you know once you have this and this error dynamics known you can play around with these parameters kd, kpe2 kind of see that a error response is is is controlled in a in a way you desire and that will help you tune kpe and kd. So, as to get like whatever desired response. So, there are so you have as I said there are other tools that that are available one can use those tools directly or one can come to come to this depending upon whatever is easier or applicable that is how one can look at this ok. So, now let us see this other problem ok. So, this is the same problem of but now like no further rotary kind of dynamics. So, you have the motor. So, this exactly like no your motor, but now at this disk is added on the top of that ok. And we have the encoder at the pack which will give you feedback theta. Now, our quantity of interest we want to place this disk as a desired angle or quantity of interest is theta and quantity in that you can dictate is input is is torque you may like no want to take voltage also to be a voltage as a input as well. Especially when you know now your model of the motor and you are actually applying this PWM duty which is average voltage that is given to the motor from 0 to 100 percent that you are giving this voltage to your motor and that can be considered as input. So, when you consider this as input then you can take the motor dynamics part also into account and get your entire model ready. Now, this model without friction and without motor dynamics will be similar to previous set of equations, but now I would like you to add let us your work at home that you would add motor model to these without considering the inductance in the motor. So, that your equations are order of equations remain the same and you can get now like how this voltage and theta relationships are coming up. The dynamic equation involving voltage will be coming or you will be getting and then now for such a system you design now what is the feedback control that you would apply so that you can do this desired goal of taking this mass from position 1 to position 2 finally. So, this is what your standard control problem could be. So, now practically when you start doing that you will find that there is additionally the friction in the system. So, now the question is how do you analyze whether in the presence of friction my proposed PD control feedback will work or not that is where now you will see that the stools of this error dynamics analysis which we saw for basic concept of feedback and fundamental OD analysis equations they would come handy to you. So, I suggest that you incorporate some model of friction simple model of friction say to begin with some simple Coulomb friction model you can put into your equations we have seen all the models of friction. So, if you put just a Coulomb friction model what would be like result of that. So, in the presence of friction can you work out whether my final error will be really 0 or not you will find that there will be some kind of a steady state error you will not be able to compensate. So, that steady state error will be there in the presence of PD control and that steady state error value will be some function of your gain and friction value. So, find out what that function is what a steady state error is and once you know that this particular control. So, this is what is going to happen in practical case also scenario. So, you start commanding your motor to the final desired position but motor will not go to that position because of the friction. So, you can say oh you know this based on the expression of the error one can get some kind of idea that if I tighten my gains further I may be able to go to the final position. Okay, but that is about it you will not be able to kind of make that 0. So, now you get a error dynamics equation worked out and think about that for some other desired error dynamic equations okay what should be to get to that what should be the modifications in the control algorithm that you are proposing that you think about and then see if you apply that can you compensate for friction in some way or minimize the bad effects of the friction. So, this is how one can start thinking when we so see for example if in the presence of friction will not be able to find trans function then you will say okay what I can do about such a system with Laplace transform and other stuff. So, this where like you know you will get into a little bit of a difficulty thinking into the domain of you know the trans functions. So, that's where like this you know thinking purely in the ordinary differential equation domain would come very very handy. So, think about that okay and slowly we will build upon these concepts and then there is another problem that one can think about see now the goal is different goal is to rotate this with the desired speed okay for this now what will be your feedback what's going to be your model of the motor if you use angle as a feedback we let help for this these are the questions you need to think about ponder over and like you know come up with some some kind of a design for such a so this is a other different problem okay. So, our control input is same say voltage and desired output now is speed is our desired output so then like you know what is now this new variable which is desired variable output what will be the equation which is governing the dynamics. So, this dynamics now is in terms of omega not really in terms of theta. So, the order of equations will reduce by one okay. So, now with that can you develop control law which will achieve this goal can you propose some law and do the analysis the error analysis now you can think over with the now you will require now that k d term is required in this case. So, one can see like that this system in terms of omega is going to be first order system instead of second order system and then there will be no overshoot for such a system if there is no overshoot then probably like this damping will not be required typically you need required damping to avoid this overshoot that was happening in the previous case. So, like that one can start thinking about doing things and getting to a control which will take us to this final desired speed and now that I want that to happen in the presence of friction as well. So, what should I do those are kind of questions that one can ponder over or like no think about and come to the some kind of a control expression which will take you to your desired goal okay. And you prove that you know with their error analysis you are indeed going to the final position in a way that you have planned okay. So, like that you can consider now these different different other systems okay couple of example one or two examples and you will form of this concept in your head okay. So, I think maybe we will stop here.