Skip to content

Instantly share code, notes, and snippets.

@jkbjh
jkbjh / python-pid_controller
Created October 25, 2017 14:54 — forked from chaosmail/python-pid_controller
Simple PID Controller
def pid_controller(y, yc, h=1, Ti=1, Td=1, Kp=1, u0=0, e0=0)
"""Calculate System Input using a PID Controller
Arguments:
y .. Measured Output of the System
yc .. Desired Output of the System
h .. Sampling Time
Kp .. Controller Gain Constant
Ti .. Controller Integration Constant
Td .. Controller Derivation Constant