Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #45 on: January 15, 2016, 04:14:51 pm »
There was a refactoring of the flight code around that time, so it was a bad time for the fracturing of OP to happen...
« Last Edit: January 15, 2016, 04:34:06 pm by TheOtherCliff »

Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #46 on: January 15, 2016, 05:10:18 pm »
Has anyone had this problem on a multicopter with well twisted wiring and that uses an OP GPS with mag that is configured to use aux mag only?

Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #47 on: January 15, 2016, 05:50:58 pm »
There is a scenario that would cause this, that has only to do with some random parts of the construction of the particular multicopter.  I mentioned it before.  There is also a way to test for whether this is happening.  I know that I could re-wire my GPS quad to cause an oscillation if I wanted to.

The issue is that a particular routing of a high current cable going to an ESC can cause a detectable mag field change when that ESC draws more power.  That cable routing could cause the detected mag field to change angle.  The typical mag field from the earth points north, but aIso points steeply down (60+ degrees in the mainland USA).  The mag field is used for more than just compass direction.  It actually gives a better determination of up and down than the accels do, because the mags can't be fooled by acceleration like the accels can be.

So you see that the mag sensor is also used for leveling information.  Also, the mag sensor can be fooled by running a high current wire pair in a way that happens to turn out to be bad.  Bad would have e.g. increasing the power to the front motor(s) change the mag field to make it look like the multicopter was pitching forward.  A small power increase there would then make it look to be pitching forward.  That would make the FC give even more power to the front motors and it would look to be tipping even more forward.  Now the fact that it is actually tipping backward begins to be seen.  Finally it would have pitched back enough that it was satisfied and reduced the motor power to normal.  Suddenly it sees that it is pitched way back and drastically reduces the power on the front motors.  Now the reduction in power does the opposite.  It makes the multicopter think it is even more pitched backward than it is.  You have an oscillation.

Warning:  Dangerous test procedures ahead.  Use caution if you do this.

