11

Controlling Motion with Encoders on Raspberry Pi Pico

So far in this book, we’ve added sensors to our robot that can track counts as its wheels turn. We’ve also looked at a PID algorithm to close the robot control loop. We can combine these concepts to control our motors and wheels more precisely.

This combination will let us maintain a known speed on each motor and correct their relative speeds for a straight line. Encoders with some geometry will let us drive the robot a predetermined distance.

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

  • Converting an encoder count into a speed
  • Using PID to maintain speed and a straight line
  • Driving a known distance

Technical requirements

For this chapter, you will require the following: ...

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.