{"id":21858436,"url":"https://github.com/darkfanxing/genetic-algorithm-with-pid-control-system","last_synced_at":"2025-04-14T18:54:38.220Z","repository":{"id":39087188,"uuid":"498842169","full_name":"darkfanxing/genetic-algorithm-with-pid-control-system","owner":"darkfanxing","description":"A PID Control System with Genetic Algorithm","archived":false,"fork":false,"pushed_at":"2022-06-06T08:28:01.000Z","size":61,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T07:22:23.195Z","etag":null,"topics":["genetics","pid-controller","python397"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darkfanxing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-01T17:53:09.000Z","updated_at":"2024-10-15T05:50:10.000Z","dependencies_parsed_at":"2022-08-25T19:33:09.599Z","dependency_job_id":null,"html_url":"https://github.com/darkfanxing/genetic-algorithm-with-pid-control-system","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkfanxing%2Fgenetic-algorithm-with-pid-control-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkfanxing%2Fgenetic-algorithm-with-pid-control-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkfanxing%2Fgenetic-algorithm-with-pid-control-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkfanxing%2Fgenetic-algorithm-with-pid-control-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darkfanxing","download_url":"https://codeload.github.com/darkfanxing/genetic-algorithm-with-pid-control-system/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248942453,"owners_count":21186946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["genetics","pid-controller","python397"],"created_at":"2024-11-28T02:45:32.149Z","updated_at":"2025-04-14T18:54:38.199Z","avatar_url":"https://github.com/darkfanxing.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Genetic Algorithm with PID Control system\n## 1. Control System I used\n### 1.1 Control System\n![](https://i.imgur.com/uD6GOUn.png)\n\n### 1.3 The Input of The Control System\n- 4 periods of standard rectangular signal\n- Each period was cut into 60 pieces (ticks)\n\n### 1.2 The Output And PID Setting of The Control System\n![](https://i.imgur.com/aAwXYRa.png)\n\n## 2. Execute Project\n### 2.1 Environment Setup\n```\npip install pipenv\npipenv shell --python 3.9\npipenv install\n```\n\n### 2.2 Run the Project\nOpen the `src/main.ipynb` file, and run all cells\n\n## 3. Results\nThe result table is based on the following settings of genetic algorithm:\n1. `population number`: 50\n2. `iteration number`: 100\n3. `mutation probability`: 0.1\n4. `crossover rate`: 0.9\n5.  `PID value boundary`: [0, 1]\n6.  `eta value boundary`: [0.30001, 0.69999]\n7.  `fitness function`:\n\n    ![](https://i.imgur.com/y0XF8TL.png?)\n\n\n| Control System Output                | Chromosome Value                                     | Control System Setting                          |\n| --                                   | --                                                   | --                                              |\n| ![](https://i.imgur.com/PpCHRmo.png) | P / I / D / eta:\u003cbr /\u003e0.990 / 0.249 / 0.021 / 0.3001 | initial_y_now / u_boundary:\u003cbr /\u003e-2 / [-20, 20] |\n| ![](https://i.imgur.com/WvvNBCY.png) | P / I / D / eta:\u003cbr /\u003e1.000 / 0.301 / 0.025 / 0.3001 | initial_y_now / u_boundary:\u003cbr /\u003e0 / [-20, 20]  |\n| ![](https://i.imgur.com/MIhFG1P.png) | P / I / D / eta:\u003cbr /\u003e1.000 / 0.269 / 0.012 / 0.3001 | initial_y_now / u_boundary:\u003cbr /\u003e2 / [-20, 20]  |\n| ![](https://i.imgur.com/r45zWmu.png) | P / I / D / eta:\u003cbr /\u003e0.938 / 0.249 / 0.030 / 0.3001 | initial_y_now / u_boundary:\u003cbr /\u003e-2 / [-50, 50] |\n| ![](https://i.imgur.com/tMVETpy.png) | P / I / D / eta:\u003cbr /\u003e1.000 / 0.257 / 0.000 / 0.3001 | initial_y_now / u_boundary:\u003cbr /\u003e0 / [-50, 50]  |\n| ![](https://i.imgur.com/EPgnP2n.png) | P / I / D / eta:\u003cbr /\u003e1.000 / 0.251 / 0.006 / 0.3001 | initial_y_now / u_boundary:\u003cbr /\u003e2 / [-50, 50]  |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkfanxing%2Fgenetic-algorithm-with-pid-control-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkfanxing%2Fgenetic-algorithm-with-pid-control-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkfanxing%2Fgenetic-algorithm-with-pid-control-system/lists"}