For anyone interested, I've tweaked the OSD firmware to add a timer and a " time to battery empty" indicator.
The timer is very simple and just starts counting when the speed is over 3m/s so you can get the flight time
The time left function attempts to give you an idea of how much time is left until your battery hits a hard coded 11.1v . Thus it's only useful for 3 cells right now, but I'm adding a feature to let you set what the min voltage should be.
It works in a pretty simple way - it just checks the battery voltage every 30 seconds and uses the last five readings to construct a linear regression and then estimate the time left until the battery hits 11.1v.
Of course if you are putting the throttle up and down and doing aerobatics it will be very wrong, but for steady autonomous flying between waypoints it is reasonably useful. The first readings won't appear until after 3:00 of flight when it has the first five readings.
Anyway, just a bit of fun. The attached zip has an updated OSD_config.exe with two new features of Timer and TimeLeft. There is also the new firmware hex file in there with the features that you will need to upload using the OSD_Config tool.
This is kind of alpha, so please don't use if you are relying on your OSD for life and death work!
I've got some ideas to make the OSD and config tool a lot more flexbile in terms of what you can display in there so will try and see how far I can push it over the next few months - when I get some spare time!
I am interested! :)
Could you share the code you inserted?
I have also made a few changes by the help of the community, like airspeed, home alt, etc.
I was planning to add flight time also, but as you have already made it, it would be nice to use it. :)
We can put together a version that does it all, if that is ok with you. ;)
The code for the timer is very simple. In OSD_Panels.pde, in the function writePanels, I have an elapsed time counter that is triggered when airspeed rises above 3m/s.
- this is from inside writePanels
if(startTime > 0)
elapsedTime = (millis() - startTime)/1000;
if(osd_groundspeed > 3)
startTime = millis();
Printing the time elapsed is a simple matter of using the elapsed time variable
void panTimer(int first_col, int first_line)
if(elapsedTime > 0)
You will need to add an elapsedTime and startTime variable to the OSD_Vars.h file (it's a long)
You will also need a slot to put the timer in the panel arrays for locating each panel. I overwrote a current panel as I wasn't using it. I'm not sure how many new panels it can handle, but you will need to modify the config tool as well to suit whatever changes you made.
I have attached a zip of the code files, as well. Other changes in this code include
Thank you James,
How did you make config tool?
I added my functions to existing panels, so i can use the old config tool, but i like your workaround much better. :)
Did you use visual studio?
Thank you James,
Now my OSD is getting better, and better. ;)