 Let us start with this new topic today. We will look at and I will split this lecture into two kind of modules and we will start with the first module. We will look at this mathematical modeling part. We will give overview and context and like you know possibly see the model of the motor. How do you model the motor? That is what we will do. Then we will move on in the next module to modeling the friction in the motor. So, we will talk about friction in more lot more details and like you know see a lot of different aspects of it. So, now to begin with we will do the let us look at the slides. First we will make it a pointer right. It is like a rough outline of the entire part, but in the modeling aspect we are going to look at some of the parts here. So, we will start with this points first and then actually as we get this context we will start about. So, why do we need to model? So, if you think about the models let us assess the system performance ok and then we can develop some controllers ok. Why they assess? How can you assess this performance with models? Because we can simulate them offline and without like you know doing much of experimentation we will be able to kind of get effect of one of the changes of the parameters or you know how the system behaves. How do you get all the details about like you know study about how the how the system behaves and what is its physics and then further utility of it for especially for mechatronics purpose is for development of controllers. So, this is very there are these two key aspects for development of the model or necessity for the development of the model. And the criteria for modeling will typically be simplicity versus accuracy. So, we want very simple models because we want to develop further controllers. So, your partial differential equation models or FEM based models which are huge you know matrices and many degrees of freedom that will be typically difficult to handle in control. So, you need to have a simple model and it should have enough accuracy reasonable accuracy to be to represent like you know whatever physics that we are talking about. And basis of modeling you all know we have we have done lot of these studies in prior classes prior courses. You you you typically model the system based on the physics of the system typically in in mechatronics systems you will have Newton's law Kirchhoff's law or many other phenomena in in the fluid mechanics you may have some laws that may govern the flow behavior or you may have a temperature behavior or you know thermal actuator you want to control temperature. So, those kind of models may be there ok. So, basically they are all all based on the physics of the system. And then you may have some empirical methods of modeling will not get into whole lot details about empirical methods of modeling, but there can be lot of different models possible just based on the input output data. You give the input system behaves in this kind of a passion and then like you know you can represent that data by by fitting some kind of a model. It need not be just a mathematical curve fitting, but it can be actually dynamic model which will fit fit the system. And then that is what we will empirical model typically will need input output observation of the system. So, for example, if you experimentally get a body plot of the system, then one can predict a similar kind of a transfer function which will have the same board plot as the system has and then that is one way of modeling the system. More advanced versions in this form can be in the domain of your artificial intelligence or machine learning based kind of a neurological kind of a neurons based kind of model ok. So, there is a lot of possibilities in further in this basis of modeling. Then for compliant systems you can or for a for more complicated systems like you may look at like you know linearized versions of of the models. You have a non-linear total model, but then you can linearize that model and then use for control. So, like like that there are these assumed modes method there are multiple kind of these methods that that would be there in the in the literature of modeling ok. It is a vast kind of a domain, but we are going to look at a part of it which is most important from many motion based mechatonic systems ok. We will not get into thermal systems too much or any fluid based systems too much, but we will just focus on motion based systems mainly ok. And we will see particularly like the motor model will if we will get a chance to kind of see this hysteresis modeling in harmonic drives systems based on like you know some kind of empirical methods rather than you know the pure physics of the system. So, this is like you know typically the outline of the thing. So, now let us get in like talk a little bit more details about these points now. So, when we start to say the need for modeling you will have first assessment of the performance. What is the assessment can be for ok? You want to design some system parameters you know as a mechanics engineer we want to kind of see ok what is the kind of sizing of the system I need to do what are the parameters I should use. So, for that you need to study this model and like get these parameters and design and then see that ok if you have some manufacturing tolerances I do not have these dimensions coming up to the expectation they are within some kind of a tolerances then how I can see that ok how the system will work or not work or what is the disturbance that will create in the system how do I handle that those kind of sensitivity studies can be done by you know assessing these performance. So, you can typically study an output variable as a function of change in the parameter and see the sensitivity behavior there. So, if the change in parameter if the output is changing a lot then like know the that output is very sensitive to the changes in that parameter and then that particular parameter will need a better kind of a tolerance strict tolerance control than maybe some other parameters in the system. So, that is to assess the performance of the system and you have I mean you know you might have done like know lot of these kind of studies of modeling may not be these sensitivity studies, but like modeling you might have done and like know see in the changes in parameters. For example, if you take a pendulum kind of a example and I say ok the change in the length is data then what will be its effect on the on some output parameter which you want to control say for example, frequency of the pendulum. So, you will be able to kind of you know say something about that. So, that kind of studies can be done with the model. Then you can offline simulate the system and then see its response or behavior to say varied inputs or in the presence of noise in the presence of disturbances all these kind of things can be done for the system. So, having a reasonable model will definitely help you to study the system in its totality to like know see expect what you will expect in the in the experimental implementation of it. And of course, last we will be a very important part is to develop controllers ok. So, test your performance of the controller or during the parameters of the controller say PID controller to or the gains of the PID controller to get desired output for the system. And other important thing is to kind of get a control input history ok. You need to make sure that your control input is not getting saturated. We will talk about this point you know multiple times because this is important aspect that often gets neglected while studying like your basic you know automatic control kind of courses. Where we are only focused on like you know stability of the system, stability of the system all the time we will talk about how to make the system stable are these gains making the system stable or these gains not making the system stable. Those kind of things we talk about a whole lot in the automatic control kind of a course. But nobody cares about like you know what is the input that I need to kind of maintain certain performance for the system ok. That is very very important aspect when you get into the practical world. Because always like you know your input is limited you will have a saturation on your motor input or motor power that is there and that needs to get factored into your simulation studies. And last and foremost point like you know you need to remember that you know you can save substantially in the time and cost if you do like no good amount of like a nice you know representation of system and do a lot of things on the soft and then going in the experiments and doing some stuff without any background in the in the really modeling. Okay so there are these criteria for modeling this is another very important thing many times often mislead people get mislead into oh I want to capture like this behavior accurately okay this model must be capturing all the things whatever are there in the phenomena. So that is not really of interest from control perspective okay. We want as simple model as possible but at the same time capturing all the things that are of interest okay. Say at different phenomena like if you observe different things may be of interest for example if there is a simple block moving on the on a resting on the surface and is applied by the force and it is moving under the action of that force okay what kind of model will come to your mind okay. If you say okay reasonable accuracy f is equal to ma that is a kind of a simple model that that will be there okay now when you say f is equal to ma we are like you know neglecting some parts in the dynamics of the interest it is resting on the surface so surface would offer some friction as a resistance okay so that needs to kind of get factored in so then for accuracy we will need that friction to be accounted for but now one way one may say okay extending this okay oh look there is a air around the block okay and that air also is giving its resistance when I kind of start pushing the block the air is resisting this thing now if I start modeling that air resistance to the block okay is it of what kind of a contribution to the entire model okay that is one needs to think about that in some cases this may be of of a great importance in some cases it may be like no negligible and important depending upon how fast you are trying to move or how what is the shape of the block and think that okay so for example if I am like no attaching some some load on the motor and like no that load is rotating that versus if that load becomes is happens to be a fan and I am driving a fan then that air is air flow air resistance that that comes into picture okay but so so now one can think okay what is the way I would model such a such a kind of a scenario these different different scenarios so for example if the block is like no moving with a reasonably low speeds I don't need to worry about the air resistance at all okay in other cases where the where there is a fan which is attached to the motor then I would say okay if I start modeling this fluid structure interaction of the of the fan and then like no create some kind of a huge numerical kind of a model or some partial differential equation based model is going to be held for for me to control this fan no fan or this fan system in in some way okay if it is needed to be controlled but then that that model will get simplified okay I'll like no so overall like no this air is giving some resistance to the to the motion and that resistance if I am able to capture in reasonably well kind of form I don't need to worry about so one can use some kind of a simple linear damping kind of a model or some kind of a non-linear damping model okay so those are kind of aspects of accuracy of representation of what is a dynamic of interest okay so this is what is an important point or important role for the designer to play to see okay what is an important part in the model and that often comes by just imagining or actually carrying out some some small experiments okay so as we go along like we can model or we can identify the friction and model the friction in in our own our motor kind of the system okay then there are these empirical models which are based on this so when the physics is so complicated that you cannot capture as I told about like a fan which is moving and churning out the air we it cannot like no the if you go through its real dynamics it will have like not a lot of this fluid structure interaction along with some some kind of a naval stokes equation partial differential equations which will model this physics I mean these models will not help us for development of control so much okay so then in that case we'll we'll consider some empirical models okay where I consider this this this and overall resistance of the friction to to be overall resistance of the air in terms of this some air friction to be of some kind okay some non-linear kind and that's like it becomes like a empirical model and I will identify the parameters of the model such that what are experimental data that I gather for various speeds it is fitting reasonably well with this empirical kind of a model okay so empirical models understand that they are not based on the physics okay they are based on like no the input output experimental data and typically they they they cannot they do not capture physics of a system okay so then you have this basis of modeling that we talked about their typical laws in in addition you may need to use see the laws of these electrical circuits okay Kirchhoff's law and the the Newton's laws okay they typically will be there in many of many mechatronic systems together okay there'll be some kind of a coupling between these two okay we'll see for example in a motor model how do this coupling happens and this coupling has a has a in high speed systems this coupling has a great effect okay or even in slow speed systems but in high speed systems like you know there are some effects that are more specifically coming up from the electrical dynamics in in normal like a lower speed things then electrical dynamics will not come into picture because electrons will have flow velocities through the through the wire much much higher order of magnitude than the mechanical motions in the system okay so electrical dynamics will really not come into picture unless like you know the speeds of motion of electrons or like you know some of the electronic elements that we are using say your magnetic actuators or something has or has some dynamics so that this electron dynamics matches with the frequencies of mechanical motion so mechanical motions need for that matter to be very very fast to have electrical and mechanical you know forces which are competing now with each other otherwise like you know some simple you know electrical dynamics will not need to consider but some kind of a simple relationships will will be sufficient okay we'll see this point in more detail when we see the model for the motor then you can use some additional like you know physics in the system and things like that so for CD-ROM case for example you may need to kind of think about some small consideration about the like you know Gaussian beam propagation and and laws of optics there like that many other kind of physics may come up okay depend upon what system you are handling here okay then based on input output observations like it will be based on experimented observations you carry out many different experiments and gather like the data of about these different complex phenomena for example hysteresis or some chemical processes fluid dynamic systems they're kind of very complicated to model from true physics of them that's where like you know you just give some input data and observe the output and then start looking at the models which can represent the data these are the typical steps in modeling okay so first as as we are mentioning earlier also identify the important physics of the phenomena and you you may do little bit in an iterative way this step or if you're experienced you may kind of like you know directly jump on to kind of knowing okay this will represent my my physics of the model very well and then if the major decision to take is whether to go for empirical models which are input output based models or you want to model like you know completely physics this is a important decision to take and then once you take decision you apply corresponding laws and and get your models done so this is how like you know we'll proceed to to do the modeling step now we'll see a motor model so that we apply now this whatever things that we have gathered you know overall kind of a context of modeling we'll apply it to this motor system now and see so this is a motor at the back what you see here is a encoder for the motor and then there are these wiring for the motor whose terminals are given in that data sheet and there is small little gear sitting on the on the shaft of the motor here so this motor will will will try to kind of see whether we can model this motor or not okay so so we'll we'll we'll work with some simple models of the motor to begin with we may make it a little bit of a no maybe we can work with the simple models only I think we'll not get into more complicated models for for motors in terms of any other kind of motors I mean we'll stick to the DC surfer motor kind of a model okay and later on we'll see some some other actuators as as a solenoid or other kind of actuators now just pause here for a moment and think okay what how do you model this motor what is the physics that is going on inside okay what kind of a base that can be captured into some kind of a model so think in terms of like know the separation in mechanical and electrical domains okay what is happening in mechanical domain and what is happening in electrical domain so for example in electrical domain you are giving some supply to these lines to the motor and motor is receiving some voltage signal and it is exciting its coils the coils when get excited with the magnetic they are suspended in typically in the in the permanent magnetic field and when the current is passed through the coil which is suspended in the permanent magnet you know that by Lorentz law you'll get a force on that coil and force will cause the motor to rotate that is what is going on as a as a phenomenon I mean as a physics in the in the system now we want to model this physics so what is that is going to happen how do you kind of think about modeling this motor so let's kind of get a mechanical domain separated with the electronics domain and see through okay what are the laws which will work at mechanical so mechanical domain what happens here anything about you'll see that you know the because of this current that is flowing in the in the wires the force is applied on the wires so so there is some kind of a torque that is generated inside okay so now there is a torque on the mass which is now rotating it's similar kind of a situation as if the block is lying on the on the surface okay and applied by the force okay it's the same situation where like now it's only in the in the variable of of theta or motion of the motor okay so the torque is applied on the system of of some mass okay and there is some bearings are there in the to this mass so like that we start and like the model the the mechanical dynamics okay so see what are the resistances that are that are provided the generation of the torque is is like you know say motor is generating torque which is tau tau m and like that you can start yourself first to to write some equations okay so do that step you write your own equations in mechanical domain think about electronics domain also in the similar kind of a fashion and then we see okay in electrical domain what are the equations or what are the elements in the electronic circuit we need to consider so you are applying voltage voltage source is there then there will be some resistance that will be applied by the wires then since the wires are in coil form there will be some inductance that will be there so like that we can think about these different different elements that will be there as a part of the electrical circuit and start modeling this motor okay and then once you are finished like know your own kind of things then you kind of proceed from this so pause at this moment I would say and then once you have done something on the paper then you can proceed to the next part of the lecture okay so here you have a representation in the form of a electrical circuit and in the form of a mechanical free body diagram okay that's what we do for any mechanical system okay so you can see that here that the torque that is applied here will have will be will be through the motor wires you know windings okay that is like no motor torque tau m there will be a torque generated by the motor and then there will be motion in the in the same direction and then you have some resisting torque which is given by the viscous kind of a friction and the important aspect here is in the electrical domain okay so and so important aspect is like know where is the coupling okay what is the coupling between the electrical and electronics electrical domain and mechanical domain okay say for example if you see this torque that is getting generated as we have seen by Lorentz law the current is related to this torque right so this torque will be proportional to the current that is flowing into the motor motor windings and similarly if you see in the in the electrical domain you will have the resistance inductance and then there will be this back emf that is generated do you know what is this this is because like no suppose you don't apply voltage and you rotate the motor shaft okay when you are not applying any voltage and rotating the motor shaft if you see the terminals of your your motor wires they will show some voltage okay there is like a electrical conductor placed in the magnetic field and it is moving it will generate current okay that we that we term term as a back emf and more faster you move the motor more will be this this current that is generated or the back emf that is generated okay so this is back emf is proportional to the to this theta theta dot sorry of velocity of motor shaft rotation okay so this is this is these are the two areas of the coupling coupling in the coupling from mechanical to electrical is through this back emf and coupling from electrical to the mechanical is through the torque that is getting applied which is proportional to tau i current torque which is proportional to the current that is flowing in the motor proportional to the current i so now how do you write the equations so so if you check here whatever your equations you have written have you missed anything probably you might have missed this back emf part okay so you add that back emf part and like you know see what is your enhanced model and then you move forward okay then you'll see that okay you'll get some equations of this kind okay so now here this so mechanical domain we apply like j theta double dot okay so j is the inertia of the the mass moment of inertia of the motor whatever is rotating in the motor shaft along with the motor shaft theta double dot will be acceleration angular acceleration then bm theta m double dot is is a is a resisting torque because of the some kind of a bearing friction this is friction in the bearing and then if you are applying like you know some additional load on the motor then this tau i and there is some gear box also okay the load is not directly applied on the motor shaft but it is applied through a gear box which is having n as a as a gear ratio then you'll get this tau i upon n term here which is equal to this is equal to tau m and this tau m is like you know the torque which is generated by the motor so you need to be careful about the tau torque which is applied externally on the motor and motor is like you know working against that torque versus the torque that is generated by the motor okay this is a torque that is generated by the motor typically is proportional to the current that is going into the armature of windings and and this is like like a constant factor this phi is a flux of magnetic field in the permanent magnet motor that flux will be constant in the in the separately excited motor there there is no permanent magnet there is a magnetic coil okay through which like you know the motor like you know permanent instead of creating permanent magnet you you create a electromagnetic magnet there okay so that flux will be bearing it may change okay so we are not talking about separately excited motors we mainly talk about permanent magnet kind of a motors so this both the terms can be a single constant okay and in the electrical domain if you see now the voltage that is applied to the motor is consumed in like the resistive losses IR and then back MF and then in the in the inductance of the motor inductance of the motor is if it is L, LDI by DT would be the the part of the it's not a resistance it's a it's a some kind of a fluctuation of the voltage across the inductor okay and accordingly that according to that your your complete balance of the voltage will take place and then this is a back MF that is in the system and as we know the back MF is proportional to the speed omega okay so we can write it as a again this flux may may be showing as a separate component or may not show as a separate component depending upon permanent magnet motor or separately excited motor okay so this is a basic kind of a motor dynamics model now one can simplify this further by considering like you know this coupling of the current eliminated the current and you'll get like you know some some more simplification for the model so you can work about that and see okay how you can get a unified model of these both these things considered together or all these relationships considered together and you get like you know the entire equation of the motion of the motor okay that may have this LDI by DT term coming so typically like L inductance of these motors is very very low so many times for all practical purposes this this inductance is neglected okay so this electrical dynamics as I was saying before that it is very fast dynamics here so that dynamics is seldom kind of like you know affects the mechanical coupling effects you know that it is it it doesn't it doesn't matter like you know really so there are two things although this current may be changing so fast if the low inductance of the motor itself like the motor winding in inductance is very very low value as compared to this back MA for these these voltages that are given here other quantities of the so this term gets neglected in the in the in the actual representation practically so with this term there are not there you can kind of try to see what is the motor model equations look like and then you can kind of take some example and simulate also okay we have some kind of you go to this maxon motor website and take some motor and put some parameters and check out and then those kind of exercise will be nice to to do to see okay how this motor will have different effects coming up in the in the modeling okay now you need to also now like you know we'll do this exercise but so so based on this model itself we can get you know the realistic simulation for the motor done okay so we are we can do that without adding any load okay so we don't have this term tau a tau i upon n they're not adding any load on the motor okay that gear is just sitting on our motor but like we if you apply some you you put some some linkage there or some kind of a the mechanisms there then like you know that is an additional load that is coming up but currently like right now we'll be we'll not be considering that any external load to the motor and then we can start thinking okay how do we can identify the parameters of motor so we'll just think about this okay given this now like you know the motor model what are the ways in which one can kind of see and identify okay what is say for example the inertia of the motor so consider these equations together and think about this this is very important and nice thinking that you can have you know to say okay I want to say get inertia of the motor what I need to need to measure okay what you have to what you what sensors you have on your motor to measure is the encoder so encoder data if I measure can I get these parameters you know that is a kind of a thinking one can one can go ahead and do then typically there'll be a friction in the motor okay so right now whatever we are modeled we have not considered friction in the motor but when we are doing this parameter identification and there'll be a part friction will be part of that identification process also okay so that will be coming up here okay so you need to be aware about that and then now we'll we'll have a question okay how do you model friction okay so we'll discuss now in the next module in a great detail like know what is a friction and how do you kind of model friction and represent friction in the motor model and then we'll be able to see a little more about you know this friction knowledge of having this good knowledge of the friction and the model of the friction is very very important aspect for the electronics engineer to consider or not consider friction or take some decisions based on based on the situation at hand in terms of friction okay so we'll do that now in the next module so I'll stop here for this module