
State Machine, bezig met mooimaken
Dependencies: Encoder HIDScope MODSERIAL biquadFilter mbed
Fork of StateMachinemooi by
Revision 33:4e5aca9f73e6, committed 2017-11-07
- Comitter:
- Gerber
- Date:
- Tue Nov 07 21:49:55 2017 +0000
- Parent:
- 32:30a36362f23d
- Commit message:
- PID WAARDEN NAAR 4200 GESCHAALD UITGEREKEND.; NU HELEMAAL KLAAR.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Nov 07 21:37:13 2017 +0000 +++ b/main.cpp Tue Nov 07 21:49:55 2017 +0000 @@ -357,16 +357,17 @@ } double FeedBackControl(double error, double &e_prev, double &e_int) // PID controller motor 1 +// The values are not correctly tuned. { - double kp = 0.0008*4200; // kind of scaled. + double kp = 3.36; // kind of scaled. double Proportional= kp*error; - double kd = 0.0008*4200; // kind of scaled. + double kd = 3.36; // kind of scaled. double VelocityError = (error - e_prev)/Ts; double Derivative = kd*VelocityError; e_prev = error; - double ki = 0.001*4200; // kind of scaled. + double ki = 4.2; // kind of scaled. e_int = e_int+Ts*error; double Integrator = ki*e_int; @@ -375,16 +376,17 @@ } double FeedBackControl2(double error2, double &e_prev2, double &e_int2) // PID controller motor 2 +// The values are not correctly tuned. { - double kp2 = 0.0008*4200; // kind of scaled. + double kp2 = 3.36 // kind of scaled. double Proportional2= kp2*error2; - double kd2 = 0.0008*4200; // kind of scaled. + double kd2 = 3.36; // kind of scaled. double VelocityError2 = (error2 - e_prev2)/Ts; double Derivative2 = kd2*VelocityError2; e_prev2 = error2; - double ki2 = 0.00005*4200; // kind of scaled. + double ki2 = 2.1; // kind of scaled. e_int2 = e_int2+Ts*error2; double Integrator2 = ki2*e_int2;