weird behavior during GPS Hold

Post Reply
NicoMigenda
Posts: 4
Joined: Tue May 10, 2016 10:05 am

weird behavior during GPS Hold

Post by NicoMigenda »

Hallo,

I have the following Problem with my Quad Copter.
While the Alt Hold mode is working quite well after protecting the Baro from sun and wind i have major problems when switching into GPS Position Hold Mode.
Aslong i stay in that inner circle which is set to 1 meter the position is hold with an error of like 10cm.
Once it switches somehow out of that window the Copter starts to make HUGE circles, loosing altitude and is about to crash within <10sec.
I played alot with the PID Gps values and even it looks strange i have the best results with the following settings
Image

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: weird behavior during GPS Hold

Post by Kbev5709 »

NicoMigenda wrote:Hallo,

I have the following Problem with my Quad Copter.
While the Alt Hold mode is working quite well after protecting the Baro from sun and wind i have major problems when switching into GPS Position Hold Mode.
Aslong i stay in that inner circle which is set to 1 meter the position is hold with an error of like 10cm.
Once it switches somehow out of that window the Copter starts to make HUGE circles, loosing altitude and is about to crash within <10sec.
I played alot with the PID Gps values and even it looks strange i have the best results with the following settings
Image

Well, you didn't mention what GPS unit you are using so the obvious first question needs to be: "Is your GPS module hooked up and working? Do you actually have a fix when trying to use position hold? Do you even have a GPS module?" While Altitude hold can be used with no GPS as long as you have a baro, the same does not hold true for Position hold. For this function to actually work you have to have a three dimensional 5 satellite GPS fix.
OK, assuming that yes, you are GPS enabled, why are your Nav R PID values so high? When tuning PIDs, especially ones used by GPS, more is not better. Your P at 20 is outrageously high. I will not suggest what any of your PID settings should actually be, but I believe that particular setting is a bit wacky and most likely the root cause of your issue if you actually have a working GPS.
I have included a link to a video of one of my quads doing a position hold and towards the end it shows all of my PID values.
https://www.youtube.com/watch?v=7PEM8sp7CrM
Notice in that video that the EZ GUI says GPS hold is on, switching to position hold, navigation system is working. This lets me know my GPS has a fix.
When you try and enable position hold do you have a way of knowing if you have a valid fix? I use the EZ GUI (unlocked) because it suits the job so well. Lets say you have a working GPS.....Did you enable the waypoint function in your config.h file so it looks like the following code?

Code: Select all

 //Enables the MSP_WP command set , which is used by WinGUI for displaying an setting up navigation
    #define USE_MSP_WP
Last edited by Kbev5709 on Wed May 11, 2016 12:59 am, edited 1 time in total.

gregd72002
Posts: 103
Joined: Fri Dec 12, 2014 5:16 pm

Re: weird behavior during GPS Hold

Post by gregd72002 »

Your NAV R values are not right

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: weird behavior during GPS Hold

Post by Kbev5709 »

gregd72002 wrote:Your NAV R values are not right

Correct, if he even has GPS on his quad. To me though, before I make a definitive diagnosis like you just did, I need to know all the information related to the problem. For all I know he is a complete newbie and doesn't know he needs GPS to use GPS hold. No GPS module? Doesn't matter what his Nav R values are. It just ain't going to work without a GPS fix and the waypoint command set enabled. Or maybe he has a GPS unit but is trying to do a hold without being GPS locked. Wacky settings won't matter there either.
Last edited by Kbev5709 on Wed May 11, 2016 4:57 am, edited 2 times in total.

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: weird behavior during GPS Hold

Post by Kbev5709 »

NicoMigenda wrote:Hallo,

I have the following Problem with my Quad Copter.
While the Alt Hold mode is working quite well after protecting the Baro from sun and wind i have major problems when switching into GPS Position Hold Mode.
Aslong i stay in that inner circle which is set to 1 meter the position is hold with an error of like 10cm.
Once it switches somehow out of that window the Copter starts to make HUGE circles, loosing altitude and is about to crash within <10sec.
I played alot with the PID Gps values and even it looks strange i have the best results with the following settings
Image

Another thing I see in your screenshot is that you don't have GPS Hold enabled in your AUX settings. In your screenshot you have GPS Home checked. If you have a gps, have a 3d 5 satellite lock and you are trying to do a hold with GPS Home instead, well, that would sort of explain things somewhat then wouldn't it.

NicoMigenda
Posts: 4
Joined: Tue May 10, 2016 10:05 am

Re: weird behavior during GPS Hold

Post by NicoMigenda »

Hallo,
first of all thanks for the replies and sorry for the missing GPS information.
Iam using an Ublox Neo 7N Modul and i have 9-10 Satelites otherwise my copter would not even switch into the gps hold mode since i need atleast 5 as you know.
Iam also using unlocked EZ Gui on my andriod which is connected via bluetooth to my Copter.
Ill try the PID Navr values you showed in your video and reply later

Another thing I see in your screenshot is that you don't have GPS Hold enabled in your AUX settings.

That setting is just wrong on that screenshot, i made all tests before with GPs hold insteed of gps home, sorry.

Nico

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: weird behavior during GPS Hold

Post by Kbev5709 »

NicoMigenda wrote:Hallo,
Iam using an Ublox Neo 7N Modul and i have 9-10 Satelites otherwise my copter would not even switch into the gps hold mode since i need atleast 5 as you know.

Good, but I had noway of knowing that with the info I had. So, is everything in your config.h GPS section set up correctly? The waypoints are enabled? Set to serial GPS. Speed correct? Set to Ublox? Do you have the correct magnetic declination entered for where you fly? Some people never update or even enter the correct info in there. Then they wonder why GPS acts funny. Do you calibrate the mag before trying a Pos hold? Some people who experience GPS issues never calibrate before flying a GPS flight. Something as seemingly unimportant as the magnetic declination not being updated to the location where you are flying will mess with every part of the positioning systems ability to accurately locate the quad where it is supposed to be. GPS thinks the quad is somewhere other than where you see it and all the conflicts add up to erratic GPS function. Every quad out there from DJI to multiwii needs to be mag calibrated before it will fly GPS with any accuracy. I calibrate my mag before EVERY GPS oriented flight. All this stuff if not done or done correctly can and will mess with the FCs ability to establish a good GPS hold.

NicoMigenda wrote:Ill try the PID Navr values you showed in your video and reply later

If everything else I mentioned above is OK, then it might be just the PIDs on Nav R.
If you think about it, if you failed to do everything needed for an accurate GPS Hold, even having the correct PIDs is not going to help any.

gregd72002
Posts: 103
Joined: Fri Dec 12, 2014 5:16 pm

Re: weird behavior during GPS Hold

Post by gregd72002 »

with all the respect, he said that the quad hold gps pos perfectly fine, so all his GPS connections yadda yadda yadda were fine. Only when the quad got out of the WP RADIUS things were getting wrong so must have been Nav R.

In any case it is good to have a better write up of it then mine, so all good! :)

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: weird behavior during GPS Hold

Post by Kbev5709 »

gregd72002 wrote:with all the respect, he said that the quad hold gps pos perfectly fine, so all his GPS connections yadda yadda yadda were fine. Only when the quad got out of the WP RADIUS things were getting wrong so must have been Nav R.

In any case it is good to have a better write up of it then mine, so all good! :)

Which is why I showed him more usable PID values for Nav R with a video in my first reply to him.
The last sentence in my last post before yours still holds true. Let me calibrate my mag next to a big old power supply. My GPS Hold will most likely fail. Try to do a hold during a bad space weather day when GPS won't work right no matter what and my GPS hold will fail.
I can go right now, enter some bogus magnetic declination in, and watch my GPS Pos Hold fail in almost the same way he describes his failing so in the end, with GPS, and from my experience with actually using my GPS and flying missions and successfully doing stuff more challenging than Pos Hold, everything matters.
Barring even all the reasoning I have stated above, and going even to just the very most basic level of logic, all the info, setup procedures and yada yada must be important somehow, or it wouldn't exist.

NicoMigenda
Posts: 4
Joined: Tue May 10, 2016 10:05 am

Re: weird behavior during GPS Hold

Post by NicoMigenda »

Sorry for the late answer but the forum seemed to be down yesterday.
Anyway, thx for all the replies
So, is everything in your config.h GPS section set up correctly?

Yes everything is correct.

Do you have the correct magnetic declination entered for where you fly?

Yes. 2.11 for Bielefeld Germany

Do you calibrate the mag before trying a Pos hold?

Im most likely calibrating everything once per day and not before every flight. Im not 100% sure if the behavior is getting worse every minute i fly and will check it this weekend.

I already entered your navr settings into the copter but as i said, i wont manage to test them before weekend :)
I will reply as soon as possible :)

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: weird behavior during GPS Hold

Post by Kbev5709 »

NicoMigenda wrote:Sorry for the late answer but the forum seemed to be down yesterday.
Anyway, thx for all the replies
So, is everything in your config.h GPS section set up correctly?

Yes everything is correct.

Do you have the correct magnetic declination entered for where you fly?

Yes. 2.11 for Bielefeld Germany

Do you calibrate the mag before trying a Pos hold?

Im most likely calibrating everything once per day and not before every flight. Im not 100% sure if the behavior is getting worse every minute i fly and will check it this weekend.

I already entered your navr settings into the copter but as i said, i wont manage to test them before weekend :)
I will reply as soon as possible :)

Yeah, cool. I'm sorry I just don't know how much you know about GPS flight. I keep a checklist where all the little things that could make a mission (a little more complicated than a hold I know) fail are checked off as I confirm that I have completed that step. If you think about this GPS stuff, your results can only be as good as your input. Remember GIGA, Garbage in garbage out. Since the FC does not have a mind of it's own, its up to the programmer to get things right so the mission, hold, rth or whatever he is trying to make the quad do, works like it should, so accurate input especially in autonomous flight is imperative. Things like having the magnetic declination of where you are flying, and not just where you live. If I'm always flying at the exact same place I can ease up on the MD settings but just move across town and you need to fix it to that spot. If you use something like this linkhttp://www.magnetic-declination.com/ to figure your MD, chances are it's not the right one where you are flying. This link gives you the MD of the city hall or some governmental office. When I use that site, it says my MD is the city of Muskegon Mi. when in reality my MD is way different and I'm not in Muskegon but in Whitehall and I fly at a park around the corner from me. Now, if I go in mission planner and get my true latitude and longitude for that park then enter them in this link http://geomag.org/models/igrfplus-declination.html I get the actual MD of the actual place where I will be flying. It's little details like that that if not followed up on can make GPS malfunction. Like I said using just the most basic of logic, if having the correct settings isn't that important, why have any at all?

NicoMigenda
Posts: 4
Joined: Tue May 10, 2016 10:05 am

Re: weird behavior during GPS Hold

Post by NicoMigenda »

Tested the Copter with the PIDs you showed in your video and its working much better but still not perfect for my case.

The last month i used Megapirate with the extern Compass from my GPS Modul but with Multiwii this doesnt work anymore so i have to use the intern on my Crius Aiop v2.0. Is it way worse than the extern GPS ?

gregd72002
Posts: 103
Joined: Fri Dec 12, 2014 5:16 pm

Re: weird behavior during GPS Hold

Post by gregd72002 »

internal GPS (and particularly compass) most likely will be skewed by all types of interference. It is quite convoluted topic all the RF interference and etc. My rule is to keep is simple and to have both of them as far as possible from any source of interference (cables, batteries, motors, etc).
I'm sure Kbev5709 will confirm this :)

With correct setup and adjustments you should be getting a very stable gps hold. I managed to get mine to pretty much within 2m radius when I tried it last time.

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: weird behavior during GPS Hold

Post by Kbev5709 »

NicoMigenda wrote:Tested the Copter with the PIDs you showed in your video and its working much better but still not perfect for my case.
It most likely will never have a perfect hold. I consider mine a pretty good holding quad when it stays within the waypoint radius horizontally without drifting away before going back and if it holds altitude within 18" (half meter.) You can mess with the PIDs (they don't need to be the same as mine) some and maybe get more improvement. Small changes can make big differences I've found. Big changes though, will make confusion while tuning. Changing by minor amounts the Pos and PosR in relation to changes made in NavR could be your solution. Set aside time for a tuning session on a calm day. Use your EZ GUI to make changes and short flights to see the effect of those changes. Any time something weird starts, go back to the previous number and then move on to the next value to set. Then after it's working pretty good, tune it some more in a steady breeze. You will most likely only need to mess with one of the parameters to get it to hold in the wind as well.

NicoMigenda wrote:The last month i used Megapirate with the extern Compass from my GPS Modul but with Multiwii this doesnt work anymore so i have to use the intern on my Crius Aiop v2.0. Is it way worse than the extern GPS ?


gregd72002 wrote:internal GPS (and particularly compass) most likely will be skewed by all types of interference. It is quite convoluted topic all the RF interference and etc. My rule is to keep is simple and to have both of them as far as possible from any source of interference (cables, batteries, motors, etc).
I'm sure Kbev5709 will confirm this :)


Yeah internal compasses can be a liability. Power wires near it and things like that. My HK Red Mega board does not hold as well as my blacked mag RTFQ mega with external compass does. But it will still do a pretty good hold even with the on-board compass because I was pretty careful to keep wires and stuff away from it. On this we both agree :D

Post Reply