mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-05 19:42:08 +02:00
Increase datatypes for W over 60kW
This commit is contained in:
parent
3e641b7ab7
commit
6c1777550d
29 changed files with 203 additions and 189 deletions
|
@ -56,20 +56,20 @@ ModbusServerRTU MBserver(Serial2, 2000);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Common system parameters. Batteries map their values to these variables
|
// Common system parameters. Batteries map their values to these variables
|
||||||
uint32_t system_capacity_Wh = BATTERY_WH_MAX; //Wh, 0-150000Wh
|
uint32_t system_capacity_Wh = BATTERY_WH_MAX; //Wh, 0-250000 Wh
|
||||||
uint32_t system_remaining_capacity_Wh = BATTERY_WH_MAX; //Wh, 0-150000Wh
|
uint32_t system_remaining_capacity_Wh = BATTERY_WH_MAX; //Wh, 0-250000 Wh
|
||||||
int16_t system_temperature_max_dC = 0; //C+1, -50.0 - 50.0
|
int16_t system_temperature_max_dC = 0; //C+1, -50.0 - 50.0
|
||||||
int16_t system_temperature_min_dC = 0; //C+1, -50.0 - 50.0
|
int16_t system_temperature_min_dC = 0; //C+1, -50.0 - 50.0
|
||||||
int16_t system_active_power_W = 0; //Watts, -32000 to 32000
|
int32_t system_active_power_W = 0; //Watts, -200000 to 200000 W
|
||||||
int16_t system_battery_current_dA = 0; //A+1, -1000 - 1000
|
int16_t system_battery_current_dA = 0; //A+1, -1000 - 1000
|
||||||
uint16_t system_battery_voltage_dV = 3700; //V+1, 0-500.0 (0-5000)
|
uint16_t system_battery_voltage_dV = 3700; //V+1, 0-1000.0 (0-10000)
|
||||||
uint16_t system_max_design_voltage_dV = 5000; //V+1, 0-500.0 (0-5000)
|
uint16_t system_max_design_voltage_dV = 5000; //V+1, 0-1000.0 (0-10000)
|
||||||
uint16_t system_min_design_voltage_dV = 2500; //V+1, 0-500.0 (0-5000)
|
uint16_t system_min_design_voltage_dV = 2500; //V+1, 0-1000.0 (0-10000)
|
||||||
uint16_t system_scaled_SOC_pptt = 5000; //SOC%, 0-100.00 (0-10000)
|
uint16_t system_scaled_SOC_pptt = 5000; //SOC%, 0-100.00 (0-10000)
|
||||||
uint16_t system_real_SOC_pptt = 5000; //SOC%, 0-100.00 (0-10000)
|
uint16_t system_real_SOC_pptt = 5000; //SOC%, 0-100.00 (0-10000)
|
||||||
uint16_t system_SOH_pptt = 9900; //SOH%, 0-100.00 (0-10000)
|
uint16_t system_SOH_pptt = 9900; //SOH%, 0-100.00 (0-10000)
|
||||||
uint16_t system_max_discharge_power_W = 0; //Watts, 0 to 65535
|
uint32_t system_max_discharge_power_W = 0; //Watts, 0 to 100000
|
||||||
uint16_t system_max_charge_power_W = 4312; //Watts, 0 to 65535
|
uint32_t system_max_charge_power_W = 4312; //Watts, 0 to 100000
|
||||||
uint16_t system_cell_max_voltage_mV = 3700; //mV, 0-5000 , Stores the highest cell millivolt value
|
uint16_t system_cell_max_voltage_mV = 3700; //mV, 0-5000 , Stores the highest cell millivolt value
|
||||||
uint16_t system_cell_min_voltage_mV = 3700; //mV, 0-5000, Stores the minimum cell millivolt value
|
uint16_t system_cell_min_voltage_mV = 3700; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages. Oversized to accomodate all setups
|
uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages. Oversized to accomodate all setups
|
||||||
|
|
|
@ -8,20 +8,20 @@
|
||||||
#define BATTERY_SELECTED
|
#define BATTERY_SELECTED
|
||||||
|
|
||||||
// These parameters need to be mapped for the inverter
|
// These parameters need to be mapped for the inverter
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
||||||
|
|
|
@ -8,20 +8,20 @@
|
||||||
#define BATTERY_SELECTED
|
#define BATTERY_SELECTED
|
||||||
|
|
||||||
// These parameters need to be mapped for the inverter
|
// These parameters need to be mapped for the inverter
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
||||||
|
|
|
@ -8,20 +8,20 @@
|
||||||
#define BATTERY_SELECTED
|
#define BATTERY_SELECTED
|
||||||
|
|
||||||
// These parameters need to be mapped for the inverter
|
// These parameters need to be mapped for the inverter
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
||||||
|
|
|
@ -8,20 +8,20 @@
|
||||||
#define BATTERY_SELECTED
|
#define BATTERY_SELECTED
|
||||||
|
|
||||||
// These parameters need to be mapped for the inverter
|
// These parameters need to be mapped for the inverter
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
||||||
|
|
|
@ -14,20 +14,20 @@
|
||||||
#define MAX_CELL_DEVIATION_MV 500 //LED turns yellow on the board if mv delta exceeds this value
|
#define MAX_CELL_DEVIATION_MV 500 //LED turns yellow on the board if mv delta exceeds this value
|
||||||
|
|
||||||
// These parameters need to be mapped for the inverter
|
// These parameters need to be mapped for the inverter
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
||||||
|
|
|
@ -14,20 +14,20 @@
|
||||||
#define MAX_CELL_DEVIATION_MV 500 //LED turns yellow on the board if mv delta exceeds this value
|
#define MAX_CELL_DEVIATION_MV 500 //LED turns yellow on the board if mv delta exceeds this value
|
||||||
|
|
||||||
// These parameters need to be mapped for the inverter
|
// These parameters need to be mapped for the inverter
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
||||||
|
|
|
@ -8,20 +8,20 @@
|
||||||
#define BATTERY_SELECTED
|
#define BATTERY_SELECTED
|
||||||
|
|
||||||
// These parameters need to be mapped for the inverter
|
// These parameters need to be mapped for the inverter
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
||||||
|
|
|
@ -34,10 +34,10 @@ void __getData() {
|
||||||
system_battery_current_dA = (int16_t)dataLinkReceive.getReceivedData(3);
|
system_battery_current_dA = (int16_t)dataLinkReceive.getReceivedData(3);
|
||||||
system_capacity_Wh = (uint32_t)(dataLinkReceive.getReceivedData(4) * 10); //add back missing decimal
|
system_capacity_Wh = (uint32_t)(dataLinkReceive.getReceivedData(4) * 10); //add back missing decimal
|
||||||
system_remaining_capacity_Wh = (uint32_t)(dataLinkReceive.getReceivedData(5) * 10); //add back missing decimal
|
system_remaining_capacity_Wh = (uint32_t)(dataLinkReceive.getReceivedData(5) * 10); //add back missing decimal
|
||||||
system_max_discharge_power_W = (uint16_t)dataLinkReceive.getReceivedData(6);
|
system_max_discharge_power_W = (uint32_t)(dataLinkReceive.getReceivedData(6) * 10); //add back missing decimal
|
||||||
system_max_charge_power_W = (uint16_t)dataLinkReceive.getReceivedData(7);
|
system_max_charge_power_W = (uint32_t)(dataLinkReceive.getReceivedData(7) * 10); //add back missing decimal
|
||||||
uint16_t _system_bms_status = (uint16_t)dataLinkReceive.getReceivedData(8);
|
uint16_t _system_bms_status = (uint16_t)dataLinkReceive.getReceivedData(8);
|
||||||
system_active_power_W = (uint16_t)dataLinkReceive.getReceivedData(9);
|
system_active_power_W = (uint32_t)(dataLinkReceive.getReceivedData(9) * 10); //add back missing decimal
|
||||||
system_temperature_min_dC = (int16_t)dataLinkReceive.getReceivedData(10);
|
system_temperature_min_dC = (int16_t)dataLinkReceive.getReceivedData(10);
|
||||||
system_temperature_max_dC = (int16_t)dataLinkReceive.getReceivedData(11);
|
system_temperature_max_dC = (int16_t)dataLinkReceive.getReceivedData(11);
|
||||||
system_cell_max_voltage_mV = (uint16_t)dataLinkReceive.getReceivedData(12);
|
system_cell_max_voltage_mV = (uint16_t)dataLinkReceive.getReceivedData(12);
|
||||||
|
|
|
@ -13,18 +13,18 @@
|
||||||
// https://github.com/mackelec/SerialDataLink
|
// https://github.com/mackelec/SerialDataLink
|
||||||
|
|
||||||
// These parameters need to be mapped on the battery side
|
// These parameters need to be mapped on the battery side
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint8_t system_bms_status; //Enum 0-5
|
extern uint8_t system_bms_status; //Enum 0-5
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
|
|
|
@ -21,20 +21,20 @@
|
||||||
#define MIN_PACK_VOLTAGE_LFP 2968 // V+1, if pack voltage goes below this, discharge stops
|
#define MIN_PACK_VOLTAGE_LFP 2968 // V+1, if pack voltage goes below this, discharge stops
|
||||||
|
|
||||||
// These parameters need to be mapped for the inverter
|
// These parameters need to be mapped for the inverter
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
||||||
|
|
|
@ -8,20 +8,20 @@
|
||||||
#define BATTERY_SELECTED
|
#define BATTERY_SELECTED
|
||||||
|
|
||||||
// These parameters need to be mapped for the inverter
|
// These parameters need to be mapped for the inverter
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
||||||
|
|
|
@ -8,20 +8,20 @@
|
||||||
#define BATTERY_SELECTED
|
#define BATTERY_SELECTED
|
||||||
|
|
||||||
// These parameters need to be mapped for the inverter
|
// These parameters need to be mapped for the inverter
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include "../devboard/config.h" // Needed for all defines
|
#include "../devboard/config.h" // Needed for all defines
|
||||||
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
||||||
|
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
|
|
||||||
void send_can_nissanleaf_charger();
|
void send_can_nissanleaf_charger();
|
||||||
void receive_can_nissanleaf_charger(CAN_frame_t rx_frame);
|
void receive_can_nissanleaf_charger(CAN_frame_t rx_frame);
|
||||||
|
|
|
@ -44,9 +44,9 @@ extern const char* version_number; // The current software version, used for mq
|
||||||
|
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
#include "../../../USER_SETTINGS.h" // Needed for WiFi ssid and password
|
#include "../../../USER_SETTINGS.h" // Needed for WiFi ssid and password
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Replaces placeholder with content section in web page
|
* @brief Replaces placeholder with content section in web page
|
||||||
|
|
|
@ -17,20 +17,20 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern const char* version_number; // The current software version, shown on webserver
|
extern const char* version_number; // The current software version, shown on webserver
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000 , Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000 , Stores the highest cell millivolt value
|
||||||
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
||||||
|
|
|
@ -6,20 +6,20 @@
|
||||||
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
||||||
|
|
||||||
// These parameters need to be mapped for the inverter
|
// These parameters need to be mapped for the inverter
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
||||||
|
|
|
@ -7,20 +7,20 @@
|
||||||
#define MAX_POWER 40960 //BYD Modbus specific value
|
#define MAX_POWER 40960 //BYD Modbus specific value
|
||||||
|
|
||||||
extern uint16_t mbPV[MB_RTU_NUM_VALUES];
|
extern uint16_t mbPV[MB_RTU_NUM_VALUES];
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint8_t system_bms_status; //Enum 0-5
|
extern uint8_t system_bms_status; //Enum 0-5
|
||||||
extern bool batteryAllowsContactorClosing; //Bool, true/false
|
extern bool batteryAllowsContactorClosing; //Bool, true/false
|
||||||
extern bool inverterAllowsContactorClosing; //Bool, true/false
|
extern bool inverterAllowsContactorClosing; //Bool, true/false
|
||||||
|
|
|
@ -6,20 +6,20 @@
|
||||||
#define MB_RTU_NUM_VALUES 30000
|
#define MB_RTU_NUM_VALUES 30000
|
||||||
|
|
||||||
extern uint16_t mbPV[MB_RTU_NUM_VALUES];
|
extern uint16_t mbPV[MB_RTU_NUM_VALUES];
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
||||||
|
|
|
@ -5,20 +5,20 @@
|
||||||
#include "../devboard/config.h" // Needed for all defines
|
#include "../devboard/config.h" // Needed for all defines
|
||||||
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
||||||
|
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
||||||
|
|
|
@ -133,10 +133,10 @@ void manageSerialLinkTransmitter() {
|
||||||
dataLinkTransmit.updateData(3, system_battery_current_dA);
|
dataLinkTransmit.updateData(3, system_battery_current_dA);
|
||||||
dataLinkTransmit.updateData(4, system_capacity_Wh / 10); //u32, remove .0 to fit 16bit
|
dataLinkTransmit.updateData(4, system_capacity_Wh / 10); //u32, remove .0 to fit 16bit
|
||||||
dataLinkTransmit.updateData(5, system_remaining_capacity_Wh / 10); //u32, remove .0 to fit 16bit
|
dataLinkTransmit.updateData(5, system_remaining_capacity_Wh / 10); //u32, remove .0 to fit 16bit
|
||||||
dataLinkTransmit.updateData(6, system_max_discharge_power_W);
|
dataLinkTransmit.updateData(6, system_max_discharge_power_W / 10); //u32, remove .0 to fit 16bit
|
||||||
dataLinkTransmit.updateData(7, system_max_charge_power_W);
|
dataLinkTransmit.updateData(7, system_max_charge_power_W / 10); //u32, remove .0 to fit 16bit
|
||||||
dataLinkTransmit.updateData(8, system_bms_status);
|
dataLinkTransmit.updateData(8, system_bms_status);
|
||||||
dataLinkTransmit.updateData(9, system_active_power_W);
|
dataLinkTransmit.updateData(9, system_active_power_W / 10); //u32, remove .0 to fit 16bit
|
||||||
dataLinkTransmit.updateData(10, system_temperature_min_dC);
|
dataLinkTransmit.updateData(10, system_temperature_min_dC);
|
||||||
dataLinkTransmit.updateData(11, system_temperature_max_dC);
|
dataLinkTransmit.updateData(11, system_temperature_max_dC);
|
||||||
dataLinkTransmit.updateData(12, system_cell_max_voltage_mV);
|
dataLinkTransmit.updateData(12, system_cell_max_voltage_mV);
|
||||||
|
|
|
@ -9,14 +9,14 @@
|
||||||
// These parameters need to be mapped for the inverter
|
// These parameters need to be mapped for the inverter
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint8_t system_bms_status; //Enum 0-5
|
extern uint8_t system_bms_status; //Enum 0-5
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
|
|
|
@ -106,11 +106,18 @@ void update_values_can_sma() { //This function maps all the values fetched from
|
||||||
system_max_design_voltage_dV); //Charge power in W , max volt in V+1decimal (P=UI, solve for I)
|
system_max_design_voltage_dV); //Charge power in W , max volt in V+1decimal (P=UI, solve for I)
|
||||||
//The above calculation results in (30 000*10)/3700=81A
|
//The above calculation results in (30 000*10)/3700=81A
|
||||||
charge_current = (charge_current * 10); //Value needs a decimal before getting sent to inverter (81.0A)
|
charge_current = (charge_current * 10); //Value needs a decimal before getting sent to inverter (81.0A)
|
||||||
|
if (charge_current > MAXCHARGEAMP) {
|
||||||
|
charge_current = MAXCHARGEAMP; //Cap the value to the max allowed Amp. Some inverters cannot handle large values.
|
||||||
|
}
|
||||||
|
|
||||||
discharge_current = ((system_max_discharge_power_W * 10) /
|
discharge_current = ((system_max_discharge_power_W * 10) /
|
||||||
system_max_design_voltage_dV); //Charge power in W , max volt in V+1decimal (P=UI, solve for I)
|
system_max_design_voltage_dV); //Charge power in W , max volt in V+1decimal (P=UI, solve for I)
|
||||||
//The above calculation results in (30 000*10)/3700=81A
|
//The above calculation results in (30 000*10)/3700=81A
|
||||||
discharge_current = (discharge_current * 10); //Value needs a decimal before getting sent to inverter (81.0A)
|
discharge_current = (discharge_current * 10); //Value needs a decimal before getting sent to inverter (81.0A)
|
||||||
|
if (discharge_current > MAXDISCHARGEAMP) {
|
||||||
|
discharge_current =
|
||||||
|
MAXDISCHARGEAMP; //Cap the value to the max allowed Amp. Some inverters cannot handle large values.
|
||||||
|
}
|
||||||
|
|
||||||
temperature_average = ((system_temperature_max_dC + system_temperature_min_dC) / 2);
|
temperature_average = ((system_temperature_max_dC + system_temperature_min_dC) / 2);
|
||||||
|
|
||||||
|
|
|
@ -5,20 +5,20 @@
|
||||||
#include "../devboard/config.h" // Needed for all defines
|
#include "../devboard/config.h" // Needed for all defines
|
||||||
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
||||||
|
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
||||||
|
|
|
@ -119,11 +119,11 @@ static CAN_frame_t SMA_018 = { // Battery Name
|
||||||
.MsgID = 0x018,
|
.MsgID = 0x018,
|
||||||
.data = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};
|
.data = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};
|
||||||
|
|
||||||
static int discharge_current = 0;
|
static uint16_t discharge_current = 0;
|
||||||
static int charge_current = 0;
|
static uint16_t charge_current = 0;
|
||||||
static int temperature_average = 0;
|
static int16_t temperature_average = 0;
|
||||||
static int ampere_hours_remaining = 0;
|
static uint16_t ampere_hours_remaining = 0;
|
||||||
static int ampere_hours_max = 0;
|
static uint16_t ampere_hours_max = 0;
|
||||||
static bool batteryAlarm = false;
|
static bool batteryAlarm = false;
|
||||||
static bool BMSevent = false;
|
static bool BMSevent = false;
|
||||||
|
|
||||||
|
@ -164,11 +164,18 @@ void update_values_can_sma_tripower() { //This function maps all the values fet
|
||||||
system_max_design_voltage_dV); //Charge power in W , max volt in V+1decimal (P=UI, solve for I)
|
system_max_design_voltage_dV); //Charge power in W , max volt in V+1decimal (P=UI, solve for I)
|
||||||
//The above calculation results in (30 000*10)/3700=81A
|
//The above calculation results in (30 000*10)/3700=81A
|
||||||
charge_current = (charge_current * 10); //Value needs a decimal before getting sent to inverter (81.0A)
|
charge_current = (charge_current * 10); //Value needs a decimal before getting sent to inverter (81.0A)
|
||||||
|
if (charge_current > MAXCHARGEAMP) {
|
||||||
|
charge_current = MAXCHARGEAMP; //Cap the value to the max allowed Amp. Some inverters cannot handle large values.
|
||||||
|
}
|
||||||
|
|
||||||
discharge_current = ((system_max_discharge_power_W * 10) /
|
discharge_current = ((system_max_discharge_power_W * 10) /
|
||||||
system_max_design_voltage_dV); //Charge power in W , max volt in V+1decimal (P=UI, solve for I)
|
system_max_design_voltage_dV); //Charge power in W , max volt in V+1decimal (P=UI, solve for I)
|
||||||
//The above calculation results in (30 000*10)/3700=81A
|
//The above calculation results in (30 000*10)/3700=81A
|
||||||
discharge_current = (discharge_current * 10); //Value needs a decimal before getting sent to inverter (81.0A)
|
discharge_current = (discharge_current * 10); //Value needs a decimal before getting sent to inverter (81.0A)
|
||||||
|
if (discharge_current > MAXDISCHARGEAMP) {
|
||||||
|
discharge_current =
|
||||||
|
MAXDISCHARGEAMP; //Cap the value to the max allowed Amp. Some inverters cannot handle large values.
|
||||||
|
}
|
||||||
|
|
||||||
temperature_average = ((system_temperature_max_dC + system_temperature_min_dC) / 2);
|
temperature_average = ((system_temperature_max_dC + system_temperature_min_dC) / 2);
|
||||||
|
|
||||||
|
|
|
@ -5,20 +5,20 @@
|
||||||
#include "../devboard/config.h" // Needed for all defines
|
#include "../devboard/config.h" // Needed for all defines
|
||||||
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
||||||
|
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
||||||
|
|
|
@ -6,20 +6,20 @@
|
||||||
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
||||||
|
|
||||||
// These parameters need to be mapped for the inverter
|
// These parameters need to be mapped for the inverter
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
||||||
|
|
|
@ -8,20 +8,20 @@
|
||||||
|
|
||||||
extern ACAN2515 can;
|
extern ACAN2515 can;
|
||||||
|
|
||||||
extern uint32_t system_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-150000Wh
|
extern uint32_t system_remaining_capacity_Wh; //Wh, 0-250000Wh
|
||||||
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_min_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
extern int16_t system_temperature_max_dC; //C+1, -50.0 - 50.0
|
||||||
extern int16_t system_active_power_W; //W, -32000 to 32000
|
extern int32_t system_active_power_W; //W, -200000 to 200000
|
||||||
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
extern int16_t system_battery_current_dA; //A+1, -1000 - 1000
|
||||||
extern uint16_t system_battery_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_battery_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_max_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_max_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_min_design_voltage_dV; //V+1, 0-500.0 (0-5000)
|
extern uint16_t system_min_design_voltage_dV; //V+1, 0-1000.0 (0-10000)
|
||||||
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_scaled_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
extern uint16_t system_real_SOC_pptt; //SOC%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
extern uint16_t system_SOH_pptt; //SOH%, 0-100.00 (0-10000)
|
||||||
extern uint16_t system_max_discharge_power_W; //W, 0-65000
|
extern uint32_t system_max_discharge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_max_charge_power_W; //W, 0-65000
|
extern uint32_t system_max_charge_power_W; //W, 0-100000
|
||||||
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
extern uint16_t system_cell_max_voltage_mV; //mV, 0-5000, Stores the highest cell millivolt value
|
||||||
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
extern uint16_t system_cell_min_voltage_mV; //mV, 0-5000, Stores the minimum cell millivolt value
|
||||||
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
extern uint16_t system_cellvoltages_mV[MAX_AMOUNT_CELLS]; //Array with all cell voltages in mV
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue