diff options
author | UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> | 2023-05-20 22:08:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-20 22:08:08 +0200 |
commit | ac1884bec264d08dc5cc58d1cda24e20734c9205 (patch) | |
tree | 6c71a74d2b3d4af7d183b0823b15bba601a37bb5 /zumo/pidtest.cpp | |
parent | 7a18524a8b97deaafcd93be14e56ce308fe4583c (diff) | |
parent | ba026d8229744a01818d38552ec7271e689d19eb (diff) |
Merge branch 'lonkaars:master' into master
Diffstat (limited to 'zumo/pidtest.cpp')
-rw-r--r-- | zumo/pidtest.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/zumo/pidtest.cpp b/zumo/pidtest.cpp new file mode 100644 index 0000000..b9ce50b --- /dev/null +++ b/zumo/pidtest.cpp @@ -0,0 +1,18 @@ +#include <cstdio> +#include <random> + +#include "pid.h" + +int main() { + float P, I, D; + P = -0.02; + I = 0.13; + D = -300; + PID test(P, I, D); + test.reset(0.0); + + fprintf(stderr, "P: %.3f :: I: %.3f :: D: %.3f\n", P, I, D); + for (unsigned int i = 0; i < 100; i++) { + printf("%2.8f\n", test.iter(i < 50 ? 1.0 : 0.0)); + } +} |