The StringCar racer robot was bouncing off the string when accelerating and braking. At slow speed, the precariously balanced car’s pulley dramatically changed speed and disengaged from the string without warning. To avoid sudden starts and stops, the car's CircuitPython code gradually ramped the motor voltage up and down using PWM (Pulse-Width Modulation) signals, so why was the car so jumpy?
It became obvious that the car's brushed direct-current (DC) motor didn’t have enough torque to run reliably at speeds less than 200RPM without some sort of gearing arrangement. A geared motor for the StringCar was too heavy and difficult to balance, so another solution was needed.
After some experimentation, the solution was to adjust one of the PWM signal characteristics. No need to add a gearbox or change hardware; we'll just apply a simple change in the CircuitPython code.
This guide will elaborate on the solution, examine some commonly available motors, and provide programming examples that will improve the low-speed performance of your robot’s brushed DC motors. First, we’ll look at the motors’ love/hate relationship with PWM and how to make them friends again.