Updated Regen Braking Logic.

Dependencies:   mbed millis

Files at this revision

API Documentation at this revision

Comitter:
cdevarakonda
Date:
Wed Jun 15 13:38:05 2022 +0000
Parent:
28:1086791972d0
Commit message:
added brake control redundancy

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Jun 15 13:36:11 2022 +0000
+++ b/main.cpp	Wed Jun 15 13:38:05 2022 +0000
@@ -64,6 +64,7 @@
     motor1.throttle(0.0f);
     brakeValve32 = 0;
     brakeValve22 = 0;
+    //inParkMode=true;
       //brakes1.BrakesOn();
   }
   else {//REGEN BRAKING
@@ -345,7 +346,8 @@
           motor1.throttle(0);
         }
         ////Park Mode
-        if (driveMode == 2) {                             //place in park mode if selected by driver
+        if (driveMode == 2) {     
+        brakeControl(4);                        //place in park mode if selected by driver
           if (inParkMode == false) {
             pc.printf("Train in park mode.\r\n"); //why?
           }