diff --git a/Core/Src/state_machine.c b/Core/Src/state_machine.c index aacb4d2..7008496 100644 --- a/Core/Src/state_machine.c +++ b/Core/Src/state_machine.c @@ -4,6 +4,7 @@ #include "errors.h" #include "stm32f3xx_hal.h" #include +#include StateHandle state; int16_t RELAY_BAT_SIDE_VOLTAGE; @@ -24,7 +25,7 @@ void sm_update(){ RELAY_BAT_SIDE_VOLTAGE = module.auxVoltages[0] * 12.42; // the calculation says the factor is 11.989. 12.42 yields the better result RELAY_ESC_SIDE_VOLTAGE = module.auxVoltages[1] * 12.42; - CURRENT_MEASUREMENT = module.auxVoltages[2] / 2.2; + CURRENT_MEASUREMENT = (module.auxVoltages[2] - 2496) * 300; switch (state.current_state) { case STATE_INACTIVE: