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

Add remaining flight time and distance calculations and OSD items #2863

Merged
merged 1 commit into from Jun 17, 2018

Conversation

Projects
None yet
3 participants
@shellixyz
Copy link
Collaborator

commented Mar 2, 2018

Answers #2804 and partially #2792. Also closes #3215.

Calculates the remaining available flight time and travel distance before needing to go straight to home based on GPS distance from home, remaining battery capacity, average power draw, altitude and direction change during RTH and wind estimation. The OSD items will blink when the timer reaches 0.

New settings:

  • osd_use_wind_compensation: use wind estimation to compensate for time/distance calculation ON/OFF
  • idle_power: power drawn by the system when the motor(s) are stopped
  • cruise_power: power drawn by the motor(s) at cruise throttle in cW (0.01W)
  • nav_fw_cruise_speed: speed at cruise throttle in cm/s
  • rth_energy_margin: desired energy left after arriving to home (for landing) in % of usable battery capacity

It will only display the time if the following conditions are met:

  • The VBAT and CURRENT_METER features are enabled
  • The GPS is healthy and the home position has been set
  • The battery capacity has been specified with the mWh unit
  • The cruise_power and nav_fw_cruise_speed settings have been set (>0)
  • The battery was full when plugged in
  • The FC is armed

Obviously be careful with this:

  • It can only be as precise as the meters calibration
  • Wind estimation has not yet been well tested and is not updated very often
  • If not configured correctly the estimated time can be way off
  • It is advised to set nav_fw_cruise_speed a bit lower than the real speed and cruise_power 10% higher than the power at cruise throttle to ensure variations in throttle during cruise won't draw more power than estimated.

@shellixyz shellixyz force-pushed the shellixyz:fly_time_left_before_rth branch from 2037d60 to a9d233f Mar 5, 2018

@stale

This comment has been minimized.

Copy link

commented May 13, 2018

This issue / pull request has been automatically marked as stale because it has not had any activity in 60 days. The resources of the INAV team are limited, and so we are asking for your help.
This issue / pull request will be closed if no further activity occurs within two weeks.

@shellixyz

This comment has been minimized.

Copy link
Collaborator Author

commented May 14, 2018

Testing is in progress. It is working but I did some minor adjustments and need to test fly it one more time.

@teckel12

This comment has been minimized.

Copy link
Contributor

commented May 23, 2018

@shellixyz Distance left in combination with distance from home could yield an automatic RTH feature.

@shellixyz

This comment has been minimized.

Copy link
Collaborator Author

commented May 23, 2018

Yes it is planned :). It is already possible with this code. The distance to home is already taken into account and soon the wind estimation from #2450.

@teckel12

This comment has been minimized.

Copy link
Contributor

commented May 23, 2018

@shellixyz I don't think even DJI uses wind estimation for the auto RTH feature.

@shellixyz shellixyz force-pushed the shellixyz:fly_time_left_before_rth branch 2 times, most recently from 7624a4c to bf5d1b1 Jun 4, 2018

@shellixyz

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 4, 2018

I've updated this PR. It has been tested and is ready for review/merge.

@shellixyz shellixyz changed the title Add remainingFlyTimeBeforeRTH calculation and OSD item Add remaining flight time and distance calculations and OSD items Jun 4, 2018

@teckel12

This comment has been minimized.

Copy link
Contributor

commented Jun 4, 2018

@shellixyz Travis doesn't agree.

@shellixyz shellixyz force-pushed the shellixyz:fly_time_left_before_rth branch from bf5d1b1 to 6bf8d40 Jun 4, 2018

@shellixyz

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 4, 2018

@teckel12 Now it does :)

@shellixyz shellixyz force-pushed the shellixyz:fly_time_left_before_rth branch 2 times, most recently from 0be765c to 471374a Jun 8, 2018

@shellixyz shellixyz force-pushed the shellixyz:fly_time_left_before_rth branch from 471374a to b7056b5 Jun 15, 2018

@shellixyz shellixyz force-pushed the shellixyz:fly_time_left_before_rth branch from b7056b5 to 83148a0 Jun 17, 2018

@fiam fiam added this to the 2.0 milestone Jun 17, 2018

@fiam fiam merged commit 04ab376 into iNavFlight:development Jun 17, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.