Default Battery Failsafe Level

1,160 views
Skip to first unread message

Robert Lefebvre

unread,
Feb 21, 2013, 8:26:03 PM2/21/13
to drones-discuss
As I'm going through setting up my 3DR quad from scratch here, one of the things I've noticed is that the default battery failsafe level is 9.6V, or 3.2V/cell.  I think this is too low.  I typically set it at 3.5V.

Anybody have an opinion on where this default should be set?  (ie: has this been discussed recently, or is this lost in history)?

I guess if it's too high, we'll have a false trigger.  But I'm running a 4S 5000 battery, so it should hold up the voltage no problem.

I also noticed the Vcc is 4.66V.  Perilously close to my planned 4.5V Vcc RTL default setting.

Craig Elder

unread,
Feb 21, 2013, 8:54:04 PM2/21/13
to drones-discuss
Is that Vcc measured on the board and using your 7805 regulator connected to the output rail?


--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Robert Lefebvre

unread,
Feb 21, 2013, 9:31:55 PM2/21/13
to drones-discuss
No, that is a stock 3DR quad, stock 3DR ESC's, powered through the output rail.  APM2.0. No power module.


Robert Lefebvre

unread,
Feb 21, 2013, 9:41:46 PM2/21/13
to drones-discuss
The good news is, it flew brilliantly with the stock parameters. I haven't flown since 2.9 rc2 apparently, and I'm not sure I even flew that, it was just what was loaded.    I just reset everything, put Rate_P on the knob and set it low, took off, and tuned it.  I ended up at 0.145 vs. 0.150 default, but I'm running 4S.

The only thing I don't like is, I used to be able to #define the battery level the LED's would start flashing at.  Now it seems to be tied to the same parameter that does the Battery_FS.  So I don't get really any warning.  I was waiting for it to go, hovering 3 feet over home, and when it hit 13.6V, it started flashing and just plunked itself right down with zero warning at all.

I think this should be tweaked.  We need to give people to some kind of warning.  If you were standing under home, which isn't that uncommon, and it was only 8-10 feet over you, I think it might land right on you before you could react.

No problems with Alt_Hold, I didn't even touch the parameters.  Brilliant.  The only thing I didn't like was flying around fairly dynamically, it would sometimes lose altitude and "just take it".  I know that's how it's set up, to accept an error after a certain point.  You just have to keep your eye on it as you're flying around.



Robert Lefebvre

unread,
Feb 21, 2013, 10:05:09 PM2/21/13
to drones-discuss
Yup, that's it, if you're in any mode other than auto, it just lands *right now*.  No warning at all, can't even get flashing lights first with the way things are now.  I'll have to disable Battery_FS.  I don't really consider this safe.

static void low_battery_event(uint8_t failure_type)
{
    // failsafe check
    if (g.failsafe_battery_enabled && !ap.low_battery && motors.armed()) {
        switch(control_mode) {
            case STABILIZE:
            case ACRO:
                // if throttle is zero disarm motors
                if (g.rc_3.control_in == 0) {
                    init_disarm_motors();
                }else{
                    set_mode(LAND);
                }
                break;
            case AUTO:
                if(ap.home_is_set == true && home_distance > g.waypoint_radius) {
                    set_mode(RTL);
                }else{
                    // We have no GPS or are very close to home so we will land
                    set_mode(LAND);
                }
                break;
            default:
                set_mode(LAND);
                break;
        }
    }

    // set the low battery flag
    set_low_battery(true);

    // warn the ground station and log to dataflash
    gcs_send_text_P(SEVERITY_LOW,PSTR("Low Battery!"));
    Log_Write_Error(ERROR_SUBSYSTEM_FAILSAFE, failure_type);
}

Ritchie Wilson

unread,
Feb 22, 2013, 3:15:07 AM2/22/13
to drones-...@googlegroups.com
Consensus is 3.0v/cell is point of no return for charging. So allowing for surges and cheap batteries I think Robert is correct. 3.5v is safe as well as not too high.

Regards
Ritchie.

On 22 Feb 2013, at 03:22, Steven Harsanyi <stevenh...@gmail.com> wrote:

I have a video of flashing lowbatt leds and a brownout with a reboot.  The atmega2560 rebooted but the ppm encoder stayed running.  Watch the leds on the apm1 board.

--

Robert Lefebvre

unread,
Feb 22, 2013, 7:46:34 AM2/22/13
to drones-discuss
Steven, what exactly is the test methodology you're doing here?  I'm not sure what you're doing.

