|
TinyRobotics
|
Automatic PID tuning using the relay (Åström-Hägglund) method. More...
#include <PIDAutoTuner.h>
Classes | |
| struct | Result |
Public Member Functions | |
| PIDAutoTuner (float target, float relayAmp, float dt) | |
| void | reset () |
| float | update (float y) |
| bool | isFinished () const |
| Result | getResult () const |
| void | setHysteresis (float h) |
Protected Types | |
| enum class | State { INIT , RUNNING } |
Protected Member Functions | |
| void | detectPeaks (float y) |
| void | registerPeak (bool isMax) |
Automatic PID tuning using the relay (Åström-Hägglund) method.
This class implements an automatic PID tuning algorithm based on the relay (bang-bang) method, also known as the Åström-Hägglund relay auto-tuning technique. It applies a relay (on/off) control to the system and analyzes the resulting oscillations to estimate the ultimate gain (Ku) and period (Tu). These values are then used to compute PID parameters using the Ziegler-Nichols tuning rules.
Usage Example: