Page 1 of 1

Engine Timer

Posted: Wed Jun 20, 2012 8:28 pm
by jevermeister
Hi,

ok, here is a simple idea:

I always have the problem, that I forget the flight time, I mostly use my phone to set a countdown to remind me to land in order to NOT kill the LIPO.
The Low Voltage warning is useless for that.
The Powermeter needs to be calibrated to each and every Lipo.

My idea is to implement a timer that sums up the time the system is armed (motors are spinning), so after a given time (maybe a config.h parameter) the buzzer will beep while the system is armed.
This helps people with cheap TX Systems like me ;-)

I already coded it:

Code: Select all

  
static uint8_t warn_runtime = 0,runTimeOfMotors = 0;     
static long millis_old = 0;   

Code: Select all

  if ( millis_old <= millis() ){
    millis_old = millis()+1000;   //+1 second
    if(armed == 1){
    runTimeOfMotors++;
    }  }
  if (runTimeOfMotors >300){  //5min of flight =300s (could be a parameter or a gui variable too)
    warn_runtime = 1;             //activate buzzer
  }


instead of "armed" ore could think of using a throttle threshold (idle+2ß% or something)
I implemented it in buzzer.ino
as usual, this seems to be a good idea for ME but what do you guys think?
Especially with the current memory discussion raging on?

Is this a usefull feature that deserves to be in the shared trunk?

Re: Engine Timer

Posted: Wed Jun 20, 2012 8:34 pm
by kos
I mostly use my phone to set a countdown to remind me to land in order to NOT kill the LIPO.


https://www.google.fr/search?q=lipo+buzzer

Re: Engine Timer

Posted: Wed Jun 20, 2012 8:51 pm
by jevermeister
This is the same principle used in the multiwii controller. The buzzer start to beep if the voltage is below a given threshold - we have three levels at the moment.
BUT
the LiPo voltage curve is not a good indicator for that. It is stable until a blink before the LiPo is discharged too much.

Everybody I know uses a countdown that is installed in his tx.

Re: Engine Timer

Posted: Wed Jun 20, 2012 9:26 pm
by kos
kos wrote:
I mostly use my phone to set a countdown to remind me to land in order to NOT kill the LIPO.


https://www.google.fr/search?q=lipo+buzzer



you need a countdown to be displayed on your groundstation or send via telemetry
you need the countdown to autostart
you need the countdown to be proportional to the drawn current


but this as nothing to do with NOT kill the LIPO .. i was mainly making fun of your requirement, i quoted this chosen part for a reason.

http://en.wikipedia.org/wiki/5_Whys

Re: Engine Timer

Posted: Wed Jun 20, 2012 9:34 pm
by Tommie
I'd appreciate some kind of general purpose warning system. Any subsystem should be able to indicate an emergency (e.g. excessive I²C errors, voltage failure etc.), and other subsystems would be triggered to indicate this state (special LED blink sequence, telemetry warning, buzzer buzzing like made etc.).

Re: Engine Timer

Posted: Thu Jun 21, 2012 1:39 pm
by Alexinparis
I think it's possible to tune the powermeter code for this need.
(for instance implementing a gas threshold with a fake and flat consumption)

Re: Engine Timer

Posted: Thu Jun 21, 2012 2:19 pm
by jevermeister
Alexinparis wrote:I think it's possible to tune the powermeter code for this need.
(for instance implementing a gas threshold with a fake and flat consumption)

Good point!
I will take a look into that and report back.

Nils

Re: Engine Timer

Posted: Mon Jun 25, 2012 9:31 am
by Hamburger
Nils,
the 'uptime' counters for both armed and power-on are both there already.
What you need to add is the alarm threshold and the alarm.

Re: Engine Timer

Posted: Mon Jun 25, 2012 10:01 am
by jevermeister
Hamburger wrote:Nils,
the 'uptime' counters for both armed and power-on are both there already.
What you need to add is the alarm threshold and the alarm.


Damn,
I knew that I reinvented the wheel ;-)

So let's see where it is...

Re: Engine Timer

Posted: Mon Jun 25, 2012 8:42 pm
by jevermeister
Did not find it :-/

Re: Engine Timer

Posted: Mon Jun 25, 2012 10:11 pm
by Hamburger
got eclipse open, so from LCD.ino

Code: Select all

print_uptime(armedTime / 1000000);
print_uptime(millis() / 1000 );

ok?