Setting up a PID controller for self-driving cars

Setting up a PID controller for self-driving cars

This project illustrates the concept of a PID controller used in self-driving cars as part of Udacity's Self-Driving Car program.

A PID controller is a feedback mechanism in a control loop that calculates the difference between a desired setpoint and the actual output of a process and uses the result to make adjustments to the process. PID controllers are widely used in industrial and robotic process control.

In the context of self-driving cars, they play an important role in controlling driving parameters such as steering, acceleration, etc. The complex algorithms used in self-driving cars essentially calculate the trajectory and speed of the self-driving car. Autonomy can only be realized if the car follows a path at a given speed. This is where the PID controller plays its role, ensuring that the self-driving car adheres to the calculated parameters. Any deviation from the calculated parameters can lead to unforeseen or catastrophic consequences.

This article has been translated from English with some adaptations. Translation made jointly with the course teacher “Building automatic control systems (ACS)” Andrei Chepiga.

1. PID controller theory

The term “PID controller” consists of three components: proportional, integral, derivative. The figure below shows the relationship between all three components and the final response.

PID control process

Proportional (P): it simply takes some fraction of the current error value. The share is specified by a constant and is denoted by the letters Kp. Used to calculate the corrective action on the process. Since the formation of a proportional effect requires the presence of an error, in its absence there is no proportional corrective effect.

Integral (I): takes into account all past error values ​​and accumulates them over time. This leads to an increase in the integral term until the error becomes zero. When the error is eliminated, the integral term stops growing. If the error still exists after applying proportional control, the integral term attempts to eliminate the error by adding the accumulated error value. This causes the proportional effect to decrease as the error decreases. The integral constant is denoted Ki

Derivative (D): the derivative is used to estimate the future trend of the error based on its current rate of change. It is used to add a damping effect to the system. The faster the change occurs, the greater the controlling or damping effect. The derivative constant is denoted by Kd

The input to the controller is the error e

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *