Skip to content

fadamsyah/Particle-Based-Optimization-for-Longitudinal-Control

Repository files navigation

Particle-Based Optimization Algorithms for Longitudinal Control of Autonomous Vehicle: A Comparative Study

Table of Contents

Introduction

Abstract

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

Contributions. This work has 4 contributions, i.e.;

  1. Propose a longitudinal controller that has a feed-forward and feedback term.
  2. Propose a longitudinal vehicle model representing a real vehicle for simulation.
  3. Compare optimization algorithms performance and stability.
  4. Compare cost function modifications on algorithm performance.

Simulations. We have done 3 kind of simulations in this repository, namely;

  1. Non-linear least-square regression.
  2. System identification.
  3. 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;

  1. Particle Swarm Optimization (PSO).
  2. Accelerated Particle Swarm Optimization (APSO).
  3. Flower Pollination Algorithm (FPA).
  4. Modified Flower Pollination Algorithm (MFPA).

How to Use

Requirements

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.

Installation

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 the conda-forge channel.
  • Now, we cannot install SciencePlots through conda directly. Instead, we need to look at the original repository.

Simulation Files

  1. Steady-State Response (PSO, APSO, FPA, MFPA)

  2. System Identification (PSO, APSO, FPA, MFPA)

  3. PID Tuning (PSO, APSO, FPA, MFPA)

  4. Cost Function Modifications (MFPA)

Results

----------------------------------------------

Technical References

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published