motor controller with P velocity control
Dependencies: HIDScope PID QEI mbed EMG
Fork of PID_VelocityExample by
Diff: main.cpp
- Revision:
- 6:f58052f57505
- Parent:
- 5:8ae6d935a16a
- Child:
- 7:e14e28d8cae3
diff -r 8ae6d935a16a -r f58052f57505 main.cpp --- a/main.cpp Fri Sep 25 13:11:43 2015 +0000 +++ b/main.cpp Fri Sep 25 13:41:59 2015 +0000 @@ -9,7 +9,7 @@ // Defines //****************************************************************************/ #define RATE 0.01 -#define Kc 0.1 +#define Kc 0.2 #define Ti 0.0 #define Td 0.0 @@ -78,7 +78,7 @@ } int main() { - scopeTimer.attach_us(&scope, &HIDScope::send, 1e4); + //scopeTimer.attach_us(&scope, &HIDScope::send, 1e4); //Initialization. initializeMotors(); initializePidControllers(); @@ -109,7 +109,7 @@ scope.set(0, request); scope.set(1, leftPwmDuty); scope.set(2, leftVelocity); - + scope.send(); pc.printf("request: %f, lefVelocity: %f, output: %f \n\r",request,leftVelocity,leftPwmDuty); //fprintf(fp, "%f,%f\n", leftVelocity, goal);