Move thermal model parameters to DTS
This commit is contained in:
+2
-2
@@ -39,8 +39,8 @@ Dcdc::Dcdc(PowerPort *hv_side, PowerPort *lv_side, DcdcOperationMode op_mode)
|
||||
lvs->neg_current_limit = -DT_INST_0_DCDC_CURRENT_MAX;
|
||||
lvs->pos_current_limit = DT_INST_0_DCDC_CURRENT_MAX;
|
||||
ls_current_max = DT_INST_0_DCDC_CURRENT_MAX;
|
||||
hs_voltage_max = DT_INST_0_CHARGE_CONTROLLER_HS_VOLTAGE_MAX;
|
||||
ls_voltage_max = DT_INST_0_CHARGE_CONTROLLER_LS_VOLTAGE_MAX;
|
||||
hs_voltage_max = DT_CHARGE_CONTROLLER_PCB_HS_VOLTAGE_MAX;
|
||||
ls_voltage_max = DT_CHARGE_CONTROLLER_PCB_LS_VOLTAGE_MAX;
|
||||
ls_voltage_min = 9.0;
|
||||
output_power_min = 1; // switch off if power < 1 W
|
||||
restart_interval = 60;
|
||||
|
||||
+7
-8
@@ -43,13 +43,12 @@ void LoadOutput::control()
|
||||
|
||||
// junction temperature calculation model for overcurrent detection
|
||||
junction_temperature = junction_temperature + (
|
||||
dev_stat.internal_temp - junction_temperature +
|
||||
current * current /
|
||||
(LOAD_CURRENT_MAX * LOAD_CURRENT_MAX) *
|
||||
(CONFIG_MOSFET_MAX_JUNCTION_TEMP - CONFIG_INTERNAL_MAX_REFERENCE_TEMP)
|
||||
) / (CONFIG_MOSFET_THERMAL_TIME_CONSTANT * CONFIG_CONTROL_FREQUENCY);
|
||||
dev_stat.internal_temp - junction_temperature + current * current /
|
||||
(LOAD_CURRENT_MAX * LOAD_CURRENT_MAX) *
|
||||
(DT_CHARGE_CONTROLLER_PCB_MOSFETS_TJ_MAX - DT_CHARGE_CONTROLLER_PCB_INTERNAL_TREF_MAX)
|
||||
) / (DT_CHARGE_CONTROLLER_PCB_MOSFETS_TAU_JA * CONFIG_CONTROL_FREQUENCY);
|
||||
|
||||
if (junction_temperature > CONFIG_MOSFET_MAX_JUNCTION_TEMP ||
|
||||
if (junction_temperature > DT_CHARGE_CONTROLLER_PCB_MOSFETS_TJ_MAX ||
|
||||
current > LOAD_CURRENT_MAX * 2)
|
||||
{
|
||||
flags_set(&error_flags, ERR_LOAD_OVERCURRENT);
|
||||
@@ -69,7 +68,7 @@ void LoadOutput::control()
|
||||
// long-term overvoltage (overvoltage transients are detected as an ADC alert and switch
|
||||
// off the solar input instead of the load output)
|
||||
if (bus->voltage > overvoltage || bus->voltage >
|
||||
DT_INST_0_CHARGE_CONTROLLER_LS_VOLTAGE_MAX)
|
||||
DT_CHARGE_CONTROLLER_PCB_LS_VOLTAGE_MAX)
|
||||
{
|
||||
ov_debounce_counter++;
|
||||
if (ov_debounce_counter > CONFIG_CONTROL_FREQUENCY) {
|
||||
@@ -108,7 +107,7 @@ void LoadOutput::control()
|
||||
|
||||
if (flags_check(&error_flags, ERR_LOAD_OVERVOLTAGE) &&
|
||||
bus->voltage < (overvoltage - ov_hysteresis) &&
|
||||
bus->voltage < (DT_INST_0_CHARGE_CONTROLLER_LS_VOLTAGE_MAX - ov_hysteresis))
|
||||
bus->voltage < (DT_CHARGE_CONTROLLER_PCB_LS_VOLTAGE_MAX - ov_hysteresis))
|
||||
{
|
||||
flags_clear(&error_flags, ERR_LOAD_OVERVOLTAGE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user