trust

  • ***
  • 108
GPS drop and Mag drift
« on: November 09, 2020, 08:39:05 pm »
I've upgraded an existing eVTOL aircraft that was flying fine with an Atom FC. I upgraded to a mini REVO fc, a combined GPS/Mag DJI/Nav GPS, and am using the OPLINK Air to send telemetry back so I can watch whats happening. (The Oplink telemetry is very handy BTW - and I seem to be able to modify any config parms through it as well - nice!)
Aircraft is set for Attitude mode in roll and pitch and rate in yaw.
Everything starts fine - Mag & GPS are green. I start to hover and unit starts yawing in one direction or another. I compensate manually, but it gets more and more severe until I have to land. Then although aircraft is stationary, the orientation on the GCS is showing the aircraft is spinning around in yaw, and the roll angle is way off - like 20 degrees even though aircraft is level.
 GPS now has a red X over it.
If I power cycle and wait again, it returns to normal.
What conditions would cause these faults?

Re: GPS drop and Mag drift
« Reply #1 on: November 09, 2020, 09:35:37 pm »
Each motor spinning in the correct direction. Each Prop the correct type (CW or CCW).  Matching props.  Matching motors.

For first flights I suggest that you use Basic for your Atti-Est-Algo in Attitude->Settings.  That will remove mag compass as possible cause.  You will also need to remove all GPS flight modes from the FMS.

If that flies fine, then there are several things about mag compass that can cause it.
- motor power wires not twisted together
- need aux mag installed AND CONFIGURED correctly
- bad mag calibration
- aux mag orientation set wrong
- a setup issue was fixed in the wrong place
- etc

trust

  • ***
  • 108
Re: GPS drop and Mag drift
« Reply #2 on: November 09, 2020, 10:32:45 pm »
Motors not an issue - they were all functioning properly with the previous fc. And it does hover - just not stable in yaw or until the roll tilt appears.
I've rerun the mag, gyro, and board calibrations multiple times. The mag seems to hold steady at first - even in hover. Then it begins to drift and it it starts spinning.
And then even when the power to motors is off and aircraft is level and not moving - the mag coordinates spin.
I have mag set as aux only.
I'm suspicious of the power supply. I'll check that.

trust

  • ***
  • 108
Re: GPS drop and Mag drift
« Reply #3 on: November 10, 2020, 04:24:39 am »
Well this is weird. I decided to just replace the regulator supplying the 5V power to the main systems with a DIY built 3A chip, plus bypass caps and big heat sink. It seems to work fine.
On the first flite test, I was able to get it up and hovering but again, it began to spin so I dropped it. I looked at the telemetry data and the GPS was X'ed out and the heading was spinning, and roll tilted - again. I unplugged power and rebooted aircraft.
Tried again - this time I was able to get it higher, with less spinning, but it again did it and also flipped over and crashed.
Yet oddly when I took aircraft back to the laptop and checked telemetry, GPS was fine and so was Mag! Everything looked normal! I chipped a prop so didn't try to fly again but now I'm wondering if there is something flaky in the GPS/mag device - every time it has landed up till now it went into this spinning mode.

Another thing I noticed is that if I move the GPS/mag - as in tilt it in pitch - so moves the horizon. I thought the mag was only used for heading. Is it used for ALL the attitude axis?

Re: GPS drop and Mag drift
« Reply #4 on: November 10, 2020, 07:31:48 am »
Is this with Basic or GPS_Navigation(INS13) (Attitude->Setting->AttiEstAlgo)?

INS13 bad mag affects all of stabilization (bank angle and compass heading).  Basic does not use mag.  That is why I suggest you fall back to test with Basic and not INS13.

trust

  • ***
  • 108
Re: GPS drop and Mag drift
« Reply #5 on: November 11, 2020, 06:21:31 pm »
Ok. Switched to basic mode to cut out the GPS/mag and changed out the VH mode to a stab mode. To my surprise, the same problem appeared. It would start out fine, and begin to hover. But then it would spin. Even after landing, with aircraft stationery and with no throttle on, the telemetry showed the aircraft was spinning!
So unless you can think of another reason why, I suspect the FC accelerometers are defective. I've ordered another one to test.

