Content
    Ordinary Differential Equation

Control Engineering Introduction

Ordinary Differential Equation

apθe(p)+ap1θe(p1)++a2θe¨+a1θe˙+a0θe=ca_p\theta_e^{(p)} + a_{p-1}\theta_e^{(p-1)} + \cdots + a_2\ddot{\theta_e}+ a_1\dot{\theta_e} + a_0\theta_e = c

For homogeneous (c=0c = 0) linear error dynamics:

θe(p)=1ap(ap1θe(p1)++a2θe¨+a1θe˙+a0θe)=ap1θe(p1)a2θe¨a1θe˙a0θe\begin{align*} \theta_e^{(p)} &= - \frac{1}{a_p} (a_{p-1}\theta_e^{(p-1)} + \cdots + a_2\ddot{\theta_e}+ a_1\dot{\theta_e} + a_0\theta_e) \\ &= -a'_{p-1}\theta_e^{(p-1)} - \cdots - a'_2\ddot{\theta_e}- a' _1\dot{\theta_e} - a'_0\theta_e \end{align*}

Using pp coupled first order ODE’s defining x=(x1,,xp)x = (x_1, \dots , x_p) where:

x1=θex2=x˙1=θe˙xp=x˙p1=θe(p1)\begin{align*} x_1 &= \theta_e \\ x_2 &= \dot{x}_1 = \dot{\theta_e} \\ \vdots & \qquad \vdots \\ x_p &= \dot{x}_{p-1} = \theta_e^{(p-1)} \end{align*}

The ODE can be written as:

x˙p=a0x1a1x2ap1xp\dot{x}_p = - a'_0 x_1 - a'_1 x_2 - \cdots - a'_{p-1} x_p

Then x˙(t)=A  x(t)\dot{x}(t) = A\;x(t) where:

A=[01000001000001000001a0a1a2ap2ap1]Rp×pA= \begin{bmatrix} 0 & 1 & 0 & \cdots & 0 & 0 \\ 0 & 0 & 1 & \cdots & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 & \cdots & 1 & 0 \\ 0 & 0 & 0 & \cdots & 0 & 1 \\ -a'_0 & -a'_1 & -a'_2 & \cdots & -a'_{p-2} & -a'_{p-1} \end{bmatrix} \in \mathbb{R}^{p\times p}

The vector differential equation x˙(t)=A  x(t)\dot{x}(t) = A\;x(t) has the solution: x(t)=eAt  x(0)x(t) = e^{At}\;x(0)

Error Response

Unit error response:

  • response θe(t),t>0\theta_e(t), t \gt 0 of the controlled system
  • for the initial conditions:
    • θe(t)=1\theta_e(t) = 1 and
    • θ˙e(0)=θ¨e(0)==0\dot{\theta}_e(0) = \ddot{\theta}_e(0) = \cdots = 0

Error response can be described by:

  • Steady-state response
    • steady-state error: esse_{ss}: asymptotic error θe(t)\theta_e(t) as tt \rightarrow \infty
  • Transient response
    • overshoot (if error response initially overshoots final steady state error): θe,minessθ(0)ess×100%\left|\frac{\theta_{e,min}-e_{ss}}{\theta(0)-e_{ss}}\right| \times 100 \%
    • (2%) settling time: the first time TT such that θe(t)ess0.02(θe(0)ess)\left| \theta_e(t) - e_{ss} \right| \leq 0.02 (\theta_e(0)-e_{ss}) for all tTt \ge T

Stability

x˙(t)=A  x(t)\dot{x}(t) = A\;x(t) converges to x=0x = 0 if:

AA is negative definite. i.e. all eigenvalues of AA (which can be complex) have negative real components.

Eigenvalues

The eigenvalues of AA are given by the roots of the characteristic polynomial. i.e. complex values ss satisfying:

det(sIA)=sp+ap1sp1++ass2+a1s+a0=0det(sI - A) = s^p + a'_{p-1}s^{p-1}+ \cdots +a'_ss^2+a'_1s + a'_0 = 0

Necessary condition for each root to have a negative real component: all coefficients a0,,ap1a'_0, \cdots, a'_{p-1} must be positive.

Stability

Error dynamics are:

  • stable: if each root has negative real component
  • unstable: if any root has positive real component

First-Order Error Dynamics

θ˙e(t)+kbθe(t)=0\dot{\theta}_e(t) + \frac{k}{b}\theta_e(t) = 0

or

θ˙e(t)+1τθe(t)=0\dot{\theta}_e(t) + \frac{1}{\tau}\theta_e(t) = 0

where:

  • τ=b/k\tau = b/k: time constant

solution:

θe(t)=et/τθe(0)\theta_e(t) = e^{-t / \tau}\theta_e(0)

Second-Order Error Dynamics

θ¨e(t)+bmθ˙e(t)+kmθe(t)=0\ddot{\theta}_e(t) + \frac{b}{m}\dot{\theta}_e(t) + \frac{k}{m}\theta_e(t) = 0

Standard Second-Order Form

θ¨e(t)+2ζωnθ˙e(t)+ωn2θe(t)=0\ddot{\theta}_e(t) + 2\zeta\omega_n\dot{\theta}_e(t) + \omega^2_n\theta_e(t) = 0

