10

Using the PID Algorithm to Follow Walls

We built a robot with multiple sensors and used distance sensors in Chapter 8, Sensing Distances to Detect Objects with Pico. We can use smarter algorithms with these sensors to make smoother behaviors.

In this chapter, we will investigate the PID algorithm, building its stages into something that will follow objects, then turning that into something that will follow a wall. We will use our new ability to graph over Bluetooth to tune the settings and get a smooth result.

In this chapter, we will cover the following main topics:

  • Introducing the PID algorithm
  • Using a PID to follow a wall
  • PID tuning – using graphs to tune the PID

Technical requirements

You will need the following items for this chapter: ...

Get Robotics at Home with Raspberry Pi Pico now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.