Inverted pendulum

Last updated
Balancing cart, a simple robotics system circa 1976. The cart contains a servo system which monitors the angle of the rod and moves the cart back and forth to keep it upright. Balancer with wine 3.JPG
Balancing cart, a simple robotics system circa 1976. The cart contains a servo system which monitors the angle of the rod and moves the cart back and forth to keep it upright.

An inverted pendulum is a pendulum that has its center of mass above its pivot point. It is unstable and without additional help will fall over. It can be suspended stably in this inverted position by using a control system to monitor the angle of the pole and move the pivot point horizontally back under the center of mass when it starts to fall over, keeping it balanced. The inverted pendulum is a classic problem in dynamics and control theory and is used as a benchmark for testing control strategies. It is often implemented with the pivot point mounted on a cart that can move horizontally under control of an electronic servo system as shown in the photo; this is called a cart and pole apparatus. [1] Most applications limit the pendulum to 1 degree of freedom by affixing the pole to an axis of rotation. Whereas a normal pendulum is stable when hanging downwards, an inverted pendulum is inherently unstable, and must be actively balanced in order to remain upright; this can be done either by applying a torque at the pivot point, by moving the pivot point horizontally as part of a feedback system, changing the rate of rotation of a mass mounted on the pendulum on an axis parallel to the pivot axis and thereby generating a net torque on the pendulum, or by oscillating the pivot point vertically. A simple demonstration of moving the pivot point in a feedback system is achieved by balancing an upturned broomstick on the end of one's finger.

Contents

A second type of inverted pendulum is a tiltmeter for tall structures, which consists of a wire anchored to the bottom of the foundation and attached to a float in a pool of oil at the top of the structure that has devices for measuring movement of the neutral position of the float away from its original position.

Overview

A pendulum with its bob hanging directly below the support pivot is at a stable equilibrium point; there is no torque on the pendulum so it will remain motionless, and if displaced from this position will experience a restoring torque which returns it toward the equilibrium position. A pendulum with its bob in an inverted position, supported on a rigid rod directly above the pivot, 180° from its stable equilibrium position, is at an unstable equilibrium point. At this point again there is no torque on the pendulum, but the slightest displacement away from this position will cause a gravitation torque on the pendulum which will accelerate it away from equilibrium, and it will fall over.

In order to stabilize a pendulum in this inverted position, a feedback control system can be used, which monitors the pendulum's angle and moves the position of the pivot point sideways when the pendulum starts to fall over, to keep it balanced. The inverted pendulum is a classic problem in dynamics and control theory and is widely used as a benchmark for testing control algorithms (PID controllers, state-space representation, neural networks, fuzzy control, genetic algorithms, etc.). Variations on this problem include multiple links, allowing the motion of the cart to be commanded while maintaining the pendulum, and balancing the cart-pendulum system on a see-saw. The inverted pendulum is related to rocket or missile guidance, where the center of gravity is located behind the center of drag causing aerodynamic instability. [2] The understanding of a similar problem can be shown by simple robotics in the form of a balancing cart. Balancing an upturned broomstick on the end of one's finger is a simple demonstration, and the problem is solved by self-balancing personal transporters such as the Segway PT, the self-balancing hoverboard and the self-balancing unicycle.

Another way that an inverted pendulum may be stabilized, without any feedback or control mechanism, is by oscillating the pivot rapidly up and down. This is called Kapitza's pendulum. If the oscillation is sufficiently strong (in terms of its acceleration and amplitude) then the inverted pendulum can recover from perturbations in a strikingly counterintuitive manner. If the driving point moves in simple harmonic motion, the pendulum's motion is described by the Mathieu equation. [3]

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 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.

Where is the angular acceleration of the pendulum, is the standard gravity on the surface of the Earth, is the length of the pendulum, and is the angular displacement measured from the equilibrium position.

When added to both sides, it will have the same sign as the angular acceleration term:

Thus, the inverted pendulum will accelerate 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:

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. Cart-pendulum.svg
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 , affixed to the end of a massless rigid rod, of length , 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:

The torque due to gravity providing the net torque:

Where is the angle measured from the inverted equilibrium position.

The resulting equation:

The moment of inertia for a point mass:

In the case of the inverted pendulum the radius is the length of the rod, .

Substituting in

Mass and is divided from each side resulting in:

Inverted pendulum on a cart

An inverted pendulum on a cart consists of a mass at the top of a pole of length 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.

