EMG driven robot which shoots elastic bands
Fork of ROBOBIRDS_FINAL by
Diff: main.cpp
- Revision:
- 41:327c9f229608
- Parent:
- 40:cac08f589732
--- a/main.cpp Thu Oct 29 15:15:45 2015 +0000 +++ b/main.cpp Tue Nov 03 10:04:54 2015 +0000 @@ -56,7 +56,7 @@ bool OutRange = false; //In Range or not // Motor 2 (Rotation) -const double n2 = 0.334; +const double n2 = 0.27/2; // 40 degrees of rotation to left and right int Pulses2; double Rotatie2 = 0; double Goal2; @@ -68,7 +68,7 @@ const double Kd2 = 10; const double Ki2 = 0.2; double v2 = 0; -double turnlimit = 0.4; +double turnlimit; // Margin 2 = 0 bool OutRange2 = false; @@ -272,10 +272,10 @@ ledC = 1; TijdEMGCal.stop(); TijdEMGCal.reset(); - T1 = 0.35*Max; // Determination of thresholds - T2 = 0.5*Max; - T3 = 0.35*Max2; - T4 = 0.5*Max2; + T1 = 0.3*Max; // Determination of thresholds + T2 = 0.55*Max; + T3 = 0.25*Max2; + T4 = 0.45*Max2; wait (3); Excecute = true; } @@ -337,11 +337,11 @@ if (Rotatie2 >= -turnlimit && Rotatie2 <= turnlimit && OutRange2 == false) { //EMG aansturing when in range / not OutRange if (y18 >= T4 ) { Direction2 = 1; - v2 = 0.06; + v2 = 0.055; } if (y18 > T3 && y18 < T4) { Direction2 = 0; - v2 = 0.06; + v2 = 0.055; } if (y18 <= T3) { Direction2 = 0;