Robot lijkt goed te reageren op potmeters van Pauline.

Dependencies:   Encoder HIDScope MODSERIAL mbed

Fork of PIDZONDERRKI by Projectgroep 20 Biorobotics

Files at this revision

API Documentation at this revision

Comitter:
Gerber
Date:
Fri Nov 03 10:58:29 2017 +0000
Parent:
13:290a1c5d4230
Commit message:
nu de PID aangepast naar de "nieuwe" waarden. Voor de rest niks verandert. Hiermee gecontroleerd of motor 1 het doet.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Nov 03 10:50:38 2017 +0000
+++ b/main.cpp	Fri Nov 03 10:58:29 2017 +0000
@@ -52,15 +52,15 @@
     
 float FeedBackControl(float error, float &e_prev, float &e_int)   // schaalt de snelheid naar de snelheid zodat onze chip het begrijpt (is nog niet in werking)
 {
-    float kp = 0.001;                             // kind of scaled.
+    float kp = 0.0015;                             // kind of scaled.
     float Proportional= kp*error;
     
-    float kd = 0.0004;                           // kind of scaled. 
+    float kd = 0.000008;                           // kind of scaled. 
     float VelocityError = (error - e_prev)/Ts; 
     float Derivative = kd*VelocityError;
     e_prev = error;
     
-    float ki = 0.00005;                           // kind of scaled.
+    float ki = 0.0001;                           // kind of scaled.
     e_int = e_int+Ts*error;
     float Integrator = ki*e_int;
     
@@ -71,10 +71,10 @@
 
 float FeedBackControl2(float error2, float &e_prev2, float &e_int2)   // schaalt de snelheid naar de snelheid zodat onze chip het begrijpt (is nog niet in werking)
 {
-    float kp2 = 0.001;                             // kind of scaled.
+    float kp2 = 0.002;                             // kind of scaled.
     float Proportional2= kp2*error2;
     
-    float kd2 = 0.0004;                           // kind of scaled. 
+    float kd2 = 0.000008;                           // kind of scaled. 
     float VelocityError2 = (error2 - e_prev2)/Ts; 
     float Derivative2 = kd2*VelocityError2;
     e_prev2 = error2;