The simple stabilizing control system used on the cart with wine glass above. Inverted Pendulum control essentials.JPG
The simple stabilizing control system used on the cart with wine glass above.

1. If the tilt angle is to the right, the cart must accelerate to the right and vice versa.

2. The position of the cart 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 where 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 . To prevent uncontrolled swinging, the frequency spectrum of the pivot motion should be suppressed near . The inverted pendulum requires the same suppression filter to achieve stability.

Note that, as a consequence of the null angle modulation strategy, the position feedback is positive, that is, a sudden command to move right will produce 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 Lagrange's equations. We refer to the drawing to the right where is the angle of the pendulum of length with respect to the vertical direction and the acting forces are gravity and an external force F in the x-direction. Define to be the position of the cart.

The kinetic energy of the system is:

where is the velocity of the cart and is the velocity of the point mass . and can be expressed in terms of x and by writing the velocity as the first derivative of the position;

Simplifying the expression for leads to:

The kinetic energy is now given by:

The generalized coordinates of the system are and , each has a generalized force. On the axis, the generalized force can be calculated through its virtual work

on the axis, the generalized force can be also calculated through its virtual work

According to the Lagrange's equations, the equations of motion are:

substituting in these equations and simplifying leads to the equations that describe the motion of the inverted pendulum:

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 .

From Euler-Lagrange equations

The generalized forces can be both written as potential energy and ,

Generalized ForcesPotential Energy

According to the D'Alembert's principle, generalized forces and potential energy are connected:

However, under certain circumstances, the potential energy is not accessible, only generalized forces are available.

After getting the Lagrangian , we can also use Euler–Lagrange equation to solve for equations of motion:

,
.

The only difference is whether to incorporate the generalized forces into the potential energy or write them explicitly as 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 second law instead of 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.

In the equations above and are reaction forces at the joint. is the normal force applied to the cart. This second equation only depends 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

Taking two derivatives yields the acceleration vector in the inertial reference frame.

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.

The first equation allows yet another way to compute the horizontal reaction force in the event the applied force 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 into which yields

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 which 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

The pendulum equation of motion written in vector form is . Dotting with both sides yields the following on the LHS (note that a transpose is the same as a dot product)

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 which signifies that the bar can only transfer loads along the axis of the bar itself. This gives rise to another equation which can be used to solve for the tension in the rod itself

The RHS of the equation is computed similarly by dotting with the acceleration of the pendulum. The result (after some simplification) is shown below.

Combining the LHS with the RHS and dividing through by m yields

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 will be damaged.

Variants

Achieving stability of an inverted pendulum has become a common engineering challenge for researchers. [4] There are different variations of the inverted pendulum on a cart ranging from a rod on a cart to a multiple segmented inverted pendulum on a cart. Another variation places the inverted pendulum's rod or segmented rod on the end of a rotating assembly. In both, (the cart and rotating system) the inverted pendulum can only fall in a plane. The inverted pendulums in these projects can either be required to only maintain balance after an equilibrium position is achieved or be able to achieve equilibrium by itself. Another platform is a two-wheeled balancing inverted pendulum. The two wheeled platform has the ability to spin on the spot offering a great deal of maneuverability. [5] Yet another variation balances on a single point. A spinning top, a unicycle, or an inverted pendulum atop a spherical ball all balance on a single point.

Drawing showing how a Kapitza pendulum can be constructed: a motor rotates a crank at a high speed, the crank vibrates a lever arm up and down, which the pendulum is attached to with a pivot. Kapitza pendulum.svg
Drawing showing how a Kapitza pendulum can be constructed: a motor rotates a crank at a high speed, the crank vibrates a lever arm up and down, which the pendulum is attached to with a pivot.

Kapitza's pendulum

An inverted pendulum in which the pivot is oscillated rapidly up and down can be stable in the inverted position. This is called Kapitza's pendulum, after Russian physicist Pyotr Kapitza who first analysed it. The equation of motion for a pendulum connected to a massless, oscillating base is derived the same way as with the pendulum on the cart. The position of the point mass is now given by:

and the velocity is found by taking the first derivative of the position:

Plots for the inverted pendulum on an oscillatory base. The first plot shows the response of the pendulum on a slow oscillation, the second the response on a fast oscillation Inverted pendulum oscillatory base.svg
Plots for the inverted pendulum on an oscillatory base. The first plot shows the response of the pendulum on a slow oscillation, the second the response on a fast oscillation

The Lagrangian for this system can be written as:

and the equation of motion follows from:

resulting in:

If y represents a simple harmonic motion, , the following differential equation is:

This equation does not have elementary closed-form solutions, but can be explored in a variety of ways. It is closely approximated by the Mathieu equation, for instance, when the amplitude of oscillations are small. Analyses show that the pendulum stays upright for fast oscillations. The first plot shows that when is a slow oscillation, the pendulum quickly falls over when disturbed from the upright position. The angle exceeds 90° after a short time, which means the pendulum has fallen on the ground. If is a fast oscillation the pendulum can be kept stable around the vertical position. The second plot shows that when disturbed from the vertical position, the pendulum now starts an oscillation around the vertical position (). The deviation from the vertical position stays small, and the pendulum doesn't fall over.

Examples

Arguably the most prevalent example of a stabilized inverted pendulum is a human being. A person standing upright acts as an inverted pendulum with their feet as the pivot, and without constant small muscular adjustments would fall over. The human nervous system contains an unconscious feedback control system, the sense of balance or righting reflex, that uses proprioceptive input from the eyes, muscles and joints, and orientation input from the vestibular system consisting of the three semicircular canals in the inner ear, and two otolith organs, to make continual small adjustments to the skeletal muscles to keep us standing upright. Walking, running, or balancing on one leg puts additional demands on this system. Certain diseases and alcohol or drug intoxication can interfere with this reflex, causing dizziness and disequilibration, an inability to stand upright. A field sobriety test used by police to test drivers for the influence of alcohol or drugs, tests this reflex for impairment.

Some simple examples include balancing brooms or meter sticks by hand.

The inverted pendulum has been employed in various devices and trying to balance an inverted pendulum presents a unique engineering problem for researchers. [6] The inverted pendulum was a central component in the design of several early seismometers due to its inherent instability resulting in a measurable response to any disturbance. [7]

The inverted pendulum model has been used in some recent personal transporters, such as the two-wheeled self-balancing scooters and single-wheeled electric unicycles. These devices are kinematically unstable and use an electronic feedback servo system to keep them upright.

Swinging a pendulum on a cart into its inverted pendulum state is considered a traditional optimal control toy problem/benchmark. [8] [9]

Trajectory of a fixed time cartpole swing up that minimizes the force squared Cart-pole swing up.gif
Trajectory of a fixed time cartpole swing up that minimizes the force squared

See also

Related Research Articles

<span class="mw-page-title-main">Polar coordinate system</span> Coordinates determined by distance and angle

In mathematics, the polar coordinate system is a two-dimensional coordinate system in which each point on a plane is determined by a distance from a reference point and an angle from a reference direction. The reference point is called the pole, and the ray from the pole in the reference direction is the polar axis. The distance from the pole is called the radial coordinate, radial distance or simply radius, and the angle is called the angular coordinate, polar angle, or azimuth. Angles in polar notation are generally expressed in either degrees or radians.

<span class="mw-page-title-main">Spherical coordinate system</span> 3-dimensional coordinate system

In mathematics, a spherical coordinate system is a coordinate system for three-dimensional space where the position of a given point in space is specified by three numbers, : the radial distance of the radial liner connecting the point to the fixed point of origin ; the polar angle θ of the radial line r; and the azimuthal angle φ of the radial line r.

<span class="mw-page-title-main">Double pendulum</span> Pendulum with another pendulum attached to its end

In physics and mathematics, in the area of dynamical systems, a double pendulum also known as a chaos pendulum is a pendulum with another pendulum attached to its end, forming a simple physical system that exhibits rich dynamic behavior with a strong sensitivity to initial conditions. The motion of a double pendulum is governed by a set of coupled ordinary differential equations and is chaotic.

<span class="mw-page-title-main">Tautochrone curve</span> Concept in geometry

A tautochrone curve or isochrone curve is the curve for which the time taken by an object sliding without friction in uniform gravity to its lowest point is independent of its starting point on the curve. The curve is a cycloid, and the time is equal to π times the square root of the radius over the acceleration of gravity. The tautochrone curve is related to the brachistochrone curve, which is also a cycloid.

<span class="mw-page-title-main">Hamiltonian mechanics</span> Formulation of classical mechanics using momenta

