Skip to content

Stable and efficient PID controller in C with anti-windup, derivative filtering, and simulated plant response for step input tracking.

Notifications You must be signed in to change notification settings

mhmosalmani/pid-controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

PID Controller Implementation in C

A stable and efficient PID controller with derivative filtering and anti-windup protection.

Features

  • Optimized Gains: K_p=1.2, K_i=1.1999, K_d=0.8
  • Noise Reduction: First-order derivative filter (N=6)
  • Anti-Windup: Prevents integral saturation
  • Realistic Simulation: Dynamic plant model included

Results

Simulink vs C Code
Comparison of step responses (Simulink vs this implementation)

Data: Time_Plot_Data.txt

Quick Start

  1. Compile:
    gcc pid_controller.c -o pid -lm
    

License

Free to use (MIT)

About

Stable and efficient PID controller in C with anti-windup, derivative filtering, and simulated plant response for step input tracking.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages