the inverted pendulum - nldlabtracking in matlab, continued •step four: make the centroids the...

66
The Inverted Pendulum Group 7: Chris Marcotte, Jeff Aguilar, Gustavo Lee, Balachandra Suri

Upload: others

Post on 22-Jan-2021

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

The Inverted Pendulum

Group 7: Chris Marcotte, Jeff Aguilar,

Gustavo Lee, Balachandra Suri

Page 2: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

The inverted pendulum is

archetypal to both Control

Theory1, 2 and Nonlinear

Dynamics3.

[1] D. Liberzon. Switching in Systems and Control (2003 Springer)

[2] Franklin; et al. (2005). Feedback control of dynamic systems, 5, Prentice Hall.

[3] Strogatz, Steven (1994). Nonlinear dynamics and chaos : with applications to

physics, biology, chemistry, and engineering. Perseus Books.

Page 3: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

History of a persistent problem

First investigated by Kapitza, then H.P. Kalmus, and E.D. Yorke. Kapitza is a Nobel laurate and founded The Institute for Physical Problems at the Russian Academy of Sciences. E.D. Yorke is one-half the Yorke-named team behind the Kaplan-Yorke number for the dimension of the strange attractor.

Page 4: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

the striking and instructive phenomenon of dynamical stability of the turned pendulum not only entered no contemporary handbook on mechanics but is also nearly unknown to the wide circle of specialists... ...not less striking than the spinning top and as instructive.

P.L. Kapitza Collected papers of P. L. Kapitza, Vol. 2, edited by D. Ter Haar

(Pergamon, London, 1965). p. 714, 726

Page 5: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Two Inverted Pendulum Problems

Vertically Driven Base If the driving waveform

is known a priori, the

system reduces to a

Lagrangian of a single

variable.

Sinusoidal waveforms

are best waveforms.

Vertically Constrained Typically involves a

freely moving cart and

a track; irreducibly two

variable.

More of a Control

Theory problem, really.

Page 6: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

The

Vertically Driven Inverted Pendulum

Page 7: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Theory and Circumstance

Page 8: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Single Pendulum

Page 9: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Derivation

Lagrangian of the inverted pendulum with a vertically-driven pivot:

ℒ =𝑚

2𝑙2𝜃 2 + 𝑦 2 + 2𝑙𝑦 𝜃 sin 𝜃 − 𝑚𝑔 𝑦 𝑡 + 𝑙 cos 𝜃

𝜃– angle between the pendulum arm and upward vertical in a counterclockwise direction

𝜃 – first derivative of 𝜃 with respect to 𝑡

𝑙– length of pendulum

𝑚 – mass of pendulum

𝑔 – acceleration due to gravity

Page 10: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Rescaling

Solving the first-order Lagrange-Euler equation in 𝜃 and 𝜃:

𝑑

𝑑𝑡

𝜕ℒ

𝜕𝜃 −𝜕ℒ

𝜕𝜃= 0

And re-scaling yields:

𝜃 + 𝛽𝑓 𝜏 − 𝛼 sin 𝜃 = 0

where, 𝜃 – second derivative of 𝜃 with respect to non-dimensional time: 𝜏 = 𝜔𝑡 𝜔– driving frequency of pivot

𝛼 =𝑔

𝑙𝜔2

𝑔– acceleration due to gravity

𝛽 =𝑏

𝑙

𝑓 𝜏 – normalized driving function, such that 𝜕𝜏2𝑦 𝑡 = 𝑏𝑓 𝜏

Page 11: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Damping

With damping, the second-order system can be written:

𝜃 + 𝛾𝜃 + 𝛽𝑓 𝜏 − 𝛼 sin 𝜃 = 0

𝛾 – constant, scaled friction term

Page 12: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Linearization

The fixed points are:

𝜃∗, 𝜃 ∗+= 0,0

𝜃∗, 𝜃 ∗−= 𝜋, 0

Making the local transformation:

± = 𝜃 ∗± + 𝛿𝜃±

We arrive at the Mathieu equation:

𝛿𝜃 ± ± 𝛽𝑓 𝜏 − 𝛼 𝛿𝜃± = 0

Page 13: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Modeling – Single Pendulum

• Using Simulink:

Page 14: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Stability Diagram - Experimental

J. A. Blackburn, H. J. T. Smith, and N. Groenbech-Jensen, ‘‘Stability and Hopf bifurcations in an inverted pendulum,’’ Am. J. Phys. 60 10, 903–908 (1992).

Page 15: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Stability Diagram - Theoretical

J. A. Blackburn, H. J. T. Smith, and N. Groenbech-Jensen, ‘‘Stability and Hopf bifurcations in an inverted pendulum,’’ Am. J. Phys. 60 10, 903–908 (1992).

Page 16: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Effective Energy Potential

Effective potential with small energy losses using two-timing method.

J. A. Blackburn, H. J. T. Smith, and N. Groenbech-Jensen, ‘‘Stability and Hopf bifurcations in an inverted pendulum,’’ Am. J. Phys. 60 10, 903–908 (1992).

Page 17: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Stability

Page 18: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Video: Single pendulum 25 Hz, unstable up

Page 19: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Video: Single pendulum at 25 Hz, stable up

Page 20: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Video: Single pendulum at 25 Hz, unstable up or down

Page 21: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Double Pendulum

Equations of Motion:

Page 22: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Modeling – Double Pendulum

• Using Simulink:

Page 23: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Video: Double pendulum at 50 Hz, stable

Page 24: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Video: Double pendulum at 50 Hz, unstable

Page 25: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Experimental Setup

Page 26: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

The General Setup

Oscillating Base

Camera: used to

track points

Pendulum

Trackers placed at pivot and end point

Page 27: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Oscillating Base

Function Generator creates Sine Wave at a set

frequency

Amplifier increases

signal with current

Signal sent to motor in

base

The amplitude of the

oscillating acceleration

is read through the

oscilloscope via signal

of the accelerometer in

the oscillating base.

Page 28: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Forcing Amplitude from

Oscilloscope

Peak to Peak Voltage:

𝐴𝑎𝑐𝑐,𝑔 =𝑉𝑝𝑘2

∗ 10

Acceleration Amplitude in g:

𝑉𝑝𝑘

Acceleration in m/s2:

𝐴𝑎𝑐𝑐 = 9.8 ∗ 𝐴𝑎𝑐𝑐,𝑔

Position Amplitude :

𝐴𝑝𝑜𝑠 =𝐴𝑎𝑐𝑐

(2𝜋 ∗ 𝐹𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦)2

2s

m

Page 29: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Stability Mapping Procedure

1. Set forcing frequency with function generator.

2. Move and support pendulum near top fixed point.

3. Slowly ramp up current until pendulum stabilizes at top.

4. Determine forcing amplitude from oscilloscope read out.

Page 30: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Tracking Setup

Trackers used:

- 10 mm white plastic balls

- White out

For 1000 fps camera, a black

backdrop was required for added

contrast

Page 31: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Camera Setup

• Two different setups used:

– PointGrey Camera: • ~200 fps

• Point Tracking done in real-time in LabView

• Only for single pendulum experiments. Tracking fails when tracking point disappears (a problem for certain pendulum setups)

Page 32: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Camera Setup, Continued

• Two different setups used:

– MotionXtra • 1000 fps

• Video saved to onboard drive, then sent to computer

• Point Tracking done post-recording in Matlab.

• Allows for tracking of fast movement (i.e. with chaotic double pendulum) as well as manual tracking at key points

Page 33: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Tracking in Matlab

• Step one: Click on markers in the first frame.

• Step two: Threshold data.

• Step three: For a square of points around

selected marker, average all of the “true” points

to get centroid:

Search area

created from

selected point

Actual

centroid

Point

selected for

marker

Page 34: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Tracking in Matlab, Continued

• Step four: Make the centroids the updated

search points for the next frame.

REPEAT STEPS 2-4 for all frames:

Search area

for the next

frame

Next

centroid

Updated

search

point

Page 35: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Tracking the Double Pendulum

• Equal rod lengths causes overlap of trackers

Page 36: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Tracking the Double Pendulum

• Equal rod lengths causes overlap of trackers

Page 37: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Tracking the Double Pendulum

• Equal rod lengths causes overlap of trackers

Pivot track

point gets

stuck on the

wrong track

point!

Page 38: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

The Pendula: The Original

High end

skateboard

bearing

Supports

Rod

Rod Length: 10 cm

Page 39: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

The Pendula: The Original Strange high friction observed at the fixed points…

X-Position

Pendulum

would settle

in different

locations

Pivot Forced Vertically at 22 Hz and ~ 7mm Amplitude

Page 40: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

The Pendula: Modified Version

High end

skateboard

bearing

Support

Shortened rod

Removed one

of the two

bearings

- Rod Length: 3 cm

- Noticeably

decreased friction

issue

- Allowed us to

observe behavior at

slightly higher

forcing frequencies

Page 41: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

The Pendula: Modified Version

-Decay is

geometric instead

of exponential

- Suggests

frictional damping

instead of viscous

damping

Experimental ring down at the stable fixed point (no shaking)

Page 42: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

The Pendula: Lego Double

Support

Lego rods

- Rod Length (6.5 cm)

- No bearings

- No strange frictional

bearing issues

- Just regular, even friction

- Lesson: Legos make great

pendula!

- Double Pendulum is a bit

rickety

Page 43: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Data and Results

Page 44: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Tracking the Pivot

Page 45: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Track the Pendulum

Page 46: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Reconstruct Motion

Page 47: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Model in Physical Units

Exact Ideal Case

No Forcing

Approximation

?

Page 48: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

The Natural Frequency

Frequency = 1.793 Hz

Page 49: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Damping

Page 50: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Finding

• How can we relate to the decreasing

Amplitude??

•Work done by friction equals the loss in

potential energy i.e. Amplitude

•Small Angle approximation yields the

following expression

•Experiment: Large Amplitude, Small

Amplitudes specially distorted

mf

TT

2max2 1

Page 51: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Determine Parameters

•Determined the frequency from decay

data

•Fit the first oscillation to a sin/cos and

get the initial theta and omega

•A Linear/Quadratic fit of the decay

turning amplitudes gives

•Initial Conditions:

•Tweak frequency and Friction

3~

1.10 6.50

5.2~Hzf 87.1

Page 52: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Simulation Vs Experiment

Experiment: Red

Simulation: Blue

Page 53: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Stability Curve

Page 54: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Small Oscillations about the Inverted Position

Page 55: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Small Oscillation Periods

Page 56: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Double Pendulum Stabilization

Page 57: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Double Pendulum Stabilization

Page 58: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

An Interesting Stable State

Page 59: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

An Interesting Stable State

Page 60: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Phase Portrait Construction

Page 61: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Closing Remarks and Future Work

Page 62: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

The Obvious

Inverted pendulum can be stabilized with

only vertical, sinusoidal driving of the

pivot.

Inverted double pendulum can also be

stabilized by this method.

Both have nontrivial stability boundaries.

Page 63: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

The Not So Obvious

Frictional5 damping stabilizes the inverted

state. Double Pendulum exhibits separable behavior. Despite idealizations and simplifications, modeling the system of ODE's exhibits the same qualitative dynamical behavior as the experimental data.

[5] Marchewka, A. , Abbott, D. , & Beichner, R. (2004). Oscillator Damped by a

Constant-magnitude Friction Force. American Journal of Physics, 72(4), 477-483.

Page 64: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Future Investigations

Period-doubling cascade (Mathieu equation) Resurrection series6, Chaos Stability region analysis of the double pendulum

Evolution of Basins of Attraction as parameters vary Three pendula? Four? Why stop there: N → ∞, continuum!

[6] P. M. Morse and H. Feshbach, Methods of Theoretical Physics (McGraw-Hill, New York, 1953), Sec. 5.2; J. Mathews and R. L. Walker, Mathematical Methods of Physics (Benjamin, New York, 1965), Sec. 7.5.

Page 65: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area
Page 66: The Inverted Pendulum - nldlabTracking in Matlab, Continued •Step four: Make the centroids the updated search points for the next frame. REPEAT STEPS 2-4 for all frames: Search area

Gratitude and Thanks

Nick Gravish

Dr. Daniel Goldman

Accommodating personnel in the Crab Lab