diff --git a/controller_teensy/include/definitions.h b/controller_teensy/include/definitions.h index 2c8bdf6..d65548e 100644 --- a/controller_teensy/include/definitions.h +++ b/controller_teensy/include/definitions.h @@ -132,6 +132,8 @@ float max_filtered_wattAll; float min_filtered_wattAll; float max_meanSpeed; +float min_voltage; + float minSpeedms; //speed in m/s of slowest wheel double overallTrip; //m. trip with read distance from sd card double trip; //m. trip distance since boot diff --git a/controller_teensy/include/display.h b/controller_teensy/include/display.h index f5898e7..7e3afd0 100644 --- a/controller_teensy/include/display.h +++ b/controller_teensy/include/display.h @@ -248,10 +248,15 @@ void display_standingDisplay(ESCSerialComm& escFront, ESCSerialComm& escRear) { //Row 1 - display.print(F("Vbat:")); display.print(escFront.getFeedback_batVoltage()); - display.print(F("/")); display.print(escRear.getFeedback_batVoltage()); + if (!_displayOverall) { + display.print(F("Vbat:")); display.print(escFront.getFeedback_batVoltage()); + display.print(F("/")); display.print(escRear.getFeedback_batVoltage()); + }else{ + display.print(F("Vmin:")); display.print(min_voltage); + } display.print(" V"); display.println(); + //Row 2 @@ -322,10 +327,10 @@ void display_standingDisarmedDisplay(ESCSerialComm& escFront, ESCSerialComm& esc //Row2 - display.print("Throttle "); + display.print(F("Throttle ")); dtostrf(ads_throttle_A_raw,1,0,buf); display.print((String)buf); - display.print("/"); + display.print(F("/")); dtostrf(ads_throttle_B_raw,1,0,buf); display.print((String)buf); display.println(); @@ -335,6 +340,11 @@ void display_standingDisarmedDisplay(ESCSerialComm& escFront, ESCSerialComm& esc display.print("Brake "); dtostrf(ads_brake_raw,1,0,buf); display.print((String)buf); + + display.setCursor(6*10,0); + dtostrf((escFront.getFeedback_batVoltage()+escRear.getFeedback_batVoltage())/2.0,1,1,buf); + display.print((String)buf); + display.print(F('V')); display.println(); diff --git a/controller_teensy/src/main.cpp b/controller_teensy/src/main.cpp index 7012459..6a923e8 100644 --- a/controller_teensy/src/main.cpp +++ b/controller_teensy/src/main.cpp @@ -232,14 +232,17 @@ void loop() { max_filtered_currentAll=max(max_filtered_currentAll,filtered_currentAll); min_filtered_currentAll=min(min_filtered_currentAll,filtered_currentAll); - max_filtered_wattAll=max(max_filtered_wattAll,filtered_currentAll*(escFront.getFeedback_batVoltage()+escRear.getFeedback_batVoltage())/2.0); - min_filtered_wattAll=min(min_filtered_wattAll,filtered_currentAll*(escFront.getFeedback_batVoltage()+escRear.getFeedback_batVoltage())/2.0); + float _meanVoltage=(escFront.getFeedback_batVoltage()+escRear.getFeedback_batVoltage())/2.0; + max_filtered_wattAll=max(max_filtered_wattAll,filtered_currentAll*_meanVoltage); + min_filtered_wattAll=min(min_filtered_wattAll,filtered_currentAll*_meanVoltage); + min_voltage=min(min_voltage,_meanVoltage); max_meanSpeed=max(max_meanSpeed,(escFront.getMeanSpeed()+escRear.getMeanSpeed())/2); if (!armed) { //reset statistics if disarmed max_filtered_currentAll=0; min_filtered_currentAll=0; max_filtered_wattAll=0; min_filtered_wattAll=0; + min_voltage=99; max_meanSpeed=0; } }