Hamiltonian mechanics emerged in 1833 as a reformulation of Lagrangian mechanics. Introduced by Sir William Rowan Hamilton, Hamiltonian mechanics replaces (generalized) velocities used in Lagrangian mechanics with (generalized) momenta. Both theories provide interpretations of classical mechanics and describe the same physical phenomena.

In analytical mechanics, generalized coordinates are a set of parameters used to represent the state of a system in a configuration space. These parameters must uniquely define the configuration of the system relative to a reference state. The generalized velocities are the time derivatives of the generalized coordinates of the system. The adjective "generalized" distinguishes these parameters from the traditional use of the term "coordinate" to refer to Cartesian coordinates.

<span class="mw-page-title-main">Spherical pendulum</span>

In physics, a spherical pendulum is a higher dimensional analogue of the pendulum. It consists of a mass m moving without friction on the surface of a sphere. The only forces acting on the mass are the reaction from the sphere and gravity.

<span class="mw-page-title-main">Projectile motion</span> Motion of launched objects due to gravity

Projectile motion is a form of motion experienced by an object or particle that is projected in a gravitational field, such as from Earth's surface, and moves along a curved path under the action of gravity only. In the particular case of projectile motion on Earth, most calculations assume the effects of air resistance are passive and negligible. The curved path of objects in projectile motion was shown by Galileo to be a parabola, but may also be a straight line in the special case when it is thrown directly upward or downward. The study of such motions is called ballistics, and such a trajectory is a ballistic trajectory. The only force of mathematical significance that is actively exerted on the object is gravity, which acts downward, thus imparting to the object a downward acceleration towards the Earth’s center of mass. Because of the object's inertia, no external force is needed to maintain the horizontal velocity component of the object's motion. Taking other forces into account, such as aerodynamic drag or internal propulsion, requires additional analysis. A ballistic missile is a missile only guided during the relatively brief initial powered phase of flight, and whose remaining course is governed by the laws of classical mechanics.

In physics, the Hamilton–Jacobi equation, named after William Rowan Hamilton and Carl Gustav Jacob Jacobi, is an alternative formulation of classical mechanics, equivalent to other formulations such as Newton's laws of motion, Lagrangian mechanics and Hamiltonian mechanics.

In rotordynamics, the rigid rotor is a mechanical model of rotating systems. An arbitrary rigid rotor is a 3-dimensional rigid object, such as a top. To orient such an object in space requires three angles, known as Euler angles. A special rigid rotor is the linear rotor requiring only two angles to describe, for example of a diatomic molecule. More general molecules are 3-dimensional, such as water, ammonia, or methane.

<span class="mw-page-title-main">Routhian mechanics</span> Formulation of classical mechanics

In classical mechanics, Routh's procedure or Routhian mechanics is a hybrid formulation of Lagrangian mechanics and Hamiltonian mechanics developed by Edward John Routh. Correspondingly, the Routhian is the function which replaces both the Lagrangian and Hamiltonian functions. Routhian mechanics is equivalent to Lagrangian mechanics and Hamiltonian mechanics, and introduces no new physics. It offers an alternative way to solve mechanical problems.

<span class="mw-page-title-main">Pendulum (mechanics)</span> Free swinging suspended body

A pendulum is a body suspended from a fixed support so that it swings freely back and forth under the influence of gravity. When a pendulum is displaced sideways from its resting, equilibrium position, it is subject to a restoring force due to gravity that will accelerate it back towards the equilibrium position. When released, the restoring force acting on the pendulum's mass causes it to oscillate about the equilibrium position, swinging it back and forth. The mathematics of pendulums are in general quite complicated. Simplifying assumptions can be made, which in the case of a simple pendulum allow the equations of motion to be solved analytically for small-angle oscillations.

<span class="mw-page-title-main">Swinging Atwood's machine</span> Variation of Atwoods machine incorporating a pendulum

The swinging Atwood's machine (SAM) is a mechanism that resembles a simple Atwood's machine except that one of the masses is allowed to swing in a two-dimensional plane, producing a dynamical system that is chaotic for some system parameters and initial conditions.

In classical mechanics, holonomic constraints are relations between the position variables that can be expressed in the following form:

<span class="mw-page-title-main">Elastic pendulum</span>

In physics and mathematics, in the area of dynamical systems, an elastic pendulum is a physical system where a piece of mass is connected to a spring so that the resulting motion contains elements of both a simple pendulum and a one-dimensional spring-mass system. For specific energy values, the system demonstrates all the hallmarks of chaotic behavior and is sensitive to initial conditions.At very low and very high energy, there also appears to be regular motion. The motion of an elastic pendulum is governed by a set of coupled ordinary differential equations.This behavior suggests a complex interplay between energy states and system dynamics.

