mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 01:39:30 +02:00
Implement contactor opening in FAULT
This commit is contained in:
parent
895fd9a9ac
commit
e235f69eff
2 changed files with 8 additions and 2 deletions
|
@ -174,6 +174,12 @@ void FordMachEBattery::transmit_can(unsigned long currentMillis) {
|
||||||
if (currentMillis - previousMillis20 >= INTERVAL_20_MS) {
|
if (currentMillis - previousMillis20 >= INTERVAL_20_MS) {
|
||||||
previousMillis20 = currentMillis;
|
previousMillis20 = currentMillis;
|
||||||
|
|
||||||
|
if (datalayer.battery.status.bms_status == FAULT) {
|
||||||
|
FORD_25B.data.u8[2] = 0x01;
|
||||||
|
} else {
|
||||||
|
FORD_25B.data.u8[2] = 0x09;
|
||||||
|
}
|
||||||
|
|
||||||
transmit_can_frame(&FORD_25B);
|
transmit_can_frame(&FORD_25B);
|
||||||
|
|
||||||
//Full vehicle emulation, not required
|
//Full vehicle emulation, not required
|
||||||
|
|
|
@ -18,7 +18,7 @@ class FordMachEBattery : public CanBattery {
|
||||||
static const int MAX_CELL_VOLTAGE_MV = 4250;
|
static const int MAX_CELL_VOLTAGE_MV = 4250;
|
||||||
static const int MIN_CELL_VOLTAGE_MV = 2900;
|
static const int MIN_CELL_VOLTAGE_MV = 2900;
|
||||||
|
|
||||||
unsigned long previousMillis10 = 0; // will store last time a 10ms CAN Message was send
|
unsigned long previousMillis20 = 0; // will store last time a 20ms CAN Message was send
|
||||||
unsigned long previousMillis30 = 0; // will store last time a 10ms CAN Message was send
|
unsigned long previousMillis30 = 0; // will store last time a 10ms CAN Message was send
|
||||||
unsigned long previousMillis50 = 0; // will store last time a 100ms CAN Message was send
|
unsigned long previousMillis50 = 0; // will store last time a 100ms CAN Message was send
|
||||||
unsigned long previousMillis100 = 0; // will store last time a 100ms CAN Message was send
|
unsigned long previousMillis100 = 0; // will store last time a 100ms CAN Message was send
|
||||||
|
@ -46,7 +46,7 @@ class FordMachEBattery : public CanBattery {
|
||||||
.ext_ID = false,
|
.ext_ID = false,
|
||||||
.DLC = 8,
|
.DLC = 8,
|
||||||
.ID = 0x185,
|
.ID = 0x185,
|
||||||
.data = {0x03, 0x4E, 0x75, 0x32, 0x00, 0x00, 0x00, 0x00}};
|
.data = {0x03, 0x4E, 0x75, 0x32, 0x00, 0x80, 0x00, 0x00}};
|
||||||
//Messages to emulate full vehicle
|
//Messages to emulate full vehicle
|
||||||
/*
|
/*
|
||||||
CAN_frame FORD_47 = {.FD = false,
|
CAN_frame FORD_47 = {.FD = false,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue