PID class

A simple PID controller. No fuss. Directly ported from python: https://github.com/m-lundberg/simple-pid Kp is the value for the proportional gain. Ki is the value for the integral gain. Kd is the value for the derivative gain. setPoint is the initial setpoint that the PID will try to achieve. sampleTime is the time in seconds which the controller should wait before generating a new output value. The PID works best when it is constantly called (eg. during a loop), but with the sampleTime set so that the time difference between each update is (close to) constant. If not set it will default to 0.01 seconds. minOutput is minimum output to use. maxOutput is the maximum output limit to use. If neither limit is set it defaults to a very large and very small number. These limits also avoid integral windup, since the integral term will never be allowed to grow outside of the limits. autoMode is whether the controller should be enabled (in auto mode) or not (in manual mode). proportionalOnMeasurement is whether the proportional term should be calculated on the input directly rather than on the error (which is the traditional way). Using proportional-on-measurement avoids overshoot for some types of systems.

Constructors

PID({double Kp = 1.0, double Ki = 0.0, double Kd = 0.0, double setPoint = 0.0, double sampleTime = 0.01, double minOutput = -double.maxFinite, double maxOutput = double.maxFinite, bool proportionalOnMeasurement = false, dynamic autoMode = true})

Properties

autoMode bool
getter/setter pair
components List<double>
no setter
derivative double
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
integral double
getter/setter pair
Kd double
getter/setter pair
Ki double
getter/setter pair
Kp double
getter/setter pair
lastInput double?
getter/setter pair
lastOutput double
getter/setter pair
lastTime DateTime
getter/setter pair
maxOutput double
getter/setter pair
minOutput double
getter/setter pair
proportional double
getter/setter pair
proportionalOnMeasurement bool
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sampleTime double
getter/setter pair
setPoint double
getter/setter pair
tunings List<double>
getter/setter pair

Methods

call(double input, {Duration? dt}) double
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited