PID controller to control the steering angle of a self driving car
- A controller with only a proportional gain (P gain) oscillates a lot.
- The amplitude of these oscillations are directly proportional to the gain.
- Here's a video of the self driving car steering only on P - Controller.
- A P - Controller along with a derivative gain (D gain) is a PD - Controller.
- The oscillations generated by the P gain are dampened by the D gain.
- There's a maximum dampening that can be achieved using the D gain.
- Here's a video of the self driving car steering on a PD - Controller.
- A PID - Controller has three gains - proportional, derivative and integral (PID).
- The I gain is required to remove any residual error introduced by the P gain.
- It overcomes systematic bias which could generate large errors.
- Introducing the I gain ensures the self driving car always stays on track.
- The P, I, D gains are determined using multiple runs of the Twiddle algorithm.
- The Twiddle algorithm pushes each of the gains up or down by a delta.
- Each time the gains are modified we calculate an error for a specific number of self driving car movements.
- Depending on how good or bad this error is, the gain deltas are either increased or decreased.