LibrePilot Forum

Users => Vehicles - MultiRotors => Topic started by: jtrout19 on November 06, 2016, 07:37:13 pm

Title: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 06, 2016, 07:37:13 pm
Got GPS and MAG going last night. Went outside today and calibrate mag over oplink. All Green and my three blue bars are all centered on 0. Although occasionally I will have an axis tick a point up or down. Anyway the GPS is not seeing more than 6 satellites most of the time. Everynow and again I will get 7 momentarily just enough for everything to go green but then it ticks back down to 6. I am using a Ublox neo 6m. I use thishttps://www.rcgroups.com/forums/showpost.php?p=30987654&postcount=296https://www.rcgroups.com/forums/showpost.php?p=30987654&postcount=296 (https://www.rcgroups.com/forums/showpost.php?p=30987654&postcount=296https://www.rcgroups.com/forums/showpost.php?p=30987654&postcount=296) to get serial Mag and GPS.

Really frustrating as I am trying so hard to get this up and running. Quad flies great in Complimentary mode. My artificial horizon is also jerky and not level. I have performed all calibration except thermal and done them over again to make sure I did them right.

Can anyone help? Thanks

edit: GPS Protocol is DJI running at 57600
Title: Re: GPS only seeing 6 satellites?
Post by: f5soh on November 06, 2016, 07:45:56 pm
The GPS issue you have is only related to the GPS module you use.

Attitude jerky comes generally from a not so good calibration and AuxMag orientation.
Title: Re: GPS only seeing 6 satellites?
Post by: jtrout19 on November 06, 2016, 08:01:38 pm
So I read it can only pick up USA satellites. That being said do we only have 6 satellites? sometimes it wont get over 5 that it is connected to. So how Do i get the quad to arm using only 5 satellites?

I have calibrated the aux mag 3 times now in the middle of a corn field with OPlink. So whats next?


Also Mag stay green at full throttle!
Title: Re: GPS only seeing 6 satellites?
Post by: f5soh on November 06, 2016, 08:14:42 pm
So how Do i get the quad to arm using only 5 satellites?

https://librepilot.atlassian.net/wiki/display/LPDOC/GPS+setup#GPSsetup-ExtendedGPSoptions
yes, neo6 only receive USA sats

Quote
I have calibrated the aux mag 3 times now in the middle of a corn field with OPlink. So whats next?

The calibration issue is covered in many places in forum, you should do a "calibration dance" for best results and double check the AuxMag orientation.
https://forum.librepilot.org/index.php?topic=1110.msg15449#msg15449


Title: Re: GPS only seeing 6 satellites?
Post by: jtrout19 on November 06, 2016, 08:41:17 pm
I have read through that entire post, great read lots of good info. Ive included picture of my mag page in GCS. You can see the one axis that is ticked a point

settings are roll - 0 pitch -5 and yaw 0

I watched the calibration video done by Luarant? (SP?) and did exactly what he did only difference is my FC is in my quad.

If I set mode to just complimentary+mag. The artificial horizon in flight data tab is nice and stable. No jumping around!

My fix jumps alot from 2d to 3d. I cannot get a steady 3d fix?

system tab is showing PDOP in the 11's as well
Title: Re: GPS only seeing 6 satellites?
Post by: f5soh on November 06, 2016, 08:54:25 pm
-5° do not make sense, except if mag is not level with board or you have motor mounts with tilt.

The 3 bars should still at zero whatever the frame orientation.

yes, my name is Laurent, i don't know what do you mean with "SP" ?
You can easily note the avatar in youtube and in this forum are the same.

Title: Re: GPS only seeing 6 satellites?
Post by: jtrout19 on November 06, 2016, 09:16:13 pm
(SP?) means spelling i was unsure if I spelt your name right. I wasnt paying attention to the avatars to be honest. It is a extremely helpful video and I appreciate that you made it.

My value were only like 5 points or so off from all being zero. I think I may have a small bit of tilt to my gps on its staff. Not much just enough to make it where i had to use small value to get all zeros. And bars stay at zero in all orientations at this point. I think it may be the Arduino thing I made. I never had issues with satellite lock before using the thing. So I am still waiting on Sbus to CPPM converter in mail When i get that I will start using I2C mag and see if that changes anything.
Title: GPS pitching back and forth in GCS
Post by: jtrout19 on November 07, 2016, 07:57:52 am
So I have solved the issue of my neo-6m not picking up more than 4 or 5 satellites. I ended up disassembling my quad and redoing all the wire. Re-Routed some, made alot shorter and doubled checked that everything was twisted. It picks up satellites very quick now. I was unable to solve the issue of the quad rocking back and forth in the Flight Data tab both model view does it and the Artificial Horizon does it as well its very slight just enough to notice it, the quad also is constantly moving in the MAP view as well. Ive played with filter settings on the accelerometer and gyro. Mag is calibrated properly per laurent's video. All bars are dead "0" In every position. I have also done the other calibrations that can be done and still have the rocking issue. Any thoughts?
Title: Re: GPS only seeing 6 satellites?
Post by: jtrout19 on November 07, 2016, 08:02:16 am
Solved this issue. Basically rebuilt the quad. New wire made sure it was all twisted. and short as possible. Also re-routed wire to better areas. GPS finds sats real quick now and usually is at least 5 or 6 and gps stays green. still have issue with rocking though. Made new thread for it.
Title: Re: GPS only seeing 6 satellites?
Post by: f5soh on November 07, 2016, 10:10:48 am
Quote
the quad also is constantly moving in the MAP view

Position moving in the map looks normal.
Gps accurancy is not so well, you can expect in best cases a moving vehicle within 3/4meters.

Gps reception can be disturbed with close house/wall and echo/ghost signals.

The rooking issues comes usually from sensor contradiction, especially when vehicle is still.
https://librepilot.atlassian.net/wiki/display/LPDOC/INS13+-+GPS+Navigation#INS13-GPSNavigation-Sensorcontradiction

