jtrout19

  • ****
  • 334
Re: GPS and AuxMag Issues when doing everything right!
« Reply #60 on: November 22, 2016, 05:23:00 am »
I just did a google video search for librepilot gps modes....no good several videos with problems in the title or something relating to a problem.


Then did a search for APM gps modes.-------nothing negative?


What is so much different between librepilot and APM that makes GPS so much more difficult to get going than APM?

jtrout19

  • ****
  • 334
Re: GPS and AuxMag Issues when doing everything right!
« Reply #61 on: November 22, 2016, 07:07:21 am »
I recorded a log. Its not me flying the quad though. I just wanted to see my mag scopes. Basically what I did was started logging and rotated the quad back and forth 180 degrees on each axis. Do you guys see any issue?

Re: GPS and AuxMag Issues when doing everything right!
« Reply #62 on: November 22, 2016, 09:56:25 am »
For me (but im not an expert) it looks like the update rate for the aux mag is very low...And if i look at your settings you only use the Aux Mag am i right?
If i take a look at the Raw mag scopes the update rate for internal mag is high but not for the aux mag...maybe its just the telemetry update rate (or scope update rate) for the aux mag...And the controller uses higher update rates for attitude...And if you look at "System" --> "Aux Mag Sensor" its updated only every 5 seconds...
Hope you get what i mean :-)

Anyway im not sure if its just the update rate for telemetry what makes the update so slow...
I think theOtherCliff could say more to this ;-)
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 #63 on: November 22, 2016, 08:42:36 pm »
Yes i am only using auxmag. I changed the update settings. I do believe that it only affects the gcs scopes. But i could be wrong. Ive changed the update rate on a lot of things to get a smoother display in scopes. Im prolly going to be purchasing a pixracer soon due to not being able to solve this issue.

f5soh

  • *****
  • 4572
    • LibrePilot
Re: GPS and AuxMag Issues when doing everything right!
« Reply #64 on: November 22, 2016, 09:15:49 pm »
I recorded a log. Its not me flying the quad though. I just wanted to see my mag scopes.

As already reported we cannot see any issue because the auxmag is very low rate.

If you want to compare onboard / auxmag symmetry or sync you simply need to display the Attitude > Magnetometer tab and both mags should be displayed at same rate in scope display / log file. 

Mateusz

  • *
  • 808
Re: GPS and AuxMag Issues when doing everything right!
« Reply #65 on: November 22, 2016, 10:25:55 pm »
I just did a google video search for librepilot gps modes....no good several videos with problems in the title or something relating to a problem.

Several videos where it works as well !






etc...

Re: GPS and AuxMag Issues when doing everything right!
« Reply #66 on: November 23, 2016, 05:04:31 am »
I have this east-west oscillation with 16.09RC# using DJI Naza GPS/mag and running AutoTuned PIDs.

I did not have this east-west oscillation with 15.09 using OPv9 GPS/mag and running basically stock PIDs on the same quad.

jtrout19

  • ****
  • 334
Re: GPS and AuxMag Issues when doing everything right!
« Reply #67 on: November 23, 2016, 06:39:47 am »
So maybe I should go back to 15.09? do you have issue with the oscillations in 16.09 not running autotuned PIDS? Autotune was a answered prayer for me. I had a really hard time tuning my quad using txpid. I wish I had someone in my area that i knew that uses librepilot. Would love to have some one on one time to has things out and combine minds. I have went to auxmagsettings in UAVO browser and put my update rate at 250. I will do a flight soon and log it. I went and changed gyro, accel, and baro update rate as well.

On a different note. My little 250 is complete! totally done! flies great!

On another note. What is the benefit of using INS13 over complimentary+mag+gpsoutdoor? I am assuming that the flight controller uses less sensor inputs? Just wanted a little clarification.

Re: GPS and AuxMag Issues when doing everything right!
« Reply #68 on: November 23, 2016, 07:41:47 am »
It's my understanding that the current version of Complementary can get confused in some cases.  For instance, if you make continuous coordinated circles it eventually gets to think of that angle as being level.

Mateusz

  • *
  • 808
Re: GPS and AuxMag Issues when doing everything right!
« Reply #69 on: November 23, 2016, 12:15:18 pm »
It's my understanding that the current version of Complementary can get confused in some cases.  For instance, if you make continuous coordinated circles it eventually gets to think of that angle as being level.

You can think of Complementary as an approximation and it was used back in days when first copters like MultiWii (Arduino based) were running on 8-bit micro-controllers that couldn't compute proper model. The Extened Kalman Filter (used in INS13) incorporates proper model and is way more accurate, but at the same time more sensitive to incorrect sensor data. In fact EKF was designed to deal with noisy data, but to some extent, it can not deal with completely corrupted data. The EKF can also start diverging (freak out) if you leave it for very long motion-less.

For autonomous flight you should always use EKF (INS13) while Complementary is I believe more for testing your sensors. I think your problem is related to magnetometer. Guy in the second movie I posted earlier (Revo Libre Pilot RTB & Land DJI GPS Hexacopter TBS Crossfire) gives good recommendation about external magnetometer that it has to be far enough.

Why EKF is so sensitive to bad magnetometer is because model in INS13 uses ALL axis. It was debated whether to use only two axis (2D mag) to determine only heading, it would probably work in most cases but in rare conditions copter could flip. Even DJI Phantom uses external mag placed in the landing legs far from motors.


jtrout19

  • ****
  • 334
Re: GPS and AuxMag Issues when doing everything right!
« Reply #70 on: November 23, 2016, 02:11:33 pm »
The aux mag on my quad is a good 8 to 9 inches away from the nearest electronic component Mag never turns from green at any point in  flight. And from watching the video again I can say my mag is higher up than his.
« Last Edit: November 23, 2016, 02:54:08 pm by jtrout19 »

Mateusz

  • *
  • 808
Re: GPS and AuxMag Issues when doing everything right!
« Reply #71 on: November 23, 2016, 03:11:54 pm »
The aux mag on my quad is a good 8 to 9 inches away from the nearest electronic component Mag never turns from green at any point in  flight.

Well then position hold is more or less what you should be expecting
Some drift is unavoidable, it's not going to sit there with centimeter accuracy as it's not standing on anything, but shouldn't go crazy.

If you don't get that what comes to mind in this order
  • Mag calibration  - Does not matter if green if not calibrated right) outdoors over OPlink after setting home location (should not be possible to start calibration without setting home
  • PIDs - Be aware that Autotune is not magic box, and you should never 100% trust it, you still have to sanity check produced PIDs and understand them, altough it does pretty good job in most cases
  • Vibrations - Well balanced frame, stiff, no lose screws, balanced propellers (the longer the more important balancing). If this does not help try increasing slightly Tau's for filtering.
  • Other sensors - Temp calibration in darkness and motionless since baro is light sensitive and while temp calibration is performed also temp is used for gyro so it must be motionles and dark.

There might be so many things, that can go wrong and each build can run into different problems, so title might not be accurate as you don't know if you are actually doing "everything right". There are people who get pretty decent results. Having sad that, I am able to cover in place (without wind) 1-3 seconds which gives me enough time to put Taranis on grass and pick it up without too much of copter drift only using basic Complementary (gyro+accel in Stabilzed with attitude on roll, pitch and axis lock on yaw). I mean just check these points, make a decent movie during the day so it's possible to see the problem or better log like f5soh suggested. Make a photo of your build. I think green Mag just means that there is no big variation but if calibration was wrong then it still can be green I guess. Did you try skipping 5 steps in mag calibration and on last 6 one rotating copter in all directions slowly ? Compas calibration is continuous it does not stop at any step, and collects samples whole time. The more you rotate it the better coverage and calibration. I would suggest that. It also means that any disturbances (putting it on a metal car or bench) between steps would affect calibration.

jtrout19

  • ****
  • 334
Re: GPS and AuxMag Issues when doing everything right!
« Reply #72 on: November 23, 2016, 04:07:40 pm »
That video is what I am trying to accomplish. I know that the quad is not going to have centimeter accuracy. Mag was calibrate outdoors over oplink with wife operating computer quad never left my hands, never touched the ground and 1/2 mile into a corn field. I did do the 5 steps then the calibration dance. Home location is set accurately. Quad flies great with autotune PID's by sanity check you are talking to make sure it does not oscillate in flight? Everything is very well balanced including props. I did not do the temp calibration in the dark. I heated the board back up with a heat lamp so I will redo that. I am also able to do the same thing in complimentary mode.


Thank you for that post. I will do what you recommend and report back with video! Can you tell me what your mag_transform values are? Just curious to know what other peoples are?

I will make a video. I included pictures somewhere of my quad but will take more and repost. I have changed a few things around since. Then.

Re: GPS and AuxMag Issues when doing everything right!
« Reply #73 on: November 23, 2016, 05:17:58 pm »
So now got everything running...
What i've done is:


1) Get a NEO M8N GPS+MAG
2) Put it far away from everything and connect MAG to Flex Port and GPS to Main Port
3) Erase the whole board. Run the vehicle setup wizard. Load old calibration data into board (esp. temperature calibration).
4) Under Hardware activate I2C in Flexi Port
4) Activate AUX MAG in settings "AuxMagSettings" --> "Type"=Flexi , "Usage"=AuxOnly
5) Set Settings for GPS in "GPSSettings" : "UbxAutoConfig"=AutoBaudConfigureAndStore, "UbxRate"=10, "UbxGNSSMode"=GPS+GLONASS (i think thats for europe)
6) Calibrate the internal MAG (or internal and external) like discussed before
7) Adjust Aux MAG orientation so that all bargraphs are pointing to zero in any orientation (For me Roll=174, Pitch=-2, Yaw=-180)
8) Test flight in attitude mode
9) Adjust virtual rotation and MAG orientation so that quad is not drifting as described here : https://librepilot.atlassian.net/wiki/display/LPDOC/Aux+Mag+Setup+and+Calibration ("Rotate Virtual" when you have an aux mag)
10) Do the auto tuning method as described by TheOtherCliff
11) Start in Stablized mode and then switch to VelocityRoam and test if it works

Its not an manual just to shortly tell what worked for me.


So that does it for me (http://h-agency.de/video/V1.mp4 ). In the video you see Velocity Roam works quiet good. I dont change any of the Altitude Hold PID´s so far, but defaults seem to work well.

Only issue i got is a little oscilation in Velocity Roam and strong oscilation if i switch to "Return to Base" and dont land but hold position...( http://h-agency.de/video/V2.mp4 ) Copter is not falling down its just me going down with the camera ;-) ...Any ideas for that????
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 #74 on: November 23, 2016, 07:09:39 pm »
I would be so excited if i could get mine to fly like that. I will try your procedure tonight