PIDControllerBase

Base class providing shared PID controller functionality.

Info

The PIDControllerBase can be used as a base class when implementing a custom Proportional, Integral, Derivative (PID) controller, and contains a considerable amount of shared implementation that conforms to the IPIDController Interface. For example implementations that utilize the PIDControllerBase class, see the IdealPIDController or StandardPIDController implementations.

For a detailed discussion and explanation of the PID algorithm, see the Wilderness Labs PID Guide.

The PIDControllerBase implements a number of properties and methods that simplify the task of creating a PID controller with a custom algorithm. Simply inherit from PIDControllerBase and implement the CalculateControlOutput method with your custom algorithm.

The source for PIDControllerBase can be found here, and may be helpful in implementing controllers that derive from it.

API

The API of PIDControllerBase conforms to IPIDController Interface, so only the API marked as abstract or virtual, and therefore up to the derivative implementation is documented here.

Abstract and Virtual Methods

public abstract float CalculateControlOutput()

This method should be implemented by any derivative classes and should calculate the control output based on the difference (error) between the ActualInput and TargetInput, using the supplied ProportionalComponent, IntegralComponent, and DerivativeComponent.