Skip to main content

Class PidControllerBase

Represents a PID controller

Assembly: Meadow.Foundation.dll
View Source
public abstract class PidControllerBase : IPidController

Derived:
Meadow.Foundation.Controllers.Pid.IdealPidController, Meadow.Foundation.Controllers.Pid.StandardPidController

Implements:
Meadow.Peripherals.Controllers.PID.IPidController

Properties

ActualInput

Represents the ProcessVariable (PV), or the actual signal reading of the system in its current state. For example, when heating a cup of coffee to 75°, if the temp sensor says the coffee is currently at 40°, the 40� is the actual input value.

View Source
public float ActualInput { get; set; }

TargetInput

Represents the SetPoint (SP), or the reference target signal to achieve. For example, when heating a cup of coffee to 75°, 75° is the target input value.

View Source
public float TargetInput { get; set; }

OutputMin

Output minimum value

View Source
public float OutputMin { get; set; }

OutputMax

Output maximum value

View Source
public float OutputMax { get; set; }

ProportionalComponent

Proportional gain

View Source
public virtual float ProportionalComponent { get; set; }

IntegralComponent

Integral gain

View Source
public virtual float IntegralComponent { get; set; }

DerivativeComponent

Derivative gain

View Source
public virtual float DerivativeComponent { get; set; }

OutputTuningInformation

Whether or not to print the calculation information to the output console in an comma-delimited form. Useful for pasting into a spreadsheet to graph the system control performance when tuning the PID controller corrective action gains.

View Source
public bool OutputTuningInformation { get; set; }

Fields

_lastUpdateTime

Last update time

View Source
protected DateTime _lastUpdateTime

_lastError

Last error value

View Source
protected float _lastError

_integral

Integral

View Source
protected float _integral

_lastControlOutputValue

Last control output value

View Source
protected float _lastControlOutputValue

Methods

ResetIntegrator()

Reset integral

View Source
public void ResetIntegrator()

CalculateControlOutput()

Calculates the control output based on the Target and Actual, using the current PID values

View Source
public abstract float CalculateControlOutput()
Returns

System.Single

Implements

  • Meadow.Peripherals.Controllers.PID.IPidController