Skip to content

AP_Periph: added BatteryTag support#29983

Merged
tridge merged 7 commits intoArduPilot:masterfrom
tridge:pr-BatteryTag
May 16, 2025
Merged

AP_Periph: added BatteryTag support#29983
tridge merged 7 commits intoArduPilot:masterfrom
tridge:pr-BatteryTag

Conversation

@tridge
Copy link
Copy Markdown
Contributor

@tridge tridge commented May 5, 2025

This adds support for BatteryTag functionality in AP_Periph, along with a lua script for logging and handling battery tags.
A batterytag is a DroneCAN node that is permanently attached to the battery to record battery cycles and armed time. It is helpful for managing battery lifetime. Note that the batterytag may not have access to the battery voltage/current/state-of-charge
split from #29310 as requested by @tpwrules

information about number of cycles a battery has been through along
with the serial number and number of hours in an armed state.

The log message in BTAG
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you forget to finish a thought?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure this needs to be filled out with some

Copy link
Copy Markdown
Contributor

@rmackay9 rmackay9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this, thanks

}


#if AP_PERIPH_RTC_ENABLED
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#if AP_PERIPH_RTC_ENABLED
#if AP_PERIPH_RTC_GLOBALTIME_ENABLED

Copy link
Copy Markdown
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the define request I've made, I think this looks really good.

I have reservations about the global time message, but it's nowhere near as big an issue if we're not locked into it in the main firmware.

@tridge tridge requested a review from peterbarker May 13, 2025 22:05
@tridge
Copy link
Copy Markdown
Contributor Author

tridge commented May 13, 2025

@peterbarker added AP_PERIPH_RTC_GLOBALTIME_ENABLED

Copy link
Copy Markdown
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just a few comment problems now.

Comment on lines +16 to +19
battery info support. This feature has a set of parameters which are
controlled by a lua script on the FMU. The battery infomation node
is attached to a specific battery and recorded the number of cycles,
and total armed time
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is entirely accurate now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

information about number of cycles a battery has been through along
with the serial number and number of hours in an armed state.

The log message in BTAG
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure this needs to be filled out with some

@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label May 16, 2025
tridge added 2 commits May 17, 2025 06:40
this implements a battery tag node that is permanently attached to
a battery to give information on armed hours and cycles
@tridge tridge merged commit a42dbfa into ArduPilot:master May 16, 2025
111 of 114 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants