Proportional, integral, derivative velocity control of a motor.

Dependencies:   mbed QEI PID

Files at this revision

API Documentation at this revision

Comitter:
aberk
Date:
Sat Nov 27 11:37:20 2010 +0000
Parent:
0:9bca35ae9c6b
Commit message:
Used new libraries (as opposed to programs) for importing QEI and PID functionality; changed some method calls to reflect changes in the library APIs.

Changed in this revision

PID.lib Show annotated file Show diff for this revision Revisions of this file
PID_lib.lib Show diff for this revision Revisions of this file
QEI.lib Show annotated file Show diff for this revision Revisions of this file
QEI_lib.lib Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 9bca35ae9c6b -r ac598811dd00 PID.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PID.lib	Sat Nov 27 11:37:20 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/aberk/code/PID/#6e12a3e5af19
diff -r 9bca35ae9c6b -r ac598811dd00 PID_lib.lib
--- a/PID_lib.lib	Tue Aug 03 09:24:06 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/aberk/programs/PID_lib/latest
\ No newline at end of file
diff -r 9bca35ae9c6b -r ac598811dd00 QEI.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QEI.lib	Sat Nov 27 11:37:20 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/aberk/code/QEI/#5c2ad81551aa
diff -r 9bca35ae9c6b -r ac598811dd00 QEI_lib.lib
--- a/QEI_lib.lib	Tue Aug 03 09:24:06 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/aberk/programs/QEI_lib/latest
\ No newline at end of file
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);