Does RTH work with Compass Error?

What I don't understand is why the software wasn't (can't) have the GPS "drag" the phantom back home sideways or at whatever orientation it is pointing the same way we can control the direction of motion no matter which way front is pointing.
The Phantom knows where it is and where home is with GPS only. It doesn't know which way it is pointed, so it does not know which way to pitch, roll or yaw to head home. However, all that is needed is to fly forward for a second. Then by GPS only, from the start and end point of that short flight, it can tell which way the aircraft is pointed. Now it can head towards home using roll and pitch only, no need to yaw the craft.
It would also be possible to return home using yaw but it would require some trial and error. It would have to move forward first to get its orientation then yaw for a number of seconds at a known speed to point approximately towards home, then fly forward again and recheck the orientation.
 
  • Like
Reactions: curiosity
Agreed. But it should be able to easily figure things out. Let's say it's at coordinates x1:y1. It needs to go home to x2:y2. If it had a working compass, the algorithm is a slam dunk. If not, it simply travels in it's current direction for a (short) bit and assumes that's 0 degrees. Checks it coordinates and then can determine it needs to rotate a certain amount and then repeats the process. It may take a little longer and may have somewhat diminished accuracy. But it's better than nothing.

I did a development contract for something like this (GPS-enabled farm equipment) some years ago. Details are a bit different, but the logic is fairly straightforward.

If the GPS is screwed, but not the compass, it's simple as well, short of the not knowing what altitude you're at drama.
If your compass pointing to the wrong direction, can your farm equipment guide you back to your home?

BTW, if there is a slam dunk solution, you could be a rich man.

your proposal of travelling a short distance and check doesn't work in real world, Have you considered the vehicle can be moved by wind,
 
The Phantom knows where it is and where home is with GPS only. It doesn't know which way it is pointed, so it does not know which way to pitch, roll or yaw to head home. However, all that is needed is to fly forward for a second. Then by GPS only, from the start and end point of that short flight, it can tell which way the aircraft is pointed. Now it can head towards home using roll and pitch only, no need to yaw the craft.
It would also be possible to return home using yaw but it would require some trial and error. It would have to move forward first to get its orientation then yaw for a number of seconds at a known speed to point approximately towards home, then fly forward again and recheck the orientation.
when the compass is lost, how do you tell which way is forward, which way is back
 
"when the compass is lost, how do you tell which way is forward, which way is back"

No kidding. If only this thing would draw my trip out on the tablets map using a green line, then I could just follow that line back.

Or if I had FPV on my tablet and some visual markers I recognized, I could fly by sight. That would be cool.

Nick Fury: Take us to the water!
Carrier Bridge Tech: We're flying blind. Navigation's recalibrating after the engine failure.
Nick Fury: Is the sun coming up?
Carrier Bridge Tech: Yes, sir.
Nick Fury: Then put it on the left.
 
when the compass is lost, how do you tell which way is forward, which way is back
You don't know which direction you are pointed in but you know which motors to engage to pitch the craft and fly in a forward direction relative to the aircraft. Once you have moved, you will know your orientation. This is the same as the GPS in your car. It knows where you are but does not know which way the car is pointed until you move.
 
  • Like
Reactions: curiosity
Yes but with no working compass the craft can't be sure which direction forward is, although it was pointed out earlier that the IMU combined with the gyros would presumably provide the aircraft with some idea if the aircraft had rotated and can therefore make a guess which direction it might be pointing and where forward might be...

...and on and on it goes in an endless loop (not the aircraft - I'm referring to this discussion) perpetuated by those late comers who didn't read the thread...

...
 
You don't know which direction you are pointed in but you know which motors to engage to pitch the craft and fly in a forward direction relative to the aircraft. Once you have moved, you will know your orientation. This is the same as the GPS in your car. It knows where you are but does not know which way the car is pointed until you move.
You can fly to the home point based purely on GPS if you ignore the compass, but can you always safely ignore the compass when it does not agree with the GPS values?
 
You don't know which direction you are pointed in but you know which motors to engage to pitch the craft and fly in a forward direction relative to the aircraft. Once you have moved, you will know your orientation. This is the same as the GPS in your car. It knows where you are but does not know which way the car is pointed until you move.
Have you considered the wind can move the quad too. hence you can't solely use the displacement to compute direction.
 
I wonder what happens when there are two compasses involved such as with the P3?
 
Hm, the GPS nav system in my car does not have a compass (as far as I know). When the car is stationary, it doesn't know the heading (the direction of the front of the car). But as soon as the car starts moving, it will be able to display the current heading on the moving map.

If combined with an autopilot, it would be able to turn the car to a predefined heading and start driving in that direction (bad idea for a car, but should work for a lost drone).

//Tom

Hard to say if the navi in the vehicle uses a compass or not. Are you speaking of built in navi or portable?

My Explorer seems to have two different navigation systems. Naturally has has a compass but when I do GPS navigation I have slightly different data between my two screens. Its trippy. You'd think both navigation screens would show the same data!!
 
Yes but with no working compass the craft can't be sure which direction forward is, although it was pointed out earlier that the IMU combined with the gyros would presumably provide the aircraft with some idea if the aircraft had rotated and can therefore make a guess which direction it might be pointing and where forward might be...

...and on and on it goes in an endless loop (not the aircraft - I'm referring to this discussion) perpetuated by those late comers who didn't read the thread...

...
I guess I need to draw a picture. The aircraft flies fast forward just as if you pushed the right stick all the way forward. The GPS Knows where it was and where it is now. The calculation of the heading is simple high school math.
The aircraft is not rotating. See my earlier posted video. We already settled that. If you want to factor in the wind, you can easily find the wind speed and direction. Switch to atti mode and drift for a couple of seconds. Again you know you start and end positions and how long you drifted so you can easily calculate the wind speed. Do this before the fast forward flight and you can add the vectors to get a true heading.
 

Attachments

  • TANGENT.jpg
    TANGENT.jpg
    71.7 KB · Views: 268
  • Like
Reactions: curiosity
Hard to say if the navi in the vehicle uses a compass or not. Are you speaking of built in navi or portable?

My Explorer seems to have two different navigation systems. Naturally has has a compass but when I do GPS navigation I have slightly different data between my two screens. Its trippy. You'd think both navigation screens would show the same data!!
My car has a compass built in but no GPS. The external GPS has no compass and will show the car at some odd angle until I start moving. Then it shows the car pointing in the right direction on the road and displays a heading which matches the the car's compass.
 
...and on and on it goes in an endless loop (not the aircraft - I'm referring to this discussion) perpetuated by those late comers who didn't read the thread...
...
Funny I was just thinking the same thing. All of a sudden there are posts asking if we had thought about the very things already discussed in the thread. I guess it was bound to happen, right?
 
Have you considered the wind can move the quad too. hence you can't solely use the displacement to compute direction.
You can test the wind direction first if you want to correct for that. Also if you fly fast to get your heading and the wind will be a smaller error.
 
I wonder what happens when there are two compasses involved such as with the P3?
I am sure that the program is already doing a check of heading by GPS as it moves. If one compass is close to this heading and the other was way off, you would choose to ignore the one that was different. If both were close you could average them. If either were giving values that changed rapidly when the other was stable, this would also indicate an error.
 
You can fly to the home point based purely on GPS if you ignore the compass, but can you always safely ignore the compass when it does not agree with the GPS values?
Well you can't fly home with just the compass, except visually as in course lock mode. Without the GPS, the craft does not know its location. So as long as you have enough satellites, you should trust GPS over the compass.
 
You could calculate wind speed and direction (relative to the AC) if you like by running an iterative process, tweaking motor thrust and watching GPS location over a few seconds until you've reached the output from each motor that is required to make it hover in a relatively stable location. But you don't even need to. All that is required is an iterative process that does nothing more but change the motor speed of each motor while watching the GPS path until that iterative process puts you on a path close to the home path. It's really not much harder than a simple binary search algorithm: just play the high/low game with each motor.

The high-low game:
You have a row of 100 people sitting in front of you: their chairs are marked 1-100 and one of those people has a $100 bill to give you. They bet you $100 that you can't find the person holding/hiding the bill with only 7 guesses playing the high/low game. They'll lose and you'll win every time. Just cut the list in half every time. Guess 50 on your first guess. If they say "lower", then guess 25. If they say higher, then guess 37. They say higher so you guess 43. Now they say lower so you guess 40. They say lower again so now you've narrowed it to either 38 or 39 with only five guesses. You use 38 as your 6th guess and the worst case is, they say higher and you use your 7th guess to say 39 which you know is correct. If we only had one motor to worry with, you've found the correct path (within a few degrees) after only 7 guesses (higher or lower motor speed).

Doing it with 4 variables (motors):
Playing the high/low game with 4 motors increases complexity but it's nothing but an iteration of the above applied to 4 motors. In other words, programatically, not really much more complex, just requires more iterations. We found our "mark" in 100 people with only 7 guesses: our guesses would be similar to changing motor speed and then asking "did my course change for the better or worse" each try. Even if you raise that to the 4th power, that's only 2400 computations (trivial for any CPU and can be computed in microseconds) and in reality, far less because you know the motor on the opposite side will give the opposite change and you can also surmise based on the direction change, which of the adjacent motors to logically try next. It's actually a pretty trivial problem to solve. In reality, the amount of time for it to find its way won't be microseconds because you'd have to watch how the course changes via GPS to determine the answer to your "high low question" but also in reality, you don't have to test each motor separately (see real world below) due to you knowing the configuration of the motors.

Wind:
You could calculate wind speed but why bother? Just keep the above algorithm running the entire trip and regardless of wind (unless we're talking hurricane force winds), it'll find its way by just continuing to play the high/low (better or worse course) game all the way, even if wind speed and direction changes along the way.

Real World:
Of course, there are a multitude of directions and 4 motors to be concerned about so the end code for the algorithm won't be exactly like the high/low game, but the concept still applies. That is, use what you know about motor location and bias them. Watch how your course changes and make educated adjustments iteratively. Going southwest and need to go north? Try +10% on motor 1. Now you're going due west. So everything considered (wind included), you can consider motor 1 to be facing south. So increase speed on the motor adjacent/clockwise (from the top) by 10% as we've surmised that to be the "west motor" now. Did that stop the western drift? Too much? Inching barely east now? Try 8% on that motor instead of 10%. Hovering now? Now try a little more on motor 1 (that south motor). Try 15%. Going north now (toward home)? And so on. Just keep that running and you'll get home. The home line might be "wavy" and not perfectly straight, but you'll get there. The baro should keep you at altitude and the gyro should easily keep yaw in check long enough to perform the iterations. Even if the gyro gets off a little over time, that doesn't matter either. If you're running this algorithm continuously, it'll take that into account.

Edit: P.S. Obviously you can't do this in a vacuum or in a "boundless" way, so you'd use the IMU to be sure you're not making changes that put the AC in a wonky tilt like beyond 45 degrees, etc.

Mike
 
Last edited:
I have worked as an engineer and programmer for 44 years. I don't know how many times someone told me something was impossible when I could clearly see the solution. More than once, I built a working prototype or wrote a program just to prove them wrong. The last 16 years I worked for a company that designed and built custom, automated mining machinery. They joked that the "impossible" just takes an extra 2 weeks (unless it violated the laws of physics, then it was 3 weeks.) There were no problems, only opportunities.
For those of you who have not done programming for modern computers, I have to say you have no idea what is possible. Computers solve lots of problems where there is no direct solution, by iteration, that is a good guess followed by testing and refinement. They can recalculate thousands of times in a second. With artificial intelligence, they can look at trends in multiple streams of data and optimize a process that has so many variables that the programmers don't really know how it arrived at the solution, just that it works.
Who would have thought 10 years ago, that we would have an affordable copter that could fly overhead, track, follow and shoot high res video of a moving subject by computer vision? Navigating without a compass is trivial compared to this.

Good point, nicely said.

I am a computer engineer as well, working at a technology giant. It's kind of sad to see people thinking that something is not possible, when you can clearly see the solution. But this has always been the case with humankind - no offence; there'll always be someone who thinks that something is not possible, and there will always be someone to disprove them, eventually.

Take a simple computer game, take all the calculations and the math that goes in just to draw a simple object in 3D. Then think about games like Crysis, think about the advancements we made with hardware and software, think about where came from. We, humans, made it possible.

I know, maybe only the people that have been in this industry will be able to appreciate how much work goes into these kind of stuff and what is simply possible. I would love to prove those who think that it would not be possible but I simply don't have the time or the motivation to do so.

One day, we'll see this tech in motion, just like we saw for everything else; from Mario to Crysis, from making the first electronics circuit to going to the moon. But then this discussion, like all the others will be history :). I understand your point.
 
Good point, nicely said.

I am a computer engineer as well, working at a technology giant. It's kind of sad to see people thinking that something is not possible, when you can clearly see the solution. But this has always been the case with humankind - no offence; there'll always be someone who thinks that something is not possible, and there will always be someone to disprove them, eventually.

Take a simple computer game, take all the calculations and the math that goes in just to draw a simple object in 3D. Then think about games like Crysis, think about the advancements we made with hardware and software, think about where came from. We, humans, made it possible.

I know, maybe only the people that have been in this industry will be able to appreciate how much work goes into these kind of stuff and what is simply possible. I would love to prove those who think that it would not be possible but I simply don't have the time or the motivation to do so.

One day, we'll see this tech in motion, just like we saw for everything else; from Mario to Crysis, from making the first electronics circuit to going to the moon. But then this discussion, like all the others will be history :). I understand your point.

Precisely. Plus... you never know what idea might give birth to other ideas...

If folks haven't seen this TED talk, it's worth a watch, it's specifically about drones: Raffaello D'Andrea: Meet the dazzling flying machines of the future | TED Talk | TED.com
In particular, the final demo is rather amazing.

~~~

As to the thread topic: Will a P3/P4 enter into RTH in event of compass failure? No. Answered.
Will we ever see a P3/P4 update that allows for RTH in event of compass failure? Almost certainly, no.
Is it *possible* to RTH without the compass? Almost certainly, yes.

~~~

Life is about more than "deliverables". No-compass RTH is a fun and interesting engineering challenge to consider.
And who knows... maybe someone on this very forum is an undergrad/grad student at university, and is working in some field of engineering.
Maybe they see this thread, and say "hey, I wonder how I could make compass-less RTH work in a quad?". And the rest is future-history.

Taking a look at an impossible problem and saying "but wait, what if we tried X" is a fundamental requisite for human advancement.

Imagine the first humans/proto-humans to harness fire. Imagine the first scientists to sit down and brain-storm the logistics of the Apollo program.
Heck, look at Advanced-LIGO. It is making the most precise measurements in human history, so precise, it recorded a vibration in space-time from black holes colliding 1.3 billion light-years away.
Einstein, the very man who came up with the theory LIGO is testing, thought gravitational waves would never be measured by humans.

Not a lot of people win by starting with "but I think Einstein wasn't quite visionary enough".
Yet some scientists, thought, hey, let's spend a billion dollars creating an instrument that may in fact never measure anything. But they did. And it worked.

We need both of course, the pragmatics and the dreamers.
The dreamers take impossible problems and create impossible solutions.
The pragmatics take impossible solutions and turn them into realized solutions.

One might even argue these are two sides of the same coin. :)

Anyway, that's my OT rant for this thread. Shammyh out.
 
I might be a little out of turn here, but my motors on a P3P will not even start when it's showing compass error. Calibrate the compass ( which I always do when I fly in a new spot) and all is well. Don't know what would happen if compass error suddenly happen during flight.
 

Recent Posts

Members online

No members online now.

Forum statistics

Threads
143,092
Messages
1,467,577
Members
104,975
Latest member
cgarner1