AP_BattMonitor_Analog: allow per-board setting of CURR_AMP_OFFSET

This commit is contained in:
Willian Galvani 2021-08-16 21:53:22 -03:00 committed by Andrew Tridgell
parent cb307891e0
commit 2e5b689196
2 changed files with 6 additions and 1 deletions

View File

@ -41,7 +41,7 @@ const AP_Param::GroupInfo AP_BattMonitor_Analog::var_info[] = {
// @Description: Voltage offset at zero current on current sensor
// @Units: V
// @User: Standard
AP_GROUPINFO("AMP_OFFSET", 5, AP_BattMonitor_Analog, _curr_amp_offset, 0),
AP_GROUPINFO("AMP_OFFSET", 5, AP_BattMonitor_Analog, _curr_amp_offset, AP_BATT_CURR_AMP_OFFSET_DEFAULT),
AP_GROUPEND
};

View File

@ -75,6 +75,11 @@
# define AP_BATT_CURR_AMP_PERVOLT_DEFAULT 17.0f
#endif
// This is 0 for the majority of the power modules.
#ifndef AP_BATT_CURR_AMP_OFFSET_DEFAULT
#define AP_BATT_CURR_AMP_OFFSET_DEFAULT 0.0f
#endif
// Other values normally set directly by mission planner
// # define AP_BATT_VOLTDIVIDER_DEFAULT 15.70 // Volt divider for AttoPilot 50V/90A sensor
// # define AP_BATT_VOLTDIVIDER_DEFAULT 4.127 // Volt divider for AttoPilot 13.6V/45A sensor