Railway Challenge / Mbed 2 deprecated challenge-ChaiUpdated-AutostopTest-30Throttle

Dependencies:   mbed millis

Files at this revision

API Documentation at this revision

Comitter:
jamesmcildowietfl
Date:
Mon Jun 20 09:55:35 2022 +0000
Parent:
32:771f6d99a77b
Commit message:
30% Throttle, terminal velocity, then grade level 2 brake, dont use EM

Changed in this revision

challenge.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/challenge.cpp	Mon Jun 20 09:49:27 2022 +0000
+++ b/challenge.cpp	Mon Jun 20 09:55:35 2022 +0000
@@ -26,7 +26,7 @@
     autoStopInProgress = false;         // Flag if auto-stop track-side sensor has been detected and auto-stop is in progress
     autoStopCruiseSpeed = 0;            // Speed of loco at time of auto-stop trackside sensor triggering so loco can maintain this speed without operator input
     autoStopThrottle = 0;               // Throttle rate applied at the time of triggering autostop
-    targetDistance = 25.00f;            // How far in meters to bring the loco to a stop
+    targetDistance = 7.50f;            // How far in meters to bring the loco to a stop
     remainingDistance = targetDistance; // How far the loco has left to go before reaching target distance
     decelerationGradient = 0;           // Gradient of y=mx+c linear speed-distance curve that is used in this auto-stop version
     requiredSpeed = 0;                  // How fast the loco should be going according to y=mx+c line
--- a/main.cpp	Mon Jun 20 09:49:27 2022 +0000
+++ b/main.cpp	Mon Jun 20 09:55:35 2022 +0000
@@ -81,31 +81,39 @@
       break;
 
     case 7 ... 8:
-      motor1.throttle(0.4f);
+      //motor1.throttle(0.4f);
+      motor1.throttle(0.3f);
       break;
 
     case 9 ... 10:
-      motor1.throttle(0.5f);
+      //motor1.throttle(0.5f);
+      motor1.throttle(0.3f);
       break;
 
     case 11:
-      motor1.throttle(0.6f);
+      //motor1.throttle(0.6f);
+      motor1.throttle(0.3f);
       break;
 
     case 12:
-      motor1.throttle(0.7f);
+      //motor1.throttle(0.7f);
+      motor1.throttle(0.3f);
       break;
 
     case 13:
-      motor1.throttle(0.8f);
+      //motor1.throttle(0.8f);
+      motor1.throttle(0.3f);
       break;
 
     case 14:
-      motor1.throttle(0.9f);
+      //motor1.throttle(0.9f);
+      motor1.throttle(0.3f);
       break;
 
     case 15:
-      motor1.throttle(1.0f);
+      //motor1.throttle(1.0f);
+      motor1.throttle(0.3f);
+      
       break;
   }
 }