Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Encoder HIDScope MODSERIAL QEI biquadFilter mbed
Diff: main.cpp
- Revision:
- 26:b3693f431d6f
- Parent:
- 25:d536056a2666
- Child:
- 27:b7caf668a682
- Child:
- 34:c672f5c0763f
--- a/main.cpp Thu Oct 08 14:25:46 2015 +0000 +++ b/main.cpp Thu Oct 08 19:17:56 2015 +0000 @@ -26,17 +26,17 @@ const double cw=0; // zero is clockwise (front view) const double ccw=1; // one is counterclockwise (front view) -const double Gain_P_turn=0.0067; +const double Gain_P_turn=10; //0.0067; // stel setpoint tussen (0 en 360) en position tussen (0 en 360) // max verschil: 360 -> dan pwm_to_motor 1 tot aan een verschil van 15 graden-> bij 15 moet pwm_to_motor ong 0.1 zijn // dus 0.1=15*gain gain=0.0067 // Als 3 graden verschil 0.1 dan 0.1/3=gain=0.33 - double Gain_I_turn=0.025; //(1/2000) //0.00000134 + double Gain_I_turn=0.1; //0.025; //(1/2000) //0.00000134 // pwm_motor_I=(integrate_error_turn + sample_time*error)*gain; pwm = (4*0.01 + 4)* Gain => 0.1 pwm gewenst (na 1 seconde een verschil van 4 graden) // 0.1 / (4.01) = Gain = 0.025 - double Gain_D_turn=0.01; + double Gain_D_turn=50; //0.01; // error_derivative_turn=(error - previous_error_turn)/sample_time //