{"id":27203424,"url":"https://github.com/adamchristiansen/axi5-pid-controller","last_synced_at":"2026-02-12T17:02:38.064Z","repository":{"id":286886570,"uuid":"962856146","full_name":"adamchristiansen/axi5-pid-controller","owner":"adamchristiansen","description":"An AXI4/5-Stream PID controller","archived":false,"fork":false,"pushed_at":"2025-09-13T06:11:22.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-13T08:25:40.004Z","etag":null,"topics":["axi4-stream","axi5-stream","control-systems","control-theory","fpga","pid","pid-controller","vhdl","vhdl-2008"],"latest_commit_sha":null,"homepage":"","language":"VHDL","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/adamchristiansen.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-08T19:22:54.000Z","updated_at":"2025-09-13T06:11:27.000Z","dependencies_parsed_at":"2025-04-08T21:27:44.367Z","dependency_job_id":"05404ea0-810a-46f8-a90a-efc5eada12a2","html_url":"https://github.com/adamchristiansen/axi5-pid-controller","commit_stats":null,"previous_names":["adamchristiansen/axi5-pid-controller"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adamchristiansen/axi5-pid-controller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamchristiansen%2Faxi5-pid-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamchristiansen%2Faxi5-pid-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamchristiansen%2Faxi5-pid-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamchristiansen%2Faxi5-pid-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamchristiansen","download_url":"https://codeload.github.com/adamchristiansen/axi5-pid-controller/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamchristiansen%2Faxi5-pid-controller/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29373837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["axi4-stream","axi5-stream","control-systems","control-theory","fpga","pid","pid-controller","vhdl","vhdl-2008"],"created_at":"2025-04-09T22:39:07.865Z","updated_at":"2026-02-12T17:02:38.050Z","avatar_url":"https://github.com/adamchristiansen.png","language":"VHDL","readme":"# AXI5-Stream PID Controller\n\nAn [AXI4/5-Stream][axi5] [PID controller][pid] implemented in VHDL-2008.\n\n## How to use\n\nSimply drop [`pid_controller.vhd`](./pid_controller.vhd) into your project and instantiate the PID\ncontroller component.\n\n```vhdl\nmy_pid_controller: entity work.pid_controller\ngeneric map (\n    DATA_WIDTH =\u003e ...,      -- natural (default: 16).\n    DATA_RADIX =\u003e ...,      -- natural (default: 0).\n    K_WIDTH =\u003e ...,         -- natural (default: `DATA_WIDTH`).\n    K_RADIX =\u003e ...,         -- natural (default: `DATA_RADIX`).\n    INTEGRATOR_WIDTH =\u003e ... -- natural: (default `DATA_WIDTH`).\n)\nport map (\n    -- Interface global signals.\n    aclk =\u003e ...,\n    aresetn =\u003e ...,\n    -- Error signal input (AXI4/5-Stream).\n    s_axis_e_tdata =\u003e ...,\n    s_axis_e_tvalid =\u003e ...,\n    -- Control variable output (AXI4/5-Stream).\n    m_axis_u_tdata =\u003e ...,\n    m_axis_u_tvalid =\u003e ...,\n    -- PID coefficients.\n    kp =\u003e ...,\n    ki =\u003e ...,\n    kd =\u003e ...\n);\n```\n\n## Documentation\n\n\u003e [!TIP]\n\u003e This information can also be found in [`pid_controller.vhd`](./pid_controller.vhd).\n\nThis controller implements the following system, where `e(t)` is the input error signal and\n`u(t)` is the computed control variable that feeds back to the system. The PID coefficients\n`kp`, `ki`, and `kd` define the loop.\n\n```\n        +---\u003e kp * e(t) --------+\n        |                       |\ne(t) ---+---\u003e ki * ∫e(t) dt --\u003e Σ ---\u003e u(t)\n        |                       |\n        +---\u003e kd * e(t)/dt -----+\n```\n\nThe PID controller is used in the following way, where `r(t)` is the setpoint and `y(t)` is\nthe process variable. The error signal fed to the PID controller is generally computed in the\nsame way from the setpoint and process variable (often as the difference).\n\n ```\n             e(t)                u(t)\n s(t) ---\u003e Σ ---\u003e PID Controller ---\u003e Process --+-\u003e y(t)\n           |                                    |\n           +------------------------------------+\n ```\n\nThe PID controller accepts `e(t)` rather than `s(t)`, so it is possible to generate error\nsignals using more sophisticated approaches.\n\n### Generics\n\n- `DATA_WIDTH`: Width in bits of the input and output AXI4/5-Streams.\n- `DATA_RADIX`: Radix position in bits of the fixed-point input and output AXI4/5-Streams.\n- `K_WIDTH`: Width in bits of the input `kp`, `ki`, and `kd` coefficients.\n- `K_RADIX`: Radix position in bits of the input `kp`, `ki`, and `kd` coefficients.\n- `INTEGRATOR_WIDTH`: Width in bits of the internal integrator. Can be used to set the\n  integrator width larger than `DATA_WIDTH` to prevent early saturation of the integrator.\n\n### Ports\n\n- `aclk`: Global AXI4/5-Stream clock.\n- `aresetn`: Global active-low AXI4/5-Stream reset.\n- `s_axis_e_*`: AXI4/5-Stream for the error signal input as a signed fixed-point integer.\n- `m_axis_u_*`: AXI4/5-Stream for the control variable output as a signed fixed-point integer.\n- `kp`: Proportional coefficient as a signed fixed-point integer.\n- `ki`: Integral coefficient as a signed fixed-point integer.\n- `kd`: Derivative coefficient as a signed fixed-point integer.\n\n## Testing\n\nThe [`Makefile`](./Makefile) has the following recipes:\n\n- `make`: Alias for `make build`.\n- `make build`: Analyze and elaborate the source and test files.\n- `make test`: Run the testbench.\n- `make wave`: Display testbench waveforms.\n- `make clean`: Remove all build artifacts.\n\n## Requirements\n\n- [GHDL][ghdl] is used for building and testing.\n- [GTKWave][gtkwave] is used for viewing waveforms.\n\n## License\n\nThis project is distributed under the terms of the MIT License. The license text can be found in\nthe [`LICENSE`](./LICENSE) file of this repository.\n\n[axi5]: https://developer.arm.com/documentation/ihi0022/latest\n[ghdl]: https://ghdl.github.io/ghdl/\n[gtkwave]: https://gtkwave.sourceforge.net/\n[pid]: https://en.wikipedia.org/wiki/Proportional%E2%80%93integral%E2%80%93derivative_controller\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamchristiansen%2Faxi5-pid-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamchristiansen%2Faxi5-pid-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamchristiansen%2Faxi5-pid-controller/lists"}