PID control explained

A zero preparation starting point

Mattia Maldini
13 min readDec 17, 2018

--

PID control is a mathematical approach to a broad range of output control scenarios. Whenever a system needs to tune an output based on some input value, PID techniques offer a neat starting point to implement a solution.

There are countless thousand pages books out there delineating the perfect way to use and manage PID control in your process. Like in most things however, the core concept can be useful even with a much lower effort, and I do believe online resources on the topic are somewhat lacking for beginners. So here we are.

The problem

Our system has an input value taken in by sensors every x time units (minutes, seconds, milliseconds; in abstract it doesn’t matter). Depending on said value a proper output response has to be calculated in order to reach a desired state. To throw in some examples, we could be talking about:

  • A thermostat. The input value is the current temperature and the output is the “power” of heating system.
  • A robotic arm. The input value is its position and the output is the voltage and direction to apply to its actuators.
  • A valve controlling water flow. The input is the current flow and the output is the speed and direction of the motor attached to the valve…

--

--

Mattia Maldini

Computer Science Master from Alma Mater Studiorum, Bologna; interested in a wide range of topics, from functional programming to embedded systems.