Changeset 25 for trunk/fw_g473rct/SES/src/fast_current.c
- Timestamp:
- Sep 7, 2025, 3:51:43 PM (7 weeks ago)
- File:
-
- 1 edited
-
trunk/fw_g473rct/SES/src/fast_current.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/fw_g473rct/SES/src/fast_current.c
r24 r25 17 17 18 18 // --- LOKALE DEFINES - bitte hier dokumentieren -------------------------------- 19 20 #define I_SENSE_GAIN 40.021 #define ADC_OFFSET 3276822 #define ADC_RESOLUTION 32768 //65536/2 da im differential mode23 24 25 #if (DEVICETYPE == 500)26 #define SHUNT_RESISTOR 0.00012527 #elif (DEVICETYPE == 250)28 #define SHUNT_RESISTOR 0.00025029 #elif (DEVICETYPE == 125)30 #define SHUNT_RESISTOR 0.00050031 #else32 #error No valid device type33 #endif34 35 19 36 20 … … 55 39 //Umrechung auf Strom 56 40 double temp_current; 57 temp_current = ((int32_t) newVal - ADC_OFFSET) * VREF ;58 temp_current = temp_current / ADC_RESOLUTION;59 temp_current = temp_current / I_SENSE_GAIN ;60 temp_current = temp_current / SHUNT_RESISTOR ;41 temp_current = ((int32_t) newVal - FAST_CURRENT_ADC_OFFSET) * VREF ; 42 temp_current = temp_current / FAST_CURRENT_ADC_RESOLUTION; 43 temp_current = temp_current / FAST_CURRENT_I_SENSE_GAIN ; 44 temp_current = temp_current / FAST_CURRENT_SHUNT_RESISTOR ; 61 45 sys_data.s.values.fast_current = temp_current * (sys_data.s.parameter.batteryCurrentGainCorrectionFaktor / 1000000.0); 62 46
Note: See TracChangeset
for help on using the changeset viewer.
