Summary
In this chapter, we learned how a controller such as Raspberry Pi Pico uses a motor controller to drive motors. We saw how to control motor directions to drive in a straight(ish) line or make a robot turn.
We then learned about PWM control and how to vary motor speeds, creating a handy robot
Python library for our robot in the process. Next, we used this to make sweeping curves and build a multi-step path example with our robot. This path code did, however, show up some accuracy shortcomings.
We have used time to estimate how much we move our motors. However, motors don’t start immediately, and they can sometimes stick. In addition, some motors are slower than others. Therefore, we are working only with approximates. In the next chapter, we will look at how to measure how much the motors have turned to get a more accurate estimation of the robot’s movement.