Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

Basic PID control.

- pidUniform :: Fractional a => a -> a -> a -> a -> a -> a -> a -> (a, a)
- pidFixed :: Fractional a => a -> a -> a -> a -> a -> a -> a -> a -> (a, a)
- pidTimed :: Fractional a => a -> a -> a -> a -> (a, a) -> (a, a) -> (a, a) -> (a, a)
- pidFixedIO :: Fractional a => a -> a -> a -> a -> IO (a -> a -> IO a)
- pidUniformIO :: Fractional a => a -> a -> a -> IO (a -> a -> IO a)
- pidTimedIO :: Fractional a => a -> a -> a -> IO (a -> a -> IO a)
- pidWithTimeIO :: Fractional a => a -> a -> a -> IO (a -> (a, a) -> IO a)

# Documentation

pidUniform :: Fractional a => a -> a -> a -> a -> a -> a -> a -> (a, a) Source

A simple PID transfer function that assumes a unit sampling interval. The first three parameters are the gains, the fourth parameter is the desired setpoint, the fifth and sixth parameters are the previous two errors, the seventh parameter is the most recent system output. The return value is a tuple of the most recent error and the computed controller output.

pidFixed :: Fractional a => a -> a -> a -> a -> a -> a -> a -> a -> (a, a) Source

PID controller with a fixed time interval between samples.

pidTimed :: Fractional a => a -> a -> a -> a -> (a, a) -> (a, a) -> (a, a) -> (a, a) Source

PID controller with explicit time stamps associated with each sample. The order of the resultant tuples is (timeStamp, sample).

pidFixedIO :: Fractional a => a -> a -> a -> a -> IO (a -> a -> IO a) Source

A PID controller that maintains its own state. The first three parameters are the gains, the fourth parameter is the desired setpoint. The return value is an IO function that takes the newest system output and returns the controller output.

pidUniformIO :: Fractional a => a -> a -> a -> IO (a -> a -> IO a) Source

A PID controller that assumes a uniform sampling interval of 1.

pidTimedIO :: Fractional a => a -> a -> a -> IO (a -> a -> IO a) Source

A PID controller that uses the system clock to associate a timestamp with each measurement that then used to determine the sampling interval.

pidWithTimeIO :: Fractional a => a -> a -> a -> IO (a -> (a, a) -> IO a) Source

A PID controller that takes values of the form (timeStamp, sample) such that the associated timestamp is used to determine the sampling rate.