Compare commits

..

No commits in common. "6c69e4c8955197fd5cd9ee8968326f0cd3cf08fc" and "07ac01b993f2b8fcf46eca8326165a6ef6f1a4d0" have entirely different histories.

3 changed files with 30 additions and 35 deletions

View File

@ -48,7 +48,6 @@ int16_t throttle_pos=0;
int16_t brake_pos=0; int16_t brake_pos=0;
unsigned long loopmillis; unsigned long loopmillis;
unsigned long looptime_duration;
#define ADSREADPERIOD 3 //set slightly higher as actual read time to avoid unnecessary register query #define ADSREADPERIOD 3 //set slightly higher as actual read time to avoid unnecessary register query

View File

@ -65,41 +65,39 @@ void loggingLoop(unsigned long loopmillis,ESCSerialComm& escFront, ESCSerialComm
dataFile.print("current_FrontL,current_FrontR,current_RearL,current_RearR,"); dataFile.print("current_FrontL,current_FrontR,current_RearL,current_RearR,");
dataFile.print("rpm_FrontL,rpm_FrontR,rpm_RearL,rpm_RearR,"); dataFile.print("rpm_FrontL,rpm_FrontR,rpm_RearL,rpm_RearR,");
dataFile.print("temp_Front,temp_Rear,vbat_Front,vbat_Rear,"); dataFile.print("temp_Front,temp_Rear,vbat_Front,vbat_Rear,");
dataFile.print("currentAll,throttle,brake,speed,trip_Front,trip_Rear,currentConsumed_Front,currentConsumed_Rear,"); dataFile.print("currentAll,throttle,brake,speed,trip_Front,trip_Rear,currentConsumed_Front,currentConsumed_Rear");
dataFile.println("temp_ESCFront,temp_ESCRear,temp_Air,looptime_duration"); dataFile.println("temp_ESCFront,temp_ESCRear,temp_Air");
dataFile.print("#TIMESTAMP:"); dataFile.println(now()); dataFile.print("#TIMESTAMP:"); dataFile.println(now());
logging_headerWritten=true; logging_headerWritten=true;
} }
dataFile.print(loopmillis/1000.0,3); dataFile.print(","); dataFile.print(loopmillis/1000.0,3); dataFile.print(";");
dataFile.print(escFront.getCmdL()); dataFile.print(","); dataFile.print(escFront.getCmdL()); dataFile.print(";");
dataFile.print(escFront.getCmdR()); dataFile.print(","); dataFile.print(escFront.getCmdR()); dataFile.print(";");
dataFile.print(escRear.getCmdL()); dataFile.print(","); dataFile.print(escRear.getCmdL()); dataFile.print(";");
dataFile.print(escRear.getCmdR()); dataFile.print(","); dataFile.print(escRear.getCmdR()); dataFile.print(";");
dataFile.print(escFront.getFiltered_curL(),3); dataFile.print(","); dataFile.print(escFront.getFiltered_curL(),3); dataFile.print(";");
dataFile.print(escFront.getFiltered_curR(),3); dataFile.print(","); dataFile.print(escFront.getFiltered_curR(),3); dataFile.print(";");
dataFile.print(escRear.getFiltered_curL(),3); dataFile.print(","); dataFile.print(escRear.getFiltered_curL(),3); dataFile.print(";");
dataFile.print(escRear.getFiltered_curR(),3); dataFile.print(","); dataFile.print(escRear.getFiltered_curR(),3); dataFile.print(";");
dataFile.print(escFront.getFeedback_speedL_meas()); dataFile.print(","); //+ //Todo: check if speed for R wheels needs to be negated dataFile.print(escFront.getFeedback_speedL_meas()); dataFile.print(";"); //+ //Todo: check if speed for R wheels needs to be negated
dataFile.print(escFront.getFeedback_speedR_meas()); dataFile.print(","); //- dataFile.print(escFront.getFeedback_speedR_meas()); dataFile.print(";"); //-
dataFile.print(escRear.getFeedback_speedL_meas()); dataFile.print(","); //+ dataFile.print(escRear.getFeedback_speedL_meas()); dataFile.print(";"); //+
dataFile.print(escRear.getFeedback_speedR_meas()); dataFile.print(","); //- dataFile.print(escRear.getFeedback_speedR_meas()); dataFile.print(";"); //-
dataFile.print(escFront.getFeedback_boardTemp()); dataFile.print(","); dataFile.print(escFront.getFeedback_boardTemp()); dataFile.print(";");
dataFile.print(escRear.getFeedback_boardTemp()); dataFile.print(","); dataFile.print(escRear.getFeedback_boardTemp()); dataFile.print(";");
dataFile.print(escFront.getFeedback_batVoltage()); dataFile.print(","); dataFile.print(escFront.getFeedback_batVoltage()); dataFile.print(";");
dataFile.print(escRear.getFeedback_batVoltage()); dataFile.print(","); dataFile.print(escRear.getFeedback_batVoltage()); dataFile.print(";");
dataFile.print(filtered_currentAll,3); dataFile.print(","); dataFile.print(filtered_currentAll,3); dataFile.print(";");
dataFile.print(throttle_pos); dataFile.print(","); dataFile.print(throttle_pos); dataFile.print(";");
dataFile.print(brake_pos); dataFile.print(","); dataFile.print(brake_pos); dataFile.print(";");
dataFile.print((escFront.getMeanSpeed()+escRear.getMeanSpeed())/2.0); dataFile.print(","); dataFile.print((escFront.getMeanSpeed()+escRear.getMeanSpeed())/2.0); dataFile.print(";");
dataFile.print(escFront.getTrip()); dataFile.print(","); dataFile.print(escFront.getTrip()); dataFile.print(";");
dataFile.print(escRear.getTrip()); dataFile.print(","); dataFile.print(escRear.getTrip()); dataFile.print(";");
dataFile.print(escFront.getCurrentConsumed(),3); dataFile.print(","); dataFile.print(escFront.getCurrentConsumed(),3); dataFile.print(";");
dataFile.print(escRear.getCurrentConsumed(),3); dataFile.print(","); dataFile.print(escRear.getCurrentConsumed(),3); dataFile.print(";");
dataFile.print(temp_ESCFront,2); dataFile.print(","); dataFile.print(temp_ESCFront,2); dataFile.print(";");
dataFile.print(temp_ESCRear,2); dataFile.print(","); dataFile.print(temp_ESCRear,2); dataFile.print(";");
dataFile.print(temp_Air,2); dataFile.print(","); dataFile.print(temp_Air,2); dataFile.print(";");
dataFile.print(looptime_duration,0); dataFile.print(",");
dataFile.println(""); dataFile.println("");
dataFile.close(); dataFile.close();
} }

View File

@ -312,8 +312,6 @@ void loop() {
} }
looptime_duration=max(looptime_duration,loopmillis-millis());
} }