Working version

This commit is contained in:
jazzpi
2022-07-18 16:56:38 +02:00
parent 1d70429708
commit 665ee02bf2
8 changed files with 67 additions and 23 deletions

View File

@ -33,6 +33,11 @@
#define AMS_PANIC_ID 0x42
#define AMS_LOGGING_ID 0x500
#define AMS_LOGGING_NUM_FRAMES 6
// Charger->Master IDs
#define CHARGER_START_CHARGING 0x446
#define BATTERY_VOLTAGE_TYPE 1
#define BATTERY_TEMP_TYPE 2
#define LOG_BAT_LOW_VOLTAGE 32768

View File

@ -12,7 +12,7 @@
#include "main.h"
#define SHUNT_OVERCURRENT 0x0FFFFFFF // Shunt Overcurrent Limit
#define SHUNT_TIMEOUT 3000 // Timeout after 500ms
#define SHUNT_TIMEOUT 500 // Timeout after 500ms
#define SHUNT_OVERTEMP 0xFFFFFFFF // Overtermperature of the Busbar
void CheckShuntLimits();

View File

@ -16,6 +16,8 @@
#define TS_DISCHARGE 3
#define TS_ERROR 4
#define TS_ACTIVE 1
#define TS_CHARGING_CHECK 5
#define TS_CHARGING 6
#define SEND_SHUNTDATA 0x01
#define SET_TSSTATE 0x02
@ -73,6 +75,7 @@ typedef struct {
} ErrorFlagHandler;
extern SlaveHandler slaves[NUMBEROFSLAVES];
extern uint16_t min_voltage, max_voltage, min_temp, max_temp;
extern ErrorFlagHandler errorflags;
extern TSHandler ctrltsstate;

View File

@ -4,7 +4,7 @@
#include "SPI_Communication.h"
#define SOCE_SHUNT_CURRENT_OFF_THRESH 20 /* mA */
#define CELL_VOLTAGE_CONVERSION_FACTOR 5.0f / 65535 /* V/quantum */
#define CELL_VOLTAGE_CONVERSION_FACTOR (5.0f / 65535) /* V/quantum */
#define BATTERY_CAPACITY (N_CELLS_PARALLEL * 2.5f * 3600) /* As */
extern uint8_t current_soc;