Chapter 5: Time Response of First-Order Systems

Lesson 3: Time Constant and Speed of Response

In this lesson we formalize the notion of time constant for first-order linear time-invariant (LTI) systems, show how it arises from the exponential solution of the differential equation, and connect it to the intuitive idea of speed of response. We derive general bounds on the decay of the tracking error and show how the time constant maps to pole locations in the complex plane. Finally, we implement and visualize these concepts using Python, C++, Java, MATLAB/Simulink, and Wolfram Mathematica in a robotics-oriented context.

1. Conceptual Overview of Time Constant

Consider a stable first-order LTI system with input \( u(t) \) and output \( y(t) \). Around a fixed operating point, many physical subsystems (e.g., RC circuits, thermal systems, low-speed robot joint dynamics) can be approximated by

\[ \tau \frac{\mathrm{d}y(t)}{\mathrm{d}t} + y(t) = K\,u(t), \quad \tau > 0,\; K \in \mathbb{R}. \]

The parameter \( K \) is the static gain (ratio of steady-state output to steady-state input), while \( \tau \) is the time constant. Intuitively, \( \tau \) sets the time scale over which the system reacts: smaller \( \tau \) means a faster response; larger \( \tau \) means a sluggish response.

For a unit-step input, the output of a stable first-order system rises monotonically from its initial value toward a new steady-state value. The time constant is defined as the time at which the response has completed about \( 63.2\% \) of the total change. We will prove this property rigorously in Section 3.

flowchart TD
  A["Physical system (motor joint, RC circuit)"]
    --> B["Model: tau dy/dt + y = K u"]
  B --> C["Transfer function G(s) = K/(tau s + 1)"]
  C --> D["Time-domain response y(t) after input change"]
  D --> E["Exponential term exp(-t/tau) identified"]
  E --> F["Time constant tau quantifies speed of response"]
        

2. First-Order Dynamics and Standard Form

Starting from the differential equation

\[ \tau \frac{\mathrm{d}y(t)}{\mathrm{d}t} + y(t) = K\,u(t), \]

take the Laplace transform under zero initial conditions \( y(0^{-}) = 0 \):

\[ \tau \left[ s Y(s) \right] + Y(s) = K U(s) \quad \Rightarrow \quad Y(s)\left(\tau s + 1\right) = K U(s). \]

Hence the transfer function from input to output is

\[ G(s) \triangleq \frac{Y(s)}{U(s)} = \frac{K}{\tau s + 1}. \]

The denominator polynomial \( \tau s + 1 \) has a single pole at \( s = -\dfrac{1}{\tau} \). For \( \tau > 0 \) this pole lies on the negative real axis, guaranteeing asymptotic stability of the homogeneous dynamics. Thus, for a first-order system,

\[ \text{pole location: } s_p = -\frac{1}{\tau} \quad \Longleftrightarrow \quad \text{time constant: } \tau = \frac{1}{|s_p|}. \]

The magnitude of the pole (distance from the origin along the real axis) is the inverse of the time constant: a pole further left (more negative) corresponds to a smaller time constant and therefore a faster response.

3. Step Response and the 63.2% Property

Consider the unit-step input \( u(t) = 1 \) for \( t \ge 0 \). The Laplace transform is \( U(s) = \dfrac{1}{s} \), so

\[ Y(s) = G(s) U(s) = \frac{K}{\tau s + 1} \cdot \frac{1}{s} = \frac{K}{s\left(\tau s + 1\right)}. \]

We perform partial fraction expansion

\[ \frac{K}{s\left(\tau s + 1\right)} = \frac{A}{s} + \frac{B}{\tau s + 1}. \]

Multiplying both sides by \( s\left(\tau s + 1\right) \) yields

\[ K = A\left(\tau s + 1\right) + B s. \]

Matching coefficients in powers of \( s \):

\[ \begin{cases} s\text{-terms:} & A \tau + B = 0, \\ \text{constant term:} & A = K. \end{cases} \]

Thus \( A = K \) and \( B = -K\tau \), so

\[ Y(s) = \frac{K}{s} - \frac{K\tau}{\tau s + 1}. \]

Taking the inverse Laplace transform:

\[ y(t) = K - K\,\mathrm{e}^{-\frac{t}{\tau}} = K\left(1 - \mathrm{e}^{-\frac{t}{\tau}}\right), \quad t \ge 0. \]

The steady-state value is \( y(\infty) = K \). The time constant is defined as the time at which the exponential term has decayed to \( \mathrm{e}^{-1} \), i.e. the output has reached a fraction \( 1 - \mathrm{e}^{-1} \approx 0.632 \) of the total change:

\[ y(\tau) = K\left(1 - \mathrm{e}^{-\frac{\tau}{\tau}}\right) = K\left(1 - \mathrm{e}^{-1}\right) \approx 0.632\,K. \]

Therefore, for any stable first-order system excited by a step input, the time constant \( \tau \) is the time required for the output to achieve approximately \( 63.2\% \) of the final value, starting from zero. The remaining error at \( t = \tau \) is

\[ e(\tau) = K - y(\tau) = K\,\mathrm{e}^{-1} \approx 0.368\,K. \]

This exponential decay of the error underlies the quantitative connection between time constant and speed of response.

4. Error Decay and General Speed-of-Response Measures

Define the tracking error for a unit-step input as \( e(t) = K - y(t) \). From the step response derived above,

\[ e(t) = K - K\left(1 - \mathrm{e}^{-\frac{t}{\tau}}\right) = K\,\mathrm{e}^{-\frac{t}{\tau}}. \]

The error magnitude satisfies

\[ |e(t)| = |e(0)|\,\mathrm{e}^{-\frac{t}{\tau}}, \quad e(0) = K. \]

Suppose we want the error to be reduced to a fraction \( \varepsilon \) of its initial value, where \( 0 < \varepsilon < 1 \). We ask for the time \( T_{\varepsilon} \) such that

\[ |e(T_{\varepsilon})| = \varepsilon |e(0)| \quad \Longleftrightarrow \quad \mathrm{e}^{-\frac{T_{\varepsilon}}{\tau}} = \varepsilon. \]

Taking natural logarithms:

\[ -\frac{T_{\varepsilon}}{\tau} = \ln(\varepsilon) \quad \Longrightarrow \quad T_{\varepsilon} = -\tau \,\ln(\varepsilon). \]

This formula shows that all time scales of interest (e.g. times to reach a given error band) are proportional to the time constant \( \tau \). For example:

  • To reduce the error to \( 5\% \) of its initial value, choose \( \varepsilon = 0.05 \):

    \[ T_{0.05} = -\tau \,\ln(0.05) \approx 3\tau. \]

  • To reduce the error to \( 2\% \) of its initial value, \( \varepsilon = 0.02 \):

    \[ T_{0.02} = -\tau \,\ln(0.02) \approx 4\tau. \]

Later lessons will name and standardize particular choices of \( \varepsilon \) as performance metrics (e.g. settling time for a prescribed error band). At this stage, the key takeaway is that the entire family of such times is linear in \( \tau \). Designing a faster system corresponds to reducing \( \tau \).

5. Pole Location, Time Scaling, and Comparative Speed

Many first-order transfer functions are initially obtained in the form

\[ G(s) = \frac{K}{s + a}, \quad a > 0. \]

This can be rewritten in the standard time-constant form by factoring out \( a \) in the denominator:

\[ G(s) = \frac{K}{a} \cdot \frac{1}{\frac{1}{a}s + 1} = K^{\ast} \cdot \frac{1}{\tau s + 1}, \quad K^{\ast} = \frac{K}{a},\; \tau = \frac{1}{a}. \]

Thus, for any stable first-order pole at \( s = -a \) with \( a > 0 \), the time constant is simply \( \tau = \dfrac{1}{a} \). Now compare two systems with the same static gain \( K \) but different time constants \( \tau_1 \) and \( \tau_2 \) satisfying \( 0 < \tau_1 < \tau_2 \). Their unit-step responses are

\[ y_1(t) = K\left(1 - \mathrm{e}^{-\frac{t}{\tau_1}}\right),\quad y_2(t) = K\left(1 - \mathrm{e}^{-\frac{t}{\tau_2}}\right). \]

For each fixed \( t > 0 \), since \( \tau_1 < \tau_2 \), we have \( \dfrac{t}{\tau_1} > \dfrac{t}{\tau_2} \) and hence \( \mathrm{e}^{-\frac{t}{\tau_1}} < \mathrm{e}^{-\frac{t}{\tau_2}} \). Because the mapping \( x \mapsto 1 - x \) is monotonically increasing,

\[ 1 - \mathrm{e}^{-\frac{t}{\tau_1}} > 1 - \mathrm{e}^{-\frac{t}{\tau_2}}, \quad t > 0, \]

so \( y_1(t) > y_2(t) \) for all \( t > 0 \). Therefore the system with the smaller time constant reaches any fixed fraction of its final value earlier in time. This formalizes the intuitive statement: smaller time constant implies faster response.

flowchart TD
  P1["Pole s = -1/tau1 (large magnitude)"] --> T1["Small tau1"]
  P2["Pole s = -1/tau2 (small magnitude)"] --> T2["Large tau2"]
  T1 --> R1["Fast exponential decay of error"]
  T2 --> R2["Slow exponential decay of error"]
        

In robot joint control, designers often specify a desired time constant for the closed-loop speed response (e.g., hip joint speed should settle within a few tenths of a second). Controller parameters (such as proportional gains) are then tuned so that the effective closed-loop pole lies at the corresponding location \( s = -1/\tau \).

6. Numerical and Robotics-Oriented Implementations

We now simulate the first-order step response and compute the time constant numerically using several programming environments. The same mathematical model underlies many robotics libraries: a single joint or wheel speed actuator is frequently approximated as a first-order system around an operating point.

6.1 Python (NumPy, Matplotlib, and python-control)

The code below computes and plots the step response \( y(t) = K\left(1 - \mathrm{e}^{-t/\tau}\right) \) and highlights the time constant \( \tau \). The same model can be embedded in robotics simulations using the python-control library or within ROS-based controllers.


import numpy as np
import matplotlib.pyplot as plt

# First-order parameters
K = 1.0          # static gain
tau = 0.4        # time constant (seconds)

# Time grid up to 5 tau
t_end = 5.0 * tau
t = np.linspace(0.0, t_end, 400)

# Analytic step response y(t) = K * (1 - exp(-t/tau))
y = K * (1.0 - np.exp(-t / tau))

plt.figure()
plt.plot(t, y, label="step response")
plt.axhline(K, linestyle="--", label="steady state K")
plt.axvline(tau, linestyle=":", label="time constant tau")
plt.xlabel("t [s]")
plt.ylabel("y(t)")
plt.title("First-order step response")
plt.legend()
plt.grid(True)
plt.show()

# Using python-control for the same system:
import control
G = control.tf([K], [tau, 1.0])
t2, y2 = control.step_response(G, T=t)
      

In robotics, G can represent an identified motor speed plant; the same structure appears in ros_control-based joint controllers, where the closed-loop dynamics are often tuned to approximate a desired time constant.

6.2 C++ (Discrete Simulation; ROS-Oriented View)

A minimal C++ program to sample the step response at a fixed time step. Such code can be embedded in a low-level loop on a microcontroller or inside a ros_control real-time controller for a single joint actuator.


#include <iostream>
#include <cmath>

int main() {
    const double K = 1.0;
    const double tau = 0.4;
    const double t_end = 5.0 * tau;
    const int N = 200;
    const double dt = t_end / static_cast<double>(N - 1);

    for (int k = 0; k != N; ++k) {
        double t = k * dt;
        double y = K * (1.0 - std::exp(-t / tau));
        std::cout << t << "," << y << std::endl;
    }
    return 0;
}
      

