From b1a7babaff81180f9ae664eab38df69cee7456b0 Mon Sep 17 00:00:00 2001 From: Martin Jaeger <17674105+martinjaeger@users.noreply.github.com> Date: Thu, 31 Oct 2019 11:33:18 +0100 Subject: [PATCH] Load overcurrent model now using internal temperature --- src/load.cpp | 3 ++- src/pcb.h | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/load.cpp b/src/load.cpp index 0818bad..6076aab 100644 --- a/src/load.cpp +++ b/src/load.cpp @@ -349,7 +349,8 @@ void LoadOutput::control() junction_temperature = junction_temperature + ( internal_temp - junction_temperature + port->current * port->current / - (LOAD_CURRENT_MAX * LOAD_CURRENT_MAX) * (MOSFET_MAX_JUNCTION_TEMP - 25) + (LOAD_CURRENT_MAX * LOAD_CURRENT_MAX) * + (MOSFET_MAX_JUNCTION_TEMP - INTERNAL_MAX_REFERENCE_TEMP) ) / (MOSFET_THERMAL_TIME_CONSTANT * CONTROL_FREQUENCY); if (junction_temperature > MOSFET_MAX_JUNCTION_TEMP diff --git a/src/pcb.h b/src/pcb.h index 6f8dc21..6dc6a2a 100644 --- a/src/pcb.h +++ b/src/pcb.h @@ -41,6 +41,14 @@ */ #define MOSFET_MAX_JUNCTION_TEMP 120 +/** Internal reference temperature at full load (°C) + * + * This value is used for model-based control of overcurrent protection. It represents + * the steady-state internal temperature for max. continuous current at ambient + * temperature of 25°C. + */ +#define INTERNAL_MAX_REFERENCE_TEMP 50 + /** Thermal time constant junction to ambient (s) * * This value is used for model-based control of overcurrent protection. It does not reflect