pyparts.logic.pid_controller
index
/home/sean/src/python/pyparts/src/pyparts/logic/pid_controller.py

 
Modules
       
threading
time

 
Classes
       
__builtin__.object
PIDController

 
class PIDController(__builtin__.object)
    A PID controller for controlling output based on desired value.
 
Attributes:
  _kp: Integer. The constant term.
  _ki: Integer. The integrator term.
  _kd: Integer. The differential term.
  _prev_error: Float. The error value from the previous calculation.
  _cp: Integer. Temp storage for constant term.
  _ci: Integer. Accumulator for integrator error value.
  _cd: Integer. Accumulator for differntial error value.
  _prev_time: Integer. The time of the previous calculation.
 
  Methods defined here:
__init__(self, kp, ki, kd)
Creates a PIDController.
 
Args:
  kp: Integer. The constant term.
  ki: Integer. The integrator term.
  kd: Integer. The differential term.
get_output(self, error)
Does a PID calculation and returns the new output value.
 
Args:
  error: Float. The current error value.
 
Returns:
  Float. The output of the PID controller for the current error.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
Worker = <class 'pyparts.logic.pid_controller.Worker'>
A worker for a PIDController to allow background processing.
 
PIDController.Worker can be used to run a PID controller loop in a
background thread. The worker calls the input function to get the current
error value. It then computes the output value using the PID controller and
calls the output function with that value.
 
Attributes:
  _controller: PIDController. The PIDController used to calculate output
    values.
  _input_func: Function. Function called to determine error.
  _output_func: Function. Function called with the output of the PID.
  _set_point: Float. The desired value.
  _stop: Boolean. Set to true to disable the controller.