Skip to content

Commit

Permalink
Add DTC for PDU LV current limit (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlim25 authored Nov 30, 2024
2 parents e87567a + 4428417 commit 2f3a0f6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions common/Data/DTC.csv
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ DTC CODE,NAME,ORIGIN,SEVERITY,SUBSCRIBERS,DATA,MESSAGE
66,PDU_Inverter_Overheat,PDU,4,VCU_BEAGLEBONE,NA,"INV: HotSpot > 45C, power derating in 30s"
67,PDU_Inverter_Derating_Power,PDU,4,VCU_BEAGLEBONE,NA,"INV: HotSpot > 45C, power derating in 30s"
68,PDU_Motor_Overheat,PDU,1,VCU_BEAGLEBONE,NA,"INV: Motor Temp > 100C"
69,PDU_Max_Current_Exceeded,PDU,3,VCU_BEAGLEBONE,NA,"LV Current > 30A"
2 changes: 1 addition & 1 deletion pdu/Inc/sensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const char *channelNames[NUM_PDU_CHANNELS];
#define LOW_VOLTAGE_LIMIT_VOLTS 10.0f

// Max LV Bus current
#define LV_MAX_CURRENT_AMPS 50.0f
#define LV_MAX_CURRENT_AMPS 30.0f
//
// TODO: Find this value
#define FUSE_BLOWN_MIN_CURRENT_AMPS 5.0
Expand Down
3 changes: 1 addition & 2 deletions pdu/Src/sensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,9 @@ void sensorTask(void *pvParameters)
{
ERROR_PRINT("Failed to send bus measurements on can!\n");
}

if (readBusCurrent() >= LV_MAX_CURRENT_AMPS) {
sendDTC_ERROR_PDU_Max_Current_Exceeded();
ERROR_PRINT("LV Current exceeded max value\n");
// TODO: Should we do anything?
}

if ((xTaskGetTickCount() - lastLvBattLowSent) > LV_BATTERY_VOLTAGE_LOW_DTC_PERIOD_MS && VoltageBusLV < 11.0f)
Expand Down

0 comments on commit 2f3a0f6

Please sign in to comment.