Here we numerically reconstruct the same analytic expression. In a ROS-based system, the value tau typically comes from system identification of the actuator or from desired closed-loop pole placement.

6.3 Java (Console Simulation; Robotics Libraries)

Java is used in several educational robotics platforms (e.g. WPILib for mobile robots). The following code prints samples of the first-order step response; the same expression can be used to design simple motion filters or to approximate actuator dynamics.


import java.util.Locale;

public class FirstOrderStep {
    public static void main(String[] args) {
        double K = 1.0;
        double tau = 0.4;
        double tEnd = 5.0 * tau;
        int N = 200;
        double dt = tEnd / (N - 1);

        Locale.setDefault(Locale.US);
        for (int k = 0; k != N; ++k) {
            double t = k * dt;
            double y = K * (1.0 - Math.exp(-t / tau));
            System.out.printf("%.4f,%.4f%n", t, y);
        }
    }
}
      

In Java-based robotics frameworks (such as WPILib), similar first-order filters are used to smooth commands or model simple actuator dynamics inside higher-level controllers.

6.4 MATLAB/Simulink (Control System Toolbox and Robotics System Toolbox)

MATLAB provides direct functions for creating transfer functions and plotting their responses:


K = 1.0;
tau = 0.4;

% Define first-order transfer function G(s) = K / (tau s + 1)
s = tf('s');
G = K / (tau * s + 1);

% Step response and highlighting tau
t = 0:0.01:5*tau;
[y, t_out] = step(G, t);
figure;
plot(t_out, y, 'LineWidth', 1.5); hold on;
yline(K, '--');
xline(tau, ':');
xlabel('t [s]');
ylabel('y(t)');
title('First-order step response');
grid on;

% In Simulink:
% - Place a Transfer Fcn block with numerator [K] and denominator [tau 1].
% - Drive it by a Step block.
% - Use a Scope to visualize y(t).
      

Within the Robotics System Toolbox, one may combine such first-order models with more complex rigid-body tree models; for example, modeling motor-plus-gearbox dynamics feeding a joint in a manipulator and specifying closed-loop time constants for motion control.

6.5 Wolfram Mathematica (Analytic and Numeric View)

Mathematica naturally expresses both analytic and numeric aspects of the step response:


k = 1.0;
tau = 0.4;
tEnd = 5.0*tau;

y[t_] := k*(1 - Exp[-t/tau]);

Plot[y[t], {t, 0, tEnd},
  AxesLabel -> {"t", "y(t)"},
  PlotRange -> All,
  PlotLegends -> {"step response"}]

(* Solve for T_eps such that y(T_eps) = k*(1 - eps) *)
eps = 0.05;
T_eps = -tau*Log[eps]
      

This last line symbolically computes \( T_{\varepsilon} = -\tau\ln(\varepsilon) \), directly connecting the algebraic expression derived earlier with a numeric evaluation.

7. Problems and Solutions

Problem 1 (Identifying Time Constant and Gain): A first-order transfer function is given by \( G(s) = \dfrac{4}{2 s + 1} \).
(a) Express \( G(s) \) in the standard form \( \dfrac{K}{\tau s + 1} \) and identify \( K \) and \( \tau \).
(b) Compute the step response \( y(t) \) for zero initial conditions.
(c) Find the time required for the output to reach \( 95\% \) of its final value.

Solution:
(a) Rewrite the denominator as

\[ G(s) = \frac{4}{2 s + 1} = \frac{4}{2} \cdot \frac{1}{s + \frac{1}{2}} = 2 \cdot \frac{1}{s + \frac{1}{2}}. \]

Comparing with \( \dfrac{K}{\tau s + 1} \), we factor the denominator:

\[ \frac{1}{s + \frac{1}{2}} = \frac{1}{\frac{1}{2}\left(2 s + 1\right)} = \frac{2}{2 s + 1} = \frac{1}{\tau s + 1}, \]

so \( \tau = 2 \) and \( K = 2 \).

(b) For a unit-step input, the general first-order response is

