trust

  • ****
  • 299
Re: GPS drop and Mag drift
« Reply #15 on: November 17, 2020, 12:36:42 am »
VH - velocity hold - a cross between position hold and velocity roam! Haha - no, actually its VR I've been testing.

The trim issue has to do with how much travel the elevons have to effect pitching forward or backward or effect yaw. I normally don't touch the trims on the xmtr when setting up  - they stay centered. In this case after switching FCs the neutral position shifted enough to create a tendency to pitch backwards. Although the electronics can compensate for this somewhat, it reduces the aircraft's ability to deal with transients or excessive wind. Its easy enough to manually adjust the pushrods to fix this.

Another FC arrived so I'll test that also.


trust

  • ****
  • 299
Re: GPS drop and Mag drift
« Reply #16 on: November 18, 2020, 07:53:20 pm »
Rainy and windy here so haven't had a chance to flite test, but did some static testing outside to try to find connector faults. Partially cloudy skies.
Inside I could not get GPS lock.
I was able to get stable GPS of 7-9 sats, but note that PDOP shifted around from 3.2 to 4.5. Every time it went over 3.5 the GPS would go orange.
I did not have RC xmtr on, but figured that didn't matter for GPS lock issues. mag stayed steady green at all times
I banged on GPS, flight controller, plane components and wiggled connectors - could not get it to go GPS X at all - only occasionally orange.
If I put my hand over GPS I can get it to go orange. But not red X
Also tested for first time video xmtr - no issue with interference that I could see to the GPS or mag.
How does the FC go to red X GPS? Loss of signal from data stream? High PDOP? It'd be useful to know exact conditions that FC uses to determine this.
Power to the GPS comes from the FC, and the FC gets power from the rcvr, which has the 3A regulator driving it. Wire size from rcvr to FC is smallish, but plenty large enough for these small loads. The OPLINK also gets powered through FC. But the servos are all powered from the regulator directly, so they should not cause V drop to the GPS - not directly anyway.

Re: GPS drop and Mag drift
« Reply #17 on: November 18, 2020, 09:53:21 pm »
Inside I could not get GPS lock.
That is normal and some GPSs are better than others for this.  I actually use this as a test for which GPS units I buy more of and which ones I stay away from.  Even the ones that don't work indoors after an hour will still work well enough outdoors that I don't bother changing them out for the better ones even though I have a stock of about 5 new and unused GPS units.

I was able to get stable GPS of 7-9 sats, but note that PDOP shifted around from 3.2 to 4.5. Every time it went over 3.5 the GPS would go orange.
...
If I put my hand over GPS I can get it to go orange. But not red X
The default GPS settings say that GPS is green when it has >= 7 satellites and PDOP is <= 3.5
Stabilization will only go green when all sensors are green.
It will not arm until stabilization is green.
Once stabilization goes green, it will stay green even if sensors turn yellow (orange).
So if sats goes less than 7 or PDOP goes more than 3.5 the GPS turns orange.
It generally is still flyable if some sensors are orange.

How does the FC go to red X GPS? Loss of signal from data stream? High PDOP? It'd be useful to know exact conditions that FC uses to determine this.
The red X is supposed to mean that the GPS has a hardware failure, not just a loss of satellites.
The red X is supposed to mean that the GPS has a hardware failure, not just a loss of satellites.
I wrote that code.  Before that, you could not really know what the X meant.  Now it means that FC is not receiving any readable packets from the GPS.
If satellite count is low or PDOP is high, you still get satellite update packets coming from GPS.  Depending on quality of GPS lock, you will have green square, orange square, or red square.  Red X means something is broken because we are not getting any data.

After you get a red X, you could try unplugging the GPS and plugging it back in, instead of unplugging / replugging the flight battery.
So recreate the issue and leave the flight battery plugged in and try unplugging the GPS and plugging it back in.  If it is a DJI GPS (or you have done the previously mentioned "save settings into the GPS" for a Ublox GPS) after that the GPS should reboot and start sending again.  If it stays red X then something is wrong inside the FC?  If it starts working, then the GPS gets glitches that are related to hard landings and that sounds like intermittent connectors or cracked PCB trace.

trust

  • ****
  • 299
Re: GPS drop and Mag drift
« Reply #18 on: November 19, 2020, 08:06:01 pm »
I added a 10uf tantalum cap on the power leads going to the GPS and rebuilt the connector.
Now it seems to be able to hover more smoothly and I can land it without loosing GPS lock.
I tried briefly VR mode, which started out ok but then began to swing from side to side, so I turned off VR mode and landed.
I'll try it in a larger test area when I get a chance, but this is an improvement.

Re: GPS drop and Mag drift
« Reply #19 on: November 19, 2020, 09:17:57 pm »
Just information:  PositionHold mode and VelocityRoam mode are exactly the same when sticks are centered in VR mode.  They use the same code in that case.  Oscillation in VR means oscillation in PH.

There is an oscillation issue when using DJI/Naza GPS.  It happens because this GPS smooths the data and thus delays it.  I have made a patched 16.09 firmware that helps the issue.

firmware:
https://forum.librepilot.org/index.php?topic=3012.msg21154#msg21154

instructions:
https://forum.librepilot.org/index.php?topic=3012.msg21173#msg21173

trust

  • ****
  • 299
Re: GPS drop and Mag drift
« Reply #20 on: November 19, 2020, 10:00:13 pm »
Ok. Uploaded dirty firmware successfully. Will test outside later. Thanks.
FYI - I got in some new min OPOSD cards and tested one - these work properly and have the correct charset after uploading firmware and charset.
Bought from here:
https://www.ebay.com/itm/MinimOSD-Mini-OSD-Module-KV-Team-MOD-for-Racing-F3-CC3D-Naze32-Flight-Controller

Will system run properly if I don't have the ground station OPLINK in use? For many tests I can use the OSD to see GPS status.

Re: GPS drop and Mag drift
« Reply #21 on: November 19, 2020, 10:49:37 pm »
Will system run properly if I don't have the ground station OPLINK in use? For many tests I can use the OSD to see GPS status.

Two areas to consider:
- Will it fly?  I have flown many telemetry missions (a handful of these had OSD too) where the telemetry went out of range for short to long times and never had problems.  I answer yes it will fly, but we have seen some oscillation related to OSD-telemetry packet rate and that makes me wonder a little bit.  I should probably not mention this as it may make you worry, but I want to let you know.
- Will the OSD work?  I have heard issues where the OSD stops updating if the OpLink telemetry goes out of range (or is switched off).  This is because they are both telemetry streams and it seems that stopping one stream can stop them both.  This may depend on whether you use MinimOSD or MinOPOSD protocol.  I suggest that you test this before flying.
« Last Edit: November 19, 2020, 10:58:54 pm by TheOtherCliff »

trust

  • ****
  • 299
Re: GPS drop and Mag drift
« Reply #22 on: November 21, 2020, 03:46:26 am »
Got a chance to test system in a big field today. Lite 4-5mph winds.
Hovered nicely most of the time. But as soon as I switched to VR mode, it seemed to try to hold position, but would then drift downwind.
 I could easily manually hold it in position (attitude mode on pitch and roll, rate on yaw). It would hold altitude and yaw angle well, but unless I tilted it into the wind it would drift. But it didn't take much control input to hold it in place - maybe 1/4 stick deflection in the direction of the wind. I recorded the OSD data and from that the tilt was never more than 10 degrees to hold it in place - but aircraft under VR wouldn't go that far. I see the VelocityRoamMaxRollPitch is 20 degrees, so well under that.
I do notice the TreatCustomCraft is set to FixedWing - how does that differ from VTOL?
This aircraft is really both- take-off is more like VTOL/quadcopter, but horizontal is more like a fixed wing, and there are modes that are a blend of both.
Trying to see what I can do with adjusting existing parameters.

Re: GPS drop and Mag drift
« Reply #23 on: November 21, 2020, 07:01:25 am »
Switch on transmitter.  Power with flight battery.  Plug in USB.  Go to GCS Input page and look to see if your Flight Mode Switch actually changes into the modes that you think it does.  (FMS and RC tabs) Sometimes Input Min / Max might need to be adjusted or transmitter switch stuff adjusted to get it to do what you want.

trust

  • ****
  • 299
Re: GPS drop and Mag drift
« Reply #24 on: November 21, 2020, 09:50:23 am »
Pretty sure the flight modes are switching instantly and being recognized by FC.
1) Mode Shows up in OSD video when I flip switch settings
2) In VR mode I can't change throttle - STAB modes I can - if I try to change throttle in VR mode nothings happens. And I tried that in flite tests. Often just a reflex if its falling so very obvious when nothing happens. It's definitely getting in VR mode.
Is there a difference in how the FC processes if VTOL vs Fixedwing mode?

Re: GPS drop and Mag drift
« Reply #25 on: November 22, 2020, 05:23:01 am »
What type of model do you have set on Vehicle page?  I would guess / suggest Multirotor.  If you use Custom, then System -> Settings -> VtolPathFollowerSettings -> TreatCustomCraftAs should be VTOL.

If that is correct, then throttle should work, but it now controls vertical velocity and full throttle is 2 meters per second.

Re: GPS drop and Mag drift
« Reply #26 on: November 22, 2020, 05:38:53 am »
I have a LibrePilot quad with an authentic DJI brand GPS.  I plugged in only USB so GPS was not powered.  GPS health showed red X as expected.  I added battery power to get the GPS to work.  It did not work.  Still red X (like you were seeing after a hard landing).  Leaving battery power plugged in, I unplugged the GPS from the MainPort and plugged it back in and the GPS went to "red block" and eventually orange and finally green.

It looks like the GPS gets into a locked up state.  Probably if there is voltage on the data pin(s?) but not on the power pin.

trust

  • ****
  • 299
Re: GPS drop and Mag drift
« Reply #27 on: December 05, 2020, 10:38:20 pm »
I switched the TreatCustomCraftAs to VTOL. I ran a test in a large field - got to moderate height, there was some wind so it was drifting some when I switched to VH mode. Heading was N, aircraft drift was west. It did a vert fast roll inverted. I switched it out of that mode back to attitude mode which rolled it back, but I lost so much altitude it crashed. Not too much damage, repaired.
  I added 3 100uf 10V caps - one on the connector going to the GPS/mag unit, one on the 5V main power regulator, and one on the OPOSD PCB. This seems to have helped the stability some, and improved the noise on the OPOSD - though not completely gone when under power and hovering. I think I may need to add a cap on the 7V supply going to the camera, or run it off battery.
  I ran a test in the street - some lite wind <5mph. After getting it in a hover and fairly still, I switched to VH mode. Aircraft pointed NW. It began to rock east-west fairly strongly - about 10-15 degrees roll. It did a couple oscillations - at least it seemed to be trying to stay in place. I switched back to attitude mode and landed it. I'll need a better day and a field test to see if the rocking decreases over time - at least in this short test it did not seem to be stopping or damped.

Re: GPS drop and Mag drift
« Reply #28 on: December 06, 2020, 07:33:50 am »
After getting it in a hover and fairly still, I switched to VR mode. Aircraft pointed NW. It began to rock east-west fairly strongly - about 10-15 degrees roll. It did a couple oscillations - at least it seemed to be trying to stay in place.
There are two oscillations, the fast one has a period of about 1/4 second.  The slow one has a period of about 4 seconds.  Since you say it did only a couple oscillations, you must be talking about the slow oscillation.  The slow oscillation is the one that the special DJI GPS firmware is suppose to help.  Were you running this "DJI fix firmware"?  I can't say that it cures the problem completely, but it does help.

trust

  • ****
  • 299
Re: GPS drop and Mag drift
« Reply #29 on: December 06, 2020, 07:40:45 pm »
I seem to get both the fast and the slow oscillations, but at different times. Yes, I am using 1609-dirty firmware mod.
 I'm PM sending you link to video clips showing two tests & description gives the times when VH mode was on. I can hear the fast oscillation as motor pulsing.