Inav: RTH without a compass

Created on 7 Aug 2019  路  15Comments  路  Source: iNavFlight/inav

Current Behavior

RTH requires a compass

Desired Behavior

RTH using GPS delta to compute heading

Suggested Solution

  1. forward command at half nav velocity
  2. calculate heading as delta GPS coordinate every second
  3. feed the nav loop with it
  4. once GPS heading and desired heading match for 10 seconds, go full nav velocity

Who does this impact? Who is this for?

For those who want to use iNav on their expensive 3" quad (and want good RTH)

Additional context

the gyro would detect sudden change in heading that could be caused by wind draft or contact, if heading varries too much then go back to 1.

Feature request

Most helpful comment

Just to be clear, the Betaflight rescue mode doesn't bring your model home safely like in INAV. It kinda brings it towards it's creator and then tries to kill them as it crashes.

Like other things, INAV has a higher standard than Betaflight. The Betaflight rescue mode is more of a method of recovering your model (at the expense of it in pieces). The INAV RTH is designed to safely bring the model home and safely land.

There's good reason it's called "rescue mode" and not RTH, as it doesn't RTH, just kinda lures it back and then crashes, hopefully not taking the pilot out.

All 15 comments

Issue-Label Bot is automatically applying the label Feature request to this issue, with a confidence of 0.56. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Why not use Betaflight in this case?
Betaflight has a RTH feature which doesn't need a compass.

because betaflight RTH drops the quad when triggered below 100m

Please have a look here:
https://github.com/betaflight/betaflight/pull/6404
Since betaflight 4 it's configurable!

Just to be clear, the Betaflight rescue mode doesn't bring your model home safely like in INAV. It kinda brings it towards it's creator and then tries to kill them as it crashes.

Like other things, INAV has a higher standard than Betaflight. The Betaflight rescue mode is more of a method of recovering your model (at the expense of it in pieces). The INAV RTH is designed to safely bring the model home and safely land.

There's good reason it's called "rescue mode" and not RTH, as it doesn't RTH, just kinda lures it back and then crashes, hopefully not taking the pilot out.

Yes and autolanding in bf is drop, that's why I'd prefer to stick with it. Also filters have become unfathomable in 4.0 and inav flight characteristics have become quite good.

Apart from the time things take, is there a reason why some things like RTH and autoland cannot be handled with the less precise sense of heading provided by delta GPS pos?

@laurentopia It's easy to determine direction when moving, but once you stop forward progress to land, it's really tough to know what direction to move (without a compass) to make a correction. This is why Betaflight's (kill creator mode) happens when "basically" home.

With this said, I think it's possible (albeit not totally accurate). But, simply using the current Betaflight recovery logic isn't possible without a catastrophic result (which is what INAV tries to avoid). In other words, it's not like the Betaflight code can simply be merged. A LOT of work needs to be done first.

@laurentopia It's easy to determine direction when moving, but once you stop forward progress to land, it's really tough to know what direction to move (without a compass) to make a correction. This is why Betaflight's (kill creator mode) happens when "basically" home.

How much correction does it need during the landing movement? Doesn't the PID loop handle wind related drift?

@laurentopia I believe a compass is needed to know which way to compensate for the wind. Wind seems to blow the quad all around unless GPS/compass-based position hold is activated. From a hundred feet up at my typical flight location (depending on the wind direction) it could end up on a house, tree, or in the river.

I think it's a terrible idea because people will rely on RTH without a compass and when it doesn't work they will blame INAV.

Sad but true.
Then the RTH to loiter is a good compromise.

@laurentopia at the risk of suggesting spending more on what you have implied is already an expensive quad, Matek makes a combo GPS/compass module that is hardly bigger than the ceramic GPS antenna.

@humanoid2050 Same with the $15 BN-880. People want this feature not because they want a compass failsafe. They want to use some cheap GPS that doesn't work well on its on it's own and they don't want to spend $15.

Honestly, I don't think the feature should be added. It will be difficult to program correctly (Betaflight's code can't be used), it won't work well, and it will encourage people to use an inferior GPS module without compass which will cause other problems. I think it's a bad idea, especially since it can be solved with $15.

The ONLY way I'm okay with it is as a failsafe that only works if you have a compass that failed during flight. But I haven't heard any cases like that so it seems totally pointless.

Betaflights recovery mode makes sense for 2 reasons. First, the quads are typically designed to crash a lot. Secondly, navigation and safety are not priorities with Betaflight. INAV has expensive/heavy navigation models that don't take a crash well. Also, there's higher safety standards with INAV.

@teckel12 I actually own both the BN880 and the Matek GPS I mentioned. The Matek is about 50% smaller I'd say just eyeballing it. More suitable for a 3" quad as the original poster mentioned they were using.

As for the feature, I'm with you. the difficulty of isolating multiple unknowns in the form of external disturbances (wind) and intentional inputs (flying "forward" without knowing what "forward" is) is not trivial at all. There are ways to mix higher order signals into the quad's motion and attempt to isolate those intentional disturbances to separate external from internal unknowns, but you would still end up with a weird sinusoidal flight back home as a best case scenario. Or you just pick a direction and fly, slowly slewing the heading until you are going in the right direction. That's more likely to make the quad fly a giant arc until the heading is pointing directly into the wind, at which point you have probably put a big dent in your battery power. And if the wind is shifting or chaotic, you may get blown around for an arbitrarily long time depending on the chosen slew rate and the rate of change in the wind. It's the kind of thing that would make an interesting collegiate research project, but not the kind of thing that you want to ship as a functional product.

Thus my suggestion of "go buy a GPS with a compass".

These issues seem relevant, they mention compass failure and using GPS heading on multirotors:

https://github.com/iNavFlight/inav/issues/991
https://github.com/iNavFlight/inav/issues/1323
https://github.com/iNavFlight/inav/pull/2802

Bump - I'm looking at smaller craft where there is no place to fit a magnetometer which isn't drowned in noise.

Was this page helpful?
0 / 5 - 0 ratings