This repository houses a PID (Proportional-Integral-Derivative) controller, implemented in Verilog, suitable for FPGA and ASIC applications. PID controllers are pivotal in control theory, and they are used in myriad applications, including those that are time-sensitive. The project aims to serve as a basis for sophisticated control systems where fine-grained control and real-time operation are essential.
- 16-bit arithmetic for high-precision control.
- Configurable
Kp
,Ki
,Kd
coefficients to adapt to various systems. - Clock prescaling feature to adjust the controller's sampling rate.
- Includes a testbench simulating a generic linear system for validation.
-
Robustness: Ongoing efforts are focused on making the PID controller more robust to cater to different environmental conditions and systems.
-
Model Predictive Control: An additional layer of Model Predictive Control (MPC) is under development, aiming to provide optimal control in complex systems.
-
Standardized Test Stimulus: Work is in progress to create a standardized testbench stimulus that simulates a common linear system for more rigorous testing and validation.
The main Verilog module pid_controller
takes care of the PID calculations:
clk
,rst_n
: Clock and Reset signals.setpoint
,feedback
: Control variables.Kp
,Ki
,Kd
: PID coefficients.clk_prescaler
: Clock prescaler for adjustable sampling rate.control_signal
: Output control signal.
The pid_tb
(testbench) module provides a simulated environment to validate the PID controller. It includes the feedback system and allows for adjustments to the Kp
, Ki
, Kd
coefficients and clk_prescaler
to test the controller in different scenarios.
- Automated Manufacturing: In industrial settings where machinery needs to respond in real-time.
- Telecommunications: For latency-critical applications such as real-time packet routing.
- Robotics and Drones: Where fast and precise control is necessary for stabilization and movement.
- Healthcare Devices: In medical instruments like infusion pumps and ventilators where precision and speed are critical.
- Xilinx Vivado for synthesizing the design (optional for FPGA deployment)
- A Verilog simulator like ModelSim for simulation and testing
- Clone this repository.
- Open the
.xpr
file in Xilinx Vivado if you are planning to synthesize for FPGA. - To run the simulation, open the project in a Verilog simulator and execute the testbench.
Contributions to enhance the functionality are most welcome. Fork this repository and create a pull request or open an issue for discussion.
This project is licensed under the MIT License. For more information, see LICENSE.md.