Mass-Spring-Damper 101
The model of the Mass-Spring-Damper system is a very simple (and yet useful) one. It can be used to understand a lot of concepts in Dynamical Systems, and to model more complex systems (like car suspensions) in a pretty accurate way.

According to Newton’s second law we can write the equation of forces in this way:
$$ m\textbf{a}=\Sigma \textbf{F} $$
The acceleration is the second derivative of our state variable x(t), $\Sigma \textbf{F}$ is the sum of the elastic force imposed by the linear spring (Hooke’s law), the viscous damping force imposed by the linear damper and the input force u(t). So the equation becomes: $$ M\ddot{x} = -Kx-C\dot{x}+u(t) $$ In the Laplace variable domain: $$ Ms^2X(s)=-KX(s)-CsX(s)+U(s) $$ $$ Ms^2X(s)+CsX(s)+KX(s) = U(s) $$ $$ X(s)(Ms^2+Cs+K) = U(s) $$ So the transfer function is: $$ G(s)=\frac{X(s)}{U(s)}=\frac{1}{Ms^2+Cs+K} $$
Standard form analysis:
The standard form of a second order system is $$ \frac{k \omega_n^2}{s^2+2\zeta\omega_ns+\omega_n^2} $$ where:
- $ k $ is the zero frequency gain. Equivalent to the DC gain in an elecrtical system.In our system that gain is $\frac{1}{K}$.
- $ \omega_n $ is the natural frequency, the frequency at which the system would oscillate if the damping C were zero. In our case $ \omega_n $ is $ \sqrt{\frac{K}{M}} $.
- $ \zeta $ is the damping factor, the rate from the actual damping of the system C and the critical damping at which the system can’t oscillate. In our case $ \zeta $ is $ \frac{C}{2\sqrt{KM}} $. We notice that if C matched the critical damping = $ 2\sqrt{KM} $, the denominator of the transfer function would have two real roots, so no imaginary parts that cause oscillations. $$ G(s) = \frac{1}{Ms^2+Cs+K} = $$ $$ =\frac{\frac{1}{K}\frac{K}{M}}{s^2+\frac{C}{M}s+\frac{K}{M}} = \frac{k \omega_n^2}{s^2+2\zeta\omega_ns+\omega_n^2} $$
The benefits of feedback explained using a Mass-Spring-Damper system:
Imagine to have a block of mass M on a frictionless surface. We are trying to control its position $x(t)$. The objective is to have it at position $\bar{x}$.

The feedforward approach:
The first way to solve this problem is a feedforward solution. Given a time T in which we’ll complete the operation, we apply a constant force $\bar{F}$ directed toward the position $\bar{x}$ for the first $\frac{T}{2}$ seconds and an equal and opposite force $-\bar{F}$ in the remaining $\frac{T}{2}$ seconds to stop the motion.
We obtain the piecewise function of the force applied, that divided by the mass, and integrated twice gives us the mathematical model of the position $x(t)$.
Working backwards we can set the value of $\bar{F}$ and $T$ to obtain the desired $x(T)$. For example:
- $M = 1kg$
- $T = 10s$
- $\bar{F} = 1N$
Is the right setup to have $x(T)=25m$
The problem when applying this model is that even small errors in measurements lead to significant undershoot or overshoot, or even more undesired behaviors. Since we are not compensating the error, it is here to stay.
In the picture below the plot of x(t) in the ideal case (yellow), and two cases with +/-10% on the mass m.

The feedback approach:
What if we start applying to the mass a force proportional to the distance from the $x$ desired?
Something like $u(t)=K(\bar{x}-x)$, that means having a sensor reading the position of our system and an actuator applying a force proportional to the error ($e = \bar{x}-x$). Namely a proportional feedback control.
The effect would be the same of an elastic force applied by a spring which has its resting position in $\bar{x}$. So $x(t)$ will keep oscillating between $\bar{x}-x_0$ and $\bar{x}+x_0$, which is a stable behaviour, but we are aspiring to asymptotic stability so we need to add some damping to our controller.
[…]