What is a PID controller?

A Proportional Integral Derivative (PID) controller is a basic controller used for the autonomous pursuit of some state. The three terms refer to gains of the error signal between the current measured state and the goal. These gains are summed together and used as a feedback signal which changes the current state, hopefully moving it towards the goal.

Implementation

A brushed DC motor with an encoder was driven and read from an rp2040. In this example, random target speeds were generated and compared to the speed of the motor. This information was fed into a traditional PID loop, written in the Arduino IDE, where I tuned the gains until the response was quick and stable. In the video, I'm setting arbitrary speeds as a goal state for the motor every so often.