CUER / Mbed 2 deprecated BMS_BMUCore_Max

Dependencies:   CUER_CAN CUER_DS1820 LTC2943 LTC6804 mbed PowerControl

Files at this revision

API Documentation at this revision

Comitter:
ItsJustZi
Date:
Sun Jul 09 17:27:12 2017 +0000
Parent:
28:f1f882bd1653
Child:
30:d90895e96226
Commit message:
Working SoC and working voltage measurements

Changed in this revision

CANParserBMU.cpp Show annotated file Show diff for this revision Revisions of this file
CANParserBMU.h 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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/CANParserBMU.cpp	Sun Jul 09 16:58:32 2017 +0000
+++ b/CANParserBMU.cpp	Sun Jul 09 17:27:12 2017 +0000
@@ -90,7 +90,7 @@
     voltData.importCANData(msg);
     int repeating_length = NO_READINGS_PER_CMU /4 + 1; 
     int offset = msg.id - BMS_BASE_ID;
-    if(offset <= 0 || offset >= 0x100 || offset % 4 == 1)
+    if(offset <= 0 || offset >= 0x10 || offset % 4 == 1)
         return false;  
     
     int cellsubset = ((offset-1) % repeating_length) - 1; //Which set of 4 voltages within the CMU
--- a/CANParserBMU.h	Sun Jul 09 16:58:32 2017 +0000
+++ b/CANParserBMU.h	Sun Jul 09 17:27:12 2017 +0000
@@ -13,37 +13,38 @@
 #define BATTERY_PACK_STATUS_ID 0xFA
 
 //@TODO add some comments
+//@TODO Heartbeat
 CANMessage createTemperatureTelemetry(uint8_t offset, char * ROMID, float Temperature);
 
-individual_temperature decodeTemperatureTelemetry(CANMessage msg);
+individual_temperature decodeTemperatureTelemetry(CANMessage msg); //working
 
-CANMessage createVoltageTelemetry(int ID, uint16_t voltage[]);
+CANMessage createVoltageTelemetry(int ID, uint16_t voltage[]); //working
 
-bool decodeVoltageTelemetry(CANMessage msg, CMU_voltage readings[NO_CMUS]);
+bool decodeVoltageTelemetry(CANMessage msg, CMU_voltage readings[NO_CMUS]); //working
 
-CANMessage createPackSOC(float SOC, float percentageCharge);
+CANMessage createPackSOC(float SOC, float percentageCharge); //working
 
-float decodePackSOC(CANMessage msg);
+float decodePackSOC(CANMessage msg); //working
 
-float decodePackSOCPercentage(CANMessage msg);
+float decodePackSOCPercentage(CANMessage msg);//working
 
-CANMessage createPackBalanceSOC(float SOC, float percentageCharge);
+CANMessage createPackBalanceSOC(float SOC, float percentageCharge); //unused (and untested)
 
-CANMessage createCellVoltageMAXMIN(pack_voltage_extremes max_voltage, pack_voltage_extremes min_voltage);
+CANMessage createCellVoltageMAXMIN(pack_voltage_extremes max_voltage, pack_voltage_extremes min_voltage); //untested
 
-void decodeCellVoltageMAXMIN(CANMessage msg, pack_voltage_extremes &min, pack_voltage_extremes &max);
+void decodeCellVoltageMAXMIN(CANMessage msg, pack_voltage_extremes &min, pack_voltage_extremes &max); //untested
 
-CANMessage createCellTemperatureMAXMIN(pack_temperature_extremes ex_temperature, bool isMin);
+CANMessage createCellTemperatureMAXMIN(pack_temperature_extremes ex_temperature, bool isMin); //working
 
-pack_temperature_extremes decodeCellTemperatureMAXMIN(CANMessage msg);
+pack_temperature_extremes decodeCellTemperatureMAXMIN(CANMessage msg); //working
 
-CANMessage createBatteryVI(uint32_t batteryVoltage,uint32_t batteryCurrent);
+CANMessage createBatteryVI(uint32_t batteryVoltage,uint32_t batteryCurrent); //battery current working, voltage unfinished
 
-CANMessage createBatteryPackStatus(uint16_t voltageThreshold[], uint8_t statusFlag,uint8_t BMS_CMU_Count,uint16_t BMS_Firmware_Build);
+CANMessage createBatteryPackStatus(uint16_t voltageThreshold[], uint8_t statusFlag,uint8_t BMS_CMU_Count,uint16_t BMS_Firmware_Build); //unused (i think?)
 
-CANMessage createExtendedBatteryPackStatus(uint32_t status);
+CANMessage createExtendedBatteryPackStatus(uint32_t status); //Unsure if its working
 
-uint32_t decodeExtendedBatteryPackStatus(CANMessage msg);
+uint32_t decodeExtendedBatteryPackStatus(CANMessage msg); //Unsure if its working
 
 
 union float2byte {
--- a/main.cpp	Sun Jul 09 16:58:32 2017 +0000
+++ b/main.cpp	Sun Jul 09 17:27:12 2017 +0000
@@ -78,7 +78,6 @@
         //Store data in the eeprom
         write_SOC_EEPROM(measurements, current_EEPROM_address);
         */
-        printf("Beginning of loop \r\n");
         // CAN bus
         CAN_data_sent = false;//Currently does nothing, adding this line in more places then using
         //while(!CAN_data_sent); in order to ensure sending completes
@@ -91,9 +90,7 @@
         loop_delay.attach(loop_delay_callback, LOOP_DELAY_S);
         while (!delay_finished) sleep();
         */
-        printf("BEFORE THE WAIT \r\n");
         wait(1);
-        printf("AFTER THE WAIT \r\n");
     } 
 }
 
@@ -430,9 +427,8 @@
     {
         //voltage
         if(decodeVoltageTelemetry(msgArray[i], voltage_readings))
-            printf("we made it inside the if \r\n");//continue;
+            continue;
         //temperature 
-        printf("We made it past the if statement \r\n");
         if(msgArray[i].id >= 0x700)
         {
             individual_temperature dataPoint = decodeTemperatureTelemetry(msgArray[i]);
--- a/mbed.bld	Sun Jul 09 16:58:32 2017 +0000
+++ b/mbed.bld	Sun Jul 09 17:27:12 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/9baf128c2fab
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/22da6e220af6
\ No newline at end of file