Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
DefaultPidConfig = PidControlLoopDefaults{
P: 0.3,
I: 0.02,
D: 0.005,
}
)
Functions ¶
This section is empty.
Types ¶
type ControlLoop ¶
type ControlLoop interface { // Cycle advances the control loop to the next step and returns the new pwm value. // Note: multiple calls to Loop may not result in the same output, as // the control loop may take time into account or have other stateful properties. Cycle(target int, current int) int }
ControlLoop defines how a FanController approaches the target value of its curve.
type DirectControlLoop ¶
type DirectControlLoop struct {
// contains filtered or unexported fields
}
DirectControlLoop is a very simple control that directly applies the given target pwm. It can also be used to gracefully approach the target by utilizing the "maxPwmChangePerCycle" property.
func NewDirectControlLoop ¶
func NewDirectControlLoop( maxPwmChangePerCycle *int, ) *DirectControlLoop
NewDirectControlLoop creates a DirectControlLoop, which is a very simple control that directly applies the given target pwm. It can also be used to gracefully approach the target by utilizing the "maxPwmChangePerCycle" property.
type PidControlLoop ¶
type PidControlLoop struct {
// contains filtered or unexported fields
}
PidControlLoop is a PidLoop based control loop implementation.
func NewPidControlLoop ¶
func NewPidControlLoop( p float64, i float64, d float64, ) *PidControlLoop
NewPidControlLoop creates a PidControlLoop, which uses a PID loop to approach the target.