Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of BX-car by
Revision 14:5cc3e028d8a3, committed 2014-06-30
- Comitter:
- physicsgood
- Date:
- Mon Jun 30 02:26:43 2014 +0000
- Parent:
- 13:0f0d341d6d61
- Child:
- 15:3fa780990a6a
- Commit message:
- QQQ
Changed in this revision
| controller.h | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/controller.h Mon Jun 30 02:10:38 2014 +0000
+++ b/controller.h Mon Jun 30 02:26:43 2014 +0000
@@ -84,6 +84,9 @@
float Kc_;
float tauR_;
float tauD_;
+ float Kp;
+ float Ki;
+ float Kd;
//Raw tuning parameters.
float pParam_;
--- a/main.cpp Mon Jun 30 02:10:38 2014 +0000
+++ b/main.cpp Mon Jun 30 02:26:43 2014 +0000
@@ -51,7 +51,7 @@
double b_r_c;
double PID_v;
- //double Kp = 0.00078, Ki = 0.0000, Kd = 0.0000;;
+ //double Kp = 0.00078, Ki = 0.0000, Kd = 0.0000;
double integral = 0, derivative = 0, error = 0, last_error = 0, turn = 0;
while(1){
@@ -145,8 +145,9 @@
b_r_c=(double)cam.black_centerR();
-
+ pc.printf("b_r_c: %lf\r\n",b_r_c);
PID_v=cam_to_M_ctrlr.compute(200,b_r_c,20.0);//set_angle()
+ pc.printf("angle: %f\r\n",PID_v);
//pc.printf("%f %d %d speed :%f bk_center %f PID:%f \r\n",cam_to_M_ctrlr.de_v,cam.de_v,cam.de_v2,motor,b_r_c,PID_v);
//b_r_c range 0~128
/*error = 20 - b_r_c;