\[ y(t) = K\left(1 - \mathrm{e}^{-\frac{t}{\tau}}\right),\quad t \ge 0. \]

With \( K = 2 \) and \( \tau = 2 \),

\[ y(t) = 2\left(1 - \mathrm{e}^{-\frac{t}{2}}\right),\quad t \ge 0. \]

(c) The final value is \( y(\infty) = 2 \). We seek \( T_{0.05} \) so that \( y(T_{0.05}) = 0.95 \times 2 = 1.9 \). Equivalently, the error should be \( 5\% \) of its initial value:

\[ e(t) = 2 - y(t) = 2\,\mathrm{e}^{-\frac{t}{2}}. \]

We solve \( e(T_{0.05}) = 0.05 \times 2 = 0.1 \), giving

\[ 2\,\mathrm{e}^{-\frac{T_{0.05}}{2}} = 0.1 \quad \Longrightarrow \quad \mathrm{e}^{-\frac{T_{0.05}}{2}} = 0.05 \quad \Longrightarrow \quad T_{0.05} = -2\ln(0.05) \approx 5.991\;\text{s}. \]


Problem 2 (General Error-Bound Time): For the system \( G(s) = \dfrac{K}{\tau s + 1} \) with a unit-step input, derive a closed-form expression for the time \( T_{\varepsilon} \) required for the error magnitude to drop below \( \varepsilon \) times its initial value, where \( 0 < \varepsilon < 1 \).

Solution: From Section 4, the step response is \( y(t) = K\left(1 - \mathrm{e}^{-\frac{t}{\tau}}\right) \) and the error is \( e(t) = K - y(t) = K\,\mathrm{e}^{-\frac{t}{\tau}} \). Thus

\[ |e(t)| = |e(0)|\,\mathrm{e}^{-\frac{t}{\tau}},\quad e(0) = K. \]

We require \( |e(T_{\varepsilon})| = \varepsilon |e(0)| \), so

\[ \mathrm{e}^{-\frac{T_{\varepsilon}}{\tau}} = \varepsilon \quad \Longrightarrow \quad T_{\varepsilon} = -\tau \ln(\varepsilon). \]

This expression shows \( T_{\varepsilon} \) scales linearly with \( \tau \) and depends only logarithmically on the error ratio \( \varepsilon \).


Problem 3 (Comparing Two Robot Joint Actuators): Two DC motors driving identical robot joints are modeled as first-order systems with identical steady-state gain \( K = 1 \) but different time constants: \( \tau_1 = 0.05 \) s and \( \tau_2 = 0.2 \) s.
(a) Write the step responses \( y_1(t) \) and \( y_2(t) \).
(b) Compute the times required for each motor speed to reach \( 90\% \) of the final value.
(c) Quantify how many times faster the first motor is, in terms of this \( 90\% \) criterion.

Solution:
(a) With \( K = 1 \), the step responses are

\[ y_1(t) = 1 - \mathrm{e}^{-\frac{t}{0.05}},\quad y_2(t) = 1 - \mathrm{e}^{-\frac{t}{0.2}}. \]

(b) The time to reach \( 90\% \) of the final value corresponds to \( \varepsilon = 0.1 \) in the error ratio: \( y(T_{0.1}) = 0.9K \). From Problem 2,

\[ T_{0.1} = -\tau \ln(0.1) \approx 2.3026\,\tau. \]

Hence,

\[ T_{0.1}^{(1)} \approx 2.3026 \times 0.05 \approx 0.115\;\text{s},\quad T_{0.1}^{(2)} \approx 2.3026 \times 0.2 \approx 0.460\;\text{s}. \]

(c) The ratio of these times is

\[ \frac{T_{0.1}^{(2)}}{T_{0.1}^{(1)}} \approx \frac{0.460}{0.115} \approx 4. \]

Thus, by this \( 90\% \)-rise criterion, the first motor is approximately four times faster than the second, consistent with the ratio \( \tau_2 / \tau_1 = 4 \).