Ritchie, I think 3.2V/cell could be a good "land NOW" setting.  But we don't have any warning level.  I used to use the lights as a warning level to come back.  It would be nice to have two levels.  Warn level flashes the lights, and maybe does a RTL if you want.  Level 2 is "land now".  Same with the Vcc.  4.5V or something is a warning and RTL, and 4.0 is "land now".

I hate going and making all this more complicated, but we'd need a bunch of new parameters to do this all right. 

There's no point in me working on it at this point, because my last pull request hasn't even been merged in yet.


On 21 February 2013 22:17, Steven Harsanyi <stevenh...@gmail.com> wrote:
I started logging board_vcc as a test.  I find that the current code works great.  You have to adjust the low volts for either 3s or 4s and measure and input your vcc from your bec/ubec.  I use 10.6 and 13.6.  Depending on the air frame I am flying I have plenty of time to land when my leds start to blink.

Here is a graph of 3 different logs when I was brownout testing my apm1 earlier tonight.

The logs are here.

On Thursday, February 21, 2013 8:26:03 PM UTC-5, robert.lefebvre wrote:

--

Randy Mackay

unread,
Feb 22, 2013, 10:37:54 AM2/22/13
to drones-...@googlegroups.com

     Ok, i've increased the default to 10.5v (3 x 3.5v).

Rob,
     Sorry if I missed your patch.  I'll do it tomorrow.  I just pulled in one of Jason's a moment ago so I'm not ignoring everyone..just got a little behind on things.

-Randy



From: Ritchie Wilson <originaln...@gmail.com>
To: "drones-...@googlegroups.com" <drones-...@googlegroups.com>
Sent: Friday, February 22, 2013 5:15 PM
Subject: Re: [drones-discuss] Re: Default Battery Failsafe Level

Robert Lefebvre

unread,
Feb 22, 2013, 10:52:20 AM2/22/13
to drones-discuss
Ok, thanks.

The only thing is... I'm not sure what the default should be anymore.  When I wrote the original note, I didn't know that it was going to *land now* at the voltage level.  I think 3.5V/cell is too high for that function, 3.2V might be right.

It seems like we need two levels.  Like a Battery_Warn, and a Battery_Critical.  My thinking is like this:

Battery_Warn:
3.5V/cell
4.5Vcc
-LED's start blinking
-MAVlink message like "Battery Low"
-RTL if Battery FS is selected

Battery_Critical:
3.2V/cell
4.0Vcc
-MAVlink message like "Battery Critical!"
-Land NOW

What do people think?  If I can get some consensus, I can put together a patch.  It would be in the same line as my dual-voltage-monitoring changes.

If we get this all working, an instructional video would be great.  Fly the copter about 50 feet away from Home, with RTL_Final set at 2m.  Put it in Loiter and start filming.  As the battery dies, the copter will fly up to RTL Approach (if I've got my param names right), fly over to home, and then descend, but hold indefinitely at 2m.  Then, when Battery Critical is reached, it'll Land.

I think this would be a great functionality?  IMO, this is proper UAV stuff.  This should be sorted before any advanced features like follow-me or things like that.  If we're going to start going for semi-autonomous flight, we need this kind of protection.

I could do the same test for Vcc.  Rig it up with 4s NiMH AAA running the APM direct, in a half-discharged state with a full 4S 5000 flight battery.  Then just let it go in Loiter.  I'll use something cheap for this test.

One thing I don't know is if we can just make up new MAVlink messages like "Battery Critical"?




u4e...@hotmail.com

unread,
Feb 22, 2013, 11:04:41 AM2/22/13
to drones-...@googlegroups.com
I agree with Rob on this one.  We should have 2 battery levels like we had before.

Andrew Chapman

unread,
Feb 22, 2013, 11:11:51 AM2/22/13
to drones-...@googlegroups.com
+1

I've been doing a lot of endurance testing lately, and it has been a mix of annoying and frightening to have the thing suddenly do an RTL when I'm just hovering nearby.

Another safty use case is indoor use or near obstacles. You need some warning in these cases.

AC.

Robert Lefebvre

unread,
Feb 22, 2013, 11:49:31 AM2/22/13
to drones-discuss
Right, do I remember correctly that we used to have a seperate #define which as the level the batteries would start blinking at?  And then maybe there was this Battery_FS, but I've never used that before.

I'll try to prepare something and show you guys.

Marco Robustini

unread,
Feb 22, 2013, 12:33:37 PM2/22/13
to drones-...@googlegroups.com
+1, nice idea Rob!


On Friday, February 22, 2013 4:52:20 PM UTC+1, robert.lefebvre wrote:

Ritchie Wilson

unread,
Feb 22, 2013, 1:31:23 PM2/22/13
to drones-...@googlegroups.com
3.5v/cell and 3.2v/cell are sensible values but without having a cell count this becomes moot. If we had  batt_warn, batt_land, batt_count the setup would be more universal I think. People would only need to alter the count to ensure safe flight then.

Regards
Ritchie.

u4e...@hotmail.com

unread,
Feb 22, 2013, 4:23:43 PM2/22/13
to drones-...@googlegroups.com
For the low_battery_event() (which puts the copter into RTL) there always was only 1 treshold.
For u4eake's showleds I had 2 tresholds, so that there was some advanced warning.  

#define BATTERY_EVENT        ENABLED
#define LOW_VOLTAGE        9.9
#define MID_VOLTAGE        10.6
#define VOLT_DIV_RATIO        3.33
#define INPUT_VOLTAGE        5.26

in sensors.pde:
#if BATTERY_EVENT == ENABLED
    //if(battery_voltage < g.low_voltage)
    // low_battery_event();

    if((battery_voltage1 < g.low_voltage) || (g.battery_monitoring == 4 && current_total1 > g.pack_capacity)) {
        low_battery_event();

Robert Lefebvre

unread,
Feb 22, 2013, 4:36:11 PM2/22/13
to drones-discuss
If it RTL'd at the same point the lights started flashing, that would be OK.  It's just the way it is now, it will Land at the same time it starts flashing.  So there's little chance to stop it.  Say you're flying over something that you don't want to land on (water, crocodiles, baby buggies...) if the battery goes low, boom, you're landing.  In my case, I was loitering over my front lawn, expecting it to do an RTL, I heard MP call out "Mode changed to" and it was already on the ground.


Marco Robustini

unread,
Feb 22, 2013, 5:07:27 PM2/22/13
to drones-...@googlegroups.com
Please remove the landing in the case of battery, as I have repeated many times is a crap.
It's always better to force an automatic landing with RTL, but as in the past have also the possibility to intervene manually in that case.
As Robert does not want to see my quad landing on trees, crocodiles, a neighbor, a road, etc.
By setting a good value are always landed in extreme safety with low battery level (not under 3.7V for cell).
My two cents...

-Marco

Ritchie Wilson

unread,
Feb 22, 2013, 6:50:38 PM2/22/13
to drones-...@googlegroups.com
Well that's the beauty of the per cell parameter and double battery parameter.
The dead limit will force a land.
The warning limit will jump into RTL.
Using a sensible warning limit will stop any "oh no" moments from crocodiles or baby buggies. So with testing a sensible default limit can be found and defaulted. Obviously would be optional for many anyway as most don't have voltage monitoring but it would be good.

Regards
Ritchie.
--

Robert Lefebvre

unread,
Feb 22, 2013, 8:05:17 PM2/22/13
to drones-discuss
Yes, exactly.

Marco, I think the forced landing at 3.2 or 3.0V per cell is reasonable, because much below that, and you're going to come down anyway, and chances are you won't be right way up! ;)

But you can turn that off if you really don't want it.

Bill Bonney

unread,
Feb 22, 2013, 8:11:46 PM2/22/13
to drones-...@googlegroups.com
I was looking into the accuracy of Vcc monitoring today, and i posted in another thread the results from that.

My only concern with monitoring Vcc for failsafe conditions is that it is a regulated voltage. It's behaviour at the point of failure tends to be a a rapid collapse. Unlike when monitoring a battery since its voltage collapse is exponential. A 3S battery at 3.0V is going to create a regulated Vcc (e.g. 5.0V) just fine. Even Rob with his low voltage drop regulator is going to be good with a 2S battery at 6V. Monitoring Vcc is good (make sure you have a reasonable regulated voltage) , but really the battery voltage, battery current or mAH used is the only useful measure to a trigger failsafe condition.


da...@wylam.co.uk

unread,
Feb 23, 2013, 7:34:06 AM2/23/13
to drones-...@googlegroups.com
I couldn't agree more with all of this. The flashing lights, the RTL, or the land if we are about to fall anyway. Perfect IMO.

One other thing that we could consider - again stolen from DJI - and probably a little more complex to implement. 

On the wookong there is another level of safety too. If you have battery monitoring setup and hit the first level of battery failsafe the wookong can slowly start to move the centre of your throttle range up. In other words you start to slowly descend unless you start raising the stick. Eventually you end up at 90% of full stick which just allows you to hover or climb slowly if you go the last 10%.

This coupled with the flashing light is very safe way of approaching the problem, although i must admit it caught me off guard the first time when the failsafe went after about 2 mins (I'd set it up wrong), and I was convinced I must have thrown 2 props on the s800 cause it just wouldn't go up anymore....

da...@wylam.co.uk

unread,
Feb 23, 2013, 7:35:45 AM2/23/13
to drones-...@googlegroups.com
Oh, and i also think 3.2 per cell is the absolute minimum. I've lost brand new nanotechs at 3.1, never to charge properly again.

Ritchie Wilson

unread,
Feb 23, 2013, 8:45:56 AM2/23/13
to drones-...@googlegroups.com
Yes 3.2 is the safe limit but most LiPos with careful monitoring can be brought back with a quick nicd charge to boost it then using a balanced lipo charger. I've done it for years and never had problems.

Regards
Ritchie.

Robert Lefebvre

unread,
Feb 23, 2013, 10:29:30 AM2/23/13
to drones-discuss
Dave, I like that idea of the forced descent, but I'm not going to tackle that at this point.  Somebody else can do it.  I just want to prevent the crashing.  I don't need a forced descent to know my battery is dying, I just need some indication.

I've also brought back LiPos from the dead.  That lipo I had on the Octo that I took down to about 2v/cell, still alive and kicking.  I can't explain it, but I've cycled it several times, and it's good.  I just marked it with an X so I can keep my eye on it.




da...@wylam.co.uk

unread,
Feb 23, 2013, 11:35:59 AM2/23/13
to drones-...@googlegroups.com
Good tips, I will drag my dodgy (but nearly new) nanos out of the firebin and give them a nicad charge and try again with the balancer. It's puffed slightly though this one so I'll be careful.

I agree on the forced descend too, a nice have, but still not much use without some indication and eventual RTL. And this needs to be right first.

Actually with simonk firmware I've found that if i go too far (ignoring the battery monitor) it gradually loses power and starts descending anyway, (unlike some firmwares where just one motor will stop first, followed by a tumble then smash) Although this pushing it is what 'killed' one of my batts, and I couldn't recommend it from any more than 50ft up as it does happen rather quickly. 

Robert Lefebvre

unread,
Feb 23, 2013, 11:39:59 AM2/23/13
to drones-discuss
I don't keep puffed packs in my house.  That's when I figured they are done, and dangerous.  They go out back until I can dispose of them.  Amazingly, the one I took to 2V, not puffed at all.  I don't get it.

Ritchie Wilson

unread,
Feb 23, 2013, 11:49:43 AM2/23/13
to drones-...@googlegroups.com
Yeh a quick nicd boost is good for unresponsive LiPos but puffed ones should be disposed of

Regards
Ritchie.

john...@gmail.com

unread,
Feb 23, 2013, 2:14:21 PM2/23/13
to drones-...@googlegroups.com
Damage at 3.2v?

If we are talking about LiPo the absolute low limit where the chemistry start to break apart is 2.7v. The lowest safe operational limit is ~3v. The limit most used in R/C is 3.3v. This is because that is the point where you can still expect to draw some current from the battery and be able to land the plane. Once you go below 3.3v it starts to drop very quickly. But a battery should not take permanent damage if above 3.0v (2.7v theoretically). But depending on the battery, if you draw high currents it can go from 3.3v to below 3v in a matter of seconds.

- JAB

Robert Lefebvre

unread,
Feb 23, 2013, 2:18:22 PM2/23/13
to drones-discuss
I wonder if temperature plays a role in these equations too.  The little Lipo I took down to 2V/cell on my Octo, well it was just below freezing, so Voltage would likely be depressed.  It recovered back to 3.0V/cell all by itself just when I brought it inside.  


john...@gmail.com

unread,
Feb 23, 2013, 2:18:42 PM2/23/13
to drones-...@googlegroups.com
For multicopters where you get instant crash without power,  I usually set low voltage warning at 3.5v and forced landing at 3.2v.

- JAB

Robert Lefebvre

unread,
Feb 25, 2013, 5:18:35 PM2/25/13
to drones-discuss
John, do you mean you have MP do a voltage warning, and then forced landing at 3.2V?  Or how did you do two-level protection when the code didn't support it?

I just did a fairly good chunk of the required code changes to my branch.  Welcome any input anybody has:


I'm still avoiding creating any new parameters at this point.  I'm going with the assumption that if somebody uses this, they'll be using a 2S battery and a 2:1 voltage divider on the input, and will be happy with a 3.5V/cell low, and 3.2V/cell critical level.  Otherwise they can #define and upload.


Bill Bonney

unread,
Feb 26, 2013, 1:59:12 AM2/26/13
to drones-...@googlegroups.com
Your changes look good, though I would suggest adding the extra parameters and make it configurable. I'll look into the changes for Vcc reading next week. Just a bit bogged down at the moment...

john...@gmail.com

unread,
Feb 26, 2013, 4:18:07 AM2/26/13
to drones-...@googlegroups.com
Robert, Sorry for the confusion, I was talking about copters and low voltage behavior in general. I'm kinda the black sheep here since I fly WKM and YS-X6 more then APM. :)

Another thing to consider is that resting voltage on lipo is pretty much useless as an indicator. If you draw to much current on a cheap battery with high internal resistance, it can be below 3v during flight and still show a much higher voltage when you land (stop drawing current) and measure the battery resting voltage. This is probably the reason why some people recommend very high cutoff voltages, and the source of "I puffed my battery at 3.4v etc" stories.

- JAB

Robert Lefebvre

unread,
Feb 26, 2013, 2:16:59 PM2/26/13
to drones-discuss
Actually, I went to add that parameter, and then I saw that I'd run out of enumeration room in the section it would fit into.  :(  Fixing that... well I'm a little unsure about it.  I think I need to bump the following parameter enumerations downward, rev the parameter list, which requires a parameter reset for everyone...

So I took the cheap way out for now.


On 26 February 2013 01:59, Bill Bonney <billb...@gmail.com> wrote:
Your changes look good, though I would suggest adding the extra parameters and make it configurable. I'll look into the changes for Vcc reading next week. Just a bit bogged down at the moment...

Robert Lefebvre

unread,
Feb 26, 2013, 2:24:19 PM2/26/13
to drones-discuss
Hey, we never know where we are if nobody ever does competitive analysis!  ;)

Are you saying that drawing a "cheap high resistance battery" below 3V per cell in flight, can cause it to puff, even if the resting voltage is still above 13.4V?

I thought it was the 3.0V resting voltage that was the important thing, more than the "dynamic" voltage.

I've done some pretty stupid things with LiPos, and been pretty lucky.  I've never ruined one from discharge, only from crashes.  And I've over-discharged them several times.

When I first started flying my Octo, I found the voltage was sagging quite a bit.  I could get below 3.5V/cell even on a fresh charge if I punched the throttle.  Simply put, ~320A from 2 parallel 5000mHA 20C packs was just too much.  Especially one set that is pretty old and tired.  I'm going to have to retire that set I think as one of them was strained even flying the 3DR Quad.  I was hitting 3.5V after less than half the expected flight time.

john...@gmail.com

unread,
Feb 26, 2013, 3:52:47 PM2/26/13
to drones-...@googlegroups.com
Yes, voltage during usage is what matters. All voltage limits I have mentioned are for when with current is being drawn from the battery. When you set cut-off voltage on a ESC, the voltage is measured during usage. When you stop drawing current the battery voltage will rise until you get the resting voltage. So it means nothing, other then a very inaccurate indication on how empty the battery is.. Or to put it other words, if your resting voltage is 3v after flight, then you have done damage to the battery since the voltage was much lower then that during usage.

- JAB

Robert Lefebvre

unread,
Feb 26, 2013, 4:01:38 PM2/26/13
to drones-discuss
Ok.  Good to know.  I thought it was the depth of discharge that caused the damage, not the voltage level being achieved.

I've actually bucked the trend of going LiPo everything, and I'm using a bunch of NiMH cells to power my GCS.  So much simpler.  2P8S NiMH, 9.6V, 4600 mAH, just leave it on a trickle charger so it's always ready to go and one less thing to worry about.  A little heavy but not a problem for the application.

For a while I was looking to put a LiPo in my Futaba Tx and realized it was a lot of PITA for little gain.

Robert Lefebvre

unread,
Feb 27, 2013, 11:51:13 AM2/27/13
to drones-discuss
One thing I struggled with, and could use some input, is the first level of protection.  If you look at the decision making process.... I'm trying to figure out all the holes.  Places the protection will fail.  I'd rather figure these out now rather than try to fix them later.  Most of the problems I forsee would occur when the user has no telemetry or external lighting, so they can't see what's happening.

- If the battery goes low when we are in Stab or Acro, with throttle = 0 , then we must be on the ground, so we simply disarm.  Simple right?  What happens if the user is doing a "tumble" when this triggers?  Mid-air disarming.  Not good.  Though thinking about it, how could this happen?  The voltage should go up when you shut off the motors, so you wouldn't just be triggering low_voltage when throttle is down.

But then there's the case where, guy is on the ground, goes to arm, low battery, it will disarm.  When it disarms, it resets the low_voltage.  So he goes "huh", and tries rearming again.  He'll just sit there trying to arm, and then it disarms disarm.  Realistically, I think it would arm for exactly 1/10th of a second, and then disarm.  So it'll look like it's never arming, and hopefully he investigates?

Then the case I really wonder about.  We have GPS, but are close to home.  We could be hovering in Stab mode near home.  Totally plausible.  Then the voltage goes low. Currently the quad will do nothing.  We don't want any sudden RTL's close to home. So the quad does nothing, but low_battery is triggered.  Now the user can fly away from home, and nothing will happen, because the system stops checking when low_battery is already triggered.

Auto mode is another problem.  Currently the way it is set up, it looks at g.failsafe_throttle to figure out what to do.  If it's set to 1 which means always RTL, it will RTL, that's fine.

But if g.failsafe_throttle is 2, which means "continue on mission if throttle signal goes to failsafe", then it just keeps on flying?  That can't be right.  What does the throttle_failsafe setting have to do with whether we continue on a mission or not with a low battery?

But so what do we want to do? Turn around when the battery goes low and come right back?  Maybe crash into a mountain on the way?  Or do we keep going, assuming the operator has telemetry control, and will make the right decision?  Or assume the operator programmed the mission properly, and knows he has enough juice to complete the mission?

Need ANOTHER setting.  :(


On 26 February 2013 01:59, Bill Bonney <billb...@gmail.com> wrote:
Your changes look good, though I would suggest adding the extra parameters and make it configurable. I'll look into the changes for Vcc reading next week. Just a bit bogged down at the moment...

Bill Bonney

unread,
Feb 27, 2013, 4:44:42 PM2/27/13
to drones-...@googlegroups.com
The throttle failsafe being disabled in Auto is for when you go outside of RC range, it stills keeps going. It shouldn't effect low battery failsafe, as in this case the RTL feature still needs to happen. Whether throttle failsafe or not. Any detection below the low voltage point should trigger a return.

If low voltage is triggered and the user flies a set distance away from home, should it not LAND at that point?  

I was thinking how to avoid spinning motors injuring people by cutting the motors under 8ft, but scrub that idea, I think we just need multirotors that have protection on the blades when they are near more than say 2 people that is operating one ;-)


Robert Lefebvre

unread,
Feb 27, 2013, 5:01:08 PM2/27/13
to drones-discuss
Not as the logic is currently laid out. I didn't write this part, it's existing, I just have to figure out what to do with it.  Right now, the *battery failsafe* system looks at the throttle failsafe setting to determine what to do if a low battery comes in on an auto mission.  Obviously not-idea.  But I know if I just make it always RTL on low battery in auto, somebody is going to plot a mission around a mountain with *just* enough battery to make it around, and they'll crash when it Battery-RTL's 3/4 of the way around.

No, if the low_voltage is triggered when they are close to home, then they fly away, it will not then do a Land or RTL.  Once low_voltage is triggered the first time, it stops running the logic.

This is actually somewhat required.  Imagine you're doing whatever, and it does a low_battery_event.  You say "WOAH, I don't want to do that!" You can take back manual control by flipping in and out of a mode.  And it's fine, because once it did the original low_battery, it stops trying to change modes to RTL.  If you had it RTL whenever the battery is low, you couldn't stop it from landing on your head, because as soon as you tried to change back to stab mode, it would go right back into RTL again.

This stuff is complex.


john...@gmail.com

unread,
Feb 27, 2013, 6:52:01 PM2/27/13
to drones-...@googlegroups.com
You just cant prevent everything, trying to do so just becomes a mess. If you can't describe the behavior in a couple of simple rules then it's most likely to complicated.
Low voltage for example, is not related to arming. If the pilot wants to arm with low battery let him, and them after he has left the ground, auto land the damn thing again if battery is critical. If he keeps doing this ignoring voltage warnings and crash, the crash was coming anyways..

- JAB

Bill Bonney

unread,
Feb 27, 2013, 8:28:04 PM2/27/13
to drones-...@googlegroups.com
I would agree with JAB it's too complex now, lets write down the simple failsafe rules and put them on the wiki. The ArduPlane rules seem simple. see http://code.google.com/p/ardupilot-mega/wiki/APM2xFailsafe If it mean RTL to your home 1Km away because you didn't make sure it was set before flying (or you didn't disable RTL) it can't be helped.

My personal opinion that running a drone without telemetry is not really good idea, the drone makes it own decisions based on its instructions and you need to know not what you have told it to do, but what conclusion it has come too. 

Randy Mackay

unread,
Feb 27, 2013, 10:40:23 PM2/27/13
to drones-...@googlegroups.com
Rob,

    For throttle failsafe we combined the enable/disable parameter with the action parameter.  So 0 = disabled, 1 = enabled always RTL, 2 = RTL but continue if AUTO

    So you could redefine the failsafe_battery_enabled parmeter (FS_BATT_ENABLE) to hold the action as well.

     I think it's probably good to have the flexibility to have separate low-voltage vs throttle failsafe responses.

-Randy


From: "john...@gmail.com" <john...@gmail.com>
To: drones-...@googlegroups.com
Sent: Thursday, February 28, 2013 8:52 AM
Subject: Re: [drones-discuss] Re: Default Battery Failsafe Level

Marco Robustini

unread,
Feb 28, 2013, 3:55:27 AM2/28/13
to drones-...@googlegroups.com, Randy Mackay
I agree Randy.
To set the alarm voltage of my lipo I use a simple method, based on the actual effective range of my lipo.
For example, when i fly my quadrirotor with one 4S 5000 mhA 40C i set the timer in my tx to 8 minutes, land and find the residue of lipo with my battery charger, after this time I've 35% residual, i set the tx timer to 10 minutes and do another flight, get out and check again lipo, the residue is now 25% (3.8V per cell)... this is my first safety level, the critic will be 10% of the residual lipo, after another minute of flight.
Now i fly again and when the timer is 10 minutes i put in Loiter my quad and look at the planner the voltage of lipo during hovering, that will be the value that I septum in my parameter.
"At rest" lipo should not drop below 3.7 volts per cell, only in this way will prevent swells and it increases the length, but during the flight the voltage can safely get to 3V.

Marco

Marco Robustini

unread,
Feb 28, 2013, 4:09:25 AM2/28/13
to drones-...@googlegroups.com, Randy Mackay
If you use "Turnigy Nanotech" you need to know that they are lighter than normal, but they are much more sensitive to undervoltage.
In general, my advice is always land with lipo to no less than 3.7 volts per cell, this is a rule to increase the life of the lipo.

My two cents,

Marco

Robert Lefebvre

unread,
Feb 28, 2013, 9:19:42 AM2/28/13
to drones-discuss
Ok John, I agree.  I just wanted some more info on a decision like this.  The best we can do is... do the best we can, and document it so people know what to expect.

Bill, I agree.  It's for that reason I'm not personally interested in that BlinkM thing.  It's just not enough info for me, I almost always have telemetry, even if flying at short range.  We have a system that is capable of making some rudimentary decisions on it's own.  But we still need to be in control to make the higher level decisions. But for that we need information.  At least until the system is very much smarter.

Randy, that's a great idea!  I can do that.  Well, first I'll simplify and rationalize what we have, and then figure out where to go from there.  

I would prefer to use the integer as a bitmask. I really like the flexibility I got out of a single bit with CopterLEDs.  The only thing is it really needs to be backed up with the right interface in MP so people don't have to figure out how to do the bitmath.

Using this, we could actually have a single integer controlling 8 failsafe options.  4 for throttle, 4 for battery, for example.

Marco, I use a pretty similar procedure to figure out how long I can fly.  I usually land at 3.5V/cell which gives me around 3.7-3.8V resting.  Sure, you could stay flying longer but, the flying starts getting bad anyway as the power drops really fast after that.  I have gone much lower a few times though, and have never puffed a pack.

Bill Bonney

unread,
Feb 28, 2013, 11:27:29 AM2/28/13
to drones-...@googlegroups.com
Rob, can you write in a pseudo code way the rules, and we can review them?

Also about battery voltage, it would be great to plot a graph of voltage over time. I suspect it very much an inverse exponential. My personal opinion is that as long as you don't pull more Amps than the battery can provide causing a drop below minimum V ( and that might be 3V) measuring mAH used is a good way to measure power consumption. I don't think currently we have a system that's good enough for that so V senseing is the best we can do for the moment, there's all the enablers in place, it just needs to be tested well enough,

john...@gmail.com

unread,
Feb 28, 2013, 4:10:53 PM2/28/13
to drones-...@googlegroups.com

LiPo discharge curves are well documented. They look something like this. Lipo will stay more or less at nominal voltage and then drop like a rock when empty. This is why it is useless to estimate flight times based on lipo voltages. Proper maH measurements is the only sure way.  Old NiMH lead acid batteries look more like the inverse exponential you mentioned.

- JAB

Robert Lefebvre

unread,
Feb 28, 2013, 4:33:19 PM2/28/13
to drones-discuss
I think mAH measurements are great for airplanes, because they can still fly at reduced power.

But I think voltage measurement is more important for VTOL's.

1)  You can have a "bad" battery, where the voltage drops off WAY before the pack is drained.  You cannot ever have a situation where the pack is drained *before* the voltage falls.  So the voltage measurement is a better early warning system.

2) Hovering aircraft rely on voltage to give them the power they need to stay airborne.  If the power is cut in half, most can't fly.

It's time to land when the voltage drops, not when the mAH are depleted.  

There is no one perfect way.  We don't have anything as reliable as a fuel gauge.  But I'm really nervous relying on capacity, because I know the voltage can drop before the capacity.


--

Randy Mackay

unread,
Feb 28, 2013, 8:18:18 PM2/28/13
to drones-...@googlegroups.com

    By the way, not sure if you've seen it, but In the AC code we have a throttle_integrator variable that, as you might guess from it's name, integrates the throttle over time.  I suspect the thinking was that it could be used to calculate the amount of battery that we've used so far.

     ..we also have the current_total1 variable which is the current useage integrated over time which probably is meant for the same purpose.

     only the current_total1 is wired into the battery failsafe warning so maybe we could remove the throttle_integrator and save 2 bytes.

-Randy


From: Robert Lefebvre <robert....@gmail.com>
To: drones-discuss <drones-...@googlegroups.com>
Sent: Friday, March 1, 2013 6:33 AM

Subject: Re: [drones-discuss] Re: Default Battery Failsafe Level

Robert Lefebvre

unread,
Feb 28, 2013, 8:28:04 PM2/28/13
to drones-discuss
Ok, I'll try to have a look for throttle_integrator.

Jason Short

unread,
Feb 28, 2013, 8:38:03 PM2/28/13
to drones-...@googlegroups.com
That was an old experiment and I never did do anything with it. I assume it would mirror amp hours fairly close.
Jason

Jonathan Challinger

unread,
Feb 28, 2013, 8:37:55 PM2/28/13
to drones-...@googlegroups.com
We need both: a low voltage measurement OR a low capacity measurement should trigger a low battery event.

We also might look at the rate of change of voltage - the voltage drops off quite steeply when the pack is dead. If that happens, we should land immediately. The only trouble there is the battery's internal resistance causing sudden changes with load.

Robert Lefebvre

unread,
Feb 28, 2013, 9:14:53 PM2/28/13
to drones-discuss
Jonathan, I had no intention of getting rid of the capacity measurement.  I just don't have a lot of use for it, but it's there, I'm leaving it.

It would be REALLY difficult to measure the voltage drop rate!  If you can figure it out, that would be great!  Maybe it could be done simply with something like a 10-30 second average?

Randy Mackay

unread,
Feb 28, 2013, 9:40:47 PM2/28/13
to drones-...@googlegroups.com

     In answer to Jonathan's comments - in the current code, both low voltage and/or a low capacity measurement can trigger a failsafe and which you use is user configurable.

-Randy



From: Robert Lefebvre <robert....@gmail.com>
To: drones-discuss <drones-...@googlegroups.com>
Sent: Friday, March 1, 2013 11:14 AM
Reply all
Reply to author
Forward
0 new messages