vgwit

  • **
  • 96
GPS modes oscillations
« on: October 16, 2018, 11:42:27 am »
Hi Guys,

Recently at last have got acquainted with GPS modes on my 250mm quad. They works quite well despite my magnetometer rests simply on top of frame. Maximum Position Hold error is about 1m. But last test showed also some troubles. In Velocity Roaming a small pitch oscillation can be seen most of the time. Perhaps, it is normal.

https://drive.google.com/open?id=1Qv9jGNVXFJM-2P0zDNpsQkpaCbPPrgfy

But one of my three tests in Return To Base showed big vibration. Other two were quite fine.

https://drive.google.com/open?id=11PaMqkM4uGwFx8yiolxH22T8BbQn58cJ

Any thoughts are highly appreciated.

Re: GPS modes oscillations
« Reply #1 on: October 16, 2018, 05:56:59 pm »
(From the sound of the pitch_osc.avi it sounds like it does it regardless of compass heading which could be a different issue than I will discuss.)  Oscillations like that would usually be caused by PIDs too high.  Are you running default PIDs or did you select a specific model template during setup?  As mentioned in your other question, I would try AutoTune.  :)
https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/25657377/AutoTune

As for the RTB oscillation, there is another user here with the exact same problem.  In RTB it flies to base OK, but once it gets there it oscillates in the hover.  Although he has not yet found a solution, we have found that if you change it so it lands instead of hovers, there is no problem.  System->Settings->System->FlightModeSettings->ReturnToBaseNextCommand=Land and press the red up arrow at the top of the screen to save it permanently.  Also, that thread has some ideas about changing some of the VtolPathFollower PIDs.
https://forum.librepilot.org/index.php?topic=4431.0
« Last Edit: October 16, 2018, 06:01:57 pm by TheOtherCliff »

vgwit

  • **
  • 96
Re: GPS modes oscillations
« Reply #2 on: October 16, 2018, 08:01:46 pm »
Thank you Cliff,

PIDs are default. I'll play with AutoTune next weekend and see.

And yes, after I've changed next step from hover to land quad carried out RTB smoothly several times.

vgwit

  • **
  • 96
Re: GPS modes oscillations
« Reply #3 on: October 16, 2018, 09:59:25 pm »
Yet another couple of questions not related to subject.

Is it possible to make altitude to be set to zero while arming (it is set to baro)?
Why MWOSD shows ground speed always zero?

Thanks.

Re: GPS modes oscillations
« Reply #4 on: October 17, 2018, 08:11:03 pm »
Is it possible to make altitude to be set to zero while arming (it is set to baro)?
The aLtitude used for flight is a combination of GPS and baro.  Basically think of it as GPS aLtitude.  Of course there are raw GPS and baro aLtitudes that you can get to in the GCS.  I'm not sure what reason you want to do this.  There is an option in flight plans that make them relative to Home, and there is an easy way to reset Home each time you fly.  Maybe you want it to show zero for FPV display?  You might be able to manually set Home by right clicking on the map in GCS (then Set Home Location) and when it asks for aLtitude offset, put in the negative (?positive?) of the measured altitude of that location (easy to determine).  @f5soh might help you with other ways that I am not aware of.


Why MWOSD shows ground speed always zero?
You may need to update your OSD firmware.  MWOSD firmware should not really need updating to match LP UAVOs though.  I recall there is an MWOSD option for LP compatibility.  Again, @f5soh might help you with that.

vgwit

  • **
  • 96
Re: GPS modes oscillations
« Reply #5 on: October 17, 2018, 09:13:06 pm »
Thank you.

Yes, I'd like to see zero altitude on OSD on arming. Even if it is a fusing of Baro and GPS I can't guess why   do not simply zero it while arming. As it does not pretend to have any relation to see level.

About speed. Does FC calculates it and sends to OSD or MWOSD firmware should do it ?

Re: GPS modes oscillations
« Reply #6 on: October 18, 2018, 01:21:07 am »
It depends on whether the GPS is connected to FC or OSD.  And you must have it configured correctly and with the correct OSD firmware.  With Revo class FC running GPS flight modes you have GPS connected to FC, so it must be set up that way.  I don't use OSD very much.  @f5soh might be able to help.

vgwit

  • **
  • 96
Re: GPS modes oscillations
« Reply #7 on: October 21, 2018, 09:00:05 pm »
Thank you.
Have run AutoTune. It's interesting. It defined PIDs about 1.5-3 times bigger than default. Now quad became more responsive while oscillations during descendings almost gone. I like it.

But small pitch oscillation in GPS modes still exist. I'd try to lower pitch PIDs of GPS hold mode. Could you point me to them. Are they VelocityRoamHorizontalVelPID ?

Another thing that bothers me is altitude in OSD. What I see so far right after arming is that its error is about 1-2m in case ny GPS sees more than 11 sats. But in case number of sats is 9-10 altitude error reaches 20m. Why not to just zero it on arming and send to OSD altitude from baro?

And last. MWOSD displays ground speed only 0. Its developer says OSD receives all GPS data fron FC including velocity. Would be good to clarify that. But it is a minor issue.

Re: GPS modes oscillations
« Reply #8 on: October 21, 2018, 10:03:16 pm »
But small pitch oscillation in GPS modes still exist. I'd try to lower pitch PIDs of GPS hold mode. Could you point me to them. Are they VelocityRoamHorizontalVelPID ?
VelocityRoamHorizontalVelPID is for VelocityRoam mode.
There are braking, landing, autotakeoff, and velocityroam mode PIDs that are for those exact flight modes (braking is done in GPSAssist modes I think).
Other GPS modes are supposed to be controlled by HorizontalVelPID.  Make sure you adjust the one that affects the flight mode you are working on.
There is also HorizontalPosP.

Another thing that bothers me is altitude in OSD. What I see so far right after arming is that its error is about 1-2m in case ny GPS sees more than 11 sats. But in case number of sats is 9-10 altitude error reaches 20m. Why not to just zero it on arming and send to OSD altitude from baro?
The GPS ALtitude we get from the GPS is inaccurate.  For my waypoint flights, I assume that one day to the next it could be as much as 4m difference in ALtitude.  Two things you can do to make your GPS as accurate as possible:
- This one makes sure it isn't usually any worse than 4m.  Let the vehicle sit and gather satellites for 12 minutes before the first flight of the day and 2 minutes for each flight after the first one.  That gets good satellite fix and you won't be adding more satellites in mid flight.  The tiny cheap GPSs that don't have memory to store today's almanac between batteries should use 12 minutes before every flight.
- This one can make it much better than 4m.  For waypoint flight, make your flight plan relative to home (that is the default), and after 12 minute warm up and with vehicle sitting at exact place you want home location to be (must be the exact same place as when you made this flight plan), clear the Attitude-Settings->HomeLocation->IsSet.  Within a few seconds the new Home Location will be set and you can press Save if you want it to be permanent.  Now all the waypoint positions (including aLtitude) will be based on the current GPS drifts rather than yesterday's.  Warning: you must set Home the exact same place each time if your waypoints are critical, such as if you fly between trees, etc.

And last. MWOSD displays ground speed only 0. Its developer says OSD receives all GPS data from FC including velocity. Would be good to clarify that. But it is a minor issue.
You need to use the correct OSD firmware and configure it correctly.  Did you get the OSD firmware from LP wiki?  I am not an OSD expert.  I only have one and I have it bypassed right now (it was resetting because 12V was less than 12V).

vgwit

  • **
  • 96
Re: GPS modes oscillations
« Reply #9 on: October 21, 2018, 10:19:58 pm »
About speed. I use latest MWOSD configurator and firmware from

https://github.com/ShikOfTheRa/scarab-osd-gui/tree/master/MW_OSD_GUI/R1.9

The configurator itself chooses correct firmware for LP and micro minimOSD.
« Last Edit: October 22, 2018, 07:56:52 am by vgwit »

f5soh

  • *****
  • 4572
    • LibrePilot
Re: GPS modes oscillations
« Reply #10 on: October 21, 2018, 10:48:34 pm »
Do you use 16.09 or Next ?
Did you try the MWOSD from wiki with the same issue ?

vgwit

  • **
  • 96
Re: GPS modes oscillations
« Reply #11 on: October 22, 2018, 09:59:50 am »
I use 16.09.
With MWOSD version 1.6.8 from wiki - the same.

f5soh

  • *****
  • 4572
    • LibrePilot
Re: GPS modes oscillations
« Reply #12 on: October 22, 2018, 11:15:19 am »
Ok, found your issue...
If board is not armed, GPS_Speed=0 in MWOSD code:

Code: [Select]
void displayGPS_speed(void)
{
  if(!GPS_fix) return;
  if(!armed) GPS_speed=0;
 

vgwit

  • **
  • 96
Re: GPS modes oscillations
« Reply #13 on: October 22, 2018, 01:02:56 pm »
It's zero during flight.

f5soh

  • *****
  • 4572
    • LibrePilot
Re: GPS modes oscillations
« Reply #14 on: October 22, 2018, 05:14:25 pm »
With 1.6.8, i have GPS Speed displayed :