CSCE 452/752 Robotics and Spatial Intelligence, Fall 2025

10. PID Control

Introduction

Definition
Control theory refers to methods for regulating the behavior of dynamical systems.
diagram overview of control
We could do a whole course minor on control.

Example

A differential drive robot rotating in place:

Goal

The goal is to stabilize the state to a set point.
The error is the difference between the state and the set point: \[ e(t) = x(t) - s \]
We want to choose actions that drive the state to the set point and keep it there.

Is this easy?

In the rotation example, suppose:
Choose an open loop control law: \[ u(t) = \begin{cases} -\pi/4 & {\rm if}   t \lt 2 \\ 0 & {\rm if}   t \ge 2 \end{cases} \] Result:
After $t=2$, the system stays at the set point $x(t) = 0$.
The point of this example is that, as we've described it so far, it's not obvious that we need feedback. It looks like we just choose a function $u(t)$ and a stopping time $T$ that solves the equations.

Does this work?

Maybe, if the system is perfectly modeled and very predictable.
But usually, we don't fully trust the system to obey the system model, due to unmodeled disturbances.
In our example:
  • acceleration
  • wheel slip
  • miscalibration of the motors
  • mismeasurement of the wheels
  • uneven floor
  • small delays executing the command
  • ...

Feedback

Feedback controllers (state-feedback policies) can respond to states that we didn't expect to reach.
Basic idea: Actions depend on states: \[ \pi: X \to U\]

Back to our example

In the rotation example, suppose:
Choose an closed loop control law: \[u(x) = -x \] Result:
Result: From any state, the system moves toward the set point.

PID control

One simple and commonly used type of feedback controller is the proportional-integral-derivative (PID) controller: \[ u(t) = K_p e(t) + K_i {\Large\int}_0^{\,t} e(\tau) \mathrm{d}\tau + K_d \frac{\mathrm{d}e}{\mathrm{d}t} \] This consists of:
Various special cases, such as P or PD controllers, can be formed by setting one or more of the gains to 0.

Discrete time PID

A discrete-time system is one in which we can only measure the state at fixed intervals.
The PID controller on the previous slide cannot be used directly in a discrete time system, because we cannot compute the integral or derivative terms.
In that case, we can use discrete approximations: \[ u_k = K_p e_k + K_i \left(\Delta t \sum_{i=1}^k e_i \right) + K_d \left(\frac{e_k - e_{k-1}}{\Delta t} \right) \]

PID Tuning

Changes to $K_p$:
response of a PID controller varying Kp
Changes to $K_i$:
response of a PID controller varying Ki
Changes to $K_d$:
response of a PID controller varying Kd
[en.wikipedia.org]