jtrout19

  • ****
  • 334
Re: GPS and AuxMag Issues when doing everything right!
« Reply #90 on: November 25, 2016, 03:42:58 am »
Some clarification needed. With this

Set and verify AuxMagSettings.BoardRotation
- Set GCS -> System -> Settings -> AuxMagSettings -> BoardRotation (correctly)
- - Look up (Google) "magnetic inclination" for your location.  For me in USA it is about 62 degrees.  So north for me is north and 62 degrees down also.
- - https://en.wikipedia.org/wiki/File:World_Magnetic_Inclination_2010.pdf
- - When making these changes, use the red up arrow (Save) at the top of the screen.  That will make it permanent, and also put it into effect immediately (no reboot required for changes to this setting).
- - Watch AuxMagSensor.  BoardRotation is correct if you point the nose of the GPS/mag north (and e.g. 62 down) and see a high positive number (+400) for X and flip the GPS/mag so tail is now pointing north and you see X has become a large negative number (-400).  These +-400 can easily be +100-800 or +600-300 for example.  If you are truly pointing the GPS/mag north, X will be the largest change and the change will make the number a lot more negative (about 800 more negative, taking it from about +400 to about -400).
- - Same for Right side with Y (flip to left side for negative Y).
- - Same for Bottom side pointing north with Z (flip to top side pointing north).
- - For APM/PixHawk I2C mag, you will probably have to make BoardRotation.Pitch=180 to get these numbers correct.
- - If your board needs some other set of rotations, you will have to figure it out.  Do this:  Only use multiples of +-90.   The way you figure it out is to start with which board rotation makes the Z change in the correct way and enter/save that, then it is just a matter of what Yaw you need to add to make X and Y work with the correct board face and in the correct direction.
With rotate virtual attitude and aux mag orientation all at zeros I get an almost steady PFD that shows the horizon being level. The instructions say to look up your value and then immediately skips to when changing these settings make sure to click the red arrow. It doesnt tell you where to put in this value or even if you have to. That just opened a large can of confusion. I decided to read the entire page that you linked and came across that before the "Rotate Virtual" when you have an aux mag. So just thought I would ask for some clarification.
« Last Edit: November 25, 2016, 04:09:22 am by jtrout19 »

Re: GPS and AuxMag Issues when doing everything right!
« Reply #91 on: November 25, 2016, 07:41:00 am »
If you have the GPS mounted normally (arrow pointing forward)
Quote
- - For APM/PixHawk I2C mag, you will probably have to make BoardRotation.Pitch=180 to get these numbers correct.
For others (OP Platinum / GPSv9 and DJI) boardrotation is all zeros.

The rest of that section is describing how to tell when you have boardrotation set correctly.  The much easier way to tell now that we have a GUI for it is to use the GUI.  (GCS Attitude -> Magnetometer)  Use the GUI to set the boardrotation and check that it is correct.  The GUI bars will be very close to zero, no matter what angle you tip it to (slow motions).

jtrout19

  • ****
  • 334
Re: GPS and AuxMag Issues when doing everything right!
« Reply #92 on: November 25, 2016, 07:53:48 am »
OK thats what I thought just wanted to make sure. I am there at the moment. My bargraphs are all good 0's at any position. I was going to test it out but I my quad developed an issue with a motor. So I got that worked out. will fly tomorrow and see how it does.


Been watching videos like these all night Been making me very sad

Mateusz

  • *
  • 808
Re: GPS and AuxMag Issues when doing everything right!
« Reply #93 on: November 25, 2016, 09:20:30 am »
Been watching videos like these all night Been making me very sad

To be honest I saw many decent movies with racing copters. I think it's not nice camera that makes great photographs but photographer himself.
For example check out MrHeli wooden builds, he didn't use any GPS at all
I am not saying that having super dedicated hardware with 3-axis gimbal does not help, it does, but it's not a requirement for making nice movies :)

« Last Edit: November 25, 2016, 09:09:53 pm by hwh »

Re: GPS and AuxMag Issues when doing everything right!
« Reply #94 on: November 25, 2016, 09:35:26 pm »
I made a code change based on a guess as to what the problem is.  When I fly it, the problem goes away on my quad.

I added an adjustment function to east west velocity.  I haven't done the research to determine whether the GPS is reporting an incorrect velocity or whether we are using the velocity incorrectly, so this code may change before it gets released.

If you can build the code, change flight/modules/GPS/DJI.c

change these lines:
Code: [Select]
#include <string.h>
#include <auxmagsupport.h>
to these lines:
Code: [Select]
#include <string.h>
#include <homelocation.h>
#include <auxmagsupport.h>

and change this line:
Code: [Select]
    gpsVelocity.East  = (float)djiGps->velE * 0.01f;
to these lines:
Code: [Select]
    // original line that oscillates
    // gpsVelocity.East  = (float)djiGps->velE * 0.01f;
    // test change that fixes it
    // gpsVelocity.East  = (float)djiGps->velE * 0.01f * 0.5f;
    {
        int32_t velocityReductionLatitude;
        float velocityReductionLatitudeCos;
        HomeLocationLatitudeGet(&velocityReductionLatitude);
        // float is accurate enough for this
        velocityReductionLatitudeCos = cosf(DEG2RAD((float)velocityReductionLatitude * 1e-7f));
        // ringing and minor oscillation still apparent with cos^1, so try cos^2
        gpsVelocity.East  = (float)djiGps->velE * 0.01f * velocityReductionLatitudeCos * velocityReductionLatitudeCos;
    }

jtrout19

  • ****
  • 334
Re: GPS and AuxMag Issues when doing everything right!
« Reply #95 on: November 25, 2016, 09:39:49 pm »
I have no clue how to do that? Would learn though if someone wanted to teach me. I think I got position hold working today. I have a motor or esc issue happening currently but I force the quad into the air and flipped the switch and it stuck to one spot except for going up and down which I think is cause by the issue going on. I made a different thread about it on here and included a video. Thank you Cliff

Re: GPS and AuxMag Issues when doing everything right!
« Reply #96 on: November 25, 2016, 09:44:57 pm »
What version are you flying and what FC are you using.  I can build it for you and attach it here.

jtrout19

  • ****
  • 334
Re: GPS and AuxMag Issues when doing everything right!
« Reply #97 on: November 25, 2016, 09:48:39 pm »
I am running 16.09 rc2 and I am using the Revolution from hobbyking. The one that says Revolution on their site

Re: GPS and AuxMag Issues when doing everything right!
« Reply #98 on: November 25, 2016, 09:53:41 pm »
I will build that and post the firmware here.  Should be way less than an hour.

jtrout19

  • ****
  • 334
Re: GPS and AuxMag Issues when doing everything right!
« Reply #99 on: November 25, 2016, 09:57:23 pm »
aweome thank you cliff

Re: GPS and AuxMag Issues when doing everything right!
« Reply #100 on: November 25, 2016, 10:05:45 pm »
Download the attached file to a place you can get to it on your computer (Desktop is usually good).

Run GCS.  Plug in the Revo to USB, but no flight battery.  Go to the Firmware tab.  Press Halt and wait (up to 15 seconds or so) for it to bring up a section that has Open, Flash, and Retrieve buttons.  Press Open.  Navigate to and select the downloaded file.  Press Flash.  Wait for it to erase, then write the flash.  Test.  Let me know here if this worked for you.

Re: GPS and AuxMag Issues when doing everything right!
« Reply #101 on: November 25, 2016, 10:06:33 pm »
Man! What a service! Nice! ;D
Its only for DJI GPS, right?

How much more accuracy do you get with DJI compared to NEO M8N? Anyone knows? Or are there any other benefits?
« Last Edit: November 25, 2016, 10:10:13 pm by DocHardinger »
Hardware: F450 Frame--Revolution Board--EMax 2213-935kv--BullTec 30A Opto--5000mAh 3S 30C LiPo--NEO M8N GPS+MAG--Fr Sky Taranis Plus + OPLink Mini
Addon: sj5000x + two axis gimbal + minimosd + eachine VT + easycap
Software: Black Rhino, LP2GO

jtrout19

  • ****
  • 334
Re: GPS and AuxMag Issues when doing everything right!
« Reply #102 on: November 25, 2016, 10:09:47 pm »
Yes thanks cliff that is great i will let you know as soon as i can with video. I have to get the other issue worked out first. Thank you again.

Sent from my LGLS991 using Tapatalk


Re: GPS and AuxMag Issues when doing everything right!
« Reply #103 on: November 25, 2016, 10:10:53 pm »
This is exactly RC2 with the only change being that longitudinal (east west) velocity data from a DJI GPS is scaled down based on latitude (distance from equator).

This change has only been done for DJI GPSs.  I haven't researched whether it needs to be done for other GPSs or not.

DJI is not more accurate than other GPSs.  The benefit of a DJI GPS is that it has GPS and mag combined on one FC port which leaves ports open for other things.  DJI also uses a different "dynamic model" than the default LP setup for UBX GPS.  DJI doesn't drift as much in hover, but can't handle quick direction changes from a racing quad as well as UBX can.  You can configure the UBX GPS to use the same dynamic model as the DJI, but you can't change the DJI to use any model other than the one.
« Last Edit: November 25, 2016, 10:20:30 pm by TheOtherCliff »

jtrout19

  • ****
  • 334
Re: GPS and AuxMag Issues when doing everything right!
« Reply #104 on: November 25, 2016, 11:26:01 pm »
Cliff hear ya go man a really short video of position hold and then velocity roam. Sorry about the middle of the video I was trying to record and switch flights modes and fly the quad. Its a little windy here today 10-13 mph gusts. I will say that velocityroam it wanted to get real high in the sky.

And keep in mind this video was shot with no tuning and defualt pid values cut in half.

https://www.dropbox.com/s/ll41gzpkfp8or24/20161125_171307%5B1%5D.mp4?dl=0