In order to adjust the speed of the PiCar in a controlled fashion, we built a PID controller. To apply the PID, we created a function that took in the current speed taken from the encoder, the desired speed and the P, I and D values that we want.

The figures above represent the different stages of PID coefficient development that were made regarding the controlling of the vehicle’s speed. These tests were completed with the drive wheels of the vehicle elevated from the ground, starting at an initial speed of 0 mph, and accelerating to a speed of 20 mph.

In Figure 1, a standard selection of PID coefficients was selected to give a decent starting point for the controller. This initial setup proved to have a considerable amount of overshoot. In Figure 2, the proportional component of the PID was reduced in its weight to both increase the response time giving the vehicle more time to accelerate and to reduce the amount of overshoot. There still appeared to be a decent amount of overshoot so for the final iteration (Figure 3) the derivative portion of the control had its weight increased to provide a higher predictive control to the PID and significantly reduce overshoot and settling time.

In the end, we did not have time to add the PID controller to the final design. In future development, it would be interesting to see how the implementation of the PID could improve speed performance.