[ Prev ] [ Index ] [ Next ]

# Mass-Spring-Damper

Created Mittwoch 27 April 2016

## Block Diagram

Single degree-of-freedom system:

Fig.1↑

## Equation of Motion and Discretization

where:

Using Laplace, the system can be written as:

Discretization can be done as follows.

Since

and

Therefore:

where is the sampling time.

## Simulation

Using the equation above and using MATLAB lsim. The system is excited with

figure;
hold on;

%% Our discretization
M = 1;
K = 1;
B = 1;

Tsim = 10;
T = 1e-3;
t = 0:ts:Tsim;

f = sin(2*pi*0.5*t);

x = zeros(length(t), 1);

for k = 3 : length(t)
x(k) = (T^2*f(k) + (2*M+B*T)*x(k-1)-M*x(k-2)) / (M+T*B+K*T^2);
end

plot(t, x, 'b');

%% Compare with MATLAB, to make sure the derived soultion is fine
H = tf(1, [M B K]);
x = lsim(H, f, t);
plot(t, x, '-.r', 'LineWidth', 1);

legend('Derived solution', 'MATLAB lsim')
xlabel('time')
ylabel('x')


./mass_spring_damper.m

Fig. 2↑

## Stability

Poles of a system defined by Eq. 2 are always be located in the left-hand plane. Therefore, mass-spring-damper system is always stable.

## State Space Model

Second order state space model of a mass-damper-system can be descried as follows.

m = 1;
b = 2;
k = 3;

ts = 1e-3;
tsim = 10;
time_span = 0:ts:tsim;
N = length(time_span);

initial_position = 0;
initial_speed    = 0;

x0 = [initial_position  initial_speed];

A = [0 1; -k/m -b/m];
B = [0; 1];
C = [1 0; 0 1];

sys = ss(A, B, C, 0);

stimulus = ones(N, 1) *0.1; %step
%stimulus = sin(2*pi*1*time_span)'; %sinusoid
response = lsim(sys, stimulus, time_span, x0);


## Resonance

When the poles are all complex numbers, the system has sharpness in its Bode plot. This is called resonance.

Setting , , and .

Fig. 3↑

omega_n = 1;
zeta = 0.01:0.19:1;

figure;
hold on;
for k = 1 : length(zeta)
sys = tf(1,[1 2*zeta(k)*omega_n omega_n^2])
bode(sys)
legends{k} = ['$\zeta=',num2str(zeta(k)), '$'];
end

h = legend(legends);
set(h,'Interpreter','latex')
xlim([0.1 10])


### Demonstrating Resonance

Take and . Applying input of 1 hz to the system witn natural frequency of 1 hz shall trigger the resonance.
Using MATLAB lsim to simulate:

omega_n = 1;
zeta = 0.01;
sys = tf(1,[1 2*zeta*omega_n omega_n^2])
figure;
bode(sys);

figure;
t = 0:0.001:1000;
u = sin(1/omega_n*t);
x = lsim(sys, u, t);
plot(t, x);
title('Input of 1 hz is applied for system with $\omega_n=1$', 'Interpreter','latex');

xlabel('$t$', 'Interpreter','latex')
ylabel('$x(t)$', 'Interpreter','latex')


We get the following response of the system:

Fig. 4↑

Running simulation a bit longer:

Fig. 5↑

Fig. 6↑

As shown in the Fig. 6 (upper), the maximum amplitude of the response is 34 dB.
Since 1 dB = 1^(1/20), then 34 dB = 1^(34/20) = 50.1187. It is exactly what is shown in Fig. 5.

## Control

Fig. 7 ↑

A system which is defined by Equ. 2 and a control law (state feedback controller) which is defined by:

and a constant gain .

The main issue here is how to maintain stabiliy, since the mass-damper system is inherently stable, but the closed loop shown in Fig. 7 can cause the system become unstable.
This is the explanation how closed loop control can cause the mass-spring-damper system can go unstable:

Simplification of Fig.7 gives:

Equ. 9 shows that closed-loop controller modifies total damping and stiffness of the system.
Let's say we want to reduce system stiffness. We then set . If we over-tune , the new stiffness turns negative and system goes unstable. The same goes with the damping.
However, if we remove the state feedback controller and relies on controller, the system remains stable.

## References

• Chapter 1 Single-degree-of-freedom Systems → D. J. Inman, Vibration with Control. Chichester, UK: John Wiley & Sons, Ltd, 2006.
• Chapter 2 One Degree of Freedom Systems → R. F. Gans, Mechanical Systems, vol. 1. Cham: Springer International Publishing, 2015.

## Lists of Useful Drawings

Open Office Drawing files:
./control.odg → Drawing for Fig. 7
./mass-spring-damper.odg → Drawing file for Fig. 1