-- 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.2
-- | Copyright (C) 2018 Jonathan Lamothe jlamothe1980@gmail.com
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Lesser General Public License as
-- published by the Free Software Foundation, either version 3 of the
-- License, or (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful, but
-- WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public
-- License along with this program. If not, see
-- https://www.gnu.org/licenses/.
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 derivative 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 control loop 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)