mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 09:49:32 +02:00
Remove more USER_SETTINGS
This commit is contained in:
parent
7328f7b99b
commit
aba193ca85
5 changed files with 25 additions and 29 deletions
|
@ -51,6 +51,14 @@ TaskHandle_t connectivity_loop_task;
|
|||
TaskHandle_t logging_loop_task;
|
||||
TaskHandle_t mqtt_loop_task;
|
||||
|
||||
/* Charger settings (Optional, when using generator charging) */
|
||||
volatile float CHARGER_SET_HV = 384; // Reasonably appropriate 4.0v per cell charging of a 96s pack
|
||||
volatile float CHARGER_MAX_HV = 420; // Max permissible output (VDC) of charger
|
||||
volatile float CHARGER_MIN_HV = 200; // Min permissible output (VDC) of charger
|
||||
volatile float CHARGER_MAX_POWER = 3300; // Max power capable of charger, as a ceiling for validating config
|
||||
volatile float CHARGER_MAX_A = 11.5; // Max current output (amps) of charger
|
||||
volatile float CHARGER_END_A = 1.0; // Current at which charging is considered complete
|
||||
|
||||
Logging logging;
|
||||
|
||||
// Initialization
|
||||
|
|
|
@ -22,29 +22,10 @@
|
|||
/* Connectivity options */
|
||||
//#define WIFICONFIG //Enable this line to set a static IP address / gateway /subnet mask for the device. see USER_SETTINGS.cpp for the settings
|
||||
|
||||
/* MQTT options */
|
||||
// #define MQTT // Enable this line to enable MQTT
|
||||
#define MQTT_QOS 0 // MQTT Quality of Service (0, 1, or 2)
|
||||
#define MQTT_PUBLISH_CELL_VOLTAGES // Enable this line to publish cell voltages to MQTT
|
||||
#define MQTT_TIMEOUT 2000 // MQTT timeout in milliseconds
|
||||
|
||||
// 500 = 50.0 °C , Max temperature (Will produce a battery overheat event if above)
|
||||
#define BATTERY_MAXTEMPERATURE 500
|
||||
// -250 = -25.0 °C , Min temperature (Will produce a battery frozen event if below)
|
||||
#define BATTERY_MINTEMPERATURE -250
|
||||
// 150 = 15.0 °C , Max difference between min and max temperature (Will produce a battery temperature deviation event if greater)
|
||||
#define BATTERY_MAX_TEMPERATURE_DEVIATION 150
|
||||
// 300 = 30.0A , Max charge in Amp (Some inverters needs to be limited)
|
||||
#define BATTERY_MAX_CHARGE_AMP 300
|
||||
// 300 = 30.0A , Max discharge in Amp (Some inverters needs to be limited)
|
||||
#define BATTERY_MAX_DISCHARGE_AMP 300
|
||||
// Enable this to manually set voltage limits on how much battery can be discharged/charged. Normally not used.
|
||||
#define BATTERY_USE_VOLTAGE_LIMITS false
|
||||
// 5000 = 500.0V , Target charge voltage (Value can be tuned on the fly via webserver). Not used unless BATTERY_USE_VOLTAGE_LIMITS = true
|
||||
#define BATTERY_MAX_CHARGE_VOLTAGE 5000
|
||||
// 3000 = 300.0V, Target discharge voltage (Value can be tuned on the fly via webserver). Not used unless BATTERY_USE_VOLTAGE_LIMITS = true
|
||||
#define BATTERY_MAX_DISCHARGE_VOLTAGE 3000
|
||||
|
||||
/* Do not change any code below this line */
|
||||
/* Only change battery specific settings above and in "USER_SETTINGS.cpp" */
|
||||
typedef struct {
|
||||
|
|
|
@ -27,8 +27,9 @@ void DalyBms::update_values() {
|
|||
datalayer.battery.status.current_dA = current_dA; //value is *10 (150 = 15.0)
|
||||
datalayer.battery.status.remaining_capacity_Wh = (remaining_capacity_mAh * (uint32_t)voltage_dV) / 10000;
|
||||
|
||||
datalayer.battery.status.max_charge_power_W = (BATTERY_MAX_CHARGE_AMP * voltage_dV) / 100;
|
||||
datalayer.battery.status.max_discharge_power_W = (BATTERY_MAX_DISCHARGE_AMP * voltage_dV) / 100;
|
||||
datalayer.battery.status.max_charge_power_W = (datalayer.battery.settings.max_user_set_charge_dA * voltage_dV) / 100;
|
||||
datalayer.battery.status.max_discharge_power_W =
|
||||
(datalayer.battery.settings.max_user_set_discharge_dA * voltage_dV) / 100;
|
||||
|
||||
// limit power when SoC is low or high
|
||||
uint32_t adaptive_power_limit = 999999;
|
||||
|
|
|
@ -128,18 +128,22 @@ struct DATALAYER_BATTERY_SETTINGS_TYPE {
|
|||
* will "see" 100% Example 8000 = 80.0%*/
|
||||
uint16_t max_percentage = 8000;
|
||||
|
||||
/** The user specified maximum allowed charge rate, in deciAmpere. 300 = 30.0 A */
|
||||
uint16_t max_user_set_charge_dA = BATTERY_MAX_CHARGE_AMP;
|
||||
/** The user specified maximum allowed discharge rate, in deciAmpere. 300 = 30.0 A */
|
||||
uint16_t max_user_set_discharge_dA = BATTERY_MAX_DISCHARGE_AMP;
|
||||
/** The user specified maximum allowed charge rate, in deciAmpere. 300 = 30.0 A
|
||||
* Updates later on via Settings
|
||||
*/
|
||||
uint16_t max_user_set_charge_dA = 300;
|
||||
/** The user specified maximum allowed discharge rate, in deciAmpere. 300 = 30.0 A
|
||||
* Updates later on via Settings
|
||||
*/
|
||||
uint16_t max_user_set_discharge_dA = 300;
|
||||
|
||||
/** User specified discharge/charge voltages in use. Set to true to use user specified values */
|
||||
/** Some inverters like to see a specific target voltage for charge/discharge. Use these values to override automatic voltage limits*/
|
||||
bool user_set_voltage_limits_active = BATTERY_USE_VOLTAGE_LIMITS;
|
||||
bool user_set_voltage_limits_active = false;
|
||||
/** The user specified maximum allowed charge voltage, in deciVolt. 4000 = 400.0 V */
|
||||
uint16_t max_user_set_charge_voltage_dV = BATTERY_MAX_CHARGE_VOLTAGE;
|
||||
uint16_t max_user_set_charge_voltage_dV = 4500;
|
||||
/** The user specified maximum allowed discharge voltage, in deciVolt. 3000 = 300.0 V */
|
||||
uint16_t max_user_set_discharge_voltage_dV = BATTERY_MAX_DISCHARGE_VOLTAGE;
|
||||
uint16_t max_user_set_discharge_voltage_dV = 3000;
|
||||
|
||||
/** The user specified BMS reset period. Keeps track on how many milliseconds should we keep power off during daily BMS reset */
|
||||
uint16_t user_set_bms_reset_duration_ms = 30000;
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
#include <string>
|
||||
|
||||
#define MAX_CAN_FAILURES 50
|
||||
|
||||
#define BATTERY_MAX_TEMPERATURE_DEVIATION 150 // 150 = 15.0 °C
|
||||
#define BATTERY_MAXTEMPERATURE 500
|
||||
#define BATTERY_MINTEMPERATURE -250
|
||||
#define MAX_CHARGE_DISCHARGE_LIMIT_FAILURES 5
|
||||
|
||||
//battery pause status begin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue