addeed the correct scaling for the current sensor

This commit is contained in:
hamza 2024-06-07 00:43:00 +03:00
parent 5213a4a2e0
commit 7a4494f5ef

View File

@ -4,6 +4,7 @@
#include "errors.h"
#include "stm32f3xx_hal.h"
#include <stdint.h>
#include <stdio.h>
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: