Up time counter

openTx has introduced a range of new features, ideas and bling. It is fast becoming the firmware of choice for many users. openTx will run on ALL current hardware platforms, including the gruvin9x and sky9x boards. Work has already started to support the new FrSky X9D radio!
Post Reply
nosense
Posts: 6
Joined: Thu Aug 16, 2012 3:16 pm
Country: -

Up time counter

Post by nosense »

Hello I am quite new into open9x, but I am missing one feature from my graupner MX-16s. It is timer, that counts "up time" from last charge. When I know that my battery last 6 hours of transmitting then I don't have to waste time charging when I see that transmitter was powered up for only 2 hours from last charge. It would be great to have this timer for example on STATS screen. In EEPROM It is necesary to store timer value and transmitter voltage. When on power up is detected voltage higher than last stored value the timer is cleared to zero, because we just detected freshly charged battery.

User avatar
Peter
Posts: 232
Joined: Thu Dec 29, 2011 8:45 pm
Country: -
Location: Zuid-Holland

Re: Up time counter

Post by Peter »

That would be a nice feature!
Romolo
9x Developer
Posts: 1109
Joined: Sat Dec 31, 2011 12:11 am
Country: -
Location: Massa (MS), Tuscany, Italy

Re: Up time counter

Post by Romolo »

How much higher ??
On NiMh there is a huge recovery effect. A used pack if left unused for a while will recover some tenths of volts but they will lost in a while.
Furthermore which time resolution you expect ?
If we want a 1 second resolution it means 3600 writes per hours about 16000 write during my last flying session; No thanks !!! I like my eeprom.
Instead lipo/life batteries have a well known discharge curve, maybe it can be useful to calculate remaining capacity knowing the voltage.
nosense
Posts: 6
Joined: Thu Aug 16, 2012 3:16 pm
Country: -

Re: Up time counter

Post by nosense »

I don't know implementation details, but it works quite well on MX-16 with Ni-Mh batteries for more than 3 years. I agree that eeprom lifetime would be issue, but then I am wondering how its done in MX-16's firmware.
Romolo
9x Developer
Posts: 1109
Joined: Sat Dec 31, 2011 12:11 am
Country: -
Location: Massa (MS), Tuscany, Italy

Re: Up time counter

Post by Romolo »

They have a battery backup on RAM if I'm not wrong.
About NiMh maybe it's sufficient to reset the counter when voltage value is near a fully charged battery (10.8V for a classical 8 element battery)

bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Up time counter

Post by bertrand35 »

I will add this feature only on boards which have the soft power feature (remanent timers). I don't want to write in EEPROM something each second...
Bertrand.
User avatar
MikeB
9x Developer
Posts: 18010
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Up time counter

Post by MikeB »

On ersky9x we already have a current monitor that stores the used capacity in the EEPROM, even better than a timer I would say.
I agree, without the soft power feature, writing to the EEPROM makes this rather a problem for wearing out the EEPROM. I have investigated the possibility previously and concluded it is difficult to do without excessive writing to the EEPROM.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
nosense
Posts: 6
Joined: Thu Aug 16, 2012 3:16 pm
Country: -

Re: Up time counter

Post by nosense »

So there is some sort of current sensor on ersky board? I am pretty sure that there is no way to do this on stock 9x board.

But to resolve EEPROM write number I think we actualy don't need one second acurancy. If we increment counter at 0:30, 1:30, 2:30,... we get one write per minute and stay within 30 second error each power cycle. My each flight is around 10 minutes and the battery last 6 hours = 36 power cycles. 36 * 30 sec = max 18 minute total error. That is totally acceptable for given purpose. We don't need super accurate timing.

This solution would results in 10 eeprom writes each flight, but I am pretty sure that I generate more writes using trims to compensate drift of gyros on my tricopter board.
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Up time counter

Post by bertrand35 »

Well, why not ... if flash allows ...
Bertrand.
User avatar
MikeB
9x Developer
Posts: 18010
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Up time counter

Post by MikeB »

The EEPROM is not as simple as that, as I understand it, it is divided into blocks and a write to any byte in a block causes the whole block to be written. So writing to two consecutive bytes counts as 2 writes to each of them!

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Up time counter

Post by Kilrah »

AFAIK the eeprom is single-byte access, I haven't read about blocks at least in the "normal" datasheet.
However, as I understand the eeprom management, a write to any single byte will trigger a write of the entire "file" anyway (either the entire currently selected model, or the "General Settings" file).
Everytime a single byte is changed (and after a short delay) a new copy of the entire model is written, because it firstly has to be compressed, with a result that will likely change much more than just the byte the user has edited, and secondly in order not to lose data if the user turns the power off during write a new copy is written and the new location is stored afterwards, so any loss of power in the middle will simply reload the last copy, losing the last change because the model location still points to the old address.

So we actually have a ton of bytes being written on each change.
User avatar
Peter
Posts: 232
Joined: Thu Dec 29, 2011 8:45 pm
Country: -
Location: Zuid-Holland

Re: Up time counter

Post by Peter »

MikeB wrote:On ersky9x we already have a current monitor that stores the used capacity in the EEPROM, even better than a timer I would say.

Mike.
Is this available on open9x too? I could only find the actual current.
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Up time counter

Post by bertrand35 »

No, it's not done today, would you open an enhancement issue?
Bertrand.
User avatar
Peter
Posts: 232
Joined: Thu Dec 29, 2011 8:45 pm
Country: -
Location: Zuid-Holland

Re: Up time counter

Post by Peter »

I just did, but I cannot change it to enhancement.
All new isseus are automatically defects.
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Up time counter

Post by bertrand35 »

The global timer (since last charge) has been added.
Also now all Model Timers may be "remanent" (you will see a 'R'). It means that when you load your model / start your Tx, it starts where it was before ...
Bertrand.

Post Reply

Return to “openTx”