No need to start a new thread in different forum sections every time you have an issue, this mean also duplicate answers...
Just for information you are already the "top thread starter"
Better use the search function for a similar thread already started and maybe answered
Title: Re: GPS only seeing 6 satellites?
Post by: jtrout19 on November 07, 2016, 02:11:00 pm
I do use the search function both in the forums and in google. Alot of times i have issues not finding what i need because i am not wording something correctly. So i apologize if i have asked duplicate questions about things. I read through the link you posted. And found this statement on how to fix my issue.

"To fix this, the variances should be adjusted by increasing or decreasing the variance of one of the affected sensors as well as fixing the cause for the contradiction (for example an incorrect magnetometer calibration)."

Since i have double and tripled check the calibrations the only thing left would be to increase or decrease the variance of the sensors. How is this done?
Title: Re: GPS only seeing 6 satellites?
Post by: f5soh on November 07, 2016, 02:16:52 pm
Never modified the EKF defaults settings here.

Post your config file
Title: Re: GPS only seeing 6 satellites?
Post by: jtrout19 on November 07, 2016, 02:23:56 pm
Ok thank you for helping. I would be lost without this forum.

Title: Re: GPS only seeing 6 satellites?
Post by: f5soh on November 07, 2016, 02:44:39 pm
Strange AuxMag Rotation, try to mimic the rotation and solve the final result:
Code: [Select]
<field name="BoardRotation" values="175,180,180"/>
Redo the calibration doing a "Calibration dance", scales are not consistent:
https://www.youtube.com/watch?v=-_mjfPlHL9o
Title: Re: GPS only seeing 6 satellites?
Post by: jtrout19 on November 07, 2016, 02:53:58 pm
Ok I will do this particular one. I did your method in your video. I played with those valuse for about an hour last night......if I set everything to 0 the blue bars are only off 1 or 2 points. I remounted GPS unit last night as well. The mounting tape that is came with did not hold it level on the mast it was pitched up about 10-15 degrees so I used a different mounting tape and now it is level with the quad. I will be right back.
Title: Re: GPS only seeing 6 satellites?
Post by: f5soh on November 07, 2016, 03:04:13 pm
The method you used for auxMag mount only alter the AuxMag rotation, not the calibration.
The 3 bars should always return to 0, whatever the frame orientation. If still to 1 or 2 this mean a bad AuxMag orientation.
Of course the auxMag orientation should not move while flying

The scales from your config file are not consistent:
Code: [Select]
1.13847804 | 1.08568275 | 1.24294817This highlight most of the time a not perfect calibration where DJI clone should report something around 1.2 if i remember right.
Title: Re: GPS only seeing 6 satellites?
Post by: jtrout19 on November 07, 2016, 03:13:26 pm
OK it is done and with pitch-roll-yaw set to zero blue bars are X axis 0 Y axis -1 Z axis 0

The pitching is almost completely gone. You can still see it but barely. Like it probably moves the distance of a couple pixles. SO definitely alot better.

New config file. So how do I get rid of the one -1 on my Y axis. I can get rid of by putting a value of 5 into pitch, should I do that or does the -1 still show that I did something wrong.

Title: Re: GPS only seeing 6 satellites?
Post by: f5soh on November 07, 2016, 03:25:11 pm
The -1 on Y axis still whatever the frame orientation ? facing down, up, etc ?
Still asymmetric scales in your last config file.
Title: Re: GPS only seeing 6 satellites?
Post by: jtrout19 on November 07, 2016, 04:04:13 pm
Im not sure what you mean by that.  But the gps unit is mounted above everything on a mast. The mag chip is on the bottom of the board so the top of the mag points down. There is an arrow on my gps casing indicating the forward position. Unfortunately i had to go to work so i will revisit everything tonight. .
Those values you are looking at should all be the same number or close to it? If so where do you find them numbers?
Title: Re: GPS only seeing 6 satellites?
Post by: f5soh on November 07, 2016, 05:04:46 pm
Quote
Those values you are looking at should all be the same number or close to it? If so where do you find them numbers?

The scale numbers, are a part of a result calibration with Biases.
You can see all those numbers in the UAVOBrowser > AuxMagSettings and another place for the onboard mag (use search field at top)

Should be almost close, not 1.24 < > 1.08

I talk about the 3 bars values while moving the frame
Title: Re: GPS only seeing 6 satellites?
Post by: jtrout19 on November 07, 2016, 05:26:37 pm
When moving the frame i will get jumps but small ones bars move 3 or 4 points and then settle back to. The original values of 0, -1, 0
Title: Re: GPS only seeing 6 satellites?
Post by: TheOtherCliff on November 07, 2016, 09:25:38 pm
The numbers will change a little when it is moving (rotating), but should come back to 0,0,0 when stopped at any bank angle.

That single -1 is not so bad.  Your GPS/mag is not _exactly_ aligned to your FC.  Fix it if you can (adjust mag rotation on same page), but if not, it should be OK.
Title: Re: GPS only seeing 6 satellites?
Post by: jtrout19 on November 07, 2016, 09:37:39 pm
Thats what i was gonna do. If i use a small number like 5 or so then all bars are zeros and and return to zero in all posistions. But i still get the rocking in flight data tab of gcs when quad is not flying. And then if i try to fly it the quad oscillates but only in a gps mode. I did the calibrate about 20 yards from anything metal out in a cornfield. Is that good enough or do i need to go farther? I am still gonna try it again to try and get number correct that F5soh is talking about.
Title: Re: GPS only seeing 6 satellites?
Post by: TheOtherCliff on November 08, 2016, 07:29:27 pm
Your issues are probably not caused by only seeing 6 sats.  Even if your GPS only gets USA satellites you should still get 7 or 8 when outdoors and away from trees and buildings, nothing overhead and not even located next to something tall.  For best reception, tall things should be far enough away that they are lets say no more than 30 degrees above the horizon.

A small amount of rocking (a few degrees) in flight data tab is normal, but if it is flipping upside down and moving a lot it is a symptom that you are using an aux mag and AuxMagSettings.BoardRotation is not set correctly.
https://librepilot.atlassian.net/wiki/display/LPDOC/Aux+Mag+Setup+and+Calibration

Oscillation in GPS flight modes are an ongoing issue.  Two kinds:
- a quick oscillation (less than 1 second per oscillation, like PIDs too high in Attitude mode that comes and goes depending on which direction the quad is pointed)
- a slow oscillation (about 4 seconds per oscillation with movement in the east-west direction)

