Skip to content

Instantly share code, notes, and snippets.

@jay3ss
jay3ss / pid_controller.py
Last active July 6, 2021 22:14
A simple, one dimensional PID controller written in Python
import robot # dummy class
class PidController:
"""Implements a one-dimensional PID controller that also takes care of
integral windup in case of large changes in the setpoint.
"""
def __init__(self, gains=None, max_windup=None):
"""Initializes the PidController object
Arguments:
import abc
class StackInterface(abc.ABC):
"""An abstract base class that defines a stack"""
@abc.abstractmethod
def is_empty(self):
"""Determines if the stack is empty
:return True if the stack is empty, False otherwise
"""