A second-order system is a dynamic model whose denominator has a degree of two. It can have two real poles or a pair of complex conjugate poles; in the latter case, the ability to oscillate appears.
If in the previous article we saw that first-order systems (like heating an aluminum block) were boring and predictable because they only rose smoothly, today we enter the true battlefield of engineering.
Second-order systems are what make your car bounce when you go over a pothole, make your robot arm tremble when it stops abruptly, or make your drone lose control and crash while wobbling.
The physics: mass, spring, and damper
To understand why things oscillate, engineers always use the same mental model: a weight hanging from a spring, placed inside a can of oil (the damper).
When you pull the weight down and release it, two things happen:
- The spring wants to return to its original position, so it pulls the mass upward. In doing so, it converts its elastic potential energy into kinetic energy (velocity).
- When the mass passes through the center (the equilibrium point), the spring no longer pulls, but the mass has inertia. This inertia causes it to overshoot, compressing the spring on the other side. Now kinetic energy is transformed back into potential energy.
This exchange of energy between inertia and elasticity is what creates the oscillation. And it would keep bouncing forever if it weren’t for the friction of the oil (the damper), which steals a little bit of energy each cycle in the form of heat until it stops.
The canonical transfer function
Many physical systems with these characteristics (whether a mechanism, an RLC circuit, or a motor connected to an elastic pulley) can be approximated in the Laplace domain with this canonical form of unit static gain:
Just as in first-order systems we had K and τ, here the main players are two parameters that dictate all the behavior:
Natural Frequency (ωn)
It is read “omega sub n”. It answers the question: how fast would this bounce if there were no friction at all? The stiffer the spring and the lighter the mass, the larger ωn will be and the faster the system will vibrate.
Damping Ratio (ζ)
It is read “zeta” and answers the question: how much is the oscillation damped? It does not always represent physical friction; it can also account for other mechanisms that dissipate or compensate energy.
Depending on the value of ζ, our system will behave in very different ways.
System behaviors
We apply a unit step (an abrupt change in the input) to our system. ζ determines the shape of the response, while ω_n sets its time scale:
- Overdamped (ζ>1): There is so much “oil” that the system doesn’t even try to oscillate. It moves toward the target extremely slowly and lazily. (E.g.: A door with a very tight door closer spring).
- Critically damped (
ζ = 1): Within this second-order family, it offers the fastest non-oscillatory response. - Underdamped (0<ζ<1): The most common case. The system is fast, but inertia gets the better of it and it overshoots the target, oscillating a few times before settling at the center.
- Undamped (ζ=0): Zero friction. The system will oscillate like a pure sine wave forever.
If ζ < 0, the amplitude grows over time and the system is unstable. This is not a fifth “normal” response, but it’s good to know that the model can also represent it.
Metrics for evaluating performance
When we are given a mechanical system to control, we need to measure how “bad” it is to compensate for it. To do this, we extract three fundamental values from the graph:
- Overshoot (Mp): It is the maximum percentage by which the system exceeds the setpoint on its first rebound. If I want to go to 100 mm and I reach 130 mm before retreating, I have a 30% overshoot. In a CNC machine, this means breaking the tool!
- Settling Time (ts): It is the time it takes for the system to enter an acceptable error band (usually ±2% of the final value) and not leave it again.
- Rise Time (tr): How fast it reaches the target for the first time.
In many adjustments, there is a trade-off: making the response faster can increase overshoot, while damping it too much can make it slow. This is not an inevitable law for every controller, but it is a common tension when tuning a system.
How to simulate it
If we wanted to simulate (not control, just simulate) the physics of this second-order system inside an Arduino using the Euler integration method, the code would look something like this:
// Parameters of our physical system
float omega_n = 4.0;
float zeta = 0.3;
// State variables
float position = 0.0;
float velocity = 0.0;
float dt = 0.01; // 10ms loop
void simulate_physics(float step_input) {
// 1. Calculate acceleration based on the differential equation:
// a = input*Wn^2 - 2*zeta*Wn*v - Wn^2*p
float acceleration = (step_input * omega_n * omega_n)
- (2.0 * zeta * omega_n * velocity)
- (omega_n * omega_n * position);
// 2. Integrate acceleration to get velocity (Euler)
velocity += acceleration * dt;
// 3. Integrate velocity to get position
position += velocity * dt;
}That velocity variable multiplied by the damping factor in the code is what dissipates energy.
If you have a very “bouncy” physical system (low damping), you can increase damping through software by programming a controller that takes the rate of change into account. This is one of the functions of the derivative action (D) of a PID controller.