-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | PID control loop -- -- Please see the README on GitHub at -- https://github.com/jlamothe/hsPID#readme @package hsPID @version 0.1 module Control.PID -- | PID control loop settings data Settings a Settings :: a -> a -> a -> a -> a -> Bool -> a -> Settings a -- | the desired setpoint [_setpoint] :: Settings a -> a -- | the proportional factor [_pFactor] :: Settings a -> a -- | the integral factor [_iFactor] :: Settings a -> a -- | the derivitave factor [_dFactor] :: Settings a -> a -- | the output bias [_bias] :: Settings a -> a -- | indicates whether or not the PID output is reversed [_isReversed] :: Settings a -> Bool -- | the maximum PID output [_maxOutput] :: Settings a -> a -- | PID status data Status a Status :: Settings a -> a -> a -> Status a -- | the PID loop's settings [_settings] :: Status a -> Settings a -- | the error on the last run of the PID loop [_lastError] :: Status a -> a -- | the accumulated integral (without factor) [_lastIntegral] :: Status a -> a setpoint :: forall a_a880. Lens' (Settings a_a880) a_a880 pFactor :: forall a_a880. Lens' (Settings a_a880) a_a880 iFactor :: forall a_a880. Lens' (Settings a_a880) a_a880 dFactor :: forall a_a880. Lens' (Settings a_a880) a_a880 bias :: forall a_a880. Lens' (Settings a_a880) a_a880 isReversed :: forall a_a880. Lens' (Settings a_a880) Bool maxOutput :: forall a_a880. Lens' (Settings a_a880) a_a880 settings :: forall a_a6U1. Lens' (Status a_a6U1) (Settings a_a6U1) lastError :: forall a_a6U1. Lens' (Status a_a6U1) a_a6U1 lastIntegral :: forall a_a6U1. Lens' (Status a_a6U1) a_a6U1 -- | the default PID settings These will probably need tuning. newSettings :: Fractional a => Settings a -- | an inital PID state with the default PID settings newStatus :: Fractional a => Status a -- | runs the PID loop run :: (Ord n, Fractional n) => n -> n -> Status n -> (n, Status n) -- | resets the integral of a PID loop resetIntegral :: Num n => Status n -> Status n instance GHC.Show.Show a => GHC.Show.Show (Control.PID.Status a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Control.PID.Status a) instance GHC.Show.Show a => GHC.Show.Show (Control.PID.Settings a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Control.PID.Settings a)