-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Improve battery monitoring #2705
Improve battery monitoring #2705
Conversation
…places where vbat calculations needs to be divided by 10
…100mV resolution because modifying the viewer is not trivial
…ype names to follow convention
…ery_monitoring_with_increased_vbat_resolution
I also merged #2684 in so it is not needed if you merge this. |
I will do some cleaning in the batteryConfig structure. I was thinking grouping the capacity/voltage items. And also moving the multiwiiCurrentMeterOutput item where it belongs. Where should it be best placed ? telemetryConfig maybe ? or systemConfig ?
|
I'm not sure we need |
@shellixyz looks like merging of MANUAL mode created a merge conflict here |
…ased_vbat_resolution
@digitalentity Can I remove |
src/main/telemetry/smartport.c
Outdated
} | ||
if (telemetryConfig()->smartportFuelPercent) | ||
smartPortSendPackage(id, calculateBatteryPercentage()); // Show remaining battery % if smartport_fuel_percent=ON and battery_capacity set | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this instead so it doesn't set a telemetry fuel sensor if a current sensor doesn't exist:
else if (feature(FEATURE_CURRENT_METER))
…NGF7, ALIENFLIGHTF4 and BETAFLIGHTF3
@shellixyz yes, please remove the |
…t to uint32_t (65Wh is not very large, it is about 6Ah for a 3S Li-Po)
…ased_vbat_resolution
src/main/fc/fc_msp.c
Outdated
@@ -399,6 +399,13 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF | |||
} | |||
break; | |||
|
|||
case MSP2_INAV_VOLTAGE_METER_CONFIG: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a special MSPv2 message for voltmeter config? Same settings are available via MSP2_INAV_BATTERY_CONFIG
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed we do not. I added it with the PR increasing the voltage resolution but now it is redundant I will remove it.
I tested again the best I could the last changes. Including I-bus telemetry values this time. I don't plan on making more changes. If it is good for you it is good for me to merge. |
Ack. Will review today |
A couple of new mods in the end even though I said I would not. Should be good this time. |
* increase battery voltage resolution to 10mV * increase battery voltage resolution to 10mV: update VBATT_HYSTERESIS * increase battery voltage resolution to 10mV: fix telemetry and other places where vbat calculations needs to be divided by 10 * increase battery voltage resolution to 10mV: revert blackbox data to 100mV resolution because modifying the viewer is not trivial * increase battery voltage resolution to 10mV: change new MSPv2 frame type names to follow convention * smartport telemetry: remove wrong and now irrelevant comments * Improve battery monitoring * improve battery monitoring: fix/simplify the batteryAdcToVoltage function * improve battery monitoring: Add OSD voltage decimals setting to OSD MISC menu * improve battery monitoring: clean the batteryConfig struct * improve battery monitoring: increase batteryConfig PG group version to 1 * improve battery monitoring: change capacity settings type from uin16_t to uint32_t (65Wh is not very large, it is about 6Ah for a 3S Li-Po) * improve battery monitoring: rename capacity settings * improve battery monitoring: improve OSD code * improve battery monitoring: simplified taskUpdateBattery * improve battery monitoring: use unfiltered vbat to decide if the battery is full
This PR includes the increased battery voltage resolution changes (#2668)
Changes summary:
battery_capacity
,battery_capacity_unit
,battery_warning_capacity
,battery_critical_capacity
.osd_stats_energy_unit
setting).NF
if the battery was not full when plugged in. It displaysNA
if battery capacity has not been specified (battery_capacity = 0).I tested these changes the best I could. I could not test the Wh/Km efficiency because I have no aircraft for the moment with video/OSD and it needs to get GPS speed.
OSD fonts update with new icons: iNavFlight/inav-configurator#333