Oscillation in GPS Modes that is Sensitive to Compass Direction
« on: December 07, 2015, 12:50:44 pm »
There was an issue back in OP days where there was an oscillation in GPS flight modes that increased/decreased depending on which direction the quad was facing in hover.  LP users have also found this issue.

Here is what we know about it.
- It happens in GPS flight modes when hovering.  Sticks in the center.
- It is often small enough that it may only be noticeable in FPV or onboard video.
- It is worse when pointing more toward south and better when pointing more north.
- It stops oscillating if you tell the quad to move, even slowly.
- There is an piece of firmware code that runs differently if below a hard coded minimum braking deceleration although I don't necessarily blame it.

Things we (users who have this issue) need to try to see if it affects the issue:
- Move your HomeLocation significantly north or south and see if it changes the issue (makes it worse or better).  Try maybe 1km, 10km, 100km, 1000km for starters.  Be aware that moving HomeLocation will make the GPS map location offset, usually toward the distant HomeLocation.  I have personally flown with 50km offset, but not more.  Be careful.  Very large offsets may cause movement north/south to climb/descend or cause other bad issues.  Make sure you have a non-GPS flight mode on your switch.
- (Carefully!) When hovering in PositionHold or VelocityRoam, can you feel it if you put your hand on it?  Does it go away if you hold the quad away from hover point, vertically or laterally, by hand, without moving the sticks?
- Waypoint flight mode with various speeds, including very slow.  Perhaps 10m/s, 1m/s, 0.1m/s, 0.01m/s.  Try to narrow down what speed the oscillation stops.
- Other users (e.g. me) can try to recreate this by moving the HomeLocation far away north or south.

I will try to keep this first post updated with the current facts about this issue.
Watch the "Last Edit:" time below to see if this post has been changed.
« Last Edit: December 07, 2015, 01:23:32 pm by TheOtherCliff »

lanzi

  • *
  • 53
Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #1 on: December 07, 2015, 07:29:06 pm »
Hi TheOtherCliff.

Thanks for officially starting a thread on this issue. Hope we all can find a solution soon.

Wagsy

  • *
  • 87
    • Rotorpix
Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #2 on: December 08, 2015, 03:36:14 am »
Will have a tinker with mine over next few days and see what it does.

lanzi

  • *
  • 53
Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #3 on: December 08, 2015, 05:54:35 am »
did some extensive testing today in a radius of 10 km.

1. when hovering in velocity / gps assist and pulling the VTOL by hand I can feel the oscillations. they increase when the VTOL gets pulled away.
2. when i yaw the hovering VTOL 180 I can feel that the oscillations decrease or increase depending on the compass direction.
3. Also noted that the oscillation still exist when given little stick input. only a more dramatic stick input fades makes the oscillations disappear.
4. here in Wellington the oscillations increase when the compass is heading SOUTH and decrease when heading North (the compass was calibrated heading North)
when i redo the compass with the compass heading south during calibration, the oscillations decrease when the VTOL is heading South and increase when heading North. 
5. Offsetting the home base 35 km (i did not dare more) did not have any positive or negative effect. things stayed the same.
6. flying close to water makes things worse

Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #4 on: December 08, 2015, 08:23:10 pm »
(That's the first time I have heard that oscillations remain at very slow speeds.)

The bit about it being worse close to water makes it sound even more like a magnetic inclination error which is my current best guess about the issue.  Magnetic inclination is the angle that a compass needle would change vertically if allowed to.  It is a large value.  In USA the needle would point north, but also point down about 60 degrees.  When you set HomeLocation, one of the important things it does is set the expected magnetic inclination.  It would also explain why most people don't have the issue; the formula estimate of magnetic inclination at their HomeLocation is more accurate.

At this point, I really expect that setting HomeLocation significantly far off north or south is a workaround to the issue, with the side effect that your GCS GPS map locations will be wrong by several hundred meters or more, so you won't be able to click up a waypoint flight using the GPS map.  I need to test this by setting my HomeLocation off by say 1000km and seeing if it starts happening to me.

ArnhemAnt

  • *
  • 147
Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #5 on: December 08, 2015, 09:52:20 pm »

This may be a real stupid question, but I figured it was still best to ask.

Could this issue be due to the differences between 'magnetic' north and 'true' north? These variances change depending where you are located in the world.
If you do what you need, you’re surviving. If you do what you want, you’re living.

Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #6 on: December 08, 2015, 11:12:31 pm »
I don't think so.  The only sensors that know absolute direction when motionless are the mag and accels, and neither of these know true north.  GPS is the only one that knows true north and you can be traveling true north, but facing east so it wouldn't be direction sensitive.

I think that the oscillation is happening because the angle between mag and accel isn't what it should be.  The typical response of the EKF to two sensors that disagree is oscillation.

lanzi

  • *
  • 53
Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #7 on: December 08, 2015, 11:20:23 pm »
My revo is rotated 90 degrees but the offset value has been applied. So the physical angle between revo and v9 is 90 degrees. Could that be an issue although the offset value has been set?

lanzi

  • *
  • 53
Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #8 on: December 09, 2015, 04:37:57 am »
I have a video up showing how flying close to water worsens the problem and also shows that the oscillations also happen in VELOCITY ROAM when flying with stick input ( figure 8 for example). I know the clip is 6 minutes, but it shows quite well (audible and visible) how the intensity of the oscillation alter when the VTOL and with that the compass is changing the heading.


Brunosanta

  • **
  • 54
  • I understand it all but know nothing
Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #9 on: December 09, 2015, 02:26:05 pm »
Maybe this is a dumb guess, but have you tryied to use the mag of the GPS only for testing?
you can go into the config> mag settings > instead of the default "Both" set it to external to test.

hope this helps,
Everybody is only optimistic on the social networks.. being real is hard nowadays

Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #10 on: December 09, 2015, 04:59:03 pm »
My revo is rotated 90 degrees but the offset value has been applied. So the physical angle between revo and v9 is 90 degrees. Could that be an issue although the offset value has been set?

You would have bad problems, unflyable in GPS modes, if your mag was rotated 90 degrees.  You DO need to configure in a rotation if your mag is rotated, but only if it is rotated from "normal level straight ahead hover" so zero is correct for your mag.

Be aware that you do need to have both mags configured and usable with rotations already configured when you calibrate mags, and that both get calibrated at the same time.

Are you configured to use both mags or one or the other?  The best advice would normally be to use just the aux mag.

lanzi

  • *
  • 53
Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #11 on: December 09, 2015, 06:37:18 pm »
I am only using the aux mag of the v9 and as the my GPS flight modes really do work apart from the oscillation I do not think the rotation of the revo is an issue. I believe there is a bug somewhere in the code. Would  you say so as well theothercliff? Especially I am not the only one with this issue. Wagsy has exactly the same issue and his videos show the same behaviour.

gitit20

  • *
  • 45
  • If it will fly I will crash it.
Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #12 on: December 10, 2015, 05:54:04 am »
I just want to hit mine with a stick sometimes I seemed to be mostly ignored when it was reported I think because most did not have this problem. I am going to reinstall my revo and flash and start over from scratch and see what we get.
Do the best you can It's all you can do.

lanzi

  • *
  • 53
Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #13 on: December 10, 2015, 06:22:31 am »
is started from scratch numerous times. with the latest OP version and with the LP version on two different frames with two different revos and two different v9s.

by now i firmly believe it is a bug in the code that needs to be found and addressed.

TheOtherCliff also hinted a bug at some point. hopefully it can be addressed with the next version.

I am not a coder at all, so the only way i can help is by addressing the issue and show how it looks like.

cheers
lanzi

I just want to hit mine with a stick sometimes I seemed to be mostly ignored when it was reported I think because most did not have this problem. I am going to reinstall my revo and flash and start over from scratch and see what we get.

Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #14 on: December 10, 2015, 07:48:43 am »
I certainly believe there is an issue.  I think the main problem is that there is no dev who can reproduce it.  :(

Is it true that tuning is not critical?  I think I recall someone trying stock PIDs and still having the problem.

What kind of PDB are you guys using?

How did you tune your PIDs?

What things about your copters do you think might be a little out of the ordinary?  Especially ones that you both have?

Did you twist all your power wires:
- battery to connector
- connector to PDB
- PDB to ESC
- ESC to motor

I can imagine it being caused by (no particular order):
- hidden copter build issue (mag field caused by increasing e.g. front motors makes it e.g. pitch back <or> mag field caused by increasing some motor(s) aligns with earth mag field when pointing this way (no oscillation) and perpendicular to earth field when pointing 180 degrees from that (oscillation) this would be worst where magnetic inclination was 45 or -45)
- local magnetic issue like deviation from normal magnetic inclination
- local magnetic issue caused by large electrical power flow in the area
- code bug
- default tuning value that we haven't tweaked yet (e.g. EKF or braking etc PIDs)