with:

  • ωn\omega_n: natural frequency
  • ζ\zeta: damping ratio

For mass-spring-damper analogy:

  • ωn=k/m\omega_n = \sqrt{k/m}
  • ζ=b/(2km)\zeta = b/(2\sqrt{k\,m})

Characteristic polynomial:

s2+2ζωns+ωn2=0s^2 + 2 \zeta \omega_n s + \omega_n^2 = 0

Roots:

s1,2=ζωn±ωnζ21s_{1,2} = -\zeta\omega_n \pm\omega_n\sqrt{\zeta^2-1}

Stable if and only if ζωn>0\zeta\omega_n >0 and ωn2>0\omega_n^2 >0.

Damping

The system behaves different depending on the roots s1,2s_{1,2}

Overdamped
  • ζ>1\zeta > 1
  • Roots s1,2s_{1,2} are real and distinct (s1s2s_1 \neq s_2)
  • Solution to ODE: θe(t)=c1es1t+c2es2t\theta_e(t) = c_1\,e^{s_1t} + c_2\,e^{s_2t}
    • c1c_1 and c2c_2 can be calculated from initial condition
Critically Damped
  • ζ=1\zeta = 1
  • Roots s1,2=ωns_{1,2} = -\omega_n are real and equal
  • Solution to ODE: θe(t)=(c1+c2t)eωnt\theta_e(t) = ( c_1 + c_2\,t) e^{-\omega_n t}
Underdamped
  • ζ<1\zeta < 1
  • Roots s1,2s_{1,2} are complex conjugates
    • s1,2=ζωn±jωds_{1,2} = -\zeta\omega_n \pm j\,\omega_d
    • where ωd=ωn1ζ2\omega_d = \omega_n \sqrt{1-\zeta^2}: damped natural frequency
  • Solution to ODE: θe(t)=(c1cosωdt+c2sinωdt)eζωnt\theta_e(t) = (c_1\cos{\omega_d t} + c_2\sin{\omega_d t}) e^{-\zeta\omega_n t}

Controller

P Controller

Simplest feedback controller:

θ˙(t)=Kp(θd(t)θ(t))=Kpθe(t)\dot{\theta}(t) = K_p(\theta_d(t) - \theta(t)) = K_p\theta_e(t)

with:

  • actual position: θ(t)\theta(t)
  • desired position: θd(t)\theta_d(t)
  • error: θe(t)=θd(t)θ(t)\theta_e(t) = \theta_d(t) - \theta(t)
Error Dynamics

With constant desired (reference) velocity: θ˙d(t)=c\dot{\theta}_d(t) = c:

θ˙e(t)=θ˙d(t)θ˙(t)=cKpθe(t)\dot{\theta}_e(t) = \dot{\theta}_d(t) - \dot{\theta}(t) = c - K_p\theta_e(t)

Solution to first-order homogeneous linear ODE:

θe(t)=cK+(θe(0)cKp)eKpt\theta_e(t) = \frac{c}{K}+ \left(\theta_e(0) - \frac{c}{K_p} \right)e^{-K_pt}

This converges to c/Kpc/K_p as time goes to infinity.

PI Controllers

θ˙(t)=Kpθe(t)+Ki0tθe(t)  dt\dot{\theta}(t) = K_p\theta_e(t) + K_i \int_{0}^{t}\theta_e(t)\; d t
Error Dynamics

With constant desired velocity: θ˙d(t)=c\dot{\theta}_d(t) = c

θ˙e(t)+Kpθe(t)+Ki0tθe(t)  dt=c\dot{\theta}_e(t) + K_p\theta_e(t) + K_i \int_{0}^{t}\theta_e(t)\; d t = c

Taking derivative:

θ¨e(t)+Kpθ˙e(t)+Kiθe(t)=0\ddot{\theta}_e(t) + K_p\dot{\theta}_e(t) + K_i \theta_e(t) = 0

Stable if Ki>0K_i > 0 and Kp>0K_p > 0.

The roots of the characteristic equation:

s1,2=Kp2±Kp24Kis_{1,2} = - \frac{K_p}{2}\pm \sqrt{\frac{K_p^2}{4}- K_i}

Feedforward Plus Feedback PI Controller

Add a term with the desired velocity θ˙d(t)\dot{\theta}_d(t):

θ˙(t)=θ˙d(t)+Kpθe(t)+Ki0tθe(t)  dt\dot{\theta}(t) = \dot{\theta}_d(t) + K_p\theta_e(t) + K_i \int_{0}^{t}\theta_e(t)\; d t

Multi-joint Robot

Same as for scalars but with vectors and matrices:

  • actual position: θ(t)Rn\theta(t) \in \mathbb{R}^n
  • desired (reference) position: θd(t)Rn\theta_d(t) \in \mathbb{R}^n
  • P gain: Kp=kpIRn×nK_p = k_p\,I\in \mathbb{R}^{n \times n}
  • I gain: Ki=kiIRn×nK_i = k_i\,I\in \mathbb{R}^{n \times n}

with:

  • kpR+k_p \in \mathbb{R}^{+} and kiR+k_i \in \mathbb{R}^{+}
  • II: Identity matrix


  • Category

  • Robotics

  • Tags

  • Control Systems
    Robotics

  • Created

  • 31. August 2023


  • Modified

  • 5. August 2025