RKI aangepast 10:02
Dependencies: HIDScope MODSERIAL QEI biquadFilter mbed
Fork of Project_script_union by
Diff: main.cpp
- Revision:
- 33:c9bfcf81f14e
- Parent:
- 32:56a8bd82e971
- Child:
- 34:9a8f901d3133
--- a/main.cpp Thu Nov 01 18:58:28 2018 +0000 +++ b/main.cpp Fri Nov 02 08:58:33 2018 +0000 @@ -355,7 +355,7 @@ encoder_radians1 = (double)encoder1.getPulses()*(2.0*PI)/8400.0; //pc.printf("encoder1 %f \n\r", (float)encoder1.getPulses()); //pc.printf("encoder_radians1 %f \n\r",(float) encoder_radians1); - err1 = q1ref - encoder_radians1; + err1 = q1_motor - encoder_radians1; //pc.printf("err1 = %f\n\r",err1); PID_control1(); //PID controller function call @@ -377,7 +377,7 @@ encoder_radians2 = (float)encoder2.getPulses()*(2.0*PI)/8400.0; //pc.printf("encoder2 %f \n\r",(float)encoder2.getPulses()); //pc.printf("encoder_radians2 %f \n\r",(float)encoder_radians2); - err2 = q2ref - encoder_radians2; + err2 = q2_motor - encoder_radians2; //pc.printf("err2 = %f\n\r",err2); PID_control2(); //PID controller function call //pc.printf("u2 = %f\n\r",u2); @@ -411,8 +411,8 @@ q1ref = q1_ii; q2ref = q2_ii; - q1_motor = q1ref*5.0; - q2_motor = q2ref/r_trans; + q1_motor = q1ref/r_trans; + q2_motor = q2ref*5.0; //pc.printf("q1ref is %f en q2ref is %f\n\r",q1ref, q2ref);