This thread discusses both issues
https://forum.librepilot.org/index.php?topic=382.0
Title: Re: GPS only seeing 6 satellites?
Post by: jtrout19 on November 08, 2016, 08:40:37 pm
I am going to take a comprehensive video of everything either tonight or tomorrow.  Thanks for all your guys help. I really do appreciate it. I own three revos as of now and absolutely love them. There is another mode that you can set complimetary+mag. Quad flies great and i have no issues in that mode. It is only when i switch to anything with gps. Occasionally i will get 7 satellites but no more. Ive gotten it to maintain 6 at this point. I want to mention that i have everyting ran through an arduino so i can get gps and mag data through on cable other port is taken by sbus. I am suspect of that causing my issue but wont know for sure until my sbus to cppm converter arrives
Title: Re: GPS only seeing 6 satellites?
Post by: jtrout19 on November 09, 2016, 03:55:32 am
OK so I just re did my mag calibration. I took off any metal I was wearing even my wedding ring. I walked a 1/4 mile into the corn field. Had my wife stay back at the house with the laptop. Did the calibration dance and these are the value that I came up with after doing it.

[1.11482167,1.08047616,1.20694065] You would still call these values asymmetrical. I have done everything right at this point. Module is mounted a good 6 inches above anything at all and my high power lines are lower than that. I have twisted all my cables. I am at a loss and getting very frustrated at this point. Only thing I have left is to take the arduino module out and connect mag through I2C and see if that works.
Title: Re: GPS only seeing 6 satellites?
Post by: jtrout19 on November 09, 2016, 05:19:40 am
Ok well I disconnected the ardiuno and hooked everything back up with AUXMAG running through I2C and GPS running through Mainport. I cannot get my FC to read the GPS now.......Not sure what is going on, I am thinking maybe it is going to keep the DJI config until I leave it disconnected for a while. So that is what I am going to do.

I will say the AuXMAG is now reading a whole lot different than it was so we will see tomorrow morning i guess.


So i just did a quick calibration in my house....I know its a no no and I am going to do a proper one but I wanted to see my numbers and here they are

0.92088962,0.89249212,1.02140617

A lot better than the others. I bet it would be perfect if I did it outside.

My thought now is why did the arduino cause issues?
Title: Re: GPS only seeing 6 satellites?
Post by: TheOtherCliff on November 09, 2016, 04:28:16 pm
I was about to add more causes of low satellite count and that is any transmitter in the aircraft that might be bleeding through to GPS frequencies or noise on the power supply.

FPV transmitters can cause GPS issues this way.  The main USA GPS frequency is in the 1.5ghz range and a 1.3ghz FPV transmitter might cause some problems if the transmitter/antenna was mounted too closely to the GPS.

I don't know what version you are running.  I'm assuming 16.09RCsomething.  There was an issue with mag calibration at one point and one work around was to set the calibration data to default before doing the mag calibration.  So many things doing on, I don't recall if this is officially fixed in an RC yet.

Go into System -> Settings -> AuxMagSettings and set:
mag_bias to 0 0 0
and
mag_transform to 1 0 0   0 1 0   0 0 1

and do the same in RevoCalibration, then do the mag calibration.

Of course this has nothing to do with the GPS satellite count...
Title: Re: GPS only seeing 6 satellites?
Post by: jtrout19 on November 09, 2016, 05:07:52 pm
I am running 16.09rc2 and fpv runs on 5.8ghz, control 2.4ghz and of course oplink at 433mhz. I cant get the fc to connect to the gps now. I removed the arduino module gps unit powers up and flashes blue light for satellite fix. But fc not reading data. Mag works great though over i2c. I did change protocol back to ublox instead of dji and and swapped rx and tx wires with not luck. Im prolly gonna buy naza clone from banggood for 22 dollars us.
Title: Re: GPS only seeing 6 satellites?
Post by: jtrout19 on November 13, 2016, 05:33:48 am
Alrighty guys, Finally got my Sbus to CPPM converter in. So I started from scratch and reset everything. Got the quad flying really good with autotune. Then setup GPS and I2C AUXMAG. Gps works much better now. Constantly have 7 sat lock.

Went out to calibrate mag tonight. Its getting cold up here so I had my wife help me. She sat inside on the laptop connected to quad through OPlink and I went outside. Did the calibration dance. Saved everything set up VelocityRoam and PositionHold flight modes. First tried Velocity roam Quad had a hard time holding altitude at hover as well as with movement. Position hold was a little better. Quad still had difficult time mainting altitude it would dip down and then over shoot. In both modes the thing barely wobbled. I did have a small bit of yaw drift to the left in position hold.

Here are my numbers

.889801  .859264   .960515

f5soh---I assume you are going to tell me that the calibration is a little off being that the last number is over a tenth of a value higher? I am going to perform other calibrations and then redo the mag calibration. Since it is getting cold I am going to go ahead and do the thermal calibration as well.

I thought I read somewhere about there being PID's for GPS that were separate from the inner and outer loops? If there is how do you go about tuning those values? Is there a wiki page available? Couldn't find one.

One last thing is there anything else I need to look at or do that I have not mentioned here?

Thanks for the help guys!
Title: Re: GPS only seeing 6 satellites?
Post by: jtrout19 on November 14, 2016, 07:05:49 am
OK So I am including a link to a video I took tonight with my phone of Position Hold, and velocity roam. I also turned on my pixpro and took a short video of quad in flight. Ive included fight log and settings. I have a naza GPS unit coming if I cannot this working. I will be honest I am getting frustrated. I have read through the Revo AuxMag and the AuxMag Calbration possible bug threads about 10 times a piece now. I can verify that when I hit start on mag calibration the value in UAVO Broswer reset to defaults. I have done calibration a more times than I care to count. I even did thermal calibration on it last night. So I really need some guidance here. I have even went back through and reassembled my quad. Made every wire as short as possible, twisted everything. Put every piece of hardware as low in the frame As I can get it. I have even unplugged everything that was not needed while doing the mag calibration and I cannot get any better than .889801  .859264  .960515.

