![](/media/cache/group/9e3cc099b3b04bca937a1cca1da81b19.jpg.50x50_q85.jpg)
De hele robot in 1 keer bam
Dependencies: mbed QEI Servo HIDScope biquadFilter MODSERIAL FastPWM
Diff: main.cpp
- Revision:
- 62:b1790e927a90
- Parent:
- 61:07035c03cf29
- Child:
- 63:d17f45d88c7a
--- a/main.cpp Fri Nov 01 00:38:26 2019 +0000 +++ b/main.cpp Fri Nov 01 00:46:39 2019 +0000 @@ -686,7 +686,7 @@ u_p1 = Kp * motor1_error; //Integral part - if ( motor_curr_state == motor_finish || operation_curr_state == operation_movement || demo_curr_state == demo_XY ) { + if ( motor_curr_state == motor_finish || operation_curr_state == operation_movement || demo_curr_state == demo_XY || demo_curr_state == demo_positioning ) { error_integral1 = error_integral1 + ei1 * Ts; u_i1 = Ki * error_integral1; } @@ -719,7 +719,7 @@ u_p2 = Kp * motor2_error; //Integral part - if ( motor_curr_state == motor_finish || operation_curr_state == operation_movement || demo_curr_state == demo_XY ) { + if ( motor_curr_state == motor_finish || operation_curr_state == operation_movement || demo_curr_state == demo_XY || demo_curr_state == demo_positioning ) { error_integral2 = error_integral2 + ei2 * Ts; u_i2 = Ki * error_integral2; } @@ -1018,8 +1018,8 @@ timerStateChange.start(); } - Vx = 8.0; - Vy = 8.0; + Vx = 5.0; + Vy = 5.0; PID_controller(); motorControl();