Page 1 of 1

Navigation fail-safe commands.

PostPosted: Sun Aug 21, 2011 11:59 am
by daedalus
Is it possible with the actual navigation commands to implement some fail-safe options. Something like, if battery voltage drops below some value or home distance is too big abort the current mission and execute another navigation sequence (e.g. fly to home position at 100m then circle above)?
As I understand the IF and UNTIL are not checked after moving to next navigation command.

Re: Navigation fail-safe commands.

PostPosted: Sat Aug 27, 2011 11:55 pm
by Rangarid
You can use the UNTIL command. For example:

do your flight code here
UNTIL (VAR > X) [var = home distance, distance for example 1000m]
FLY_TO_RELATIVE(0,0,100)

Until the distance of 1000m is reached you can do whatever you want, if home distance gets larger then 1km it flies back to your home position. Or something similiar to this. Works with battery voltage as well.

do your flight code here
UNTIL (VAR < X) [var = battery voltage, x = 10]
FLY_TO_RELATIVE(0,0,100)

As long as battery has more then 10V do whatever you want, after that set the FLY_TO_RELATIVE(0,0,100). Then it returns to home if battery voltage is under or same as 10V.

There is an example in the wiki:
1 CLIMB(35m)
2 CIRCLE_RELATIVE(lon: 0m, lat: 0m, radius: 100m, height: 150m)
3 UNTIL(Height(m) > 145)
4 FLY_TO_REL(lon: -150m, lat: 150m, height: 145m)
5 FROM_TO_REL(lon: -150m, lat: 150m, height: 145m)
6 FROM_TO_REL(lon: 150m, lat: 150m, height: 145m)
7 FROM_TO_REL(lon: 150m, lat: -150m, height: 145m)
8 FROM_TO_REL(lon: -150m, lat: -150m, height: 145m)
9 GOTO(5)

Let me explain it for you:
1. the plane will get some altitude until it reaches 35m
2. the plane will come back and flies circles above your head in a 100m radius and the height of 150m
3. it will fly circles and circles until height is 145m
for 4-8 have a look at the picture:
Image
The numbers on the lines are the numbers of the code. This one will fly to the 4 points forever until it crashes because battery is empty ;)

Re: Navigation fail-safe commands.

PostPosted: Tue Aug 30, 2011 12:17 pm
by Tom
What a complete answer ;-)

@daedalus Micropilot (c) has navigation commands which are continuously executed in parallel to the "normal" ones. This functionality can be used for all kinds of fail safe commands.
Is this what you were referring to?

Re: Navigation fail-safe commands.

PostPosted: Tue Aug 30, 2011 1:08 pm
by daedalus
Thank you Rangarid for your explanation. It sounds great, but my understanding was that UNTIL command is checked after executing all previous commands and then repeating only the previous navigation command, not an entire block of commands.

A fail-safe command should kick in no matter which line the navigation program is currently executing. Suppose you have a long flight plan, 30min, but after 5min the battery voltage drops too much - abort and come home.

@Tom, not necessarily navigation commands executed in parallel but to constantly check some fail-safe parameters (min. voltage, max. home distance, max. flight time, etc.). I might be wrong, but I think you already have some options in GluonPilot code - when there is no radio link it switches to automatic mode, if there is no navigation program it returns to home at 100m.