In the first video the quad is pointing south. The final video and the longest it starts pointed south I gain some altitude then turn it to point north stay for a minute and then point south. Right after the yaw the quad descends rapidly because of mistake by the thumb you can kind of hear and see it in the video. The main reason for the last video was to listen for oscillations which I dont think I hear any. Also the third video is flown in stabilized mode with no GPS.

I got people telling me to give up and get something that works with APM. but I am determined to make these work. The revo without GPS works like a dream on my small 250. I have no gripes about it. The same people telling me to switch FC are using the FC's they are telling me to switch to and have GPS modes that work just fine on their quads.

Also I was playing with my extra revo tonight without anything attached to it expect for a power supply. Low current I did a mag calibration on the onboard mag and came up with the same numbers I have been? Why is that? Why the same exact numbers? Shouldn't the on board mag especially with nothing to influence that mag have better calibration results?

http://vid203.photobucket.com/albums/aa66/SickFoto/20161113_2317071.mp4 (http://vid203.photobucket.com/albums/aa66/SickFoto/20161113_2317071.mp4)
https://www.dropbox.com/s/relmviywlmpmktj/Quadflight1.avi?dl=0 (https://www.dropbox.com/s/relmviywlmpmktj/Quadflight1.avi?dl=0)
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 15, 2016, 12:34:56 am
I am honestly starting to draw the conclusion that the Revolution is not a good choice for anything with GPS flight modes. It should not be this difficult to get up and running. My naza GPS is supposed to arrive this week and I will see if that fixes my issue. If it does not then I am going to call it quits a purchase a Pixhawk 2 or a pixracer. I cant seem to get it figured out and the support team for librepilot can't seem to help me figure it out either. I appreciate you guys trying to help me. Hopefully it is my hardware that is defective and all is good. If not I am reserving revolution FC's strictly for non gps flight.

I will say that my little 250 is a rock solid little quad. Flies like its on rails and i couldnt ask for the revo to be any better in that situation.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff on November 15, 2016, 05:54:10 pm
Go back to Attitude mode and set it up with AltitudeVario throttle/thrust mode and get that working.  It sounds like you have Baro problems.  If so, this won't hold altitude correctly either.

Of course you still need to take off in Attitude with manual thrust mode while debugging this.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 15, 2016, 06:18:38 pm
Ok i will try that tonight when i get home from work. If i have same issues in that mode then i have a bad barometer on my board?
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: f5soh on November 15, 2016, 07:13:56 pm
Is the baro sensor protected from the light ?

From the first video you posted, the altitude difference can be simply due to the sensor exposed to the light or not.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 15, 2016, 09:04:19 pm
Its in the middle of my quad. So it should never get direct sunlight
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: f5soh on November 15, 2016, 09:17:07 pm
I recall some tests using a closed box (opaque) with only a 3x3mm hole in one side and noticed changes when the hole was facing sun light (end of day) while yaw rotating...
You can do a simple test in night and apply or not the light and monitor the baro altitude.

Baro sensors are very sensible to light.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 15, 2016, 10:47:37 pm
I will say this as well. The board was inside a mounting box that was dark grey. I took it out last night and changed my mounting to something that would absorb vibration. Another thing i have found as well is one of my props is a little messed up and is causing one motor to vibrate really bad. So i am going to swap my 12inch propr for my 10inch propa and see if that helps any as well. Would bad vibration cause the issues i am facing?
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 16, 2016, 03:10:14 am
ok so the prop problem is fixed. I just reamed the hubs out till the prop would sit on the top of the motor. No more vibration at all from my motors. I need to redo my autotune now that that major source of vibration is gone. It was so bad that it made the spinner look like it was a rectangle. Im not sure how I missed that but it is fixed now. After I redo the auto tune I will redo the altitudevario flight.

I did take it outside and try it though and in altitudevario it still went up and down. never hit the ground though. I tried positionhold and velocityroam again as well. Its ability to hold its position is majorly improved I barely get any roll drift but I still get up and down drift not as much as before though.

So if it does turn out that I have a baro, what would exactly be wrong with it? Would I just need to purchase one and replace it? If so, I have never worked with baro's are they heat sensitive is there a special way you got to solder them to the board?

Charging batteries now will try to take a video of results tonight and post.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 16, 2016, 04:04:11 am
OK so I did some research on barometers and wow. I didnt realize how sensitive these things were. So i copied off this guy and made a home for my baro
https://www.youtube.com/watch?v=AMJYXNMOuwM (https://www.youtube.com/watch?v=AMJYXNMOuwM)

Batteries almost charged
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 16, 2016, 04:54:52 am
Alrighty I got some hope back now!! Things are looking much much better. I included some videos again of VelocityRoam and PositionHold. Compared to how it was its amazing. It is still no where I want it. I would like a more solid hold. I really dont want to see movement at all in PositionHold. The other thing is VelocityRoam supposed to keep the quad at a certain altitude in flight? If that is the purpose of it I would like it to be more precise as well. It holds altitude alright if I barely push the stick forward but if I go much past half stick it wants to loose altitude. Oh and f5soh I've include my most recent mag calibration numbers. I change GPS mast. to something alot better. With 4 screw holes and more rigid mast. Anyway tell me what you think and how I can continue to improve this.

Code: [Select]
.917266 , .888816 , .989901 Alot better than before yeah!

Now for videos!!
https://www.dropbox.com/s/fgfmee3ot5zhl4m/20161115_222539%5B1%5D.mp4?dl=0 (https://www.dropbox.com/s/fgfmee3ot5zhl4m/20161115_222539%5B1%5D.mp4?dl=0)
https://www.dropbox.com/s/k868lobwzr7tbb8/20161115_222617%5B1%5D.mp4?dl=0 (https://www.dropbox.com/s/k868lobwzr7tbb8/20161115_222617%5B1%5D.mp4?dl=0)
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff on November 16, 2016, 04:58:42 pm
Wind from one or more props is a major concern too (not just light).  Even after trying to keep the wind off, on one quad I have, it would climb at full power if I yawed left hard (and not stop if I neutralized the yaw), but not if I yawed right.

You need just the right thickness of "open cell" foam.  The right thickness is like the right sized tiny hole, and it slows down the changes from prop blast, but not from actual altitude change.

Both VelocityRoam flight mode and AltitudeVario thrust mode have a dead band at center throttle stick.  If the stick is within +-10% (IIRC) of the center it acts exactly like it is in the center and is not supposed to vary in altitude.  Some users report they have to tune the Altitude PIDs to get it to work better.  I don't really recommend that.

Loosing altitude if going past half pitch stick when in these modes is usually a sign of motors not strong enough to do this.  As you approach a 90 degree bank the power required to avoid loosing altitude goes to infinity so all quads fail sooner or later.

Did you start from a cloud config or someone else's config (UAV file)?  That sometimes causes confusion where the original quad was tweaked in some strange way...
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 16, 2016, 05:23:41 pm
I started from the basic quad config. Did autotune. Set things up that way. I built that little box for it and put that around it. I did try autoland last night as well and it works fairly well. It drops real quick for the first couple feet then slows down and continues to descend slowly till it hits the ground. No air or light can get to the barometer at this point. The little box that covers it is filled with cotton as well. The quad can yaw left and right with the same behavior as when at center stick. I know you do not recommend it but where do I find the altitude PID's? Would love to get it totally stable!

Thanks for your help.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff on November 16, 2016, 06:58:54 pm
Air needs to be able to "leak" in to the box as if through a pin hole, but not much bigger a hole than that.  If the box is tightly built and glued down to seal then the baro can't work.  If AltitudeVario still works, then there is enough of a leak to work.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 16, 2016, 07:10:29 pm
Yes i put a very very small hole in the top of the box. But i am still having small issues with it not holding its altitude. What causes this and how do i go about fixing it?
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 17, 2016, 08:10:33 am
OK I had found a page that described an issue with the a certain cap next in a voltage regulator circuit that caused barometer issues. Sitting still my baro fluctuates between 207 and 209. So as soon as I find the page again I am going to remove that capacitor. I believe it is C9 but want to make sure. I will report back if the fix works.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: f5soh on November 17, 2016, 06:27:10 pm
So as soon as I find the page again

https://librepilot.atlassian.net/wiki/display/LPDOC/Altitude+Hold
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 17, 2016, 07:51:12 pm
Yip thats it thank you. The only thing is the revolutions i have are not laid out like the original revolutions. So i can find the regulator but not sure which cap is which and i cannot see a trace that runs to the cap because of a cap that is so close to the pin. Granted that might be the cap so i will try tonight and see what happens
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: DocHardinger on November 18, 2016, 02:44:45 pm
Hi everybody,

i also trying to get GPS mode working with internal mag.
So i read about the gain(scale) values (revo_calibration-->mag_transform), which should be nearly the same in all values (r0c0,r1c1,r2c2), as discussed here.
But also if i do the calibration with only the revo board in my hand outside on a field i'm getting these results : 0,85 / 0,83 / 1,14

Also mounted revo on the frame (mounted 45mm above the frame, no metall around, GPS 80 mm above frame) and doing the calibration, results are nearly the same and MAG is always green also when hovering.
So i tried to switch to INS13 navigation mode with flight mode in Attitude mode and manual thrust. It then flies nearly as good as complementary mode. Also Hold Altitude mode works well (Oscilates smooth half meter up and down on a windy day) (Thanks to the discussion in this thread  ;) ). Just need a little more PID fine tuning.
For info: got a Revolution clone with dark plastic cover and black foam already installed. Just needed to make the foam a little thinner otherwise it oscilated really strong, because air cant get through i think.

So am i right if i now switch to position hold mode that this will also work well? Or does this mode uses different attitude calculation? Cause flying without assist in INS13 mode seems to work...


Thx in advance for your investigation and by the way sorry for not the best english ;-)
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff on November 20, 2016, 12:24:04 am
Sounds like you are ready to use the GPS.  :)

Before first flight of the day, let it sit for 15 minutes for GPS to "download the almanac".

I recommend you use VelocityRoam instead of PositionHold.  All sticks in the center, it is EXACTLY the same as PositionHold, but if you move a stick, it moves a little bit, and exactly as you would hope it would.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 20, 2016, 05:21:15 am
I have to say this......the naza gps is so much better than the neo m6n that I purchased off of hobbyking. I will not buy any other gps from now on. I will post video tomorrow of how my flight goes. I think I finally got everything set. Its been a long journey, almost wanted to give up at times but I am hopeful this time. Gut feeling! wish me luck
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff on November 20, 2016, 02:20:40 pm
Good luck, but I don't think you will need it.  :)

The only recommendation I have is to have an FMS that has Attitude mode for takeoff and emergencies.  The other mode should be VelocityRoam.  Take off in Attitude and switch to VR.  If you have any problem, switch back to Attitude.  Play with VR.  It is very fun to fly.  You can drive it around like an RC car.

https://forum.librepilot.org/index.php?topic=1805.msg13091#msg13091
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 20, 2016, 07:43:17 pm
I also posted this in the Revo Aux Mag thread for the sake of having more info in that thread.  (duplicate post removed - hwh)

alrighty tell me why this would happen.

So I got my genuine naza gps yesterday installed it and did a just for the hell of it calibration inside my house last night. 
the mag_transform values i got last night in the house were great. All values were in like .05 of each other. So today I go outside and redo the calibration over oplink in the cornfield with my wife operating the computer.

these are the values I got
Code: [Select]
1.04264   1.02504    1.17621

f5soh says these values are not symmetrical. So why do I get better values inside the house and worse values outside the house.

Now I will say that velocity roam holds altitude really well currently. I have small oscillations in both velocity roam and position hold. I also get a large oscillation that gets worse evertime it cycles. The small oscillation looks like to high a Kp the entire quad oscillates. The large oscillation is just a pitch axis oscillation so at first it will tilt forward slightly then tip back slighty and then go forward again a little bit farther and then go back a little bit farther.....and so on until i have to switch back to a non gps mode to keep it from crashing or manual moves the sticks to correct it.

So things are a little better but still not there yet. Any Ideas. oh and MAG stays green the entire flight even at full throttle so does GPS. and AUX MAG ORIENTATION values are all at 0 and stay there regardless of quad position.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff on November 20, 2016, 08:55:07 pm
At one time there was an issue with aux mag calibration.  The values need to be reset before doing the calibration.  I'm not 100% sure the fix is in the RC yet or that you have the latest RC.