An easy way to test whether this is causing the issue is to tie the multicopter down firmly (and move props (and invert them) all to the motor to the CW of them so they blow up, not down).  Change stabilization to manual (maybe use FlightModeSettings.DisableSanityChecks to allow you to use Manual on a quad) or rate, not Attitude, we don't want any stabilization if possible.  Decrease the logging period for which ever mag sensor you are using to 100ms.  Display the three mag sensor dimensions on a scope on the scope page.  Point the multicopter north.  I hope that the ground it is sitting on doesn't cause too much mag problem.  It shouldn't.  Use RF telemetry, or a long USB cable if you don't have RF telemetry.  "Start logging" for later analysis.  Spin the motors up to hover power or a little higher.  If you feel it is safe, rock the pitch (or which ever direction you think yours oscillates in) back and forth (it doesn't have to be fast rocking) a bit to simulate what happens during flight.  Also run the power up high and back down a few times.  Throttle to zero.  Stop the logging.  Immediately do a print screen to capture your scopes.  Post the scope pictures (and log) here.

I am betting that we will see mag scopes change.  For a pitch oscillation, I think it is the Y axis that we will probably see change a lot.

I really think this will turn out to be the cause.  The solution will be to find what wire pair is causing the issue.  I can also imagine a certain kind of circular PDB being the perfect design to cause this.  Say power in from the side.  When high power is in front, the front half circle causes a mag field "up".  When high power is in back, the back half circle causes a mag field "down".

(Note to self:  I see that it is true that for some users it does it pointing either north or south, but does not do it east-west.  I see that happen on that OP 14.10 video.  I definitely see a pitch oscillation when pointing either north or south.  I wonder if I even see/hear a smaller roll oscillation when facing east or west.)
« Last Edit: January 15, 2016, 06:07:26 pm by TheOtherCliff »

gitit20

  • *
  • 53
  • If it will fly I will crash it.
Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #48 on: January 16, 2016, 12:47:22 am »
you could also test this using only external mag with the GPS up on a pole I tried this and still had the same problem? the pole was 8 10 and 12 in tested no notice in any changes. for me.

Do you think It still could be wires?


There is a scenario that would cause this, that has only to do with some random parts of the construction of the particular multicopter.  I mentioned it before.  There is also a way to test for whether this is happening.  I know that I could re-wire my GPS quad to cause an oscillation if I wanted to.

The issue is that a particular routing of a high current cable going to an ESC can cause a detectable mag field change when that ESC draws more power.  That cable routing could cause the detected mag field to change angle.  The typical mag field from the earth points north, but aIso points steeply down (60+ degrees in the mainland USA).  The mag field is used for more than just compass direction.  It actually gives a better determination of up and down than the accels do, because the mags can't be fooled by acceleration like the accels can be.

So you see that the mag sensor is also used for leveling information.  Also, the mag sensor can be fooled by running a high current wire pair in a way that happens to turn out to be bad.  Bad would have e.g. increasing the power to the front motor(s) change the mag field to make it look like the multicopter was pitching forward.  A small power increase there would then make it look to be pitching forward.  That would make the FC give even more power to the front motors and it would look to be tipping even more forward.  Now the fact that it is actually tipping backward begins to be seen.  Finally it would have pitched back enough that it was satisfied and reduced the motor power to normal.  Suddenly it sees that it is pitched way back and drastically reduces the power on the front motors.  Now the reduction in power does the opposite.  It makes the multicopter think it is even more pitched backward than it is.  You have an oscillation.

Warning:  Dangerous test procedures ahead.  Use caution if you do this.

An easy way to test whether this is causing the issue is to tie the multicopter down firmly (and move props (and invert them) all to the motor to the CW of them so they blow up, not down).  Change stabilization to manual (maybe use FlightModeSettings.DisableSanityChecks to allow you to use Manual on a quad) or rate, not Attitude, we don't want any stabilization if possible.  Decrease the logging period for which ever mag sensor you are using to 100ms.  Display the three mag sensor dimensions on a scope on the scope page.  Point the multicopter north.  I hope that the ground it is sitting on doesn't cause too much mag problem.  It shouldn't.  Use RF telemetry, or a long USB cable if you don't have RF telemetry.  "Start logging" for later analysis.  Spin the motors up to hover power or a little higher.  If you feel it is safe, rock the pitch (or which ever direction you think yours oscillates in) back and forth (it doesn't have to be fast rocking) a bit to simulate what happens during flight.  Also run the power up high and back down a few times.  Throttle to zero.  Stop the logging.  Immediately do a print screen to capture your scopes.  Post the scope pictures (and log) here.

I am betting that we will see mag scopes change.  For a pitch oscillation, I think it is the Y axis that we will probably see change a lot.

I really think this will turn out to be the cause.  The solution will be to find what wire pair is causing the issue.  I can also imagine a certain kind of circular PDB being the perfect design to cause this.  Say power in from the side.  When high power is in front, the front half circle causes a mag field "up".  When high power is in back, the back half circle causes a mag field "down".

(Note to self:  I see that it is true that for some users it does it pointing either north or south, but does not do it east-west.  I see that happen on that OP 14.10 video.  I definitely see a pitch oscillation when pointing either north or south.  I wonder if I even see/hear a smaller roll oscillation when facing east or west.)
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 #49 on: January 16, 2016, 02:04:32 am »
Yes I think putting the GPS on a long pole has the same effect as the test described by theothercliff. Also I will do the test. Just to make sure it is not the wiring. Although I am pretty sure that it is not the wiring. My V9 is 12.5 inch above the pdb and all my wires are twisted. All of them. And my pdb is square not round. Chucked in one of my pixhawks yesterday. Using the same GPS pole. No oscillations whatsoever. It is killing me not knowing what it is.

Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #50 on: January 16, 2016, 03:36:01 am »
If it acts the same whether using external mag or onboard mag, then the issue I described is not your issue (should be at least much better with external mag).

If it acts the same (same size oscillation) whether using 6 inch pole or 12 inch pole, then the issue I described is not your issue (should be at least much better with 12 inch pole).

If you have never flown with onboard mag, and always used the same length pole then it still could be caused by the issue I describe.

Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #51 on: January 16, 2016, 03:39:58 am »
Are the 3 non-zero values in mag_transform (for the mag you are using) all in the range 0.85 to 1.05?

Also, I presume that everyone has tried recalibrating mags.

gitit20

  • *
  • 53
  • If it will fly I will crash it.
Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #52 on: January 17, 2016, 11:27:01 pm »
HAHA you said 12 inch pole  :-X

I am not at home now traveling for work I will do some more checking and so on when I get back would a dump of my settings help if I uploaded it here?

Do the best you can It's all you can do.

Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #53 on: January 19, 2016, 03:49:15 am »
You can post the uav file and I can check the calibrations, but those questions should be answered too.  :)

lanzi

  • *
  • 53
Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #54 on: January 27, 2016, 07:30:16 am »
Hi Cliff,

here is my latest working UAV file. Everything is working nicely (apart from the oscillations)

lanzi

lanzi

  • *
  • 53
Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #55 on: February 05, 2016, 10:52:35 pm »
Ok Guys, I have a solution (kind of).
I just wanted narrow down what might be causing the oscillations. I wanted to make sure that none of my power components are causing the issue (Mag interference etc, etc.)
So I went a bit brutal and ripped out the revo and v9 gps and replaced it with a pixhawk and pixhawk gps. literlay nothing else changed. all components are the same. ESCS, Motors, FPV Gear, Lipos, Props, Telemetry 915 mhz, 433 UHF.
Ran calibration on the Pix using external and internal mag in combo and voila. flies ultrasmooth in all GPS Modes (don't know if i should be happy or sad about that).
No oscillations whatsoever.

APM Planner has a pretty cool tool to measure the mag interference. did that and turns out it is less then 10 % (up to 30% is fine for good GPS/Mag performance).

So at least i now know my system is clean.

Will rip out the Pix now and plug the revo back in now knowing the issue is with the revo/gps/firmware.

TheOtherCliff, did you have a chance to check out teh UAV.file i uploaded?

cheers
lanzi


gitit20

  • *
  • 53
  • If it will fly I will crash it.
Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #56 on: February 17, 2016, 10:07:45 pm »
I also tried a APM Mini as well and it also works just fine :) I saw your post and decided to copy what you did and it worked too...
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 #57 on: February 17, 2016, 10:19:14 pm »
I plugged the revo/v9 back into the quad and went back to 15.2. (the last version before Velocity Roam got introduced) All is fine under 15.02. no oscillation in GPS assist flight modes. I will stick with 15.02 until a solid fix is available.

f5soh

  • *****
  • 4527
    • LibrePilot
Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #58 on: February 17, 2016, 10:37:36 pm »
First time we see the issue Paolo (liftbag) was using 14.10.

Can you post your 15.02 config file working without oscillations ?

lanzi

  • *
  • 53
Re: Oscillation in GPS Modes that is Sensitive to Compass Direction
« Reply #59 on: February 17, 2016, 10:45:25 pm »
here we go