Estimate remaining UAV flight time under current load and wind using a simple empirical model.
Project description
Battery Life Estimator (UAV)
Predict remaining flight time under current load and wind using a simple empirical model you can calibrate from 5–10 past flights.
What it does
- Calibrate a model from your flight logs (payload, speed, wind, flight time).
- Estimate total flight time for a given payload & airspeed.
- Estimate remaining time based on current pack voltage (via a LiPo voltage→SOC curve).
Model (MVP)
We fit a linear model on the inverse of total flight time (minutes):
1 / T ≈ b0 + b1 * payload_kg + b2 * v_air^2
where v_air = ground_speed_mps + headwind_mps (tailwind is negative).
Then we estimate remaining time as:
T_remaining ≈ T_total * SOC(voltage_per_cell)
SOC is mapped from an industry-typical LiPo 3.3–4.2 V per cell curve (see code).
This is deliberately simple, fast, and explainable. You can later add more features (temperature, altitude, prop type) or non-linear terms.
Quick start
-
Put your flights into a CSV with columns:
flight_time_min– total flight time (minutes)payload_kgground_speed_mpsheadwind_mps– positive=headwind, negative=tailwind
-
Calibrate and save a model:
python battery_life_estimator.py calibrate --csv example_flights.csv --out model.json
- Estimate total flight time for a new config:
python battery_life_estimator.py estimate-total --model model.json --payload-kg 0.6 --ground-speed-mps 10 --headwind-mps 2
- Estimate remaining time using current voltage (per-cell):
python battery_life_estimator.py estimate-remaining --model model.json --payload-kg 0.6 --ground-speed-mps 10 --headwind-mps 2 --voltage-per-cell 3.85
Example data
See example_flights.csv for a fake-but-plausible dataset to test the pipeline.
Notes
- Voltage→SOC mapping uses a smoothed interpolation of typical LiPo discharge (4.20V=100%, ~3.50V≈20%, 3.30V≈0%). Always set your own conservative landing threshold.
- The model assumes steady-state cruise. Hover-heavy profiles or aggressive maneuvers will deviate.
- For quads,
v_air^2works well as a first-order proxy; for fixed-wing you may want lift/drag terms and throttle% if available.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uav_battery_estimator-0.1.0.tar.gz.
File metadata
- Download URL: uav_battery_estimator-0.1.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f9d8ea8bdbbef237f9719c738b870a5a55449dc545f2cb0db227b3273e1f9d8
|
|
| MD5 |
206979608d0fb12d9f029ff6af43f7a6
|
|
| BLAKE2b-256 |
924d0763625fde000a92f51c832b33dafb4ced248a8ef197a66377db7838b7d3
|
File details
Details for the file uav_battery_estimator-0.1.0-py3-none-any.whl.
File metadata
- Download URL: uav_battery_estimator-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39d19953b974b662254268f3c825cd07d99e306d80864c6afdb73926046d40e2
|
|
| MD5 |
3e0aec128612f488ba388ee6f7def034
|
|
| BLAKE2b-256 |
603452961c568ffd73b8aad9951284f67447bac6dc5a8cc5617d05f9131bcb38
|