แบบจำลองพลวัตและฟังก์ชันถ่ายโอน
Differential equations, Laplace transforms, transfer functions and time response
Overview: models turn tuning from guesswork into reasoning
A dynamic model is a set of equations describing how a system changes over time in response to its inputs: how quickly a drone accelerates when throttle increases, or how long a motor takes to reach the commanded thrust. With a model you can predict a controller's effect before flying, run SITL experiments with a purpose, and explain why a loop oscillates.
Three tools do most of the work. Differential equations express the physics. The Laplace transform turns differential equations into algebra. The transfer function summarises the input-output relationship compactly. This unit covers all three and connects them to responses you see in drone logs.
From physics to differential equations
A differential equation contains rates of change of its variables. Two appear constantly in drone work:
- Vertical dynamics: Newton's second law gives m·z̈ = T − mg, where z̈ is vertical acceleration, T is total thrust and mg is weight.
- Motor and propeller: rotor speed cannot change instantly because of inertia. A first-order model τ·ẏ + y = K·u captures this, where τ is the time constant and K is the steady-state gain.
Many real relationships are nonlinear; thrust, for instance, grows roughly with the square of the command, T = k·u². Because a drone spends most of its time near hover, we can linearise about that point: ΔT ≈ 2k·uh·Δu, with uh the hover command. A linear model is accurate close to the operating point and less so further away.
The Laplace transform and transfer functions
The Laplace transform maps a time signal x(t) to a function X(s) of a complex variable s. Differentiation becomes multiplication by s when initial conditions are zero, so differential equations become algebraic equations that are easy to solve. The pairs used most often are:
| Time domain | s domain | Meaning |
|---|---|---|
| Unit step | 1/s | An instant change that then holds |
| e−at | 1/(s + a) | Exponential decay |
| ẋ(t) | s·X(s) − x(0) | Derivative |
| x(t − T) | e−sT·X(s) | Time delay T |
A transfer function G(s) is the ratio of output to input in the s domain with zero initial conditions. A first-order motor model is G(s) = K/(τs + 1). The roots of the denominator are the poles, and they determine the character of the response. A system is stable when every pole has a negative real part, that is, lies in the left half of the s-plane.
Closing a unity-feedback loop around a controller C(s) and plant G(s) gives the closed-loop transfer function T(s) = C(s)G(s) / (1 + C(s)G(s)), which shows where the controller gains move the poles. The final value theorem gives the eventual value of a response without solving it fully: final value = limit of s·Y(s) as s approaches 0, valid only for stable systems.
First- and second-order responses
A first-order system responds to a step as y(t) = K(1 − e−t/τ). It reaches 63.2% of its final value at t = τ and about 95% at 3τ, and never overshoots.
The standard second-order system is G(s) = ω0² / (s² + 2ζω0s + ω0²), where ω0 is the natural frequency and ζ the damping ratio. With ζ below 1 the response overshoots and rings toward its final value. Useful measures are:
- Overshoot Mp = e−πζ/√(1−ζ²); ζ = 0.5 gives about 16%, ζ = 0.7 about 4.6%.
- Settling time to within ±2%, approximately Ts ≈ 4/(ζω0).
- Pole location at −ζω0 ± jω0√(1 − ζ²). The more negative the real part, the faster the response settles.
A delay T leaves signal amplitude unchanged but adds ωT radians of phase lag at frequency ω. In a closed loop, delay from filters and computation can make a system that looks fine on paper oscillate on the real aircraft.
Worked example: a PD altitude controller
Example: from the equation to ω0 and ζ
Assume a 1.5 kg drone whose altitude controller commands extra thrust ΔT = Kp(r − z) − Kd·ż on top of the hover thrust that cancels weight. Choose Kp = 6 N/m and Kd = 4.2 N·s/m, and ignore motor lag. All values are assumed.
- Equation: 1.5·z̈ = 6(r − z) − 4.2·ż. The Laplace transform gives Z(s)/R(s) = 6 / (1.5s² + 4.2s + 6).
- Divide by 1.5: the denominator becomes s² + 2.8s + 4. Matching the standard form gives ω0 = √4 = 2 rad/s and 2ζω0 = 2.8, so ζ = 0.7.
- Overshoot = e−π(0.7)/√(1−0.49) ≈ 4.6%. A 1 m climb command overshoots by about 4.6 cm.
- Settling time ≈ 4/(0.7 × 2) ≈ 2.9 s. A numerical simulation gives 4.6% overshoot and about 3.0 s settling, close to the formulas.
- The poles are at −1.4 ± j1.43. Both real parts are negative, so the loop is stable.
Doubling Kp without changing Kd raises the natural frequency but lowers ζ: faster, with more overshoot. The model shows this before you try it on the aircraft.
A second case worth knowing is a first-order plant under P-only control, for example G(s) = 1/(0.2s + 1) with Kp = 4. The closed loop is 4/(0.2s + 5). The time constant drops from 0.2 s to 0.04 s, but the final value theorem gives a final value of 4/5 = 0.8, a 20% steady-state error. That is why the PID unit adds an integral term.
Common pitfalls
- Assuming motors respond instantly when their time constant is tens of milliseconds.
- Using a linear model far from hover, or forgetting that payload moves the operating point.
- Mixing units in a block diagram, such as degrees and radians, or percent throttle and a 0 to 1 fraction.
- Applying the final value theorem to an unstable system, which gives a wrong answer.
- Trusting the settling-time formula over measured data; it is an approximation.
- Ignoring delay from filtering and computation.
Continue in the lessons
- UAT 206 Module 1: Control systems and models: measure a motor time constant on a test stand and linearise vertical dynamics.
- UAT 206 Module 2: Response and stability: step-response measures, poles, and the effect of delay.
Key references
- Nise, N. S. (2019). Control systems engineering (8th ed.). Wiley. link
- Åström, K. J., & Murray, R. M. (2021). Feedback systems: An introduction for scientists and engineers (2nd ed.). Princeton University Press. link
- Ogata, K. (2010). Modern control engineering (5th ed.). Pearson.
- Beard, R. W., & McLain, T. W. (2012). Small unmanned aircraft: Theory and practice. Princeton University Press. link