Nieuwe kinematica + potmeter
Dependencies: HIDScope MODSERIAL QEI biquadFilter mbed
Fork of Project_script_union_potmeter by
Diff: main.cpp
- Revision:
- 35:01aa6cb4a35f
- Parent:
- 34:bece2820b63b
- Child:
- 36:bfdd1409855a
--- 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;