Problem 4 (From Pole Location to Time Constant): A first-order closed-loop transfer function has a real pole at \( s_p = -20 \). Find the time constant \( \tau \), and estimate the time required for the error of a unit-step response to fall below \( 1\% \) of its initial value.

Solution: Comparing \( s_p = -20 \) with \( s_p = -\dfrac{1}{\tau} \), we obtain

\[ \tau = \frac{1}{20} = 0.05\;\text{s}. \]

To reach \( 1\% \) error, set \( \varepsilon = 0.01 \). Then

\[ T_{0.01} = -\tau \ln(0.01) \approx 0.05 \times 4.6052 \approx 0.230\;\text{s}. \]

Thus the system reaches within \( 1\% \) of its final value in approximately \( 0.23\;\text{s} \).


Problem 5 (Designing a Desired Time Constant): You are tuning a simple proportional controller for a robot wheel-speed loop. The identified open-loop plant is approximately \( G_p(s) = \dfrac{1}{0.1 s + 1} \). You desire a closed-loop first-order response with time constant \( \tau_d = 0.05\;\text{s} \). Assuming the closed-loop behaves approximately as \( G_{cl}(s) = \dfrac{K_{cl}}{\tau_{cl} s + 1} \), by what factor must the dominant closed-loop pole magnitude be increased relative to the open-loop pole?

Solution: The open-loop pole is at \( s = -10 \) (because \( 0.1 s + 1 = 0 \Rightarrow s = -10 \)), so its associated open-loop time constant is

\[ \tau_{\text{open}} = \frac{1}{10} = 0.1\;\text{s}. \]

We want \( \tau_{cl} = \tau_d = 0.05\;\text{s} \), corresponding to a closed-loop pole magnitude

\[ |s_{cl}| = \frac{1}{\tau_{cl}} = \frac{1}{0.05} = 20. \]

Thus the closed-loop pole magnitude must be increased from \( 10 \) to \( 20 \), i.e. by a factor of \( 2 \). In practice, proportional gain is increased until the dominant pole of the closed-loop transfer function attains this approximate location.

8. Summary

In this lesson we:

  • Introduced the standard first-order model \( \tau \dfrac{\mathrm{d}y}{\mathrm{d}t} + y = K u \) and its transfer function \( G(s) = \dfrac{K}{\tau s + 1} \).
  • Derived the unit-step response \( y(t) = K\left(1 - \mathrm{e}^{-t/\tau}\right) \) and proved the \( 63.2\% \) interpretation of the time constant.
  • Obtained the general formula \( T_{\varepsilon} = -\tau \ln(\varepsilon) \) linking the time to reach a given error fraction with the time constant.
  • Related the time constant to the real pole location via \( s_p = -1/\tau \), establishing that smaller \( \tau \) implies faster response.
  • Illustrated first-order dynamics numerically in Python, C++, Java, MATLAB/Simulink, and Wolfram Mathematica, with emphasis on the role of time constant in robotics actuator models.

These results provide the foundation for the next lesson, where we formalize time-domain performance metrics for first-order systems (rise time, settling time, etc.) using the exponential structure captured by the time constant.

9. References

  1. Åström, K.J. (1970). Introduction to stochastic control theory. Various early chapters on first-order system response and time constants. Lecture notes and related journal publications.
  2. Zadeh, L.A., & Desoer, C.A. (1963). Linear System Theory. McGraw–Hill. (Foundational treatment of first-order systems, poles, and time constants.)
  3. Jury, E.I. (1964). The time-domain analysis of linear discrete systems. IRE Transactions on Circuit Theory, 11(4), 410–423.
  4. Truxal, J.G. (1955). Automatic Feedback Control System Synthesis. McGraw–Hill. (Classical development of exponential response and speed-of-response concepts.)
  5. Hsu, C.S. (1963). On the transient response of linear systems. Journal of the Franklin Institute, 275(5), 338–360.
  6. MacFarlane, A.G.J. (1956). The transient response of control systems. Proceedings of the IEE - Part B: Radio and Electronic Engineering, 103(8), 435–444.