Re: GPS drop and Mag drift
« Reply #6 on: November 11, 2020, 09:33:25 pm »
Defective sensors would do that, but there are other reasons that are more likely.

If you arm it (but leave motors stopped or even running, but at idle speed) and let it sit there for 5 minutes does GCS say it is spinning?  But hover with small motions only and GCS says it is spinning?

Quote
Even after landing, with aircraft stationery and with no throttle on, the telemetry showed the aircraft was spinning!
This happens when if the aircraft spins constantly in flight.  Was it doing that and you let it spin many times in flight?  Where you were holding the stick to keep it from spinning constantly in one direction?

One time I did a test and hung an airplane fuselage from a ceiling fan at lowest speed.  It flew around in a circle at 45 degree bank for several minutes this way.  When I stopped it, the GCS said it was spinning.

Strong vibrations that are worse than a certain amount affect the sensors to make the sensors think the model is spinning when it is not.

It is dangerous, and you must decide if you can do it sately but on Output page and starting with sliders all the way to the left, I would carefully use Outputs->TestOutputs and the sliders (move sliders very slowly!!!) to test model, in hand (or bolted down to a table), with props on, each motor separately, to full power.  Do this to look for a motor/prop that vibrates worse than the others.

I would check for bent motor shafts and carefully balance all props.
« Last Edit: November 12, 2020, 05:54:57 am by TheOtherCliff »

trust

  • ***
  • 108
Re: GPS drop and Mag drift
« Reply #7 on: November 12, 2020, 10:32:19 pm »
It is not constant spinning. When it first lifts off, for a few moments it's fine. Then it slowly starts spinning and rapidly increases. If I try to correct it, it will stop the spinning, but then it starts to spin in the opposite direction, picking up speed of rotation. I rarely let it go more than one turn before cutting throttle and letting it drop. From then on looking at the telemetry it says it is spinning at about a revolution every 2 seconds. If I power cycle it comes up fine.
This aircraft was working fine, was balanced and trimmed with an Atom FC and worked fine with it. when it is running with the new FC, motor spin up is smooth and no problems with the esc's or motors or props. Everything looks properly trimmed and elevon throws & gyro settings are same as in previous FC version.
It strikes me that the continuous spinning appears every time the aircraft comes down spinning and I throttle off. Ie if it was spinning when throttled off, it seems to think it is still spinning even though physically it is motionless.
I'm using attitude mode on pitch and roll and rate mode on yaw.
Enclosed is the UAV settings from the GPS mode with VH version. For the basic tests I turned those off. Yaw control is through elevons behind the motors, not conventional motor differential.

Re: GPS drop and Mag drift
« Reply #8 on: November 13, 2020, 05:55:38 am »
Did you change the input reversing after running the setup/transmitter wizard?  It sounds like yaw (only) stabilization may be backwards and the way that happens is when you change input reversing when you should have changed output reversing.

With it armed, rotate it by hand in yaw direction.  Does stabilization move the elevons in the direction that would slow the hand powered rotation down?  It should.  If it is wrong, then changing the yaw reversing in both input and output (to the opposite values of whatever they are) might fix it.

That still doesn't explain GCS saying it is spinning after landing unless it was spinning very very fast.
« Last Edit: November 13, 2020, 06:00:08 am by TheOtherCliff »

trust

  • ***
  • 108
Re: GPS drop and Mag drift
« Reply #9 on: November 13, 2020, 06:50:35 pm »
That was it! Damn I should have caught that - always check the direction of the compensation to make sure it's going the correct way. I reversed the yaw input then had to fiddle with the servo gain polarities but then it ran fine and hovered in basic mode.
I then switched it to GPS mode. It's getting pretty windy here so had to cut tests short. I was able to hover it in GPS INS13 mode briefly twice.
I did see some strange things though. On one reboot, it got to 7 satellites, all went green for a few moments, then GPS went to X and the yaw started spinning again! And I didn't move anything!
I fiddled with the wiring a bit. I'm wondering if the GPS/mag connections are iffy. I couldn't find any bad connections though - I have clear shrink wrap on the connections so I can see the solder joints. All looked fine.
I let it go up to 11 satellites on one test and it seemed more stable. Altitude is definitely more stable in INS13 mode.
What happens when GPS drops? IS there a way to fall back to basic compensation mode?

Re: GPS drop and Mag drift
« Reply #10 on: November 13, 2020, 09:47:14 pm »
That was it! Damn I should have caught that - always check the direction of the compensation to make sure it's going the correct way. I reversed the yaw input then had to fiddle with the servo gain polarities but then it ran fine and hovered in basic mode.
I would have expected the yaw spin-up even in Basic mode.  ;)

I did see some strange things though. On one reboot, it got to 7 satellites, all went green for a few moments, then GPS went to X and the yaw started spinning again! And I didn't move anything!
I fiddled with the wiring a bit. I'm wondering if the GPS/mag connections are iffy. I couldn't find any bad connections though - I have clear shrink wrap on the connections so I can see the solder joints. All looked fine.
I would suspect the tiny connectors at the FC.

I personally have experienced some cases where it does bad things when GPS signal gets very marginal.  If GPS position jumps a long distance, then GPS position modes (even Position Hold) will try to fly there.  I had a case where a big GPS change like that even caused Attitude mode to bank strongly into a tree (no damage).

Imagining what it would do if the GPS dropped out completely:  It would probably think that it was always at that last good location.  If you started PositionHold before the dropout, it would want to be at that location, but would usually be a little wrong.  That slight difference would become a constant drift, possibly getting worse and worse as the PID winds up (because it thinks it is not moving).

I let it go up to 11 satellites on one test and it seemed more stable. Altitude is definitely more stable in INS13 mode.
Manual thrust mode should feel the same in Basic or INS13.  If you are using VelocityRoam (you REALLY should try it if you haven't :) ) then it is using barometer and GPS to manage throttle for you.  Center throttle stick (center +- 10% is all deadband = exactly the center) in AltitudeVario thrust mode or GPS flight mode such as VelocityRoam means "manage the throttle for me to keep at exactly this altitude".  In VelocityRoam GPS mode (or AltitudeVario thrust mode for non-GPS flight modes), away from center means "keep it ascending or descending at exactly this speed" where speed is proportional to stick.  Very nice!!!

What happens when GPS drops? IS there a way to fall back to basic compensation mode?
In a word, no.  I have heard it discussed for 'next' but I don't think it is implemented.
I think that INS13-Indoor would be a better fallback, but maybe not if mag was also broken?  I forget how INS13-Indoor relates to regular INS13.
I have a long personal list of LP things I would like coded/fixed and that is one of them.  :)
All the modes should degrade so something less.
INS13/GPS landing mode should degrade to Basic/Attitude (with working flight controls) with baro controlling rate of descent.  Not perfect since wind/drift will allow it to move sideways while landing.  This degraded mode should be available for people who do not have a GPS.
« Last Edit: November 13, 2020, 09:53:34 pm by TheOtherCliff »

trust

  • ***
  • 108
Re: GPS drop and Mag drift
« Reply #11 on: November 15, 2020, 01:58:16 am »
I got a chance to test several times today. I also tried replacing (with a recalibration) the GPS/mag unit. The results were the same.
Aircraft takes off ok, and hovers fine for 5-10 seconds. Usually the failure mode is aircraft needs more and more pitch to hold stable. Then it suddenly flips over backwards.
The GPS flag has a red X over it. The flight display shows the aircraft slowly spinning, with a tilt - even though it's not moving. Letting it sit doesn't help. I have to power cycle it.
AFter a power cycle and time to acquire sats, it's ready to test again. I never get more than a few seconds hover time.
What conditions make the X appear?
Can I turn on a log to record whats happening?

Re: GPS drop and Mag drift
« Reply #12 on: November 15, 2020, 04:37:22 am »
The red X is supposed to mean that the GPS has a hardware failure, not just a loss of satellites.

The simple first guess is that vibration has made an intermittent connector come open.

Another guess, since this model has servos, is that the 5V power supply is not strong enough and servos moving fast and strong has caused a power sag that is first seen in the GPS.

trust

  • ***
  • 108
Re: GPS drop and Mag drift
« Reply #13 on: November 16, 2020, 07:25:24 am »
I moved the GPS input port from the Flex port to the main port. Did a recalibration. It seemed a little better, more stable. I did some trim adjustments on hover mode pitch that helped a lot. I was able to hover for a while then tried switching to VH mode. It didn't hold very well, but it was gusty. Started from 9 sats - seems like its taking a long time EVERY time to find enough sats.
And every time it lands - even if its moderately softly, the GPS gets an X over it and then I have to reboot. I'm surprised it can't recover from these conditions - if it is a 5V transient it should recover quickly. Can it ever recover by itself or do you always have to power cycle?
I checked the power usage - no servos moving 0.35A, all servos moving about 0.8A. The regulator is good for 3A - I checked the heat sink and its warm only 35C and it can keep 3A up to 65C. Big caps too, so don't think it's the supply. Yes, servos can spike if they get jolted or jammed, but don't think this is happening. I've seen the X appear with no movement at all. It went from all green almost immediately to X once. That was before I moved the ports however.
I have the servo power coming from a separate set of leads - there is no 5V out of the FC that's very useful.

Re: GPS drop and Mag drift
« Reply #14 on: November 16, 2020, 08:27:02 am »
I did some trim adjustments on hover mode pitch that helped a lot. I was able to hover for a while then tried switching to VH mode. It didn't hold very well, but it was gusty.
(VH mode? :) ) By the way, you should never use your transmitter trims (or at least put them back to center where they were when you ran wizard) if you have more than one flight mode.  For instance, trimming Attitude mode for level will cause VelocityRoam mode to move constantly.  Attitude mode trimming should be done with GCS->Settings->Attitude->RotateVirtual...  Rate mode and GPS modes should never need trimming.

Started from 9 sats - seems like its taking a long time EVERY time to find enough sats.
The default for "enough" sats is 7 (and PDOP < 3.5).  A long time would be 10 minutes (GPS almanac completely downloads in 12 minutes).  A short time would be 1-2 minutes.  My experience.  Some cheap GPS don't have a super cap or battery.  Any that use a battery instead of super cap are more likely to have a broken battery.  Some GPS units only get USA sats, and some get other country's versions of GPS too and thus get more sats quicker.

And every time it lands - even if its moderately softly, the GPS gets an X over it and then I have to reboot. I'm surprised it can't recover from these conditions - if it is a 5V transient it should recover quickly. Can it ever recover by itself or do you always have to power cycle?
DJI/Naza GPS should recover because they do not require initialization, so power off and on should simply work again.  The default is that Ublox GPS gets inited, so power off and on requires init again.  (But you can use GPSSettings->UbxAutoConfig=AutoBaudConfigureStoreAndDisable one time to permanently remember settings so that Ublox GPS also don't need initialization after power on.)  One problem is that power transients might leave it locked up instead of rebooted.  After you get a red X, you could try unplugging the GPS and plugging it back in, instead of unplugging / replugging the flight battery.  is any of your FC mounting hardware metal or carbon that could touch something in a hard landing?  A cracked trace in the FC or GPS could do it too.

I checked the power usage - no servos moving 0.35A, all servos moving about 0.8A. The regulator is good for 3A - I checked the heat sink and its warm only 35C and it can keep 3A up to 65C. Big caps too, so don't think it's the supply. Yes, servos can spike if they get jolted or jammed, but don't think this is happening. I've seen the X appear with no movement at all. It went from all green almost immediately to X once. That was before I moved the ports however.
I have the servo power coming from a separate set of leads - there is no 5V out of the FC that's very useful.
I would gently smack it and/or wiggle wires to see if I could recreate or narrow it down.
« Last Edit: November 17, 2020, 01:22:43 am by TheOtherCliff »