Thomas Kolb
46d3e16104
- Run ADC Calibration on startup (without calibration, there is a huge offset error, making the current sensing unusable) - Added calibration factors which allow to compensate for inaccuracies in the circuitry (example: 1% tolerance transistors) - Send measured values via RS485
16 lines
492 B
C
16 lines
492 B
C
#ifndef CALIBRATION_H
|
|
#define CALIBRATION_H
|
|
|
|
/* All values defined here are divided by 1000 to determine the actual scaling
|
|
* factor. Therefore, if the voltage determined by the firmware is 2% lower
|
|
* than the actual voltage, you have to scale by 1.02 and therefore specify
|
|
* 1020 in this list. */
|
|
|
|
#define CAL_FACTOR_U_BAT 1000
|
|
#define CAL_FACTOR_U_SOLAR 1002
|
|
#define CAL_FACTOR_U_SW 1005
|
|
#define CAL_FACTOR_I_SOLAR 1015
|
|
#define CAL_FACTOR_I_LOAD 1000
|
|
|
|
#endif // CALIBRATION_H
|