Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Inverted pendulum
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Equations of motion== The [[equations of motion]] of inverted pendulums are dependent on what constraints are placed on the motion of the pendulum. Inverted pendulums can be created in various configurations resulting in a number of Equations of Motion describing the behavior of the pendulum. ===Stationary pivot point=== In a configuration where the pivot point of the pendulum is fixed in space, the equation of motion is similar to that for an [[Pendulum (mathematics)|uninverted pendulum]]. The equation of motion below assumes no friction or any other resistance to movement, a rigid massless rod, and the restriction to [[2-dimensional]] movement. :<math>\ddot \theta - {g \over \ell} \sin \theta = 0</math> Where <math>\ddot \theta </math> is the [[angular acceleration]] of the pendulum, <math>g </math> is the [[standard gravity]] on the surface of the Earth, <math>\ell</math> is the length of the pendulum, and <math>\theta</math> is the angular displacement measured from the equilibrium position. When <math>\ddot \theta </math> added to both sides, it has the same sign as the angular acceleration term: :<math>\ddot \theta = {g \over \ell} \sin \theta</math> Thus, the inverted pendulum accelerates away from the vertical unstable equilibrium in the direction initially displaced, and the acceleration is inversely proportional to the length. Tall pendulums fall more slowly than short ones. '''Derivation using torque and moment of inertia:''' [[Image:cart-pendulum.svg|thumb|300px| A schematic drawing of the inverted pendulum on a cart. The rod is considered massless. The mass of the cart and the point mass at the end of the rod are denoted by M and m. The rod has a length l.]] The pendulum is assumed to consist of a point mass, of mass <math>m </math>, affixed to the end of a massless rigid rod, of length <math>\ell</math>, attached to a pivot point at the end opposite the point mass. The net [[torque]] of the system must equal the [[moment of inertia]] times the angular acceleration: :<math>\boldsymbol{\tau}_{\mathrm{net}}=I \ddot \theta</math> The torque due to gravity providing the net torque: :<math>\boldsymbol{\tau}_{\mathrm{net}}= m g \ell \sin \theta\,\!</math> Where <math> \theta\ </math> is the angle measured from the inverted equilibrium position. The resulting equation: :<math> I \ddot \theta= m g \ell \sin \theta\,\!</math> The moment of inertia for a point mass: :<math>I = m R^2</math> In the case of the inverted pendulum the radius is the length of the rod, <math> \ell </math>. Substituting in <math>I = m \ell ^2</math> :<math> m \ell ^2 \ddot \theta= m g \ell \sin \theta\,\!</math> Mass and <math>\ell^2</math> is divided from each side resulting in: :<math>\ddot \theta = {g \over \ell} \sin \theta</math> ===Inverted pendulum on a cart=== An inverted pendulum on a cart consists of a mass <math> m </math> at the top of a pole of length <math> \ell </math> pivoted on a horizontally moving base as shown in the adjacent image. The cart is restricted to [[linear motion]] and is subject to forces resulting in or hindering motion. ===Essentials of stabilization=== The essentials of stabilizing the inverted pendulum can be summarized qualitatively in three steps. [[Image:Inverted Pendulum control essentials.JPG|thumb|600px| The simple stabilizing control system used on the cart with wine glass above.]] 1. If the tilt angle <math> \theta </math> is to the right, the cart must accelerate to the right and vice versa. 2. The position of the cart <math> x </math> relative to track center is stabilized by slightly modulating the null angle (the angle error that the control system tries to null) by the position of the cart, that is, null angle <math> = \theta + k x </math> where <math> k </math> is small. This makes the pole want to lean slightly toward track center and stabilize at track center where the tilt angle is exactly vertical. Any offset in the tilt sensor or track slope that would otherwise cause instability translates into a stable position offset. A further added offset gives position control. 3. A normal pendulum subject to a moving pivot point such as a load lifted by a crane, has a peaked response at the pendulum radian frequency of <math> \omega_p = \sqrt {g/\ell} </math>. To prevent uncontrolled swinging, the frequency spectrum of the pivot motion should be suppressed near <math> \omega_p </math>. The inverted pendulum requires the same suppression filter to achieve stability. As a consequence of the null angle modulation strategy, the position feedback is positive, that is, a sudden command to move right produces an initial cart motion to the left followed by a move right to rebalance the pendulum. The interaction of the pendulum instability and the positive position feedback instability to produce a stable system is a feature that makes the mathematical analysis an interesting and challenging problem. === From Lagrange's equations === The equations of motion can be derived using [[Lagrangian mechanics|Lagrange's equations]]. We refer to the drawing to the right where <math>\theta(t)</math> is the angle of the pendulum of length <math>l</math> with respect to the vertical direction and the acting forces are gravity and an external force ''F'' in the x-direction. Define <math>x(t)</math> to be the position of the cart. The kinetic energy <math>T</math> of the system is: :<math> T = \frac{1}{2} M v_1^2 + \frac{1}{2} m v_2^2, </math> where <math>v_1</math> is the velocity of the cart and <math>v_2</math> is the velocity of the point mass <math>m</math>. <math>v_1</math> and <math>v_2</math> can be expressed in terms of x and <math>\theta</math> by writing the velocity as the first derivative of the position; :<math> v_1^2=\dot x^2, </math> :<math> v_2^2=\left({\frac{\rm d}{{\rm d}t}}{\left(x- \ell\sin\theta\right)}\right)^2 + \left({\frac{\rm d}{{\rm d}t}}{\left( \ell\cos\theta \right)}\right)^2. </math> Simplifying the expression for <math>v_2</math> leads to: :<math> v_2^2= \dot x^2 -2 \ell \dot x \dot \theta\cos \theta + \ell^2\dot \theta^2. </math> The kinetic energy is now given by: :<math> T = \frac{1}{2} \left(M+m \right ) \dot x^2 -m \ell \dot x \dot\theta\cos\theta + \frac{1}{2} m \ell^2 \dot \theta^2. </math> The generalized coordinates of the system are <math>\theta</math> and <math>x</math>, each has a generalized force. On the <math>x</math> axis, the generalized force <math>Q_x</math> can be calculated through its virtual work :<math> Q_x\delta x=F \delta x,\quad Q_x=F, </math> on the <math>\theta</math> axis, the generalized force <math>Q_\theta</math> can be also calculated through its virtual work :<math> Q_\theta\delta\theta=mgl\sin\theta \delta \theta,\quad Q_\theta=mgl\sin\theta. </math> According to the [[Lagrangian mechanics|Lagrange's equations]], the equations of motion are: :<math> \frac{\mathrm{d}}{\mathrm{d}t}{\partial{T}\over \partial{\dot x}} - {\partial{T}\over \partial x} = F, </math> :<math> \frac{\mathrm{d}}{\mathrm{d}t}{\partial{T}\over \partial{\dot \theta}} - {\partial{T}\over \partial \theta} = mgl\sin\theta, </math> substituting <math>T</math> in these equations and simplifying leads to the equations that describe the motion of the inverted pendulum: :<math> \left ( M + m \right ) \ddot x - m \ell \ddot \theta \cos \theta + m \ell \dot \theta^2 \sin \theta = F, </math> :<math> \ell \ddot \theta - g \sin \theta = \ddot x \cos \theta. </math> These equations are nonlinear, but since the goal of a control system would be to keep the pendulum upright, the equations can be linearized around <math>\theta \approx 0</math>. === From Euler-Lagrange equations === The generalized forces can be both written as potential energy <math>V_x</math> and <math>V_\theta</math>, {| class="wikitable" |- ! Generalized Forces !! Potential Energy |- | <math>Q_x=F</math> || <math>V_x=\int_{t_0}^tF\dot{x}\ {\rm d}t</math> |- | <math>Q_\theta=mgl\sin\theta</math> || <math>V_\theta=mgl\cos\theta</math> |} According to the [[D'Alembert's principle]], generalized forces and potential energy are connected: :<math>Q_j = \frac{\mathrm{d}}{\mathrm{d}t}\frac{\partial V}{\partial \dot{q}_j} - \frac{\partial V}{\partial q_j} \,,</math> However, under certain circumstances, the potential energy is not accessible, only generalized forces are available. After getting the [[Lagrangian mechanics|Lagrangian]] <math>L=T-V</math>, we can also use [[Euler–Lagrange equation]] to solve for equations of motion: :<math>\frac {\partial L}{\partial x} - \frac{\mathrm{d}}{\mathrm{d}t} \left ( \frac {\partial L}{\partial \dot{x}} \right ) = 0</math>, :<math>\frac {\partial L}{\partial \theta} - \frac{\mathrm{d}}{\mathrm{d}t} \left ( \frac {\partial L}{\partial \dot{\theta}} \right ) = 0</math>. The only difference is whether to incorporate the generalized forces into the potential energy <math>V_j</math> or write them explicitly as <math>Q_j</math> on the right side, they all lead to the same equations in the final. === From Newton's second law=== Oftentimes it is beneficial to use [[Newton's laws of motion|Newton's second law]] instead of [[Lagrangian mechanics|Lagrange's equations]] because Newton's equations give the reaction forces at the joint between the pendulum and the cart. These equations give rise to two equations for each body; one in the x-direction and the other in the y-direction. The equations of motion of the cart are shown below where the LHS is the sum of the forces on the body and the RHS is the acceleration. :<math> F-R_x = M \ddot x </math> :<math> F_N - R_y - M g = 0 </math> In the equations above <math>R_x</math> and <math>R_y</math> are reaction forces at the joint. <math>F_N</math> is the normal force applied to the cart. This second equation depends only on the vertical reaction force, thus the equation can be used to solve for the normal force. The first equation can be used to solve for the horizontal reaction force. In order to complete the equations of motion, the acceleration of the point mass attached to the pendulum must be computed. The position of the point mass can be given in inertial coordinates as :<math> \vec r_P = (x-\ell \sin \theta) \hat x_I + \ell \cos \theta \hat y_I </math> Taking two derivatives yields the acceleration vector in the inertial reference frame. :<math> \vec a_{P/I} = (\ddot x + \ell \dot \theta^2 \sin \theta - \ell \ddot \theta \cos \theta ) \hat x_I + (-\ell \dot \theta^2 \cos \theta - \ell \ddot \theta \sin \theta) \hat y_I </math> Then, using Newton's second law, two equations can be written in the x-direction and the y-direction. Note that the reaction forces are positive as applied to the pendulum and negative when applied to the cart. This is due to Newton's third law. :<math> R_x = m(\ddot x + \ell \dot \theta^2 \sin \theta - \ell \ddot \theta \cos \theta ) </math> :<math> R_y - m g = m (-\ell \dot \theta^2 \cos \theta - \ell \ddot \theta \sin \theta) </math> The first equation allows yet another way to compute the horizontal reaction force in the event the applied force <math>F</math> is not known. The second equation can be used to solve for the vertical reaction force. The first equation of motion is derived by substituting <math>F-R_x = M \ddot x</math> into <math>R_x = m(\ddot x + \ell \dot \theta^2 \sin \theta - \ell \ddot \theta \cos \theta )</math>, which yields :<math> \left (M+m \right) \ddot x - m \ell \ddot \theta \cos \theta + m \ell \dot \theta^2 \sin \theta = F </math> By inspection this equation is identical to the result from Lagrange's Method. In order to obtain the second equation, the pendulum equation of motion must be dotted with a unit vector that runs perpendicular to the pendulum at all times and is typically noted as the x-coordinate of the body frame. In inertial coordinates this vector can be written using a simple 2-D coordinate transformation :<math> \hat x_B = \cos \theta \hat x_I + \sin \theta \hat y_I </math> The pendulum equation of motion written in vector form is <math>\sum \vec F = m \vec a_{P/I}</math>. Dotting <math>\hat x_B</math> with both sides yields the following on the LHS (note that a transpose is the same as a [[dot product]]) :<math> (\hat x_B)^T\sum \vec F = (\hat x_B)^T (R_x \hat x_I + R_y \hat y_I - m g \hat y_I) = (\hat x_B)^T(R_p \hat y_B - m g \hat y_I) = -m g \sin \theta </math> In the above equation the relationship between body frame components of the reaction forces and inertial frame components of reaction forces is used. The assumption that the bar connecting the point mass to the cart is massless implies that this bar cannot transfer any load perpendicular to the bar. Thus, the inertial frame components of the reaction forces can be written simply as <math>R_p \hat y_B</math>, which signifies that the bar can transfer loads only along the axis of the bar itself. This gives rise to another equation that can be used to solve for the tension in the rod itself: :<math> R_p = \sqrt{ R_x^2 + R_y^2} </math> The RHS of the equation is computed similarly by dotting <math>\hat x_B</math> with the acceleration of the pendulum. The result (after some simplification) is shown below. :<math> m(\hat x_B)^T(\vec a_{P/I}) = m(\ddot x \cos \theta - \ell \ddot \theta) </math> Combining the LHS with the RHS and dividing through by m yields :<math> \ell \ddot \theta - g \sin \theta = \ddot x \cos \theta </math> which again is identical to the result of Lagrange's method. The benefit of using Newton's method is that all reaction forces are revealed to ensure that nothing is damaged. For a derivation of the equations of motions from Newton's second law, as above, using the Symbolic Math Toolbox<ref>{{cite web| url = https://www.mathworks.com/help/symbolic/derive-and-simulate-cart-pole-system.html| title = Derive Equations of Motion and Simulate Cart-Pole System}}</ref> and references therein.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)