Beste Version

Dependencies:   mbed

Fork of Roboshark_V8 by Roboshark

Files at this revision

API Documentation at this revision

Comitter:
ahlervin
Date:
Wed May 09 17:08:24 2018 +0000
Parent:
12:cd07a80f0a9a
Commit message:
Optimaler Regler und Schnellster Speed

Changed in this revision

Fahren.cpp Show annotated file Show diff for this revision Revisions of this file
IRSensor.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Fahren.cpp	Tue May 08 10:48:05 2018 +0000
+++ b/Fahren.cpp	Wed May 09 17:08:24 2018 +0000
@@ -17,8 +17,8 @@
 //Konstruktor
 Fahren::Fahren(Controller& controller, EncoderCounter& counterLeft, EncoderCounter& counterRight, IRSensor& iRSensor):
     controller(controller), counterLeft(counterLeft), counterRight(counterRight), iRSensor (iRSensor){
-SpeedR = 100.0f;
-SpeedL = 100.0f;
+SpeedR = 120.0f; //120
+SpeedL = 120.0f; //120
 disF = 0.0f;
 //ticker.attach(callback(this, &Fahren::reset), PERIOD);
 }
@@ -50,14 +50,14 @@
     reglerEinL = 1;
     
     while(1){
-    float diff = (iRSensor.readR() - iRSensor.readL())*0.85f;            //Regler
+    float diff = (iRSensor.readR() - iRSensor.readL())*0.81f;            //Regler 0.81
     if(iRSensor.readR()>80.0f) diff=0;
     if(iRSensor.readL()>80.0f) diff=0;
     //printf("diff =%f \n",diff);
     controller.setDesiredSpeedRight(SpeedR+diff);
     controller.setDesiredSpeedLeft(-(SpeedL-diff));
     
-    wait(0.05);
+    wait(0.02); //0.02
        
        // printf("Encoderrechts %d \n\r", counterRight.read());                   //Debugging Zweck (Putty benutzen!)
        // printf("Encoderlinks %d \n\r", counterLeft.read());                     //Debugging Zweck (Putty benutzen!)
--- a/IRSensor.cpp	Tue May 08 10:48:05 2018 +0000
+++ b/IRSensor.cpp	Wed May 09 17:08:24 2018 +0000
@@ -30,7 +30,7 @@
     const int IRSensor :: minIrR = 88;         // minimal Distanzen
     const int IRSensor :: minIrL = 88;
     const int IRSensor :: minIrF = 79;
-    const float IRSensor :: Period = 0.05;       // Ticker Periode
+    const float IRSensor :: Period = 0.02;       // Ticker Periode