AP_BattMonitor_Params.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #pragma once
  2. #include <AP_Param/AP_Param.h>
  3. class AP_BattMonitor_Params {
  4. public:
  5. static const struct AP_Param::GroupInfo var_info[];
  6. AP_BattMonitor_Params(void);
  7. /* Do not allow copies */
  8. AP_BattMonitor_Params(const AP_BattMonitor_Params &other) = delete;
  9. AP_BattMonitor_Params &operator=(const AP_BattMonitor_Params&) = delete;
  10. // Battery monitor driver types
  11. enum BattMonitor_Type {
  12. BattMonitor_TYPE_NONE = 0,
  13. BattMonitor_TYPE_ANALOG_VOLTAGE_ONLY = 3,
  14. BattMonitor_TYPE_ANALOG_VOLTAGE_AND_CURRENT = 4,
  15. BattMonitor_TYPE_SOLO = 5,
  16. BattMonitor_TYPE_BEBOP = 6,
  17. BattMonitor_TYPE_MAXELL = 7,
  18. BattMonitor_TYPE_UAVCAN_BatteryInfo = 8,
  19. BattMonitor_TYPE_BLHeliESC = 9,
  20. BattMonitor_TYPE_Sum = 10,
  21. BattMonitor_TYPE_FuelFlow = 11,
  22. BattMonitor_TYPE_FuelLevel_PWM = 12,
  23. };
  24. // low voltage sources (used for BATT_LOW_TYPE parameter)
  25. enum BattMonitor_LowVoltage_Source {
  26. BattMonitor_LowVoltageSource_Raw = 0,
  27. BattMonitor_LowVoltageSource_SagCompensated = 1
  28. };
  29. BattMonitor_Type type(void) const { return (enum BattMonitor_Type)_type.get(); }
  30. BattMonitor_LowVoltage_Source failsafe_voltage_source(void) { return (enum BattMonitor_LowVoltage_Source)_failsafe_voltage_source.get(); }
  31. AP_Int8 _type; /// 0=disabled, 3=voltage only, 4=voltage and current
  32. AP_Int8 _volt_pin; /// board pin used to measure battery voltage
  33. AP_Int8 _curr_pin; /// board pin used to measure battery current
  34. AP_Float _volt_multiplier; /// voltage on volt pin multiplied by this to calculate battery voltage
  35. AP_Float _curr_amp_per_volt; /// voltage on current pin multiplied by this to calculate current in amps
  36. AP_Float _curr_amp_offset; /// offset voltage that is subtracted from current pin before conversion to amps
  37. AP_Int32 _pack_capacity; /// battery pack capacity less reserve in mAh
  38. AP_Int16 _watt_max; /// max battery power allowed. Reduce max throttle to reduce current to satisfy t his limit
  39. AP_Int32 _serial_number; /// battery serial number, automatically filled in on SMBus batteries
  40. AP_Int8 _low_voltage_timeout; /// timeout in seconds before a low voltage event will be triggered
  41. AP_Int8 _failsafe_voltage_source; /// voltage type used for detection of low voltage event
  42. AP_Float _low_voltage; /// voltage level used to trigger a low battery failsafe
  43. AP_Float _low_capacity; /// capacity level used to trigger a low battery failsafe
  44. AP_Float _critical_voltage; /// voltage level used to trigger a critical battery failsafe
  45. AP_Float _critical_capacity; /// capacity level used to trigger a critical battery failsafe
  46. AP_Int8 _failsafe_low_action; /// action to preform on a low battery failsafe
  47. AP_Int8 _failsafe_critical_action; /// action to preform on a critical battery failsafe
  48. AP_Int32 _arming_minimum_capacity; /// capacity level required to arm
  49. AP_Float _arming_minimum_voltage; /// voltage level required to arm
  50. };