aboutsummaryrefslogtreecommitdiff
path: root/zumo/pidtest/pidtest.cpp
blob: 4d047fb882b9b081d79fb5c57bfabbbfb29a4c4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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));
	}
}