Fly's fine, then not so much in Alt_Hold and Loiter mode: AC v4.0.3

EDIT: One of the two gyros is causing the issue, by forcing the pixhawk to use one the good gyro, I have not had the issue reappear in ~10 packs, here is the parameter. INS_ENABLE_MASK = 2 (#2 is the second gyro and the good one on my PHL FC, #1 is the first gyro). I still get bad gyro health warning on boot, but zero other warnings during flight or issues, thanks for the help guys!

I have a 250mm quad running AC 4.0.3 on PixHawkLite FC, now that I got it flying fairly well, sometimes not so good flights when in alt_hold or loiter modes.

Issues: works fine and then sometimes:

  1. Alt-hold starts throttle pulsing up/down, you can see it some times, but you can definitely hear it (I checked vibes and they are ok).
  2. Loiter mode, will be stable holding then after “warning EKF primary changed:1” just kicks the quads nose up ~5 degrees and starts moving backward until corrected with sticks.

The log attached is just sitting on a wood post out in the open, zero movement, power up and sometimes it gives warnings/etc, compass/mag/gyro/acc/baro all giving issues. If it was a sensor issue, I would not think all sensors would be bad. I have seen the gps glitch give the same pattern on the map over and over (something like a 7 to 12 pointed star, gps glitches wouldn’t repeat a pattern, this seems like a code issue is my guess) while its just sitting, unarmed.

I have the yaapu telemetry on my x9d and when it gives this message “warning EKF primary changed:1” (it sometimes give gps glitch, error velocity variance) it starts flying bad in alt-hold and loiter, switch back to stabilize and its fine. A power cycle and its ok until it randomly acts up again (roughly 1 in ~3 flights). I have powered up and set on top of a wall away from all power lines/etc, let the gps stabilize (~15 sat/0.6 hdop) and I will get the above warnings without firing up the motors. I disabled the PHL onboard compass (SPI mag, now using the I2C mag in the GPS unit in stead of both). If I need to move the gps/mag higher, I will do that if you think it will help (if yes, how high?). The quad has never been crashed.

My quad has a 4n1 esc just below the PHL FC, and above that and 2 inches forward is the M8N gps/mag. The FC is soft mounted, I could try hard mounting it if you think that might help (has 6000 gyro). I have had the copter connected usb to MP and wiggled the wires/connectors and never get a issue. Included a pics to see if its a layout issue?

My main problem is I am not good at reading the dataflash logs, so many parameters plus the way the code fuses data/etc.

Could be a coincidence, “seems” like it was after the autotune, random weird stuff started happening.

Seems it might be a code issue,not sure.
Thanks for any advise to track down this issue!

2020-09-11 10-41-13.zip (532.9 KB)
2020-09-11 10-41-13.log.param.txt (17.4 KB)

Really need to see a log of it flying.

The log looks a little like the old noisy IMUs on the original Pixhawk. I suggest disabling the second IMU, disabling the internal compass, recalibrate both and see if that’s any better

@andyp1per thanks for the suggestion.

I just now set INS_ENABLE_MASK from 127 to =1

I already have the second compass selected, at least I think so, see pics.
The onboard compass is disabled and using the I2C MAG on the GPS.

Will re-calibrate gyro/acc/compass and retest when I get home and report back.

PHL Gyro ID's
PHL 1 compas selection

Use the external compass - less interference, and I suggest using the MPU6000 rather than the L3GD20

It’s not totally clear how to select external compass or the MPU6000 gyro, as in MP it says “select 1st IMU or compass”. With the device ID picture above:

  1. Is the MPU6000 the first gyro?
  2. Is the external i2c compass, also the first compass?

Is the device ID in order of devices or is there a better way to tell what is what?

Looks to me like you have selected the external compass and the 1st IMU (MPU6000) with those settings.Unless you are run latest beta or Dev in which case you can prioritize the compass’s easily.

Now every boot I get bad gyro and AHRS constantly, the flight was fine for ~30 seconds in stab/alt-hols and loiter, then all heck broke loose :slight_smile: Stab/alt-hols and loiter was leaning 10~15 degrees tilted back and heading that direction, I went right back to stab and still fighting it, then I herd something like safety rtl, since it was heading straight towards me, I instantly disarmed on a switch (love that feature), fell about 4 feet to the grass. I rebooted, recal’ed compass/acc, rebooted, same bad gyro and AHRS constantly, I had a feeling I shouldn’t arm it (lol), after ~10 seconds of hovering it tilted back and started climbing quick in what looked like a fly-a-way, disarmed and caught it.I re-enabled both gyro’s and it flew like it did before, ok in stab, but intermittent in alt-hold/stab. I wanted to try and enable the second gyro, but that is not an option.

Maybe you have a bad IMU - try it the other way around. Disable the first and enable the second.

It is an option. INS_ENABLE_MASK 2 will accomplish that. If you don’t see the check box dialog pop up when you enter the parameter value update Mission Planner.

Only got two packs in tonight so not a good test sample.

On boot always gyro health warning (like before), but zero other warnings in flight or any major change in flight characteristic like intermittently before.

In alt-hold, i still hear and see the thro pulsing when maxing the r/p sticks (wonder if its just tuning issue?), Loiter seems fine. It didn’t do any freaking out like the day before. I would say disabling the first gyro helped, but more testing needed.

I notice the yaapo reports quite a bit more messages on my x9d than MP does on my computer (not today as I only got bad gyro health), is there a setting or something?

The warning “bad gyro health” what is it and is there a threshold setting or?

Quick update: three more packs today and the only warning is the bad gyro health on boot, zero other warnings during warm up and flying, also no strange flights. How can I verify which gyro is gyro1 (the one giving the trouble)?

INS_GYR_ID. INS_GYR2_ID is the 2nd one.

Look at IMUx.GH in the logs - that’s the log of gyro health

Added by yours truly a long time ago when bad gyro health caused me a few crashes :slight_smile:

Quick update. After backing up my full parameter list, I dropped back to a saved version and screwed the pooch :slight_smile: Everything was lost, all my settings, calibration/ect. I manually setup/cal’ed and something was just not right. then went back to the latest saved and now no matter what (either 1 gyro setting) I get the AHRS. Just weird and inconsistent. I updated to v4.0.4 and same. I ordered a couple new omnibus f4 pro v3 FC to replace this PHL FC.

A little reading suggests its the power rail supplying the gyro, I can easily add a bunch of decoupling caps and retest, I was even thinking of just replace the gyro from a good working spare BF FC, this would prove if its a bad gyro or something else (but BF seems to have much better gyro filtering (at least for mini quads) and adjustments, so maybe not).

@andyp1per when I looked at the IMU1/2 GH in the logs, all are flat line on good/bad logs and both gyros. But the ACC-Z axis is a mess on the bad log. Example, the good gyro seemed to be #2, here is a picture just flying around in stabilize mode, at the beginning and end, ACC-Z is a mess, and gyro health (GH + AH) are flat lines overlaying. I dont want to waste too much time on this, I am hoping its the PHL FC and move on when my new FC’s get here.

This may just be logging (the gap). Make sure you have a fast enough card. You would expect AccZ to be centered around 9.8

I need to buy a couple more cards, what size, brand and where do you recommend?

Also what small semi low cost gps/compass do you recommend?

Anything class 10 should be ok. I have had issues with >32Gb on some boards. I’ve bought Samsung in the main of late - it’s reliable and cheap

@andyp1per Thanks.

What small semi low cost small gps/compass do you recommend?
(Ebay/banggood/aliexpress are all fine with me)

I have two of these - they work great

http://www.mateksys.com/?portfolio=m8q-5883

1 Like

There are few choices in small GPS/Compass modules regardless of cost. The Matek unit is the logical/practical choice.