MOtor control Pololu
Dependencies: Encoder HIDScope mbed-dsp mbed
Diff: main.cpp
- Revision:
- 11:afe2140e469e
- Parent:
- 10:6f8af13cc3f4
- Child:
- 12:19ea553567a3
diff -r 6f8af13cc3f4 -r afe2140e469e main.cpp --- a/main.cpp Wed Oct 01 09:58:52 2014 +0000 +++ b/main.cpp Wed Oct 01 11:50:54 2014 +0000 @@ -3,18 +3,18 @@ #include "HIDScope.h" #define TSAMP 0.01 -#define K_P (0.01) -#define K_I (0 *TSAMP) +#define K_P (0.1) +#define K_I (0.03 *TSAMP) #define K_D (0 /TSAMP) #define I_LIMIT 1. -#define POT_AVG 50 +//#define POT_AVG 50 void clamp(float * in, float min, float max); float pid(float setpoint, float measurement); AnalogIn potmeter(PTC2); volatile bool looptimerflag; -float potsamples[POT_AVG]; +//float potsamples[POT_AVG]; HIDScope scope(6);