mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 17:59:27 +02:00
Improvement: Tesla blown pyro event (#808)
* Remove unnecessary includes * Add fuse blown event for Tesla
This commit is contained in:
parent
ffe583d551
commit
eb3ea8dbb4
5 changed files with 16 additions and 12 deletions
|
@ -2,8 +2,6 @@
|
|||
#ifdef CHADEMO_BATTERY
|
||||
#include "../datalayer/datalayer.h"
|
||||
#include "../devboard/utils/events.h"
|
||||
#include "../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
|
||||
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
||||
#include "CHADEMO-BATTERY-INTERNAL.h"
|
||||
#include "CHADEMO-BATTERY.h"
|
||||
#include "CHADEMO-SHUNTS.h"
|
||||
|
|
|
@ -22,8 +22,6 @@
|
|||
#ifdef CHADEMO_BATTERY
|
||||
#include "../datalayer/datalayer.h"
|
||||
#include "../devboard/utils/events.h"
|
||||
#include "../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
|
||||
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
||||
#include "CHADEMO-BATTERY-INTERNAL.h"
|
||||
#include "CHADEMO-BATTERY.h"
|
||||
#include "CHADEMO-SHUNTS.h"
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#ifndef CHADEMO_SHUNTS_H
|
||||
#define CHADEMO_SHUNTS_H
|
||||
|
||||
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
||||
|
||||
uint16_t get_measured_voltage();
|
||||
uint16_t get_measured_current();
|
||||
void ISA_handleFrame(CAN_frame* frame);
|
||||
|
|
|
@ -887,12 +887,18 @@ void update_values_battery() { //This function maps all the values fetched via
|
|||
|
||||
/* Value mapping is completed. Start to check all safeties */
|
||||
|
||||
if (battery_hvil_status ==
|
||||
3) { //INTERNAL_OPEN_FAULT - Someone disconnected a high voltage cable while battery was in use
|
||||
//INTERNAL_OPEN_FAULT - Someone disconnected a high voltage cable while battery was in use
|
||||
if (battery_hvil_status == 3) {
|
||||
set_event(EVENT_INTERNAL_OPEN_FAULT, 0);
|
||||
} else {
|
||||
clear_event(EVENT_INTERNAL_OPEN_FAULT);
|
||||
}
|
||||
//Voltage missing, pyrofuse most likely blown
|
||||
if (datalayer.battery.status.voltage_dV == 10) {
|
||||
set_event(EVENT_BATTERY_FUSE, 0);
|
||||
} else {
|
||||
clear_event(EVENT_BATTERY_FUSE);
|
||||
}
|
||||
|
||||
#ifdef TESLA_MODEL_3Y_BATTERY
|
||||
// Autodetect algoritm for chemistry on 3/Y packs.
|
||||
|
@ -2585,13 +2591,18 @@ void update_values_battery2() { //This function maps all the values fetched via
|
|||
battery2_cell_deviation_mV = (battery2_cell_max_v - battery2_cell_min_v);
|
||||
|
||||
/* Value mapping is completed. Start to check all safeties */
|
||||
|
||||
if (battery2_hvil_status ==
|
||||
3) { //INTERNAL_OPEN_FAULT - Someone disconnected a high voltage cable while battery was in use
|
||||
//INTERNAL_OPEN_FAULT - Someone disconnected a high voltage cable while battery was in use
|
||||
if (battery2_hvil_status == 3) {
|
||||
set_event(EVENT_INTERNAL_OPEN_FAULT, 2);
|
||||
} else {
|
||||
clear_event(EVENT_INTERNAL_OPEN_FAULT);
|
||||
}
|
||||
//Voltage missing, pyrofuse most likely blown
|
||||
if (datalayer.battery2.status.voltage_dV == 10) {
|
||||
set_event(EVENT_BATTERY_FUSE, 0);
|
||||
} else {
|
||||
clear_event(EVENT_BATTERY_FUSE);
|
||||
}
|
||||
|
||||
#ifdef TESLA_MODEL_3Y_BATTERY
|
||||
// Autodetect algoritm for chemistry on 3/Y packs.
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include "../../lib/ayushsharma82-ElegantOTA/src/ElegantOTA.h"
|
||||
#include "../../lib/mathieucarbou-AsyncTCPSock/src/AsyncTCP.h"
|
||||
#include "../../lib/mathieucarbou-ESPAsyncWebServer/src/ESPAsyncWebServer.h"
|
||||
#include "../../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
||||
|
||||
extern const char* version_number; // The current software version, shown on webserver
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue