NTC on PCB not used as battery temperature anymore

- MCU temperature was renamed to internal_temperature
- NTC at board edge senses temperatures far above battery / ambient temperature at high loads and is now ignored
- Battery temperature always assumed 25ÂC unless external sensor is detected
This commit is contained in:
Martin Jaeger
2019-10-31 11:22:03 +01:00
parent 5b4df98656
commit b0e265f3e9
12 changed files with 32 additions and 86 deletions
+2 -2
View File
@@ -25,7 +25,7 @@
volatile bool short_circuit = false;
extern LogData log_data;
extern float mcu_temp;
extern float internal_temp;
#ifndef UNIT_TEST
@@ -347,7 +347,7 @@ void LoadOutput::control()
// junction temperature calculation model for overcurrent detection
junction_temperature = junction_temperature + (
mcu_temp - junction_temperature +
internal_temp - junction_temperature +
port->current * port->current /
(LOAD_CURRENT_MAX * LOAD_CURRENT_MAX) * (MOSFET_MAX_JUNCTION_TEMP - 25)
) / (MOSFET_THERMAL_TIME_CONSTANT * CONTROL_FREQUENCY);