Particle-Based Optimization Algorithms for Longitudinal Control of Autonomous Vehicle: A Comparative Study
In order to improve the stability and performance of an autonomous vehicle, optimizations need to be explicitly performed in the controllers, which has an essential part in the tracking system. This work proposes a novel longitudinal control optimization scheme and a novel longitudinal controller consisting of a feed-forward and feedback term. The feed-forward term is inspired by the vehicle's steady-state response, whereas the feedback term is a proportional- integral-derivative (PID) controller. Also, A model representing the longitudinal vehicle dynamics is designed based on physical phenomena affecting the vehicle. Besides, some nature-inspired optimization algorithms are used to optimize the controller, i.e., Particle Swarm Optimization (PSO), Accelerated PSO (APSO), Flower Pollination Algorithm (FPA), and Modified FPA (MFPA). The algorithms are compared in optimizing the longitudinal vehicle model and controller using the CARLA simulator, and stability tests are also done for each algorithm. In addition, the characteristics of several cost functions in the controller optimization are inspected. The results show that the MFPA is the most stable algorithm, the proposed model represents the system satisfactorily, and optimizing the controller using a regularized cost function leads to better overall performance.
Contributions. This work has 4 contributions, i.e.;
- Propose a longitudinal controller that has a feed-forward and feedback term.
- Propose a longitudinal vehicle model representing a real vehicle for simulation.
- Compare optimization algorithms performance and stability.
- Compare cost function modifications on algorithm performance.
Simulations. We have done 3 kind of simulations in this repository, namely;
- Non-linear least-square regression.
- System identification.
- PID tuning.
Optimization Algorithms. We compare 4 nature-inspired optimization algorithms to determine which one is the best and most reliable algorithm. The optimization algorithms explored in this work are;
- Particle Swarm Optimization (PSO).
- Accelerated Particle Swarm Optimization (APSO).
- Flower Pollination Algorithm (FPA).
- Modified Flower Pollination Algorithm (MFPA).
We heavily depend on the following libraries;
jupyter
jupyterlab
numpy
numba
matplotlib
pandas
SciencePlots
We use Numba to speed up our code. We found that by using Numba
, surprisingly we're able to accelerate our simulation more than 10x times faster. But it also has several trade-off, e.g. less flexible, prone to bugs, and quite hard to refactor.
We suggest to use a conda environment to make your installation easier. Installing libraries in conda
is relatively easy because it will also automatically install their dependencies.
After installing conda
, we recommend do as follows;
# Create an environment inside conda
conda create -n py39 python=3.9
# Activate the environment
conda activate py39
# Install the required libraries
conda install jupyter -y
conda install -c intel numpy -y
conda install -c numba numba -y
conda install -c conda-forge jupyterlab matplotlib pandas -y
Notes:
conda install -c intel numpy
is recommended if you have an intel CPU installed on your computer, because it will use the Intel Math Kernel Library (MKL) as its backend. Otherwise, you'd better avoid MKL by using theconda-forge
channel.- Now, we cannot install
SciencePlots
through conda directly. Instead, we need to look at the original repository.
-
Cost Function Modifications (MFPA)
----------------------------------------------