Spring-Pendulum Dynamic System Investigation K. Craig 1
Spring-Pendulum
Dynamic System Investigation
Spring-Pendulum Dynamic System Investigation K. Craig 2
An Interesting Experiment
• Here’s an experiment to see the effects of nonlinearities.
– Take any spring and measure its unstretched length, ℓ.
– Attach a mass to the end of the spring. Choose a mass so that the
equilibrium length of the spring (i.e., the length of the spring when there
is no motion) is about (1.33)ℓ.
– Secure the upper end of the spring to a fixed pivot point.
– Pull the mass straight down a little bit from its equilibrium, release it, and
watch its motion.
– The mass moves up and down like a simple spring-mass system should.
But after a little while, the angle the spring makes with the vertical starts
to increase while the up-and-down (or in-and-out) motion decreases. It
decreases until the spring swings laterally only, like a simple pendulum,
essentially without in-and-out motion. Then the angle starts to
decrease, and the in-and-out motion starts to appear again.
– The sequence of events repeats itself. WHY?
Spring-Pendulum Dynamic System Investigation K. Craig 3
Spring-Pendulum Physical System
There is a range of values for the mass
for which this described phenomenon
occurs. For values of mass outside that
range, the motion takes place essentially
along the vertical, where it started.
This is a nonlinear phenomenon called
Nonlinear Resonance!
It cannot be predicted by linearizing the
differential equations of motion for small
amplitudes of motion.
This phenomenon occurs in many
dynamical systems, e.g., satellites, ships,
airplanes, buildings, and machines.
Every engineer should be aware of it!
Spring-Pendulum Dynamic System Investigation K. Craig 4
Topics
• Physical Modeling of the Spring-Pendulum System
– Simplifying Assumptions
– Parameter Identification
• Mathematical Modeling of the Physical Model
– Particle and Rigid Body Kinematics
– Particle and Rigid Body Kinetics
• Newton-Euler Equations
• Lagrange’s Equations
• Predicted Response vs. Experimental Measurements
– MatLab / Simulink and SimMechanics Simulations
Spring-Pendulum Dynamic System Investigation K. Craig 5
Engineering
System
Investigation
Process
Spring-
Pendulum
Dynamic System
Investigation
Spring-Pendulum Dynamic System Investigation K. Craig 6
Physical Model
Simplifying Assumptions
• pure spring, i.e., negligible inertia and damping
• ideal (linear) spring
• frictionless pivot
• neglect all material damping and air damping
• point mass, i.e., neglect rotational inertia of mass
• two degrees of freedom, i.e., r and are the generalized
coordinates (this assumes no out-of-plane motion and no
bending of the spring)
• support structure is rigid, so pivot point is fixed to ground
Spring-Pendulum Dynamic System Investigation K. Craig 7
• These physical modeling assumptions lead to what we
call the design model, i.e., one that gives us insight and
understanding.
• There are a whole hierarchy of models possible.
• Modify assumptions that lead to the Truth Model
– Include pivot friction
– Treat spring as not pure, i.e., has inertia and energy dissipation
– Treat the attached mass as a rigid body and not a point mass –
this adds a degree of freedom
Spring-Pendulum Dynamic System Investigation K. Craig 8
Physical Modelwith
Parameter Identification
m = pendulum mass = 1.815 kg
mspring = spring mass = 0.1445 kg
ℓ = unstretched spring length = 0.333 m
k = spring constant = 172.8 N/m
g = acceleration due to gravity = 9.81 m/s2
Ft = 5.71 N = pre-tension of spring
rs = static spring stretch, i.e., rs = (mg-Ft)/k = 0.070 m
rd = dynamic spring stretch
r = total spring stretch = rs + rd
m
k
θℓ + r
Spring-Pendulum Dynamic System Investigation K. Craig 9
Spring Parameter Identification
Fspring (N)
Spring Pre-Tension
Ft = 5.71 N
K = 172.8 N/m
Spring Displacement
(meters)0.070 m
mg = 17.805 N
Spring-Pendulum Dynamic System Investigation K. Craig 10
r
r r r
2
r
r r
ˆr re
drˆ ˆ ˆ ˆv re r e v e v e
dt
dvˆ ˆa r r e r 2r e
dt
ˆ ˆ a e a e
magnitude change
direction change
magnitude change
direction change2
r
r
r r
r
rv
v
r
r
ˆdee
d
ˆdee
d
O
PATH
r
re
e
Polar Coordinates:
Position, Velocity, Acceleration
Spring-Pendulum Dynamic System Investigation K. Craig 11
Rigid Body Kinematics
XY: R reference frame (ground)
xy: R1 reference frame (pendulum)
x cos sin 0 X
y sin cos 0 Y
z 0 0 1 Z
ˆ ˆi Icos sin 0
ˆ ˆj sin cos 0 J
ˆ ˆ0 0 1 Kk
1 1 1 1 1 1R R R R R RR P R O R R OP R OP P R Pa a r r a 2 v
mℓ + r
k
X
Y
xy
P
O
θ
θ
Spring-Pendulum Dynamic System Investigation K. Craig 12
Rigid Body Kinematics
After substitution and evaluation:
1
1
1
1
R O
RR
OP
RR
R P
R P
a 0
ˆ ˆk K
ˆ ˆ ˆr r j r sin I cos J
ˆ ˆk K
ˆ ˆ ˆv rj r sin I cos J
ˆ ˆ ˆa rj r sin I cos J
R P 2ˆ ˆa i r 2r j r r
Spring-Pendulum Dynamic System Investigation K. Craig 13
Mathematical
Model
Free Body Diagram
Nonlinear Equations
of Motion
2
r rF ma m r r
F ma m r 2r
2
tmr m r kr F mgcos 0
r 2r gsin 0
2
tkr F mgcos m r r
mgsin m r 2r
kr + Ft
mg+r
+θ
+θℓ + r
Spring-Pendulum Dynamic System Investigation K. Craig 14
Mathematical Model:
Lagrange’s EquationsLagrange’s Equations
Generalized Coordinates
Kinetic Energy
Potential Energy
Generalized
Forces
Nonlinear Equations
of Motion
2
tmr m r kr F mgcos 0
r 2r gsin 0
21V kr mg r cos
2
22 21
T m r r2
1
2
q r
q
r tQ F
Q 0
i
i i i
d T T VQ
dt q q q
Spring-Pendulum Dynamic System Investigation K. Craig 15
What is a Block Diagram?
• Block Diagram
– A block diagram of a system is a pictorial representation
of the functions performed by each component and of
the flow of signals. It describes a set of relationships
that hold simultaneously.
– A block diagram contains information concerning
dynamic behavior, but it does not include any
information on the physical construction of the system.
– Many dissimilar and unrelated systems can be
represented by the same block diagram.
– A block diagram of a given system is not unique.
Spring-Pendulum Dynamic System Investigation K. Craig 16
What is Simulink?
• Simulink is an extension to MatLab that allows engineers to
rapidly and accurately build computer models of dynamic
physical systems using block diagram notation.
– linear and nonlinear systems
– continuous-time and discrete-time components
– graphical animations are possible
• Previously, a block diagram of the dynamic system
mathematical model was created and then the block diagram
was translated into a programming language.
• In Simulink, the computer program is the block diagram and
this eliminates the risk that the computer program may not
accurately implement the block diagram.
Spring-Pendulum Dynamic System Investigation K. Craig 17
Spring-Pendulum Dynamic System Investigation K. Craig 18
Spring-Pendulum Dynamic System Investigation K. Craig 19
Why Is Simulink Important?
• The potential productivity improvement and cost savings
realized from the block diagram approach to programming is
dramatic.
• There are two principal strategies for Simulink employment.
– Rapid Prototyping
• This is the application of productivity tools to develop working
prototypes in the minimum amount of time. Here we optimize for
development speed, rather than execution speed or memory use. A
hierarchy of physical models is used in this phase. Physical system
design and control design are optimized simultaneously.
– Rapid Application Development
• Here the final computer program is the Simulink model or is derived
from the Simulink model through automatic C-code generation.
Spring-Pendulum Dynamic System Investigation K. Craig 20
Simulink for the Spring Pendulum
• Nonlinear Equations of Motion
• Step 1: Solve for the highest derivative in each
equation.
2
tmr m r kr F mgcos 0
r 2r gsin 0
2 tFkr r r gcos
m m
12r gsin
r
Spring-Pendulum Dynamic System Investigation K. Craig 21
• Create two stems.
• Do what the equations say.
∫ ∫
∫ ∫
00
r r0r
r0r
Spring-Pendulum Dynamic System Investigation K. Craig 22
MatLab Command Window
Select Simulink Library
Spring-Pendulum Dynamic System Investigation K. Craig 23
Simulink Library Browser
Select New Model
Spring-Pendulum Dynamic System Investigation K. Craig 24
Build Simulink Block Diagram here.
First Build the Two Stems.
Then Do What the Equations Say.
Save Model: Spring_Pendulum_Dynamic_System
Spring-Pendulum Dynamic System Investigation K. Craig 25
File Name
Spring-Pendulum Dynamic System Investigation K. Craig 26
Spring-Pendulum Dynamic System Investigation K. Craig 27
Spring-Pendulum Dynamic System Investigation K. Craig 28
Spring-Pendulum Dynamic System Investigation K. Craig 29
Spring-Pendulum Dynamic System Investigation K. Craig 30
Simulink Block Diagram Manipulations
Spring-Pendulum Dynamic System Investigation K. Craig 31
These are the blocks we need for the Spring-Pendulum System. We know this
because we created the block diagram for the equations of motion on paper by
hand before we even turned the computer on. We know the block diagram is
correct because we can write the equations of motion from the block diagram.
Spring-Pendulum Dynamic System Investigation K. Craig 32
Go to: Diagram, Format, Font Style to enlarge font.
Spring-Pendulum Dynamic System Investigation K. Craig 33
Resize Blocks.
Spring-Pendulum Dynamic System Investigation K. Craig 34
Lay out the Two Stems. Annotate the Stems.
Spring-Pendulum Dynamic System Investigation K. Craig 35
Replicate blocks and lay out the block diagram.
Annotate Diagram.
Spring-Pendulum Dynamic System Investigation K. Craig 36
MatLab M-File with Spring Pendulum Parameters
Never put numbers into the Simulink block diagram, unless the
number is part of the actual equation. Always use variables,
even for initial conditions. Define the variable values in the
workspace or create a m-file with the parameter values defined.
Save the m-file and then run it before you run the Simulink
program. See below.
Spring-Pendulum Dynamic System Investigation K. Craig 37
Choose Simulation, Model Configuration Parameters
Spring-Pendulum Dynamic System Investigation K. Craig 38
Make Selections as shown.
Spring-Pendulum Dynamic System Investigation K. Craig 39
uncheck
Spring-Pendulum Dynamic System Investigation K. Craig 40
scope parameters
uncheck
To Workspace block
Choose
Array
Scope
Block
NOTE
Spring-Pendulum Dynamic System Investigation K. Craig 41
theta vs. timer vs. time
x-axis: theta
y-axis: -r
0.070 equilibrium
Spring-Pendulum Dynamic System Investigation K. Craig 42
0
0
0.021 rad
r 0.115 m
InitialConditions
NotePlot was
created in the
MatLab
workspace
from the To
Workspace
block
outputs, r and
theta plotted
vs. tout.
0.070 equilibrium
Spring-Pendulum Dynamic System Investigation K. Craig 43
Actual Measured Dynamic Behavior
0 10 20 30 40 50 60-0.2
-0.15
-0.1
-0.05
0
0.05
0.1
0.15
0.2
time (sec)
rad
ial a
nd
an
gu
lar
po
sitio
n (
rad
or
m)
Experimental Results with Initial Conditions: theta = 0.021 rad, r = 0.115 m
InitialConditions
0
0
0.021 rad
r 0.115 m
This plot was
created from two
sensor outputs: a
potentiometer
measuring theta
and an ultrasonic
sensor measuring r.
Spring-Pendulum Dynamic System Investigation K. Craig 44
Comparison
0 10 20 30 40 50 60-0.2
-0.15
-0.1
-0.05
0
0.05
0.1
0.15
0.2
time (sec)
rad
ial a
nd
an
gu
lar
po
sitio
n (
rad
or
m)
Experimental Results with Initial Conditions: theta = 0.021 rad, r = 0.115 m
Initial Conditions:0
0
0.021 rad
r 0.115 m
Spring-Pendulum Dynamic System Investigation K. Craig 45
Conclusion
Is the model adequate based on the comparison between predictions and measurements?
What attributes in the physical system are missing from your physical model?
How would you make the physical model more accurate, i.e., be a better representation of the
actual physical system?
Spring-Pendulum Dynamic System Investigation K. Craig 46
What is SimMechanics?
• SimMechanics provides a multibody simulation environment
for 3D mechanical systems, such as robots, vehicle
suspensions, construction equipment, and aircraft landing
gear.
• You model the multibody system using blocks representing
bodies, joints, constraints, and force elements, and then
SimMechanics formulates and solves the equations of
motion for the complete mechanical system.
• Models from CAD systems, including mass, inertia, joint,
constraint, and 3D geometry, can be imported into
SimMechanics. An automatically generated 3D animation
lets you visualize the system dynamics.
Spring-Pendulum Dynamic System Investigation K. Craig 47
• You can parameterize your models using MatLab
variables and expressions, and design control systems
for your multibody system in Simulink.
• You can add electrical, hydraulic, pneumatic, and other
components to your mechanical model using Simscape
and test them all in a single simulation environment.
• To deploy your models to other simulation
environments, including hardware-in-the-loop (HIL)
systems, SimMechanics supports C-code generation
(with Simulink Coder).
Spring-Pendulum Dynamic System Investigation K. Craig 48
SimMechanics
Spring-Pendulum Dynamic System Investigation K. Craig 49
body elements
constraints
forces
& torques
frames
& transforms
gears
utilities
joints
Spring-Pendulum Dynamic System Investigation K. Craig 50
SimMechanics for the Spring Pendulum
Simulink Work Space
Saved File Name
Spring-Pendulum Dynamic System Investigation K. Craig 51
Spring-Pendulum Dynamic System Investigation K. Craig 52
Spring-Pendulum Dynamic System Investigation K. Craig 53
Spring-Pendulum Dynamic System Investigation K. Craig 54
Spring-Pendulum Dynamic System Investigation K. Craig 55
Spring-Pendulum Dynamic System Investigation K. Craig 56
Spring-Pendulum Dynamic System Investigation K. Craig 57
Spring-Pendulum Dynamic System Investigation K. Craig 58
Spring-Pendulum Dynamic System Investigation K. Craig 59
Spring-Pendulum Dynamic System Investigation K. Craig 60
Spring-Pendulum Dynamic System Investigation K. Craig 61
Spring-Pendulum Dynamic System Investigation K. Craig 62
Spring-Pendulum Dynamic System Investigation K. Craig 63
Simulink
SimMechanics
Ft = 0
theta_0 = 0.021 rad
r_0 = 0.045 m
r = 0.1
ℓ+r = 0.433
Spring-Pendulum Dynamic System Investigation K. Craig 64
Spring-Pendulum Dynamic System Investigation K. Craig 65
Simulink
Ft = 5.71 N
theta_0 = 0.021 rad
r_0 = 0.045 m
SimMechanics
0.07
0.403