Introducing the PID algorithm
In this section, we will introduce the different parts of the PID algorithm while building on what you have already seen.
Control and feedback
Controlling robot systems generally depends on feedback loops like the following one:
Figure 10.1 – Control and feedback loop
The preceding figure shows data from the sensors going into a control algorithm. The algorithm controls the motor as its output. The motor will cause the robot to move. This movement leads to a feedback loop as the sensor reading changes and goes through the cycle again. This concept is known as closed-loop control.
This closed-loop lets the robot interact with the real world, adjusting its behavior to produce the desired result.
We built a simple system like this for our distance sensors. We’ll look more closely at that system next.
Bang-bang control
In the examples provided in Chapter 8, Sensing Distances to Detect Objects with Pico...