The work around is to set all your aux mag biases to 0 (0,0,0) and the transform to 1,0,0,0,1,0,0,0,1 before doing the calibration.

I have a consistent east-west oscillation in GPS flight (PH / VR) and that may be what you are seeing.  Is your oscillation east-west only?  Is that with a DJI/Naza GPS/mag?
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 20, 2016, 09:27:36 pm
The version of GCS I have automatically resets everything when you git start calibration. I have the UAVO broswer open right next to the calibration window so I can see it happen real time. I didnt pay attention to the direction at all times. I will say the last time I flew it the quad was pointed east and the oscillation was east to west there. I could deal with a little oscillation but the fact that it gets bigger and bigger and bigger to the point where the quad crashes is not good. Last question is yes I it is with the DJI GPS/MAG
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff on November 20, 2016, 11:53:19 pm
I reduced my VtolPathFollowerSettings PIDs and it still oscillates a bit, but does not grow any more.

I need to look into this and fix it.  I have a good idea where to look.

My settings (this might calm it down a bit for you):
HorizontalPosP 0.125
Both HorizontalVelPID and VelocityRoamHorizontalVelPID are 2.4 1.2 1.2 0.95
VelocityFeedForward 0.6
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 21, 2016, 02:07:36 am
OK I will try those settings. Thank you for your help. Let me know if there is anything I can do to help! I will report back tomorrow. Maybe tonight if I decided to get all bundled up and go outside but definitely tomorrow.

So if there anyway that explains all the values in vtolpathfollowersettings? I know there are some mouse over notes but I would really like to learn the FC and the GCS inside and out.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 21, 2016, 11:37:47 pm
Alright gave those settings a shot and it still has the issue. the back and forth got really large this time though and it is east to west or west to east. I made sure by facing east Would going back to 15.09 solve my issue?
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: hwh on November 22, 2016, 12:29:59 am
No, 15.09 isn't better at anything than the 16.09RCx releases.  It also doesn't support any external mag other than the original OpenPilot GPS Platinum (aka V9) that's no longer made.  It doesn't support the Naza GPS at all.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 22, 2016, 01:47:52 am
Well i dont know what to do then. Ive done evrything you guys have said. I might have to go to a different fc for gps modes
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 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?
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 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?
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: DocHardinger 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 ;-)
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 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.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: f5soh 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. 
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: Mateusz 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 !

https://www.youtube.com/watch?v=iPdW-wXulak
https://www.youtube.com/watch?v=443R9qn3CVw
https://www.youtube.com/watch?v=NHCwlP7C0Pg
https://www.youtube.com/watch?v=NZiB3EytVAM
https://www.youtube.com/watch?v=FUqh1PXs27c
etc...
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff 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.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 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.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff 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.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: Mateusz 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.

Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 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.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: Mateusz 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 https://www.youtube.com/watch?v=MBsSHpZmqGE
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

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.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 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.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: DocHardinger 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 (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 (http://h-agency.de/video/V2.mp4) ) Copter is not falling down its just me going down with the camera ;-) ...Any ideas for that????
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 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
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 23, 2016, 11:41:12 pm
real quick question about tuning.....Which loop do you want to tune first? Outer or inner? And if using TxPID then you want to tune all p's first then I's then d's.....so it would be Roll Kp, Pitch kp, and Yaw kp for the first set? I am asking for the future here. I would like to get good at tuning with TxPID.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 24, 2016, 03:47:11 am
A few pictures. I am going to calibrate mag next. The quad is all back together. I am going to do a test as well to see about vibrations. I shouldn't have any. I am a nut about balancing.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 24, 2016, 05:33:01 am
Well new revelation tonight. Maybe someone can fill me in on this one.

So tonight I went out to do the mag calibration again. It has been raining all day so the cornfield is all muddy. I went into it anyway so did the calibration once and came up with the values ive been coming up with   1.04  1.03 and 1.15 those are round about numbers I have been getting. So i told my wife to reset everything and lets do it again. This time I moved about 10 feet away from where I usually do the calibration. I usually do it in the exact same spot everytime. So anyway I moved and used a different spot 10 feet away from my original spot. Did the calibration dance and these are the numbers that popped up. .0980935  .988603   .671426...... Whats up with that? I am literally in the middle of a cornfield doing this dance. No highpower lines above and the only thing around me is my house that is a good 20-30 yards in from of me..


Makes me wonder am I trying to do my calibration on a damn ley line!  lol  :o

tomorrow being thanksgiving and all we are going to families house out in the country I will try again elsewhere and see what happens...


Well decided to try again outside in a different spot came up with these values

1.06208   1.0487      1.19019 

I did a short log of these values. With an update of 250ms. looks fairly symmetrical to my untrained eyes. What do you guys think. Oh and when I did this I did roll first 180 degrees back and forth then 180 back and forth of pitch and finally yaw 180 degrees back and forth.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff on November 24, 2016, 07:19:57 am
You are far enough away that telemetry may be dropping data.  A slightly different position may have put you or something else in the RF link path.

Generally you tune Inner with Rate mode, then tune outer with Attitude mode.

DocHardinger is not running a DJI GPS (whether that makes a difference, I don't know yet), and (from the description) has oscillation problems too.  RTB with PH at end is probably the same as PH, and I know for sure that VR with stick centered is the exact same as PH.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: DocHardinger on November 24, 2016, 07:44:47 am
Thats strange because RTB without landing (PH over home)causes really bad oscillations +-30° and they are really strong. But in normal PH mode it looks fine. Maybe its because of using a fix position? Anyway are there any parameters to play with?

I also recognized that there are PID's for VR horizontal and just horizontal PID's. So which one are for PH and which one are for VR and is there anywhere a description what PID's are used for which flightmode? Also for other flightmodes... Such a docu were really good :-)
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 24, 2016, 08:05:27 am
Thanks cliff! I am going to redo the calibration again tomorrow. With computer outside as well. Did you happen to take a look at that flight log and the Raw Mag values? I am wanting to know what exactly I am shooting for. I am assuming that I want the aux mag lines to be a replica of the regular mag lines. Just wanting to make sure. Also f5soh said something a while back about mag-transform number and how they needed to be very close in value with each other. Is that correct or did I misunderstand?
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: DocHardinger on November 24, 2016, 08:12:34 am
For me they look like youre last result 0.99 0.97 1.17...and this works great....to get both mags the same you need to adjust the aux mag rotation but i think you know that...

What i would try is to calibrate the internal mag and look if PFD and orientation/compass looks good and then adjust aux mag orientation so that are all bargraphs are zero in any orientation...


Oh something ive forgotten: Thx Cliff for your investigation ;-)
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 24, 2016, 05:46:09 pm
Doc I like your hardware. Our quads are very similar as far as specs go. I have a 2 axis gimbal I was given. It is a brushless gimbal. I will eventually use it but want to get the quad flying without it. Plus i am going to have to get creative when it comes to mounting it. I is made for the DJI phantom but no big deal I will figure it out. Just wanted to tell ya nice hardware!
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: DocHardinger on November 24, 2016, 06:42:12 pm
If you would know how my gimbal looks like  ;D
Its made out of Balsa wood and with two micro servos with the Pi camera adapted to it... But hey it works nice with LibrePilot Gimbal Stabilization :P
And i got a live HD stream directly to my phone into my gear vr :-) with about 90ms delay over wifi ...thats okay for flying around and taking pictures or videos....
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 24, 2016, 07:04:26 pm
Hey if it works it works! Cant fault nobody for building something works regardless of what its made out of or how it looks!! 90ms of delay isnt bad at all......what kind of range do you get out of it
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: DocHardinger on November 24, 2016, 07:28:16 pm
Hmm dont really test it yet...will use a good router on the ground...should be nearly 500 meter...but dont know...as soon as i tested it i will tell you...but problem will be if it looses connection it needs some time to reconnect so not good for real fpv flying...but for me its good
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: Mateusz on November 24, 2016, 08:02:49 pm
Hmm dont really test it yet...will use a good router on the ground...should be nearly 500 meter...but dont know...as soon as i tested it i will tell you...but problem will be if it looses connection it needs some time to reconnect so not good for real fpv flying...but for me its good

I have Xiaomi Yi camera that has WiFi. The IEEE 802.11 to which belongs WiFi uses 2.4 GHz, 3.6 GHz, 4.9 GHz, 5 GHz, and 5.9 GHz bands. My FrSky system also uses 2.4Ghz and it was entering Fail-safe randomly whenever I had WiFi module on camera turned on. If your radio uses the same frequency take interference into consideration ;)
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: DocHardinger on November 24, 2016, 08:21:47 pm
Yes i know but im using 2.4ghz for transmitter and 5ghz for wifi and i already tested it in flight...but not tested the range(i think 5ghz hasnt as much range as 2.4)..but im too afraid of loosing radio signal for control  ;D ...and just today i set failsafe mode to Return to home, so maybe next time im brave enough for range testing :D
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: Mateusz on November 24, 2016, 08:38:15 pm
Yes i know but im using 2.4ghz for transmitter and 5ghz for wifi and i already tested it in flight...but not tested the range(i think 5ghz hasnt as much range as 2.4)..but im too afraid of loosing radio signal for control  ;D ...and just today i set failsafe mode to Return to home, so maybe next time im brave enough for range testing :D

Ok, RF is black magic to me, I guess 2.4 and 5 are used by the routers concurrently so shouldn't have too much interference/harmonics, but no clue. Good that if it works for you, probably because you are lucky to be able to set your WiFi device to use only 5G band, I couldn't do that on my camera.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 25, 2016, 03:01:19 am
You set your router up to broadcast both 2.4ghz and 5ghz. Then you connect your device to the 5ghz band. That is how you set it up. You have to have a router capable of broadcasting both frequencies
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 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.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff 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).
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 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 https://www.youtube.com/watch?v=ccFhx1OvjdQ (https://www.youtube.com/watch?v=ccFhx1OvjdQ) Been making me very sad
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: Mateusz 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 https://www.youtube.com/watch?v=s7UP_g79bVg
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 :)

Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff 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;
    }
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 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
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff 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.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 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
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff on November 25, 2016, 09:53:41 pm
I will build that and post the firmware here.  Should be way less than an hour.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 25, 2016, 09:57:23 pm
aweome thank you cliff
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff 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.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: DocHardinger 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?
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 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

Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff 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.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 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 (https://www.dropbox.com/s/ll41gzpkfp8or24/20161125_171307%5B1%5D.mp4?dl=0)
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff on November 26, 2016, 07:05:57 am
Heading to bed.  Didn't watch video.  :(  Climbing too much in GPS mode is usually a sign of either a baro that is getting prop blast on it or invisible oscillations caused by PIDs too high.  Edit: could also be ESC calibration.

The only change in the firmware I posted is a fix for the east - west oscillation in GPS mode.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 26, 2016, 07:23:33 am
Thats fine I still have to tune it. I am going to do that tomorrow. Then I will take another video. I am going to do an fpv flight tomorrow as well. Finally got my new VTX in. My Baro is totally hidden no prop blast or light can get to it.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: DocHardinger on November 26, 2016, 10:33:44 am
Maybe its to much hidden ;-) i needed to remove some foam...otherwise pressure needs to long to get into the baro...nd that for me causes same issues...quad is going up because it was too low but baro didnt relize the pressure change that fast...so it was always behind the real height...hope you get what i mean
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 26, 2016, 04:05:00 pm
Yeah I was wondering about that so last night I removed the balsa box I made for it. Reused the case the revo came in added some memory foam to it. Now pressure changes in scopes immediately and I can take my surefire flashlight and shine on the case and no change. I can also take a can of compressed air and blow on it and no change. The scope picture i posted last night was after all that. I also black electrical taped the casing as well.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: rotomoto on November 26, 2016, 05:57:48 pm
Can confirm . Librepilot GPS setup is quite bad.
Spend 2 days trying get magnetometers right (DJI pug) with RC2 ,No luck.
There must be something fundamentally wrong with the software. Same time same parts with Pixhawk and position hold is rock solid.

Any way .. .RC2 with standard PID flies great.
https://www.youtube.com/watch?v=5zKKNkhzPpo
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 26, 2016, 06:25:35 pm
Can confirm . Librepilot GPS setup is quite bad.
Spend 2 days trying get magnetometers right (DJI pug) with RC2 ,No luck.
There must be something fundamentally wrong with the software. Same time same parts with Pixhawk and position hold is rock solid.

I do not think something is "fundamentally wrong" with the software. I personally think the reason people have such a hard time with getting it right is because of the 3d mag. From what I understand a 3d mag is much more sensitive than a 2d mag. I also believe the pixhawk uses a 2d mag. There are plenty of people who have got gps to work with this flight controller. I will be honest I have been tossing around the idea of getting a pixhawk. Just to see how something else works. And to be honest I will prolly get one but I am not giving up on the revolution or librepilot.

I am getting ready to build the flightcontroller from scratch the reason for this is because I know chinese clones can be bad products. They use cheaper components to save on costs. The end result ends up being something that isnt quite right but will work. So I am going to build one the way it was meant to be built using the parts that were meant to be used. My conclusion is that I will have something that will work better than my chinese made ones that I have.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 27, 2016, 12:10:56 am
Alrighty Cliff and anyone else who is following this. I dont have a video cause it is already dark where I am at. I will take a video tomorrow before I change anything to let you see what is going on. Position hold is literally almost there. I was very impressed by it. Velocity roam is a whole other story. The quad oscillates a fast oscillation.

I didnt have time to do the txpid tonight so I did a quick autotune. Here is what it got. Do the PIDs seem a bit high. I mean the quad flies good in my opinion. But they are the highest values I have seen in my short time of doing this.


Roll         pitch         yaw
.00526    .00596     .01490
00951     .001078   .02156
.000077   .000087   .000174

outer loop

Roll          pitch
3.309      3.309
1.271      1.271
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff on November 27, 2016, 05:38:54 pm
FYI: the oscillation that I saw was in a line, not the circular toilet bowl.  For me, sometimes the oscillation did not start if I switch to VR when stationary and don't move the sticks.

With the sticks in the center, VR is supposed to run the same code as PH.

A fast oscillation (much faster than a 4 second period) has been seen by some people for a long time (even 15.09).
https://forum.librepilot.org/index.php?topic=382.0

In VtolPathFollowerSettings there is a separate (higher) PID for VR.  You might try setting the horizontal VR PID to the same as the horizontal generic PID.

Did the new firmware help the east west oscillation for you?  FYI, it uses the same settings as RC2, so you can just flash one then the other to test for a difference.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 27, 2016, 07:20:29 pm
Two new videos of VR and PH. Problem still not solved. The wind is weird today. It will be really still and then all the sudden a quick gust. Same behavior on both regular 16.09rc2 and 16.09rc2_dirty.

Flies great without gps. I couldnt ask for better flight without gps. Ive switched into VR both at a hover with no stick input and with stick input. Changing the pid did not work either.

https://www.dropbox.com/s/fod41zho33yewrz/20161127_130011%5B1%5D.mp4?dl=0 (https://www.dropbox.com/s/fod41zho33yewrz/20161127_130011%5B1%5D.mp4?dl=0)
https://www.dropbox.com/s/otrliz5ktj394xy/20161127_125840%5B1%5D.mp4?dl=0 (https://www.dropbox.com/s/otrliz5ktj394xy/20161127_125840%5B1%5D.mp4?dl=0)
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: TheOtherCliff on November 27, 2016, 07:39:27 pm
That is exactly what my 500 looks like with stock firmware.  The two test flights I made with the dirty firmware, I had zero issues.

It sometimes takes 10 - 15 seconds to get started, and initial motion seems to help it get started.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 27, 2016, 07:51:32 pm
I wonder why I am still having same issues with dirty firmware. Those videos are with the dirty firmware.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 29, 2016, 09:36:48 pm
Hey guys first i want to start off by saying thank you for all the assistance you have given me over the past few months.

I have decided to put the revo on hold. I purchased a pixhawk for my large drone. I have been trying to get gps to work for long on this quad i missed out on the summer and fall season of flying. I just cant do it anymore i dont have the drive to do it anymore.

That being said i have three revos as well as blank boards on the way thatbi am going to put together. I will continue using the revo on my smaller quads and any build i dont want gps modes on. It is an excellent flight controller.

So again thank you for your help i will continue to follow these forums for updates and chnages and anything else..
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: DocHardinger on November 29, 2016, 10:03:47 pm
Oh thats really sad...for me pos and altitude hold works really good...after tuning its like nailed in the air...
But a pixhawk is a really good choice i think
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: jtrout19 on November 29, 2016, 10:22:35 pm
I know it sucks I really wanted to get it working, I hate being beat by something. My wife even started telling me to go different. She saw how frustrated it was making me and started to get upset that I was frustrated every night after I got home from work....lol

Anyway I will still try things when new releases come out and such. I will hook it back up and re-try it. I just want to get my quad in the air and do some photos and video and such. I am not blaming the flight controller either or the firmware or the developers. I am not blaming myself either. Hell I can't blame anything because I just dont know why I couldn't get it working.

Maybe I will have the same problems with the pixhawk maybe I won't. I just dont want to spend hours in the cornfield anymore calibrating my mag. The final thing that made me jump was on saturday, I went over to my brother in laws house for dinner took my large quad, was gonna fly it around the city. He lives on the east side of indianapolis. So there are really nice views from the air. So I got my quad out and tried to go flying. Could not get it to arm. No matter what I did. I didnt have my laptop so I couldnt see what was keeping if from arming but it always armed itself at my house. I never had issue with it arming at my place. I even left the thing sitting for 20 minutes. No go so I ended up flying my little 250.

Anyway no hard feelings guys I still enjoy the product just not the issue that are unsolvable for me.
Title: Re: GPS and AuxMag Issues when doing everything right!
Post by: DocHardinger on November 30, 2016, 08:28:35 pm
https://www.youtube.com/watch?v=qrPd98flX_E

Here you see how good external MAg with Velocity Roam could work if it works ;-)
And of course some free riding...

Filmed over wifi with Rasperry Pi 3 and PiCamera v2.1...not the best quality but hey its a stream