View Source PidController (PidController v0.1.3)
Documentation for PidController.
controller-action
Controller action
By default, the controller will produce a direct control action, meaning that
an increasing error term will result in an increasing control value.
If the controller action is set to :reverse
, an increasing error term
will result in a decreasing control value. (This is generally needed only
if the element being controlled, such as a valve, requires it.)
Link to this section Summary
Functions
Returns the controller action (direct or reverse).
Returns the derivative coefficient (Kd) for the controller.
Returns the integral coefficient (Ki) for the controller.
Returns the proportional coefficient (Kp) for the controller.
Create a new instance.
Calculates the control value from the current process value.
Returns the range to which the control value will be limited, in the form
{min, max}
. If either value is nil
, the range is unbounded at that end.
Sets the controller action. Returns the new state.
Sets the derivative coefficient (Kd) for the controller. Returns the new state.
Sets the integral coefficient (Ki) for the controller. Returns the new state.
Sets the proportional coefficient (Kp) for the controller. Returns the new state.
Sets the range to which the control value will be limited, in the form
{min, max}
. If either value is nil
, the control value will not be limited
in that direction.
Sets the setpoint for the controller. Returns the new state.
Returns the current setpoint for the controller.
Link to this section Types
@type controller_action() :: :direct | :reverse
Link to this section Functions
@spec action(state()) :: controller_action()
Returns the controller action (direct or reverse).
Returns the derivative coefficient (Kd) for the controller.
Returns the integral coefficient (Ki) for the controller.
Returns the proportional coefficient (Kp) for the controller.
Create a new instance.
Calculates the control value from the current process value.
Returns `{:ok, output, state}``.
Returns the range to which the control value will be limited, in the form
{min, max}
. If either value is nil
, the range is unbounded at that end.
@spec set_action(state(), controller_action()) :: state()
Sets the controller action. Returns the new state.
Sets the derivative coefficient (Kd) for the controller. Returns the new state.
Sets the integral coefficient (Ki) for the controller. Returns the new state.
Sets the proportional coefficient (Kp) for the controller. Returns the new state.
Sets the range to which the control value will be limited, in the form
{min, max}
. If either value is nil
, the control value will not be limited
in that direction.
Sets the setpoint for the controller. Returns the new state.
Returns the current setpoint for the controller.