![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
werkt nog niet
Dependencies: HIDScope MODSERIAL biquadFilter mbed QEI
Fork of Project_script_union by
Revision 35:01aa6cb4a35f, committed 2018-11-02
- Comitter:
- MarijkeZondag
- Date:
- Fri Nov 02 07:59:57 2018 +0000
- Parent:
- 34:bece2820b63b
- Commit message:
- ..
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r bece2820b63b -r 01aa6cb4a35f main.cpp --- a/main.cpp Thu Nov 01 17:31:44 2018 +0000 +++ b/main.cpp Fri Nov 02 07:59:57 2018 +0000 @@ -68,26 +68,22 @@ //Variables PID controller double PI = 3.14159; -double Kp1 = 20.0; //Motor 1 eerst 17.5 , nu 1 +double Kp1 = 20.0; //Motor 1 double Ki1 = 1.02; double Kd1 = 1.0; double encoder_radians1=0; double err_integral1 = 0; double err_prev1, err_prev2; double err1, err2; +BiQuad LowPassFilterDer1( 1.12160e-01, 1.12160e-01, 0.00000e+00, -7.75680e-01, 0.00000e+00 ); //sample frequency 500 Hz, cutoff 20Hz low pass -//BiQuad LowPassFilterDer1(0.0640, 0.1279, 0.0640, -1.1683, 0.4241); -//BiQuad LowPassFilterDer2(0.0640, 0.1279, 0.0640, -1.1683, 0.4241); -BiQuad LowPassFilterDer1( 1.12160e-01, 1.12160e-01, 0.00000e+00, -7.75680e-01, 0.00000e+00 ); //sample frequency 500 Hz, cutoff 20Hz low pass -BiQuad LowPassFilterDer2( 1.12160e-01, 1.12160e-01, 0.00000e+00, -7.75680e-01, 0.00000e+00 ); - - -double Kp2 = 20.0; //Motor 2 eerst 17.5, nu 1 +double Kp2 = 20.0; //Motor 2 double Ki2 = 1.02; double Kd2 = 1.0; double encoder_radians2=0; double err_integral2 = 0; double u1, u2; +BiQuad LowPassFilterDer2( 1.12160e-01, 1.12160e-01, 0.00000e+00, -7.75680e-01, 0.00000e+00 ); int start_control = 0;