Equations of Motion for the Inverted Pendulum (2DOF) Using Lagrange's Equations

  Рет қаралды 97,652

Good Vibrations with Freeball

Good Vibrations with Freeball

4 жыл бұрын

Download notes for THIS video HERE: bit.ly/2Jgqiyo
Download notes for my other videos: bit.ly/37OH9lX
Deriving the equations of motion for the inverted pendulum riding on a cart using the method of Lagrange's equations. Two degree-of-freedom system.

Пікірлер: 158
@YoungjuPark86
@YoungjuPark86 Жыл бұрын
Thank you Professor Snape
@JITCompilation
@JITCompilation Жыл бұрын
_I can teach you to bewitch the mind and ensnare the body_
@maxbinaei139
@maxbinaei139 Жыл бұрын
Fantastic video for what it's meant to be. Thank you for clearly stating the intention at the beginning--exactly what I was looking for.
@stevekim6923
@stevekim6923 Жыл бұрын
Thank you for your clear explanation Professor Snape.
@ACota-dk9qw
@ACota-dk9qw 4 жыл бұрын
Awesome job man, thanks a bunch. Make more with different scenarios just for fun and practice, I'll watch them all.
@AchrajSarma
@AchrajSarma 4 жыл бұрын
Thanks for a clear and descriptive video explanation. Could you also explain how the expressions would change if there is a drag force (-bx_dot) on the cart?
@Freeball99
@Freeball99 4 жыл бұрын
You would need to define the Rayleigh's Dissipation Function, R. In this case, R = 0.5 * b * x_dot^2 and then use the extended form of Lagrange's equations. I have explained it in this video: kzfaq.info/get/bejne/hLxnlsdenLjeXX0.html
@spencergee6948
@spencergee6948 2 жыл бұрын
Thank you for your replies. Much appreciated.
@mahdialhusseini9270
@mahdialhusseini9270 4 жыл бұрын
Could you derive the equations of motion for an inverted spherical pendulum? Such as Cubli?
@erfanroghani
@erfanroghani 3 жыл бұрын
Awesome explanation. It would be great if you could solve the same problem with the coordinates x and theta.
@Freeball99
@Freeball99 3 жыл бұрын
I will put this on my list, however, solving this is almost identical to what I have shown in several other videos (particularly the animation series). Solving for x and θ uses the identical method to what I have shown before.
@yevgeniysimonov5906
@yevgeniysimonov5906 3 жыл бұрын
Thank you. Very good explanation.
@SeidelMatheus
@SeidelMatheus 3 жыл бұрын
Great video! Thanks!
@gururajsh5540
@gururajsh5540 4 жыл бұрын
Very helpful!!!
@moh3en1375
@moh3en1375 Жыл бұрын
Thanks a lot. Very helpful
@mohamedghazali
@mohamedghazali 2 жыл бұрын
Merci beaucoup monsieur
@tahirusman1129
@tahirusman1129 3 жыл бұрын
Thanx man. BTW I was super confused at the last step when you took double derivatives in one step. D/dtgeta and d/dt. Any ways, very helpfuk thanx
@Freeball99
@Freeball99 3 жыл бұрын
I combined this into one step because I wanted to fit it all on the same page. If you write out the last part on some paper an go through the derivatives one step at a time, it will make sense.
@Omar-sj7wl
@Omar-sj7wl 4 жыл бұрын
How is this different from your other video? I enjoy all of these synamics videos!
@danilbutygin238
@danilbutygin238 4 жыл бұрын
F(t)
@Freeball99
@Freeball99 4 жыл бұрын
This was a remake of a previous video which was popular, but had a couple of errors. Since KZfaq no longer supports annotations to correct these errors, I decided to redo it.
@Z0mb13ta11ahase
@Z0mb13ta11ahase Жыл бұрын
Are there any videos that describe this not on a cart but a rotating body? Say the pendulum was connected to a point on a circle spinning counter clockwise and the pendulum itself was falling counter clockwise itself. I'd like to know how to find the rate at which the body would have to be rotating to "catch" the pendulum and keep it in a semi vertical position, in relation to the axis it would create if it went all the way through it.
@Freeball99
@Freeball99 Жыл бұрын
Not sure exactly what you are trying to achieve, but the spherical pendulum might be a good starting point. You could model something like this attached to a rotating base perhaps. kzfaq.info/get/bejne/h9VgfLpqltrSmas.html
@cataloncio297
@cataloncio297 2 жыл бұрын
Hi I'm trying to get into Lagrangian mechanics, mainly so I can code my own inverted pendulum on a moving cart from scratch (and be able to control the cart), and this helped a lot. The one thing I did not understand was at 14:22, how/why you found out that the "external momentum" was 0 for theta, but F(t) for x. I kind of get it, but not in a very scientific way. If you could clarify that for me or give me a video I can watch to understand, I would greatly appreciate it! I've tried googling it, but Lagrange equations just seem too general. I later read something that said that the external force should be accounted for in the potential energy because F=dV/dx, but that should break for non-conservative forces, which I'm pretty sure f(t) is. Thanks in advance! Great video
@Freeball99
@Freeball99 2 жыл бұрын
According to the problem statement, there is an external load, F(t) being applied to the cart in the x-direction. There is no mention of an external moment being applied at the hinge. Lagrange's equations require us to apply the load to the right hand side of the equation corresponding to the coordinate that the load is applied to (this is derived from the fact that the external load/moment will do work as a result of that displacement changing). Consequently, the external force is applied to the right hand side of the "x" equation of motion and since there is no external moment, there will be a zero on the right hand side of the θ equation. Regarding conservative/non-conservative forces....you can ALWAYS add the external load/moment to the right-hand side of the equation regardless of whether is it conservative or non-conservative. However, IF the load is conservative then it can always be written in terms of the derivative of a potential function. As a result, for a conservative load (e.g. gravity), you can either add it to the right-hand side of Lagrange's equation as a load OR you can include it in the potential function and add it to the left-hand side of Lagrange's equation.
@eduardomoreira7624
@eduardomoreira7624 Жыл бұрын
Thank you
@alexmiller8126
@alexmiller8126 3 жыл бұрын
at 11:15 why did the xdot cancel to get (ml*theta(doubledot)costheta - mltheta^2*sintheta?
@duncanhw
@duncanhw 3 жыл бұрын
First take the partial derivative with respect to xdot (so xdot disappears, because d(a • xdot)/dxdot=a). Then take the derivative with respect to time, which requires the product rule giving the two terms
@farombifolajimi2962
@farombifolajimi2962 Жыл бұрын
hello sir, i am really impressed and i finally get a hang of the lagragian equation, i am trying to model a system using simulink to get the response of the dynamic equations, i learnt that to feed your dynamic equations into simulink you need to put the greater power on the left, but the equations we got from your video Xddot and theta ddot both appear on each equation with the same power. i would like to know if you have any suggestion on how to feed it into my simulink to see the response.
@Freeball99
@Freeball99 Жыл бұрын
I've never used Simulink so I'm not familiar with the process, but I'm guessing that you need to write the equations in vector/matrix form.
@victorDH96
@victorDH96 2 жыл бұрын
Hello there! What if we have the pendulum on the right side of the intermitent line? Should I use a negative thetha and sum up the X of the big mass? Greetings from Ecuador.
@Freeball99
@Freeball99 2 жыл бұрын
Yes. If the pendulum is to the right, you can just use a negative θ.
@DRnick2359
@DRnick2359 4 жыл бұрын
What software are you using to write your equations? They look so elegant....
@Freeball99
@Freeball99 4 жыл бұрын
The app is called "Paper" by WeTransfer. Running on a iPad Pro 13-inch and using an Apple Pencil.
@JordanMetroidManiac
@JordanMetroidManiac 4 жыл бұрын
Thanks for fixing your errors! So, dumb question, if I wanted to solve for theta numerically, do I just use Euler's method or maybe the Runge-Kutta method? Would I need to solve for theta double prime in equation (11) and then plug that into equation (10) to solve for theta prime? Would I then use theta double prime to change theta prime and use theta prime to change theta? It's been a couple years since I took a course in differential equations, so I just want to make sure that this is the way you'd solve for theta numerically. EDIT: Actually, I only need to worry about the second derivatives, right? I just calculate theta double prime and x double prime (and set F(t) to whatever I want). Then I change theta prime and x prime, which then changes x and theta. That makes sense to me. I made it all work. I hope this helps whoever is also trying to simulate a cart-pole environment.
@Freeball99
@Freeball99 4 жыл бұрын
Yes, you can use Euler (which is really just RK1) or RK4 to get numerical solutions. The method you have described is not correct... You first need to rewrite the equations of motion in state-space form. In doing so, you are converting the system of equations from two 2nd order differential equations to a system of four 1st order differential equations. I have several videos on how to do this. kzfaq.info/get/bejne/m5ehZ9l1l7HOoHk.html kzfaq.info/get/bejne/iaygfcWera-5cmQ.html kzfaq.info/get/bejne/r7OVlM5pt72vpH0.html
@JordanMetroidManiac
@JordanMetroidManiac 4 жыл бұрын
Freeball Oh, I remember how to do that. It’s just a bunch of substitutions, which is similar to what I ended up doing anyway. Regardless, I saw what I’d call physically accurate behavior in my simulation with my implementation of solution approximation. Thanks!
@ahmednozahy7050
@ahmednozahy7050 4 жыл бұрын
Can you please explain the difference if it is not a cart but a wheel? like a Segway robot (with no curvature motion)
@Freeball99
@Freeball99 4 жыл бұрын
I modeled the spherical pendulum in this video: kzfaq.info/get/bejne/h9VgfLpqltrSmas.html - you should be able to combine this with the model above to get the model you are describing.
@bandreghetti7663
@bandreghetti7663 4 жыл бұрын
What if the pendulum rod is directly attached to the axis of a single non-slipping wheel, in which case the input would be a torque applied between the wheel and the rod, like in a typical inverted pendulum robot? It's a similar case but it would be nice to have the differences pointed out! Thanks c:
@Freeball99
@Freeball99 4 жыл бұрын
The model as described in the problem really just consists of two point masses connected by a rod. As a result of this: 1) the pendulum bob has no rotational inertia (so no rotatory kinetic energy) and 2) the cart, wheels and applied force (F) are all located at a single point located at the hinge of the pendulum - so, the wheels have no radius and the force F produces no moment about the hinge. If you wanted to model the control input to the wheels, you would need to expand the model to include assumptions about the wheels, eg what is the radius, the mass and the moment of inertia of the wheel? What is the offset between the hinged and the wheels? Etc.
@andresfelipehoyosmoreno3567
@andresfelipehoyosmoreno3567 3 жыл бұрын
Hi, i have some doubts with the potential energy of mass m, I thought that it´s delta height would be l+lcos(theta) because i´ve seen Lagrangian models in which the height is measured from the lowest point at which the pendulum can be. Please correct m if I am wrong.
@Freeball99
@Freeball99 3 жыл бұрын
If the pendulum was hanging down, you would use for its change in height l - lcos θ OR you can just define it's y-location as -lcos θ and call this the height depending on where you define you define y to be zero. These are the same thing just shifted by a constant, L. Both will produce identical results when differentiated in Lagrange's Eqns because the constant, L, disappears when you differentiate it. For the inverted pendulum, it would just be the negative of this.
@amadino1320
@amadino1320 2 жыл бұрын
Great explanation. I solved the equation 10 for x_double_dot and set this into equation 11. After this I formed the equation for theta_double_dot. What ist theta_double_dot and what can I do with it. How do I calculate further to make a controled inverted pendulum? It would be great if you could anwser my questions.
@Freeball99
@Freeball99 2 жыл бұрын
The equations must be solve numerically (as far as I am aware). In order to do this, the equations must first be written in state-space form. I have shown how to solve the equations for the double pendulum in this video (kzfaq.info/get/bejne/pKhyhK6Lx5yuip8.html). Explaining control systems are outside the scope of this material, however, I would recommend Steve Brunton's channel for more on controlling the inverted pendulum. If you are going to add a control system, then you will first need to write the equations in state-space form.
@prakhars962
@prakhars962 3 жыл бұрын
This reminds me of the basic reinforcement learning tutorial in open AI gym.
@maxbinaei139
@maxbinaei139 Жыл бұрын
do you have a video on how to linearize these equations of motion?
@Freeball99
@Freeball99 Жыл бұрын
In order to linearize the final equations, use the small angle approximation. So, sin θ --> θ and cos θ --> 1.
@KARANAMHEMASUDHADIWAKAR
@KARANAMHEMASUDHADIWAKAR 6 ай бұрын
Hi, Thanks for this excellent video. However, I am finding it difficult to intuitively understand the third term of kinetic energy expression at 7:45. I understand it has something to do with the coupling effect of the motion of the cart and pendulum. Still, it does not make sense scientifically according to my understanding. Anyone can explain it intuitively? Thank you
@Freeball99
@Freeball99 6 ай бұрын
When taking time derivatives to find velocities, these derivatives must be taken with respect to an INERTIAL REFERENCE FRAME. This cross-product term in the kinetic energy is, indeed a coupling effect, and arises from considering the pendulum's motion from the perspective of a non-inertial reference frame - the moving cart. As the cart accelerates, so does the hinge point of the pendulum, which means that if you just consider the first two terms of the kinetic energy, then you're observing the pendulum's motion from a platform that itself is moving. This non-inertial reference frame thus introduces complexities in how the pendulum's kinetic energy is calculated. Intuitively, the cross-product term accounts for the additional velocity and, therefore, kinetic energy that the pendulum mass has due to its rotation around the hinge point, which isn't stationary but moving with the cart. This is why it contains both x_dot and θ_dot. This is probably a good topic for a video!
@sumaiyajerin2859
@sumaiyajerin2859 Жыл бұрын
In a previous problem, (vertical cart attached to spring and one pendula), you considered the height h displaced by the bob. With that logic shouldn't V = mgh* = - 1 * mg (l - l*cos(theta)) ?
@Freeball99
@Freeball99 Жыл бұрын
Both are right. This is fundamentally just a difference of the coordinate system. In this case, I have the origin at the hinge. In the other problem, I placed the origin at the equilibrium position of the mass. As a result, these expressions for potential energy differ by a constant, HOWEVER, the constant get differentiated out when the potential energy is substituted into Lagrange's equations - so, as one might expect, you can arbitrarily select the point of zero potential energy depending on where you place the origin of you coordinate system and it should make no difference to the final result.
@naseralbadareen3527
@naseralbadareen3527 Жыл бұрын
How can we linearize such a system to have an LTI representation?
@Freeball99
@Freeball99 Жыл бұрын
You can linearize the equations of motion by making the small angle assumption. Under this assumption, sin θ = θ and cos θ = 1. Then to write them in suitable form for use in a controls problem, you must rewrite the equations in state-space form. I have several videos demonstrating how to do this. Here is one: kzfaq.info/get/bejne/iaygfcWera-5cmQ.html
@EigenA
@EigenA 3 жыл бұрын
Absolutely love this kind of math! Especially when some one does such a good job of explaining! I could be wrong but I believe at around 13:00 you were differentiating with respect to theta, but you increased the order of the X term.
@Freeball99
@Freeball99 3 жыл бұрын
I first differentiate with respect to θ and THEN I differentiate with respect to t. This is why the order of the derivative on X increases.
@EigenA
@EigenA 3 жыл бұрын
@@Freeball99 Thank you for the clarification.
@anaeem86
@anaeem86 Жыл бұрын
Hello sir. Ur videoes are very awesomely explained. Can u plz share as to which video editor you use after making ur videoes. Thanks
@Freeball99
@Freeball99 Жыл бұрын
Whiteboard presentations are produced using the app "Paper" by WeTransfer. Running on an iPad Pro 13 inch. Video captured using Quicktime and edited using iMovie.
@chaimadine2452
@chaimadine2452 3 жыл бұрын
thanks alot!
@diegohcsantos
@diegohcsantos 3 жыл бұрын
If we subs eq10 (without ext force) in eq11 we get l.t'' - c.(a.l.t''.c - a.l.t'.t'.s) - g.s = 0 -> (l - c.c.a.l)t'' + a.l.s.c.t'.t' - g.s = 0 -> (1 - c.c.a)t'' + a.s.c.t'.t' - g.s/l = 0 Where: t = theta c = cos theta s = sin theta a = m/(M+m) As a0. So, at first look, nothing prevents theta = pi/2, right? My question is: in the eq of motion are, somehow, implied what would happens when theta =pi/2?
@diegohcsantos
@diegohcsantos 3 жыл бұрын
I didnt mention that my consideration was made because x=constant and theta= pi/2 inst a equilibrium of the system. It's very strange, the stick of the pendulum just don't want to rest?
@amirpasagic162
@amirpasagic162 3 жыл бұрын
First of all, thank you for explaining complicated topics with such incredible clarity. Secondly, I refered to this video to cross check my own derivation of potential and kinetic energy, and for derivation of total kinetic energy, I started by adding translational kinetic energy of the cart with the rotational energy of the pendulum (point mass), but I am missing the -2*L*dFi/dt*dX/dt*cos(Fi). What would be a physical interpretation of this element of the equation? why isn't rotation of the pendulum and translation of the cart encompasing the total kinetic energy of the system?
@Freeball99
@Freeball99 3 жыл бұрын
It's a little hard to tell without looking at your work, but my sense is that you have not squared your velocity properly. Make sure you: 1. locate the position of the mass(es) using the coordinates and geometry of the problem, 2. Differentiate with respect to time to get the velocity of the mass(es), 3. Use this value for the velocity for the kinetic energy expression AND SQUARE IT! When dealing with rotations, do try to do this intuitively as it is easy to miss a term (usually a cross-product type of term) the result is that there is a coupling in the motion of the two masses that you are missing.
@amirpasagic162
@amirpasagic162 3 жыл бұрын
@@Freeball99 thank you very much for your answer. Well, I basically just naively summed up all the kinetic energies that I thought are involved which come from both translation of both masses and the rotation of the pendulum, which equaled to T =1/2* (m+M)*v^2 + 1/2*m*L^2 *w^2 (assuming point mass). So if I would here simply substitute v for dx/dt and w for dFi/dt, I would got something similar, but with discussed term missing (-2*L*w*v*cos(fi)). I guess one can't just sum up what he assumes to be energies, but rather has to start bottom up and define radius vectors and calculate their derivative to obtain velocities and kinetic energies, but I am wondering if there is some interpretation of this missing term here. I thought it has to do something with coordinate definitions perhaps, but what you mention as "coupling in the motion of the two masses" sounds interesting. Especially since this term does resemble cross product of linear and angular velocity (depending on the cos(fi)). I am not 100% sure what are you refering to by this, could you perhaps point me somewhere where I could read more about it? Thank you once again for you clarifications, they have been most helpful.
@wezzzzzzzz
@wezzzzzzzz 4 жыл бұрын
In 13:06 why did not you differentiate both x dot and cos(theta) wrt time instead of only cos(theta)?
@Freeball99
@Freeball99 4 жыл бұрын
I differentiated wrt x in the previous term. Since both x_dot and Cos θ are functions of t (as you have pointed out) I need to apply the product rule when differentiating this. So first I differentiate the x_dot and multiply it by Cos θ and then I differentiate the Cos θ and multiply it by the x_dot. This is what I did in terms 2 and 3.
@wyt0104
@wyt0104 4 жыл бұрын
@@Freeball99 Hi, I think what he/she said is that , why d (-ml theta_dot multiply x_dot cos theta) not = -ml x_double_dot theta_dot cos_theta + ml multiply theta_dot_square x_dot sin_theta - ml theta_double_dot x_dot multiply cos_theta. I am stuck on there too. :(
@soumikchakraborty9885
@soumikchakraborty9885 Жыл бұрын
How mant degrees of freedom in this system which ar generalized coordinates in this system?? Please reply me .
@Freeball99
@Freeball99 Жыл бұрын
The are 2 degrees of freedom in this system ( corresponding to each of the generalized coordinates x and θ). That is to say that if we know x and θ, then we can completely describe the location of each of the masses in the system.
@kaushalparmar4767
@kaushalparmar4767 4 жыл бұрын
That's amazing , btw which pad or software is this you are using ? Just curious
@Freeball99
@Freeball99 4 жыл бұрын
I’m using an iPad Pro 13-inch with an Apple Pencil. Software is called “Paper” by WeTransfer.
@marcosdfa
@marcosdfa 4 жыл бұрын
For the kinetic energy, can I write 0,5*M*x_dot^2 + 0,5*m*(L*theta_dot)^2? If the velocity of m is L*theta_dot, isn't it simple to use that way?
@Freeball99
@Freeball99 4 жыл бұрын
No. This is a common mistake - DON'T DO IT!! The velocity of m is x_dot - L·θ_dot·cos θ and you need to square this. This gives you THREE components of velocity for the mass, m - the two that you have included plus a rotational effect that you are not including. If you look at Eqn. 6, you will find that you are missing the last term. When you are dealing with rotating systems, this is generally nonlinear stuff. Solve it using basic principles and math rather than using intuition which is often wrong when dealing with rotations.
@reubenthomas1033
@reubenthomas1033 2 жыл бұрын
@@Freeball99 Hey! We don't see a term that involves moments of inertia in these equations. So has the effect of inertia been neglected for simplicity, or is it embedded in the cross term?
@Freeball99
@Freeball99 2 жыл бұрын
@@reubenthomas1033 When modeling a simple pendulum, it is common to treat the mass as a point mass and ignore and rotational kinetic energy of the mass. Really what we are saying here is that if the diameter of the mass is much less than the length of the rod, L, then the contribution of the rotational kinetic energy is negligible. This also keeps the math a little more simple - which is helpful for teaching purposes. I probably should have mentioned this at the start of the problem (I think I mentioned it for some of the other simple pendulum examples). I have separately showing an example of a compound pendulum which does require one to include the rotational kinetic energy (kzfaq.info/get/bejne/m6iXa8qgy5e2cps.html)
@reubenthomas1033
@reubenthomas1033 2 жыл бұрын
@@Freeball99 Awesome! Got it. Thanks a lot :D
@mackathan1
@mackathan1 3 жыл бұрын
Wouldn't the potential energy of the pendulum be at its lowest when the ball is pointing straight down (theta=180)? Your potential energy equation would imply that at this point we would have negative potential energy, not 0 (m*g*l*cos(180) = -m*g*l). I have seen other resources that indicate the same and I am thoroughly confused as to why. Any help would be greatly appreciated.
@Freeball99
@Freeball99 3 жыл бұрын
This is really just a question of where you are drawing your axes. Truth of the matter is that zero potential energy is only at the center of the earth, so if any problem we arbitrarily chose a zero potential point. In my case, the x-axis is on the cart and this is defined as zero potential. To be clear, all these different descriptions of the potential energy vary by a constant. When you substitute the potential energy into Lagrange's Equation, the constant gets integrated away. The result is that it make no difference what the absolute value of the potential energy is. Rather what is important, is the DERIVATIVE of the P.E. with respect to the particular coordinate. Also, this means that negative values of potential energy are fine. Hope this clears it up.
@tanmanpeng5675
@tanmanpeng5675 Жыл бұрын
With using the product rule for eqn 10, isn't derivative of theta dot is 1? But instead it was theta dott,please explain for this. Thanks
@Freeball99
@Freeball99 Жыл бұрын
In this case we are differentiating with respect to t and NOT with respect to θ_dot.
@stevenkao1993
@stevenkao1993 4 жыл бұрын
how do you know that the right side is f(t) in equation 1? Shouldn't it be 0?
@Freeball99
@Freeball99 4 жыл бұрын
The problem shows that f(t) is the force applied to the system in the x-direction. Therefore, it appears as a generalized force on the right-side of the equation of motion for the x-coordinate.
@reubenthomas1033
@reubenthomas1033 2 жыл бұрын
Which tool are you using in this video for the drawings?
@Freeball99
@Freeball99 2 жыл бұрын
App is "Paper" by WeTransfer. Running on an iPad Pro 13 inch and using an Apple Pencil.
@reubenthomas1033
@reubenthomas1033 2 жыл бұрын
@@Freeball99 thank you!
@sterlingdeye5660
@sterlingdeye5660 2 жыл бұрын
What software did you film this video in?
@Freeball99
@Freeball99 2 жыл бұрын
Drawing app is called "Paper" by WeTransfer. Running on an iPad Pro 13 inch and using an Apple Pencil. For screen recording I attach the iPad to a Mac and use Quicktime to record.
@SyedMohammedAzaas
@SyedMohammedAzaas Жыл бұрын
Which application is this for note making??
@Freeball99
@Freeball99 Жыл бұрын
The app is called "Paper" by WeTransfer. It is running on an iPad Pro 13 inch and I am using an Apple Pencil.
@benjamescuajotor1153
@benjamescuajotor1153 Жыл бұрын
Can small angle approximations (sinθ ≈ θ, cosθ ≈ 1) be applied in the equations?
@Freeball99
@Freeball99 Жыл бұрын
Yes, provided the angle is, in fact, small (typically less than 10 degrees). Linearization can be used when examining the control problem of keeping the pendulum balanced and upright.
@abumohandes4487
@abumohandes4487 Жыл бұрын
I'm always a bit confused about kinetic energy of 'rotating masses' and their rest frames. In this case we apparently ignored the rotational energy of the small ball at top, because we have modelled it as a point mass, am I right?
@Freeball99
@Freeball99 Жыл бұрын
Yes, exactly right. Typically we model a simple pendulum as a point mass. This assumption is fine as long as the dimensions of the mass are relatively small compared to the length of the rod.
@abumohandes4487
@abumohandes4487 Жыл бұрын
@@Freeball99 Thanks. I'm so happy to have (re)discovered the joys of Lagrange Motion equations. Together with Runge Kutta solvers, I get excellent non-linear simulation behaviour. I am modelling the balancing of a a non-slipping ball on a glass plate. After linearizing and Kalman filtering, I can measure the position of the ball by the torque needed to keep the glass plate level. Next step: position control. Without position sensors ;-)
@Freeball99
@Freeball99 Жыл бұрын
@@abumohandes4487 Sounds interesting. Would love to see it when you're done.
@nzcsx
@nzcsx 7 ай бұрын
Thank you for this thread. I was wondering about the rotational kinetic energy as well.
@aimanenedjima5252
@aimanenedjima5252 2 жыл бұрын
First ... thank you a lot...GREAT WORK Q: where can I get more solved problem like this (using Lagrange's Equations)?
@Freeball99
@Freeball99 2 жыл бұрын
I have several videos on this channel that demonstrate how to solve problems using Lagrange's Equations. Also, there are undoubtedly numerous other KZfaq channels which contain videos on using Lagrange's Equations to solve problems.
@PaulMurrayCanberra
@PaulMurrayCanberra 10 ай бұрын
@1:00 this setup appears to be missing one variable - the angular velocity of the pendulum at t=0. Needs to be specified, as it could be anything.
@Freeball99
@Freeball99 10 ай бұрын
This is a 2nd order differential equation in time, so it requires 2 initial conditions. Typically it is assumed that the initial angle and the initial angular velocity are known. This is be based on the setup.
@gustavoexel3341
@gustavoexel3341 2 жыл бұрын
Why is the generalized force for θ (torque) equals to 0? Doesn't the force F(t) applies a torque to the system?
@Freeball99
@Freeball99 2 жыл бұрын
We are considering only external forces in the case of generalized forces, so it's just F in this case (we can ignore forces from the rod) No, the force does not apply a moment to the small mass - it is purely applied to the cart and in the x-direction. If the force were applied directly to the small mass, m, then you would be correct that it would also produce an external moment. For the generalized force, we only consider those forces that are acting directly on the particular coordinate. In the case, the external force is assumed to act act through the location of the hinge (the cart is assumed to be infinitely thin) and so cannot produce a moment about this point.
@chienvt
@chienvt 3 жыл бұрын
Hi sir, pls tell me: why equation (1) is "xm = X - l*sin(theta)" but not "xm = -l*sin(theta)"?
@Freeball99
@Freeball99 3 жыл бұрын
This is due to the displacement of the cart. If the pendulum angle remained zero at all. times, then the mass, m, will still be displaced by the same amount as the cart, so we need to add X.
@alex.ander.bmblbn
@alex.ander.bmblbn 4 жыл бұрын
hi, sorry for a stupid question, but isn't derivative of sin(theta) at 3:14 just cos(theta)?
@Freeball99
@Freeball99 4 жыл бұрын
The derivative, d/dθ (sin θ) = cos θ HOWEVER, we are taking the derivative with respect to t and NOT with respect to θ. Therefore the chain rule must be applied. d/dt (sin θ) = cos θ · d/dt (θ)
@alex.ander.bmblbn
@alex.ander.bmblbn 4 жыл бұрын
​@@Freeball99 dear sir, thanks a lot for the reply, i have figured that out just a few minutes ago, and you have confirmed it. although initially i thought it has something to do with derivative of a complex function, like d sin(f(t))/dt which is equal to cos(f(t))f(t) + f(t)'sin(f(t))
@spencergee6948
@spencergee6948 2 жыл бұрын
I's an interesting problem and well explained, as ever. But why would one have an inverted pendulum on a moving wagon?
@Freeball99
@Freeball99 2 жыл бұрын
As an example, a human being can be modeled as an inverted pendulum (since we're all top-heavy). Our ability to move our feet allows us to stay balanced and upright. This could be modeled as an inverted pendulum on a cart.
@sayanjitb
@sayanjitb 2 жыл бұрын
Can you provide solutions of these kind of questions using only Newtonian mechanics. I just want to see how does that work out. Thanks
@Freeball99
@Freeball99 2 жыл бұрын
Yes, but it will take me a little while to get there. I have several other videos to make first.
@lucasantagata4551
@lucasantagata4551 4 жыл бұрын
Why the external moment is zero?
@Freeball99
@Freeball99 4 жыл бұрын
We have not been given any external moment in the problem. It is assumed that F(t) is acting directly through center of the hinge so it produces no moment about it.
@c-easy1825
@c-easy1825 3 жыл бұрын
Ok man but how do you linearize that equation so that a controller could model and control the motion of Pendulum?
@Freeball99
@Freeball99 3 жыл бұрын
You can linearize the equations by assuming small displacements and then eliminating all higher-order terms - i.e. fully expand out the equations and eliminate all terms that contain x^2, θ^2 or x.θ (or higher powers). Also you will make the approximation that sinθ=θ and cosθ=1.
@c-easy1825
@c-easy1825 3 жыл бұрын
@@Freeball99 yes i've learnt some tricks in 4 months. Thanks anyway. Appreciate it
@fillemonmvura7077
@fillemonmvura7077 Жыл бұрын
Great video. There's just something I don't quite get. At 14:10 , why is it that when the cos(theta) is differentiated, the negative sign infront of it does not become positive, because from what I understand, derivative of cos is - sin and this negative sign is supposed to cancel out the negative sign that's already infront of the original undifferentiated term.
@Freeball99
@Freeball99 Жыл бұрын
There are actually 3 negatives here and they combine to produce a -ve sign. You are correct that the negative sign from the derivative of cos will cancel out the negative sign that already exists for this term in the Lagrangian. HOWEVER, if you look at eqn 7 (we are dealing with the 2nd term here) dL/dq_i must be SUBTRACTED. This is why we have negative signs before the last 2 terms of this equation.
@fillemonmvura7077
@fillemonmvura7077 Жыл бұрын
@@Freeball99 Ouh I see sir, Thank You Very Much 🙏.
@phucle-ic6fc
@phucle-ic6fc 4 жыл бұрын
That's good
@BlosHaterz
@BlosHaterz 3 жыл бұрын
Sorry, but what about the rotational kinetic energy? Why wasnt it considered in the Kinetic Energy equation?
@Freeball99
@Freeball99 3 жыл бұрын
Typically, we treat a simple pendulum as a point mass (though I should have made this more clear at the start), in which case its rotational KE is zero. In general, you are correct that the rotational kinetic energy should be included. In reality, what you'll find is that in most cases, the rotational KE is negligible for a simple pendulum UNLESS the radius of the mass is very large. In the case of a compound pendulum (or in cases where the mass of the rod/string is not negligible) then the rotational kinetic energy must be included - I have another video showing this.
@LusidDreaming
@LusidDreaming 4 жыл бұрын
Is the reason F doesn't have a component in the second equation because it's only being applied to the cart?
@Freeball99
@Freeball99 4 жыл бұрын
Yes, you could say that. A better explanation would be that the force, F, acts only in the x-direction and produces no moment in the θ direction.
@LusidDreaming
@LusidDreaming 4 жыл бұрын
@@Freeball99 thanks for getting back to me. I realize my confusion was that considering the whole system, pulling the cart would cause the arm to rotate, but we are not considering the whole system but rather just the virtual work done by F, which is zero in the theta coordinate.
@Freeball99
@Freeball99 4 жыл бұрын
Adam Johnston correct. That’s an even better explanation.
@print.helloworld
@print.helloworld 7 ай бұрын
Hi, I have some questions: 1. Why don't you add the potential energy of M in the equation (5)? 2. I think you missed the square of l in the second term in the equation (10). 3. What if m is in the right, not the left? I think they are different. Thank you.
@Freeball99
@Freeball99 7 ай бұрын
1. The mass, M, has zero potential energy since it is located at y=0 and it's y location doesn't change. 2. This is correct as written. The 2nd term in eqn 10 comes from the THIRD term in eqn 9 - because the 2nd term in equation 9 does not contain an 'x' so it does not appear in eqn 10. 3. If m is to the right, then according to my current setup, θ would be negative. However, if you choose to make θ positive to the right instead, then you will need to adjust the kinematics and flip the sign of the 2nd term to positive in eqns 1 & 3.
@mhd.arifin2904
@mhd.arifin2904 4 жыл бұрын
may I ask for a reference source for this question, sir?
@Freeball99
@Freeball99 4 жыл бұрын
This problem exists in many references, however, this came from my own notes. The diagram I re-drew comes from Wikipedia though it too exists in many places online and in many textbooks. The inverted pendulum is a fairly common problem in vibrations and controls classes.
@mhd.arifin2904
@mhd.arifin2904 4 жыл бұрын
@@Freeball99 Yes, thank you. What is one source of the book, sir, because I really love working on problems like this
@Freeball99
@Freeball99 4 жыл бұрын
@@mhd.arifin2904 You can try Mechanical Vibrations by S. S. Rao, 5th Edition. It does not contain the inverted pendulum problem, however, there are many other examples in there.
@mhd.arifin2904
@mhd.arifin2904 4 жыл бұрын
@@Freeball99 thanks very much sir
@TopicsInControlSystems
@TopicsInControlSystems Жыл бұрын
@@Freeball99 I was reading a survey paper the other day that said the inverted pendulum problem has been used as an educational tool in controls for 62 years !!! web.mit.edu/klund/www/keeling/Pendulum2009.pdf
@soumikchakraborty9885
@soumikchakraborty9885 Жыл бұрын
Why equation of motion for x is equal to force ?? But equation of motion of theta is not equal to force ?? Please reply me
@Freeball99
@Freeball99 Жыл бұрын
We place the generalized force/moment on the right-hand side of the equation. In the case of the x-coordinate, there is a force, F, in this direction, so this appears on the right side of the x-equation. In the case of the θ-coordinate, there is no external moment applied, so the right side of the θ equation is 0.
@tayfuncelebi2982
@tayfuncelebi2982 3 жыл бұрын
you take derivative of lagrange equation in the video (10.45 s) but you said derivation will be taken according to x_dot but you did not do that. You use product rule but we do not need to use it becuase if you take derivative of m*L*Q_dot* x_dot*cos(Q) according to x_dot , the answer will be m * L * Q_dot * x_doubledot * cos(Q), wont it ?
@Freeball99
@Freeball99 3 жыл бұрын
No, this is not correct. If I take the derivative of m*L*Q_dot* x_dot*cos(Q) according to x_dot, then I get m*L*Q_dot*cos(Q) according to x_dot. I then need to take the derivative of this with respect to t. This is where the product rule come in because both Q_dot AND cos(Q) depend on time. This results in the TWO terms in the parentheses.
@tanmanpeng5675
@tanmanpeng5675 Жыл бұрын
@@Freeball99 I get X-dot derivation, what about theta dot. cause the derivation of theta dot for mine is -mL*Xdot*cos theta (only derivation of theta dot), with respect to time, isnt the formula mLX_dott*sin(theta)?
@erockromulan9329
@erockromulan9329 6 ай бұрын
I agree with the control guys that this is harder 😬
@NYKYADU
@NYKYADU 3 жыл бұрын
Hey Freeball, Keep up the good work. Can't explain how helpful your contents are! So I just felt like taking this cart and pendulum model to python and play around with the initial condition to see how the system reacted. As expected, the cart had movement even when the initial condition for x (cart's position) was zero for different values of theta (pendulum's position) implying that they are coupled. However, for the case where the pendulum was initially horizontal ( theta = pi/2) I found no movement in cart (x = zero for all t). This looks wrong intuitively... is it because the EOM don't have the x_dot terms in it?
@Freeball99
@Freeball99 3 жыл бұрын
I agree that something seems off here. The cart should move whenever the pendulum swings, regardless of its initial condition. This is not related to the EOM's having no x_dot terms (these would come from adding damping).
@NYKYADU
@NYKYADU 3 жыл бұрын
@@Freeball99 Hey there, I worked on it and figured out this was a non linear problem so the mass matrix( being part of 2n x 2n matrix A from your video on Direct time integration) and B matrix (comprising of damping and stiffness matrix) were also varying with time and I had considered them constant. This has solved the above problem of theta and x coupling for theta = pi/2. The reason I asked about x_dot was that the absence of x_dot in the EOMs made it feel like the system behaved independent of cart velocity. So assume I give an initial velocity to the cart, the pendulum hence theta should change but it's not.
@Freeball99
@Freeball99 3 жыл бұрын
@@NYKYADU This problem is a semi-definite problem because the system is not restrained and can move as a rigid body without oscillating. For example, if initially the cart had some velocity, x_dot and the pendulum was pointing perfectly straight up (theta = 0) then the cart would just continue to move along at its initial velocity with the pendulum pointing straight up. The initial velocity of the cart doesn’t affect the pendulum (unless there is damping applied to the cart), but rather it is the accelerations of the cart that impart a force/moment to the pendulum and hence the coupling. Pro Tip: Any time you are dealing with geometric nonlinear problems, you will have to update the stiffness matrix with each time step. You will also find that updating the mass matrix with each time step becomes very expensive because you need to invert M. Inverting a matrix requires in the order of n^2 iterations. As a result, as n grows, inverting the mass matrix becomes prohibitively expensive (time consuming). The good news is that in many instances you actually don’t need to update the mass matrix (unless mass is being lost by the system) and this results in very little loss of accuracy, but a huge improvement in speed. You should alway test whether not updating the mass matrix produces similar/accurate results.
@NYKYADU
@NYKYADU 3 жыл бұрын
@@Freeball99 That clears things up. Never crossed my mind that it was a semi definite system. Trying to understand balancing of inverted pendulum now. Thanks for the tip. You have been phenomenal. Thanks a lot.
@Freeball99
@Freeball99 3 жыл бұрын
@@NYKYADU the balancing of the pendulum, which is a controls problem, requires you to first linearize the EOM, by assuming that the displacements are small and then throwing away the higher-order terms and making appropriate substitutions i.e. Sin θ = θ and Cos θ = 1.
@enisekartal7309
@enisekartal7309 3 жыл бұрын
isn't this solution wrong? there must be (1/2).I.(w^2) in T, too (rotational kinetic energy)
@Freeball99
@Freeball99 3 жыл бұрын
Technically you are correct! However, for the case of the simple pendulum, it is typically assumed that we are dealing with point masses which is why we can ignore the rotational kinetic energy. I mentioned this in the video on the double pendulum, but should have been more clear here. The reality is, that when dealing with a simple pendulum, the rotational kinetic energy is typically negligible when compared to the translational kinetic energy (except for cases when the diameter of the mass is very large and the connecting rod is very short). Also in reality, the connecting rod is not massless and it will also contribute to the rotational kinetic energy (and is usually more significant than the rotational KE of the mass). I have shown this for the case of the so-called "compound pendulum" in this video: kzfaq.info/get/bejne/m6iXa8qgy5e2cps.html So, for the simple pendulum, you can ignore the rotational KE with little loss of accuracy.
@ashishnegi9663
@ashishnegi9663 3 жыл бұрын
@@Freeball99 Thanks for the informative video. But continuing with Enise's question, if we include rotational kinetic energy as well, what I (moment of inertia) should be taken. Is it about the centre of mass? or is it about the hinge?
@Freeball99
@Freeball99 3 жыл бұрын
@@ashishnegi9663 You need to find the rotational KE about the center of mass. The effects of the mass rotating about the hinge are already taken into account by considering its translational velocity relative to the hinge.
@ashishnegi9663
@ashishnegi9663 3 жыл бұрын
@@Freeball99 ok, thanks. I’ll think about it.
@perceptronsaber4479
@perceptronsaber4479 3 жыл бұрын
I think the last equation is wrong because derivation of cos(&) = - sin(&)
@Freeball99
@Freeball99 3 жыл бұрын
Yes, that is correct. But according to Lagrange's Equation, I need to subtract this term. This flips the sign again. So we have three negative signs: 1) the original sign of the term, 2) the sign we get from taking the derivative 3) the sign we get from the 2nd term of Lagrange''s Equation after substitution.
@perceptronsaber4479
@perceptronsaber4479 3 жыл бұрын
@@Freeball99 I want to connect with you via whatsapp, sir I am Control Engineer
@Freeball99
@Freeball99 3 жыл бұрын
@@perceptronsaber4479 I don't use WhatsApp. You can email me at: apf999@gmail.com
@lutrienn
@lutrienn 3 жыл бұрын
@@Freeball99 I was also trying to figure out why we got that negative. Thank you so much for the video and all the explanations
Introduction To The Lagrange Multiplier Method
21:25
Good Vibrations with Freeball
Рет қаралды 17 М.
Lagrangian and Hamiltonian Mechanics in Under 20 Minutes: Physics Mini Lesson
18:33
아이스크림으로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 61 МЛН
Looks realistic #tiktok
00:22
Анастасия Тарасова
Рет қаралды 105 МЛН
Alex hid in the closet #shorts
00:14
Mihdens
Рет қаралды 11 МЛН
Equations of Motion for the Elastic Pendulum (2DOF) Using Lagrange's Equations
10:01
Good Vibrations with Freeball
Рет қаралды 42 М.
Classic Inverted Pendulum - Equations of Motion
23:01
Brianno Coller
Рет қаралды 153 М.
SWA#245 KTPA 14 July TOO LOW!
9:11
blancolirio
Рет қаралды 192 М.
Equations of Motion for the Double Pendulum (2DOF) Using Lagrange's Equations
20:33
Good Vibrations with Freeball
Рет қаралды 162 М.
Inverted Pendulum on a Cart [Control Bootcamp]
15:08
Steve Brunton
Рет қаралды 240 М.
Pole Placement for the Inverted Pendulum on a Cart [Control Bootcamp]
12:55
아이스크림으로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 61 МЛН