Commit Graph

33 Commits

Author SHA1 Message Date
CUAVmengxiao 425d03d909 msg: Add full_charge_capacity_wh 2022-01-26 13:44:48 -05:00
Claudio Micheli d122513197 extend support for Battery status message
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2022-01-13 08:40:34 +01:00
Matthias Grob ddc6b6bc9c battery: move MAVLink specific handling out of battery class 2021-12-07 21:06:51 +01:00
Matthias Grob 91c48606ee battery_status: clearly define and handle zero remaining flight time 2021-11-15 15:44:02 +01:00
Matthias Grob 54f2e91775 battery_status: report remaining flight time in seconds
This allows more accurate reporting and is compliant with the
MAVLink interface.
2021-11-15 15:44:02 +01:00
Matthias Grob b824f33ae9 battery: publish measured values also when battery not connected 2021-07-01 14:24:38 +02:00
Matthias Grob 9c0c85c9e2 battery_status: naming consistency current_filtered_a -> current_average_a 2021-07-01 14:24:38 +02:00
CUAVmengxiao 45b9e18195
UAVCANv0: add CUAV smart battery support 2021-04-11 21:27:31 -04:00
bazooka joe 8d5813994f format smart battery serial number as string on mavlink
according to change on mavlink protocol message
formatted as 'dd/mm/yy-123456'
2020-12-28 11:04:54 +01:00
Daniel Agar 0dc8bb9c86
uORB: increase ORB_MULTI_MAX_INSTANCES 4 -> 10
- put more realistic bounds on maximum number of battery instances, gps, etc
2020-09-24 11:01:28 -04:00
bazooka joe 190b96a46c SMbus battery driver - a lot of updates and optimizations
- added support for BQ40Z80 based battery
- added performance counter for interface errors
- added SMART_BATTERY_INFO mavlink message
- general code cleanups and optimization
- fixed: void flooding the log in case of interface error
- fixed: using _batt_startup_capacity instead of _batt_capacity for discharged_mah
- update: read manufacture_date
- update: get _cell_count from parameter and not const 4
- update: avoid re-reading data that has already been read and stored on class already
- currently the battery type defined by BAT_SMBUS_MODEL parameter and not by auto detection
2020-08-18 21:41:19 -04:00
Julian Oes cafd52647c msg: fix battery source enum 2020-04-06 15:56:54 +02:00
Julian Oes f650b91718 battery: check source param inside battery lib
This moves the handling of the BAT%d_SOURCE param inside of the battery
library. Users of the library now pass the source instead of the flag
whether to publish. The battery library then checks if the source is
selected using the param and publishes accordingly.

Since we removed the strange system_source flag, we now need to look at
all batteries in commander.
For current estimation - I think - it makes sense to sum them up.
2020-04-06 15:56:54 +02:00
Julian Oes 5beb293a6a msg: fix typo 2020-04-06 15:56:54 +02:00
Hyon Lim 3bcd8c63f8
SMBus battery (a.k.a. smart battery) enhancement. (#14496)
* Enhancement: State of health, and max_error value is added. Both shows battery health of SMBUS smart battery.
 * Enhancement: BAT_C_MULT parameter is introduced. This is for high-current capable SMBUS-based battery.
As SMBUS only provides 16-bit for current, it could only be +-32768mA which is about +-32A.
But with proper treatment, it could be extended with little accuracy loss.
This factor can be set for individual battery system with available information.
    * Relative SOC introduced. Proper SMBUS battery should provide percentage of remaining battery
directly. Therefore it does not have to be computed like before.
    * State of Health introduced. Proper SMBUS battery should provide SOH value.
    * Max error: this shows estimation error of BMS.
 * Enhancement: With smart battery, precise estimation of time remaining is provided
with impedance track. It is unit of minute, so 60 seconds multiplied.
Update rate of this is not fast, but very useful.

Co-authored-by: Hyon Lim <lim@uvify.com>
2020-03-31 17:28:22 -04:00
Timothy Scott 14a61a6695 Fixed reporting of battery voltages in uORB 2020-03-31 09:14:50 +02:00
Timothy Scott 993fa5bd37 Refactored to work with new battery_status module 2019-12-05 16:38:04 +01:00
Timothy Scott 39a5799e65 Mavlink: fixed temperature for batteries (#12605) 2019-08-02 10:09:03 -04:00
Jake Dahl f8b9217750 batt_smbus rework 2018-11-01 10:49:26 -04:00
TSC21 e932030d88 add timestamp field to uORB msgs; sync timestamp whenever possible 2018-08-09 13:40:48 +02:00
AlexKlimaj 83d01a7c76 Updated batt_smbus. Expanded battery_status.msg. Fixed mavlink_messages.cpp temperature. (#8991)
* Updated and expanded batt_smbus to work with bq40z50-R2. Expanded battery_status.msg. Fixed mavlink_messages.cpp temperature, added commented out expanded battery_status.msg parameters for future mavlink expansion.

* Changed errx to PX4_ERR

* Added PX4_ERR returns
2018-03-06 10:42:20 +01:00
Daniel Agar 64fa1ec6a5 batt_smbus readd to configurations and fix compilation errors 2018-02-08 19:00:48 +01:00
David Sidrane 8e8510f398 Added Power Brick related battery_status.msg fields
system_source - This battery status is for the brick that is
                   supplying VDD_5V_IN
   priority      - Zero based, This battery status is for the brick
                   that is connected to the Power controller's
                   N-1 priority input. V1..VN. 0 would normally be
                   Brick1, 1 for Brick2 etc

  Battery now assigns connected from the api in the
  updateBatteryStatus, as well as system_source and priority
2017-07-17 21:02:50 -10:00
Lorenz Meier 7372014aee Battery: Implement an emergency warn level 2017-02-27 09:03:20 +01:00
Dennis Shtatnov 37641042cc Explicit internal battery resistance params 2016-11-19 14:55:52 +01:00
Dennis Shtatnov a634c14582 Scale throttle outputs by battery level. Fixes #4751 2016-11-19 14:55:52 +01:00
Lorenz Meier 7633797190 Battery status: Add valid flag 2016-05-15 15:37:46 +02:00
Daniel Agar 76387b1693 uorb autogeneration 2016-05-14 11:27:07 +02:00
sander 1a04e952f8 Inline comment addition 2016-05-10 21:34:11 +02:00
sander 9a09c5af5c Add low pass filtered current draw 2016-05-10 21:34:11 +02:00
Julian Oes 32c3135788 commander: move battery calculations to systemlib
The commander used to consume the battery_status topic and write the
contents after some calculations into the system state. Instead, the
calculations now happen in library calls in systemlib/battery.

This moves the battery fields out of the vehicle_status message into the
battery_status topic.

This brought quite some changes in all modules that need battery
information. The current state is compiling but untested.
2016-04-11 18:01:47 +02:00
Angus Peart 6ac26c680d batt_smbus: read button status from the smart battery
This is a cherry-pick of commit 8bd17a4b0cd9c1432cb57a9a80a215692f532370
in 3drobotics/PX4Firmware-solo

Conflicts:
	src/drivers/batt_smbus/batt_smbus.cpp
	src/drivers/drv_irlock.h
	src/lib/ecl
2016-02-18 21:47:09 +01:00
Lorenz Meier d400643738 Move battery status to generated topics 2015-05-27 15:21:31 -07:00