Documentation
¶
Overview ¶
Toepid – totally over-engineered PID control
Copyright (C) 2024–2025 Torsten Bronger, bronger@physik.rwth-aachen.de
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Toepid – totally over-engineered PID control
Copyright (C) 2024–2025 Torsten Bronger, bronger@physik.rwth-aachen.de
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Toepid – totally over-engineered PID control
Copyright (C) 2024–2025 Torsten Bronger, bronger@physik.rwth-aachen.de
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Toepid – totally over-engineered PID control
Copyright (C) 2024–2025 Torsten Bronger, bronger@physik.rwth-aachen.de
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Index ¶
Constants ¶
const ( ModeOff = iota ModeOn ModeAntifreeze ModeSetPower )
const ( ResetAuto = iota ResetFalse ResetTrue ResetDerivative )
const ( Basic = iota Saturated PWM )
const ( SaturatedNone = iota SaturatedLow SaturatedHigh )
Variables ¶
var ErrNotReady = errors.New("Controller is not initialised")
var ModeNames = map[int]string{ModeOff: "off", ModeOn: "on", ModeAntifreeze: "antifreeze", ModeSetPower: "set power"}
var ResetNames = map[int]string{ResetAuto: "auto", ResetFalse: "false", ResetTrue: "true", ResetDerivative: "derivative"}
var SaturationNames = map[int]string{ SaturatedNone: "none", SaturatedLow: "low", SaturatedHigh: "high", }
Functions ¶
This section is empty.
Types ¶
type ControlParams ¶
type Controller ¶
type Controller interface {
encoding.BinaryMarshaler
encoding.BinaryUnmarshaler
Initialize(mode int, setPoint float64, reset int) (hasReset bool)
SetParams(params ControlParams)
IsReady() bool
ControlVar(p timeseries.Point, preload UncertainFloat) (u float64, info statusInfo, err error)
SetLimits(lower, upper float64)
}
func NewController ¶
func NewController(logger tbr_logging.Logger, conType int, window float64, resetTime time.Duration) (c Controller)
NewController returns a controller with bang–bang behaviour. Use the method Controller.SetTerms for switching to general PID control. The window is given in seconds. The window should not contain more than or close to mollifySamples data points. A good number is 15 to 31 time series points. It is given in units of time. Note that the PID control will have a lag of one third of the window. If the controller was set to zero for longer than resetTime, the integral term and the time series are re-set.
type UncertainFloat ¶
type UncertainFloat struct {
Value, Uncertainty float64
}