Classic Inverted Pendulum - Equations of Motion

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so here's a working model simulation of a classic problem that one studies in control theory that is this this rectangular mass down here is attached and is constrained to move along a straight line just back and forth there's no friction whatsoever and come burring its motion and then you have the pendulum this the circular mass here that's attached to the other mass through a rigid rod the pendulum sort of swings back and forth as the rectangular mass responds to it it's kind of cool-looking yeah so the traditional control problem is how do you apply a force to this rectangular mask how do you push it left or right in such a way that you can keep the pendulum balanced upright that is keep the pendulum up here at the top without falling over now that is the control problem and we will study that in this class but you know before we get there before we start applying control theory what we need to do is derive equations of motion for the system and that's really the purpose of this video so here's my little cartoon drawing in the system we've got this mass the carts I'll call that mass MC the mass of the pendulum Bob I'll call that MP will let L represent the length of that pendulum so those are the parameters that characterize the system and then we need dynamic variables state variables to describe its motion and for that we will let the position of the cart be X and to represent the angle at which the pendulum is leaning from vertical will use the symbol theta and theta positive is the direction indicated here so if theta dot is positive this thing would be rotating counterclockwise as we're viewing it who that picture is getting pretty busy just a couple more things I want to add to it I want to put into the standard basis vector so call I hat horizontal J hat vertical like so so now we're ready to start deriving equations of motion and there's more than one way to do this perhaps the most elegant way to derive these equations is with the formulation called the Lagrangian formulation as I said that's the most elegant way to do it but it also in order to understand what's going on there you need to need to do a bit of work right to understand the derivation of how how how lagron ship roche works we're not going to do that we're going to do the simplest approach that's not the cleanest not the most elegant but perhaps simplest you only need sort of sophomore level engineering dynamics to do it so that's that's why that's the way we're going to go we're just going to go straight forward Newton's second law F equals MA and see where that takes us so the first thing I'm going to do is draw a free body diagram of the cart when I say draw a free body diagram of the cart I mean just the cart not the pendulum so what are the forces acting on the cart maybe you should do this yourself and pause the video make sure you get all the forces yourself but here I go first thing I'm putting on here is the weight of the cart itself so this is a M C times G in the minus J hat direction the next thing we have is a normal force pushing upward this is the force of the road or the track or whatever pushing up on the cart so this is an N in the J hat direction and then there's the tension or compression in this massless rod right here so I'm going to call tension positive so I'll call that force T sine theta in the minus I Direction plus T cosine theta in the J like so and then I have one more force it's not really apparent in there but when I was describing this to you as saying that in our control problem what you do is you imagine pushing the cart to the left or right in order to keep the pendulum balanced so that control force that force pushing the cart left and right I'm just going to call F it's going to be horizontal of course so F in the I hat direction and then F can be positive or negative it can be changing in time it's what they what's the controller decides as necessary so now we need the free body diagram of the pendulum itself that's this circular mass up here remember that we're seeing we're assuming that the rod is massless so we do not need a free body diagram of the rod anywhere in this thing so here we are at the pendulum what are the forces acting on it the first one that comes to mind is its weight or at least my mind it's it's M PG in the minus J hat direction so there's the weight of the pendulum acting down on it and then it also feels the tension in the rod again the exact same rod so it's the exact same tension but it's the other end of the rod so it's a force equal in magnitude opposite in direction of the tension acting on the cart so when I draw the rod tension on this Freebody diagram I'll put it in exactly the opposite direction and when I label it I'll put a t positive t sine-theta in the I hat direction and then minus T cosine theta and the J hat Direction remember they're equal and opposite so this force right here is equal and opposite to that one up there and I think that doesn't so now I think I'm ready to start writing equations of motion to do that I'll use Newton's second law and I'm going to start with the cart and we'll pick off the I hat direction or the horizontal direction first and when we write this out we're just going to look at my Freebody diagram so in the horizontal direction I've got a force F I can push the lever to the right I've got a component of the tension right minus T sine theta and those are all the forces I have horizontally over here so this has to equal mass times mass of the cart times the acceleration of the cart horizontally and the acceleration of the cart horizontally is x double-dot so there's my my first equation in fact I'm going to give it the label 0 so that's equation number 0 right there now I can also write an equation for the dynamics vertically right so I got forces vertically I'll have an acceleration vertically ooh actually the cart does not accelerate vertically at all right but so I can write equations for for the vertical motion but that's not going to be very interesting to me since nothing is moving vertically it's only moving horizontally so if I were interested in this normal force perhaps I'd be interested in writing that equation but I don't care what that normal force it's whatever is necessary to keep this thing from accelerating upward or downward so I'm going to skip the vertical direction for the cart and move directly onto the pendulum now for the pendulum in the horizontal direction the I hat direction what do we have we'll just look at the Freebody diagram again I get T sine theta and by the way if you didn't follow the the sines and cosines up here and over there I encourage you to go through that and look that make sure you understand that because that the trigonometry is important so at T sine theta pushing to the in the positive I hat direction so that's a positive therefore positive T and that's my only force horizontally so this is equal to mass of the pendulum times the acceleration or the horizontal component of acceleration of this pendulum so I'm just going to for now I'm just going to call that a P X so that's the acceleration of the pendulum in the horizontal direction the horizontal component alright so next we'll move over to the vertical direction let me scroll up where it a little bit we don't have to see those pictures up ahead we just look at the pendulum now so in the J hat direction minus T cosine theta pulling down we have the weight pulling down as well so minus MP G and this has to equal mass of the pendulum times the acceleration of the pendulum vertical component all right so those two equations from a pendulum horizontal vertical I'll give those names to our labels I'll call them equation number one and equation number two now equation zero one and two while these are valid dynamic equations for my system I'm still a few steps away or several steps away and actually coming up with the equations of motion because look what I have I've got things in terms of a px and a py I mean if tension I need to write everything in terms of the states I need to write everything including these accelerations in terms of X X dot X double dot theta theta dot theta double dot those things so I can't just have a symbol here a px a py and sit with that so what I'm going to do next is go back to kinematics I'm going to try to write these accelerations a px and py in terms of the states in terms of the X X double dot X single dot and theta if they do not they double out and try to write those accelerations that way so I'm going to use a result that I hope you remember from your dynamics class that is will say the acceleration of the pendulum is equal to the acceleration of the cart plus the acceleration of the pendulum relative to the carton of course all these are vectors let me play little tail in Ernie right remember this thing this is they're nicely expression for for relative accelerations and this approach is really kind of handy when you have bodies connected to each other by things like pin joints like I have here all right so let's go through with the here's the acceleration the pendulum Enix and it's expressed in terms of the acceleration of the cart or relative acceleration depending the relative to the cart so remember the acceleration of the car in fact we've already written it up here the acceleration of the cart now position the cars is actually acceleration just moves along a straight line so the acceleration of the cart is X double dot so there's a see that that part's really easy is just an X double dot in the I hat direction now the acceleration of the pendulum relative of the cart that's a little trickier but actually not too bad let me make some space over here to draw a little picture now here's the cart and the pendulum again now when I say acceleration the pendulum relative the cart that means we're looking at the penny 'm from a point of reference that's fixed to the cart that's moving with the cart as the cart moves back and forth a reference or the way we look at the pendulum is awesome' moving with that cart so the only way that the pendulum moves with respect to the cart is around in a perfect circle the this rod here connecting the pendulum to the cart it's rigid it doesn't get any shorter doesn't get any longer so that pendulum always has to be a constant distance from this pin joint right here again it moves along in a perfect circle so the only way that that you get acceleration from a perfect circle is from two different sources one type of acceleration you get by going along a perfectly circular path has the form l theta double dot right this is an acceleration in the e hat so called the e hat theta direction where we had theta Direction is this way over here it's tangent to the circle right so you get this type of acceleration when theta dot is changing so when the rotation rate is changing again actually and you actually get a theta double dot that's that type of acceleration that means you're speeding up or slowing down along the direction of that circular path so there's one type of acceleration and then there's another type of acceleration that looks like this oops should have a minus sign right there another time looks like this it's an L times a they - dot squared in the - Yi hat R direction where the positive be had our direction is radially outward so we had our and this is your centripetal acceleration right this is an acceleration the - II had our direction its acceleration towards the center is due to the fact that as this as is pendulums going around in a perfect circle around the car - that is a relative to the card it's going around a perfect circle the direction of that velocity is changing right that direction is always turning inwards and I get an acceleration inwards towards the center hence the word centripetal so that's my acceleration right the acceleration of the pendulum is equal to the acceleration of the cart that's this piece right here plus the acceleration the pendulum relative to the card so that's these pieces right here in the square brackets right this is the fact that that we're moving around in a perfect circle at least from a frame of reference moving with the cart now when I write it this way I'm throwing a little bit of a monkey wrench into the mix because I just wrote these these two pieces of my acceleration in terms of e hat are and he had theta where as I've done everything else in terms of I and J right so my equations of motion in terms of I and J so I better reconcile this by by writing these accelerations in terms of the I in the J so when I write things in terms of I and J this is what I get so I get the X double dot this is still in the I hat direction forget that I and then we have L theta double dot that's in the e hat theta direction but he had theta direction I can write that in terms of I and J right so be a minus cosine theta in the I minus a sine theta and J recall that theta is this theta that I defined originally up there so that theta is the same as sort of a theta right there as well but you could do the trigonometry you can find that out in me and similarly the positive e had our direction would be in the - have a minus sine theta in the I hat and a cosine theta positive cosine theta in the J hat right I'll let you work at that trigonometry make sure it makes sense so now the next order of business is to solve these expressions for acceleration into my equations of motion number one and number two over here so in particularly when I put this into equation number one I get t sine-theta that's directly from above equals mass of the pendulum times the horizontal component of the pendulums acceleration so I get an MP x and x double-dot just from here OOP maybe should be looking right here and then I'm going to pull out these horizontal pieces right this eyepiece and that IP so I've got a minus L theta double dot cosine theta and I have a plus minus minus is plus so plus L theta dot squared sine of theta so there's my new equation number two my new equation number one which I'm going to call an equation number three now I just realized I made two most small mistakes that forget to put the MP in this term and that term as well so let me make room for that so there's MP in both those equations now so now I think it's okay I hope and what I'm going to do next is do the same process on equation number two I'm going to put the vertical components of acceleration into here let me just scroll up to make some room for that and go for it so equation two has a minus T cosine theta minus the weight equals and again I'm just pulling out the vertical pieces now so I've got a minus MP L theta double dot sine theta the down here I also have a minus MP L theta dot squared cosine theta and I'm calling this one equation number four I hope I did that one right please check this for yourself as as I'm writing this you should be writing this for yourself make sure all the steps make sense make sure you can do the exact same thing all right so now let's check where we are so look what I've got equations number three and number four here and they are differential equations in other words they have X double dot that will theta double dot theta dot in here so it's a relationship between X and theta and their various derivatives there's a different that's a definition of a differential equation which is what we're after right equations of motion our differential equations and I also have equation number zero up here as well we haven't used that guy yet but this isn't here's another differential equation there so really I have three differential equations right here the root number three number four number zero top and guess what there are three unknowns we got the theta in the X those are sort of two unknowns and they're various derivatives but we also have a tension here as well now this tension here in general is okay we can keep that tension there but if we can we'd like to eliminate it right because it's going to save a bit of a hassle later on and in this problem it is actually quite easy to get rid of the tension so I suggest we do it so let's go ahead and do that and here's here's how I'm going to do it got a little trick up my sleeve so I'm looking at these two equations right here number three and number four and what I'm going to do is I'm going to take equation number three and multiply it by cosine of the angle theta and then add to it equation number four multiplied by sine theta and maybe you can see right now exactly what's going to happen so when we do this let's check this out in fact we'll just go term by term so this equation number three here I'm going to take T sine theta I'm going to multiply it by cosine in fact I'm multiplying every single term in here by cosine but we'll start with this one right here the T sine theta gets multiplied by cosine so I get T sine theta cosine theta right and then let's look at before going on let's look let's look at this term down below so I got a minus T cosine theta that's an equation number four so things in equation number four I'm going to multiply by sine theta so this one's gonna be minus T cosine theta sine theta what was the one above again the one above was T sine theta cosine theta here's minus T cosine theta see totally cosine theta sine theta so when I add these two things together these two pieces are going to cancel each other out in this operation right there so they're going to go away in fact those are the only two terms with the tension in there so that's how I get rid of the tension so when I get rid of those two terms when I get those two terms to cancel each other out poof tension is gone and what I'll have left is the result of this operation right I kind of like that okay so on the left hand side I've got those two terms that cancelled out got away and on the left hand side I still have this right here mpg but I'm multiplying that one by sine-theta so I'm going to have minus M P G sine theta coming out of this that's cool I like that so that's all I have left on the left hand side of these equations once I do this operation on okay so what do I have on the right-hand side so on the right-hand side I have an MP X double dot all right so MP X double dots and since that's in equation number three that gets multiplied by a cosine and there's no other X double dot so that that's going to survive there and then the next thing I have is a minus MP L theta double dot cosine theta and I multiply that by cosine theta so this is going to be MP L theta double dot cosine squared theta right and notice the one below that also has an MP L theta double dot now when I'm multiplying by sine so this is going to be minus MP L theta double dot sine squared and when I add these two terms together I get MP L theta double dot this one's gonna be cosine squared this one's going to be sine squared and cosine squared plus sine squared is just 1 so when I do these operations with the cosine and the sine and I add the terms together these two third terms combine together in a really nice simple way I get minus MP L theta double dot and since cosine squared plus sine squared is 1 boom that's all I get out of those two simplifies quite nicely so there's that and then let's move over to the centripetal pieces the L theta dot squared pieces remember this one also comes in the same pattern as what we had over here you'll notice so this first one when I multiply by cosine a guy MP al qaida dot squared sine theta cosine theta that comes out of this cosine right there the second one gets an MP L theta dot squared cosine beta I'm multiplying that one by sine theta oh so I got sine theta cosine theta on the top and I get cosine theta sine theta on the bottom again these ones are going to cancel each other out so those ones go away and this is all I have left I like it so much I'm going to call that equation number five so here's my essentially my pendulum remember I had to pendulum equations they started off as as equations number one and number two and then when I substituted those expressions in for the acceleration I got equations number three and four and then what I did is took three and four together combine them in in such a way that got rid of the tension when I get rid of tension I can just replace these two equations by this one equation right here very very nice so now I have one equation that has it's a differential equation it relates derivatives of X and theta but I've got one equation right here with sort of two different derivatives of two different states in there so I need another equation and that other equation who it's equation number zero at the top so here's my other equation here's my second equation but notice that one has a TN at all man it has a t shoot what am I going to do the wait don't fear don't fear don't fear because remember down here remember equation number three it says T sine theta equals all this stuff remember how tension appeared in equation number zero T sine theta so I can take this T sine theta right here and make the substitution this T sine theta has got to be the same as that T sine theta so wherever I see a T sine theta in this expression up here also I'm going to do oops this is expression up here all I'm going to do is I'm going to substitute in all this stuff right there well first of all we'll note that it's a minus F minus T sine theta so we'll say so we'll say F and we'll have minus T sine theta so I'm going to get a minus MP X double dot now I'm not going to put that term in yet because I want to put it in later on so I'll go to the next term minus T sine theta sine you're getting minus this stuff so this is going to be plus MP updated double dot cosine theta out of there - MP L theta dot squared sine theta equals and notice that on the equals sign I have MC x double dot right there but I forgot to write down the MP X double dot I didn't actually forget I just felt like pushing it all over the other side so when I combine those two terms together I get MP Plus MC x double-dot and there's my next equation which I call number six so now what I have are two equations there's no tension in here anymore which is very nice so that two differential equations relating the state's X X dot X double dot to the other states theta theta dot theta double dot Wow so here's my differential equation these are the equations of motion for my system and they're nonlinear differential equations there's a sine theta in there there's a theta dot squared over there and a cosine theta here so highly nonlinear differential equations but nonetheless these are the equations of motion for the system they can be simplified somewhat and we'll do that but for now I would say we're done we we hit our goal we've got equations of motion for the system well in this video right here
Info
Channel: Brianno Coller
Views: 121,810
Rating: undefined out of 5
Keywords: Equations Of Motion, Pendulum, dynamics, Newton
Id: 5qJY-ZaKSic
Channel Id: undefined
Length: 23min 1sec (1381 seconds)
Published: Wed Mar 18 2015
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.