CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/libraries/AP_BattMonitor/AP_BattMonitor_Params.h
Views: 1798
1
#pragma once
2
3
#include <AP_Param/AP_Param.h>
4
#include "AP_BattMonitor_config.h"
5
6
class AP_BattMonitor_Params {
7
public:
8
static const struct AP_Param::GroupInfo var_info[];
9
10
AP_BattMonitor_Params(void);
11
12
/* Do not allow copies */
13
CLASS_NO_COPY(AP_BattMonitor_Params);
14
15
// low voltage sources (used for BATT_LOW_TYPE parameter)
16
enum BattMonitor_LowVoltage_Source {
17
BattMonitor_LowVoltageSource_Raw = 0,
18
BattMonitor_LowVoltageSource_SagCompensated = 1
19
};
20
enum class Options : uint16_t {
21
Ignore_UAVCAN_SoC = (1U<<0), // Ignore UAVCAN State-of-Charge (charge %) supplied value from the device and use the internally calculated one
22
MPPT_Use_Input_Value = (1U<<1), // MPPT reports voltage and current from Input (usually solar panel) instead of the output
23
MPPT_Power_Off_At_Disarm = (1U<<2), // MPPT Disabled when vehicle is disarmed, if HW supports it
24
MPPT_Power_On_At_Arm = (1U<<3), // MPPT Enabled when vehicle is armed, if HW supports it
25
MPPT_Power_Off_At_Boot = (1U<<4), // MPPT Disabled at startup (aka boot), if HW supports it
26
MPPT_Power_On_At_Boot = (1U<<5), // MPPT Enabled at startup (aka boot), if HW supports it. If Power_Off_at_Boot is also set, the behavior is Power_Off_at_Boot
27
GCS_Resting_Voltage = (1U<<6), // send resistance resting voltage to GCS
28
AllowSplitAuxInfo = (1U<<7), // allow different node to provide aux info for DroneCAN
29
InternalUseOnly = (1U<<8), // for use internally to ArduPilot, not to be (eg.) sent via MAVLink BATTERY_STATUS
30
Minimum_Voltage = (1U<<9), // sum monitor measures minimum voltage rather than average
31
};
32
33
BattMonitor_LowVoltage_Source failsafe_voltage_source(void) const { return (enum BattMonitor_LowVoltage_Source)_failsafe_voltage_source.get(); }
34
35
AP_Int32 _pack_capacity; /// battery pack capacity less reserve in mAh
36
AP_Int32 _serial_number; /// battery serial number, automatically filled in on SMBus batteries
37
AP_Float _low_voltage; /// voltage level used to trigger a low battery failsafe
38
AP_Float _low_capacity; /// capacity level used to trigger a low battery failsafe
39
AP_Float _critical_voltage; /// voltage level used to trigger a critical battery failsafe
40
AP_Float _critical_capacity; /// capacity level used to trigger a critical battery failsafe
41
AP_Int32 _arming_minimum_capacity; /// capacity level required to arm
42
AP_Float _arming_minimum_voltage; /// voltage level required to arm
43
AP_Int32 _options; /// Options
44
#if AP_BATTERY_WATT_MAX_ENABLED
45
AP_Int16 _watt_max; /// max battery power allowed. Reduce max throttle to reduce current to satisfy t his limit
46
#endif
47
AP_Int8 _type; /// 0=disabled, 3=voltage only, 4=voltage and current
48
AP_Int8 _low_voltage_timeout; /// timeout in seconds before a low voltage event will be triggered
49
AP_Int8 _failsafe_voltage_source; /// voltage type used for detection of low voltage event
50
AP_Int8 _failsafe_low_action; /// action to preform on a low battery failsafe
51
AP_Int8 _failsafe_critical_action; /// action to preform on a critical battery failsafe
52
#if AP_BATTERY_ESC_TELEM_OUTBOUND_ENABLED
53
AP_Int8 _esc_telem_outbound_index; /// bitmask of ESCs to forward voltage, current, consumption and temperature to.
54
#endif
55
};
56
57