PIDController

Module that applies PID control independently to each of its inputs. All inputs and the control output can be filtered using the exponentially moving average. The filter constant is set by the parameters Fs, Fm and Fc. Also the error used for propertional, integral and derivative control can be filtered by setting the constants Fp, Fi and Fd to a value below 1. The integrator will not integerate the error when the control output has reached its minimum or maximum.

Example XML definition

A simple example

  <module
      class = "PIDController"
      name = "PIDController"
      Kp = "0.1"
      Kd = "0.1"
      Ki = "0.1"
  />

Parameters

NameDescriptionTypeDefault
classThe class name for the module; must be "PIDController".string
nameThe name of this instance of the module.string
KbThe controller biasfloat0.0
KpThe proportional gainfloat0.1
KiThe integral gainfloat0.0
KdThe derivative gainfloat0.0
FsSet-point filter constantfloat0.0
FmMeasurement filter constantfloat0.0
FpProportional error filter constantfloat0.0
FiIntegral error filter constantfloat0.0
FdDifferential error filter constantfloat0.0
FcControl filter constantfloat0.0
CmaxMaximum control outputfloat1000.0
CminMinimum control outputfloat-1000.0

Module Connections

Inputs

NameDescription
INPUTThe curent signal
SETPOINTThe desired value

Outputs

NameDescription
OUTPUTThe control output.
DELTAThe current deviation from the set point.
FILTERED_SETPOINTSet point filtered by exponentially moving average.
FILTERED_INPUTInput filtered by exponentially moving average.
FILTERED_ERROR_PError term used for proportional control filtered by exponentially moving average.
FILTERED_ERROR_IError term used for integral control filtered by exponentially moving average.
FILTERED_ERROR_DError term used for derivate control filtered by exponentially moving average
INTEGRALThe current integrated error.

Author

Christian Balkenius
christian.balkenius@lucs.lu.se
Lund University Cognitive Science

Files

PIDController.h
PIDController.cc
PIDController.ikc

blog comments powered by Disqus