This project implements a simplified cruise control system for vehicles using a PID controller. The goal is to regulate the car's velocity to a user-defined target value by compensating for resistances like rolling resistance and aerodynamic drag. These resistances are modeled linearly for simplicity, enabling efficient simulation and control design.
Upon running the program, the user will be prompted to input a simulation time, the number of steps the time should be broken down into and a target velocity. The output will be a velocity timeseries vector. This vector is a breakdown of the velocity versus time steps to showcase the controller's behavior over simulation time.
- Matplot++ for visuaĺization purpose (included in CMakeLists.txt)
To work on this project, you will need a C++ development environment set up on your machine. Follow these steps to clone the repository, compile the code, and run the algorithm:
Open a terminal and clone the repository by running:
git clone https://github.com/BKristandra/Cruise_Control.git
This will create a local copy of the project on your machine.
Build from your teminal using CMake:
mkdir build
cd build
cmake ..
makeRun from your terminal using ./cruise_control.
The code will output a timeseries velocity vector
The values used in this project are the same values used in this resource, these are the variables to change for your project.
m = 1000 kg: mass of the vehicleb = 50 N*sec/m: The resistance coefficient that estimates the rolling and aerodynamic resistanceT = 10 s: The simulation time [ User Input ]N = 20 steps: Total number of simulation steps [ User Input ]K_p = 800: The proportional gain of the PI controllerK_i = 40: the integral gain of the PI controller
If you have any inquiries, please don't hesitate to contact:
Brian: ge35yez@tum.de
If you have ideas for releases in the future, it is a good idea to list them in the README.
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
This work is supervised and advised by the Technical University of Munich.