Proportional, integral, derivative velocity control of a motor.

Dependencies:   mbed QEI PID

Revision:
1:ac598811dd00
Parent:
0:9bca35ae9c6b
diff -r 9bca35ae9c6b -r ac598811dd00 main.cpp
--- a/main.cpp	Tue Aug 03 09:24:06 2010 +0000
+++ b/main.cpp	Sat Nov 27 11:37:20 2010 +0000
@@ -89,7 +89,7 @@
         leftVelocity = (leftPulses - leftPrevPulses) / RATE;
         leftPrevPulses = leftPulses;
         leftController.setProcessValue(leftVelocity);
-        leftPwmDuty = leftController.getRealOutput();
+        leftPwmDuty = leftController.compute();
         leftMotor = leftPwmDuty;
         fprintf(fp, "%f,%f\n", leftVelocity, goal);
         wait(RATE);