diff options
author | UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> | 2023-06-06 12:00:58 +0200 |
---|---|---|
committer | UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> | 2023-06-06 12:00:58 +0200 |
commit | 077069b82a34bd5e0d51509eb751df9b44a5f6d3 (patch) | |
tree | 1753f1266c2837282c7a1f7ce8137161c85a1a0a /zumo/pidtest/pidtest.cpp | |
parent | f2335307a26a8ab3e18d8990d2640a8de4cbd0e4 (diff) | |
parent | 0f764db3c3595e863a4949c67592451c7d65a2cf (diff) |
Merge branch 'master' of https://github.com/unavailabledev/avans-dui
Diffstat (limited to 'zumo/pidtest/pidtest.cpp')
-rw-r--r-- | zumo/pidtest/pidtest.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/zumo/pidtest/pidtest.cpp b/zumo/pidtest/pidtest.cpp new file mode 100644 index 0000000..4d047fb --- /dev/null +++ b/zumo/pidtest/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)); + } +} |