<span class="mw-page-title-main">Kepler orbit</span> Celestial orbit whose trajectory is a conic section in the orbital plane

In celestial mechanics, a Kepler orbit is the motion of one body relative to another, as an ellipse, parabola, or hyperbola, which forms a two-dimensional orbital plane in three-dimensional space. A Kepler orbit can also form a straight line. It considers only the point-like gravitational attraction of two bodies, neglecting perturbations due to gravitational interactions with other objects, atmospheric drag, solar radiation pressure, a non-spherical central body, and so on. It is thus said to be a solution of a special case of the two-body problem, known as the Kepler problem. As a theory in classical mechanics, it also does not take into account the effects of general relativity. Keplerian orbits can be parametrized into six orbital elements in various ways.

<span class="mw-page-title-main">Furuta pendulum</span>

The Furuta pendulum, or rotational inverted pendulum, consists of a driven arm which rotates in the horizontal plane and a pendulum attached to that arm which is free to rotate in the vertical plane. It was invented in 1992 at Tokyo Institute of Technology by Katsuhisa Furuta and his colleagues. It is an example of a complex nonlinear oscillator of interest in control system theory. The pendulum is underactuated and extremely non-linear due to the gravitational forces and the coupling arising from the Coriolis and centripetal forces. Since then, dozens, possibly hundreds of papers and theses have used the system to demonstrate linear and non-linear control laws. The system has also been the subject of two texts.

<span class="mw-page-title-main">Lagrangian mechanics</span> Formulation of classical mechanics

In physics, Lagrangian mechanics is a formulation of classical mechanics founded on the stationary-action principle. It was introduced by the Italian-French mathematician and astronomer Joseph-Louis Lagrange in his presentation to the Turin Academy of Science in 1760 culminating in his 1788 grand opus, Mécanique analytique.

In Euclidean geometry, for a plane curve C and a given fixed point O, the pedal equation of the curve is a relation between r and p where r is the distance from O to a point on C and p is the perpendicular distance from O to the tangent line to C at the point. The point O is called the pedal point and the values r and p are sometimes called the pedal coordinates of a point relative to the curve and the pedal point. It is also useful to measure the distance of O to the normal pc (the contrapedal coordinate) even though it is not an independent quantity and it relates to (r, p) as

<span class="mw-page-title-main">Kapitza's pendulum</span>

Kapitza's pendulum or Kapitza pendulum is a rigid pendulum in which the pivot point vibrates in a vertical direction, up and down. It is named after Russian Nobel laureate physicist Pyotr Kapitza, who in 1951 developed a theory which successfully explains some of its unusual properties. The unique feature of the Kapitza pendulum is that the vibrating suspension can cause it to balance stably in an inverted position, with the bob above the suspension point. In the usual pendulum with a fixed suspension, the only stable equilibrium position is with the bob hanging below the suspension point; the inverted position is a point of unstable equilibrium, and the smallest perturbation moves the pendulum out of equilibrium. In nonlinear control theory the Kapitza pendulum is used as an example of a parametric oscillator that demonstrates the concept of "dynamic stabilization".

References

  1. C.A. Hamilton Union College Senior Project 1966
  2. "Model Rocket Stability".
  3. Mitchell, Joe. "Techniques for the Oscillated Pendulum and the Mathieu Equation" (PDF). math.ou.edu. Retrieved 2023-11-06.
  4. Ooi, Rich Chi. "Balancing a Two-Wheeled Autonomous Robot" (PDF). robotics.ee.uwa.edu.au. Retrieved 2023-11-06.
  5. "Archived copy" (PDF). Archived from the original (PDF) on 2016-03-04. Retrieved 2012-05-01.{{cite web}}: CS1 maint: archived copy as title (link)
  6. "Archived copy" (PDF). Archived from the original (PDF) on 2016-03-04. Retrieved 2012-05-01.{{cite web}}: CS1 maint: archived copy as title (link)
  7. "The Early History of Seismometry (to 1900)". Archived from the original on 2009-11-28.
  8. "The Acrobot and Cart-Pole" (PDF).
  9. "Cart-Pole Swing-Up". www.cs.huji.ac.il. Retrieved 2019-08-19.

Further reading