https://github.com/darkfanxing/genetic-algorithm-with-pid-control-system
A PID Control System with Genetic Algorithm
https://github.com/darkfanxing/genetic-algorithm-with-pid-control-system
genetics pid-controller python397
Last synced: 6 months ago
JSON representation
A PID Control System with Genetic Algorithm
- Host: GitHub
- URL: https://github.com/darkfanxing/genetic-algorithm-with-pid-control-system
- Owner: darkfanxing
- License: mit
- Created: 2022-06-01T17:53:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-06T08:28:01.000Z (over 3 years ago)
- Last Synced: 2025-03-28T07:22:23.195Z (6 months ago)
- Topics: genetics, pid-controller, python397
- Language: Jupyter Notebook
- Homepage:
- Size: 59.6 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Genetic Algorithm with PID Control system
## 1. Control System I used
### 1.1 Control System
### 1.3 The Input of The Control System
- 4 periods of standard rectangular signal
- Each period was cut into 60 pieces (ticks)### 1.2 The Output And PID Setting of The Control System
## 2. Execute Project
### 2.1 Environment Setup
```
pip install pipenv
pipenv shell --python 3.9
pipenv install
```### 2.2 Run the Project
Open the `src/main.ipynb` file, and run all cells## 3. Results
The result table is based on the following settings of genetic algorithm:
1. `population number`: 50
2. `iteration number`: 100
3. `mutation probability`: 0.1
4. `crossover rate`: 0.9
5. `PID value boundary`: [0, 1]
6. `eta value boundary`: [0.30001, 0.69999]
7. `fitness function`:
| Control System Output | Chromosome Value | Control System Setting |
| -- | -- | -- |
|  | P / I / D / eta:
0.990 / 0.249 / 0.021 / 0.3001 | initial_y_now / u_boundary:
-2 / [-20, 20] |
|  | P / I / D / eta:
1.000 / 0.301 / 0.025 / 0.3001 | initial_y_now / u_boundary:
0 / [-20, 20] |
|  | P / I / D / eta:
1.000 / 0.269 / 0.012 / 0.3001 | initial_y_now / u_boundary:
2 / [-20, 20] |
|  | P / I / D / eta:
0.938 / 0.249 / 0.030 / 0.3001 | initial_y_now / u_boundary:
-2 / [-50, 50] |
|  | P / I / D / eta:
1.000 / 0.257 / 0.000 / 0.3001 | initial_y_now / u_boundary:
0 / [-50, 50] |
|  | P / I / D / eta:
1.000 / 0.251 / 0.006 / 0.3001 | initial_y_now / u_boundary:
2 / [-50, 50] |