Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Battery indicator seems broken on Arducopter 2.8.1 #50

Open
dccourt opened this issue Feb 23, 2013 · 5 comments
Open

Battery indicator seems broken on Arducopter 2.8.1 #50

dccourt opened this issue Feb 23, 2013 · 5 comments
Labels

Comments

@dccourt
Copy link

dccourt commented Feb 23, 2013

I'm not sure which parameter the battery status indication is being read from, but for me it always says "-102%" in mavelous.

In QGroundControl and MissionPlanner, I see the correct voltage reading being displayed.

I'm running Arducopter 2.8.1 on APM 2.5.

@pchickey
Copy link
Contributor

Can you please provide the value of the SYS_STATUS packet in mavproxy (prints at the prompt with > status SYS_STATUS) while the indicator shows this error?

@dccourt
Copy link
Author

dccourt commented Feb 27, 2013

Will do. While code reading it looked like there might be some interaction with avionics battery vs main battery - anyway, now I know how to dump the packets, I'll take a look at both the relevant ones.

@dccourt
Copy link
Author

dccourt commented Mar 11, 2013

I struggled to get the prompt working with mav_proxy (not sure why) but anyway, I was able to grab the relevant data from status.txt:

101: SYS_STATUS {onboard_control_sensors_present : 4294966319, onboard_control_sensors_enabled : 4294945839, onboard_control_sensors_health : 4294966319, load : 0, voltage_battery : 11165, current_battery : -1, battery_remaining : -106, drop_rate_comm : 0, errors_comm : 0, errors_count1 : 0, errors_count2 : 0, errors_count3 : 0, errors_count4 : 0}

This corresponds to a battery indicator in mavelous of -106 - i.e. it seems to be taken directly from the battery_remaining param.

@dccourt
Copy link
Author

dccourt commented Mar 11, 2013

This is an APM2.5 with a homemade voltage divider supplying the battery voltage metrics, and no current sensor (current sensor is disabled in arducopter config parameters). My guess is that this means that the arducopter firmware can't calculate battery_remaining properly.

My suggestion is that we change the code in mavelous to look at current_battery. If it's == -1, then display voltage_battery / 1000 for the battery status, otherwise behave as before.

Ideally we'd also allow for configuration of a low-battery threshold, and have colour-coding of the icon based on that - especially since the battery status number doesn't seem to be displayable on small-screen devices such as phones. I'm not sure what the right UI design for that is - perhaps have preset thresholds for the colours based on a drop-down preference setting of the number of cells? Or, for simplicity, just a pair of voltage thresholds, for the red and yellow colours. (Alternatively, a pop-up indicator on the battery icon that displays battery status, as per GPS, would be a good start).

If you guys let me know what you think for the design, I'd be happy to draft up and test a patch.

@pchickey
Copy link
Contributor

Thanks for tracking down this behavior, we hadn't accounted for users who
have just a voltage sensor. I've only tested with my 3DR power board, which
has voltage and current.

Yes, I agree a configurable low battery threshold is a great idea. You can
probably add a popover like the GPS has fairly easily now that I've
refactored that code. We could look into a better UI for low voltage
alarms, maybe via a dismissable alert that appears below the navbar or at
the bottom of the screen.

I'd be happy to code review and accept a patch to add any of this
functionality.

Pat

On Mon, Mar 11, 2013 at 2:38 PM, David Court [email protected]:

This is an APM2.5 with a homemade voltage divider supplying the battery
voltage metrics, and no current sensor (current sensor is disabled in
arducopter config parameters). My guess is that this means that the
arducopter firmware can't calculate battery_remaining properly.

My suggestion is that we change the code in mavelous to look at
current_battery. If it's == -1, then display voltage_battery / 1000 for the
battery status, otherwise behave as before.

Ideally we'd also allow for configuration of a low-battery threshold, and
have colour-coding of the icon based on that - especially since the battery
status number doesn't seem to be displayable on small-screen devices such
as phones. I'm not sure what the right UI design for that is - perhaps have
preset thresholds for the colours based on a drop-down preference setting
of the number of cells? Or, for simplicity, just a pair of voltage
thresholds, for the red and yellow colours. (Alternatively, a pop-up
indicator on the battery icon that displays battery status, as per GPS,
would be a good start).

If you guys let me know what you think for the design, I'd be happy to
draft up and test a patch.


Reply to this email directly or view it on GitHubhttps://github.com//issues/50#issuecomment-14744505
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants