## 11.2.2.2. Second-Order Error Dynamics

#### 11.2.2.2. Second-Order Error Dynamics

This video studies error dynamics modeled as a second-order linear ordinary differential equation. Stable error dynamics are characterized as overdamped, critically damped, or underdamped.

Let's continue with our mass-spring-damper analogy for the error dynamics of a controlled single-joint robot. Design of the controller allows us to alter the spring k and damper b, and therefore how the error theta_e evolves.

We divide the second-order differential equation by the leading coefficient m to get this form, where the leading coefficient is 1. Assuming m, b, and k are all positive, the error dynamics are stable, and the error will decay to zero. For stable second-order differential equations, it is customary to define the natural frequency omega_n to be equal to the square root of k over m and the damping ratio zeta to be b over 2 times the square root of k m. Then we can rewrite the differential equation as theta_e-double-dot plus 2 zeta omega_n theta_e-dot plus omega_n-squared theta_e equals zero. This is the standard form for a stable, second-order homogeneous linear differential equation.

The characteristic equation of this differential equation is the quadratic equation s-squared plus 2 zeta omega_n s plus omega_n-squared equals zero. The roots of this quadratic equation are minus zeta omega_n plus-or-minus omega_n times the square root of zeta-squared minus 1. Since zeta and omega_n are real numbers, the two roots are real values if the quantity inside the square root is greater than or equal to zero. In other words, s_1 and s_2 are real numbers if the damping ratio zeta is greater than or equal to 1.

If zeta is less than 1, the square root produces an imaginary number, and the roots are complex conjugates. We will consider three cases, depending on the damping ratio zeta. If the damping ratio zeta is greater than 1, we say that the error dynamics are overdamped. If zeta is equal to 1, the error dynamics are critically damped. Finally, if zeta is less than 1, the error dynamics are underdamped. Let's look at the details of the error response for each of these cases.

First, for the overdamped case, the error response that solves the differential equation is the sum of two decaying exponentials, where the roots s_1 and s_2 are shown here. We can plot the roots in the complex plane, defined by the real and imaginary axes. Since the error dynamics are stable, the roots have a negative real component, and therefore lie in the left-half plane. Since these roots are real numbers, they lie on the real axis. The time constants of the two corresponding decaying exponentials are the negative inverses of s_1 and s_2.

We can plot the unit step error response by solving for c_1 and c_2 using the initial conditions theta_e equal to 1 and theta_e-dot equal to 0. The sum of the two decaying exponentials tends to be dominated by the exponential corresponding to the less negative root. We call this the "slow" root since its exponential decays more slowly.

If the error dynamics are critically damped, then the roots are identical, at minus omega_n, and the error response takes this form, where the time constant of the decaying exponential is 1 over omega_n. Solving for c_1 and c_2, the unit step error response looks like this. Again, there is no overshoot or oscillation. Unlike the overdamped response, neither of the roots is "slower" than the other. As with the first-order response, the 2 percent settling time is approximately 4 times the time constant of the exponential.

Finally, the error dynamics are underdamped if the damping ratio is less than 1. In this case, the error response is a decaying sinusoid. The time constant of the decay is 1 over zeta omega_n. The frequency of the sinusoid is the damped natural frequency omega_d, which equals the natural frequency times the square-root of 1 minus zeta-squared. The roots are complex conjugates, with a real value minus zeta omega_n and an imaginary value plus-or-minus j omega_d. This is the unit step error response. The 2 percent settling time is approximately 4 time constants. We can calculate the overshoot as e to the minus pi zeta over the square root of 1 minus zeta-squared and then express it as a percentage.

Plotting the responses on top of each other, we see that if the two roots are complex conjugates in the left-half plane, we get an underdamped decaying sinusoidal error response. If the two roots are real but not equal, we get an overdamped response dominated by the slow root. If the two roots are coincident, we get a critically damped response, which in this case converges faster to zero than the overdamped response because the roots are faster than the slow root of the overdamped response.

In summary, if any of the roots lie in the right-half plane, the controlled system is unstable, and the error grows exponentially at a rate that increases the further the root is to the right. Similarly, the further the roots are to the left, the faster the error decays. Finally, if the roots are not on the real axis, the error response will exhibit overshoot and oscillation that increases with the imaginary components of the roots.

These observations hold for higher-order systems, too. The more negative the real portions of the roots of the characteristic equation, the faster any initial error decays.

In the next video, we will finally begin applying what we've learned about linear error responses to the control of a robot.