5'' Copter losing control in AUTO mode (Barometer glitch?)

Hi all,

My current (just for fun) project is a small, 5’’, sub-250g quad with a Raspberry Pi Zero and a camera on board for mapping, equipped with a mro PixRacer.
After some manual tuning and a Autotune flight it was flying reasonably well in AltHold and Loiter modes (maybe reacting a bit slow when stopping in Loiter). Vibration values also look good, below 14 on all axes.

However, when flying a test mission in Auto, after a bit of steady and nice flying the Copter suddenly jerked violently and lost altitude rapidly. It caught itself after some meters of falling and I was able to fly it back using RTL and land it safely. After that, tried flying it in Loiter some more and everything behaved normally again.

Looking at the log, I see the following:

  • Arming checks should be full - I forgot to add GPS back in after testing it indoors. But GPS reception looks good throughout the flight, with a single GPS glitch after landing.
  • Vibrations look ok up until the incident. Only during/after the violent descent there is increased vibration/clipping
  • the Power Supply for the Pixracer looks poor, with Vcc going down to 4.86v. But I don’t see a correlation with the problems during automatic flight. I will try to find a better solution for powering the Pixracer (and still keeping the copter lightweight)
  • Just before the descent the Pressure drops rapidly/Barometric altitude rises from 50 to 100 m and then oscillates at an extreme amplitude (GPS altitude is representative of the Copters actual behaviour)

It should be noted that the Pixracer is uncovered on top of the Copter. Can this be the reason for this sudden drop in pressure? It’s strange because it behaved well during the manual/loiter tests.
I’m a bit puzzled because of the very extreme and sudden reaction of an otherwise well-flying copter.

Log: https://cloud.geekbox.info/index.php/s/wBk3FcBjLcPLdkD

The baro on the original Pixracer is marginal. I’d stick some open cell foam on the baro. This has helped alt hold issues for me in the past.

Yeeea, that baro is not happy.

Also needs a fair amount of tuning in general. Have you had a chance to auto tune and set up the dynamic notch?

I auto-tuned it twice already. The first time the resulting values were totally off (especially on pitch), then I tuned it manually according to this thread https://discuss.ardupilot.org/t/arducopter-on-small-quadcopter/31752/2
and afterwards I performed an autotune flight over all axes again (also there was nearly no wind today, which led to better results, I think).

Now its at least flying ok in stabilize and AltHold.

Is there a trick to get better results out of autotune with smaller frames?

Dynamic notch is not set up yet, I’ll have to look into that.
Where is the baro on the Pixracer located/where do you put the foam normally?

On the bottom of the board on the lower right. Silver component with the 2 small holes.

The dynamic notch makes a huge difference on a quad this small. What ESC are you running? There’s a dynamic notch tuning mega thread that you should hop on when you’re ready and Peter (who wrote the dynamic notch) will assist.

Really just covering the whole FC with anything (cardboard even) would help in general. Not great to have it totally exposed like that for a multitude of reasons.

Thanks! I’m used to fixed wing UAS, not really used to have anything uncovered at all :grinning:
I’m using this 4-in1 ESC: https://www.airbladeuav.com/products/spedix-is35-35a-5s-4-in-1-blheli_s-esc?_pos=1&_sid=133498379&_ss=r

1 Like

Ok, so I think you can use RPM via bidirectional blheli. Andy just released a build for the Pixracer you could try out for using with the dynamic notch.

On a 5" a good tune will show the plots tracking each other very closely. You can see they don’t track very close. Not terrible, but could be much better.

You need custom firmware flashed to Blheli_S ESC’s for that to work. Google “ jazzmaverick” to get the details. If you don’t want to bother with that throttle referenced notch filter works.

1 Like

Also I “Andy” couldn’t get it to work on the Beast H7 - I think BLHeli_S is very timing sensitive. I will take a look when I get a chance but its pretty low on my priority list right now.

1 Like

Meaning you didn’t get the BLHeli telemetry to work or you didn’t get the ESC to work with Arducopter all together?

I’ve set up a throttle referenced notch filter, which looks promising- a clear peak at 224 Hz is reduced to a little bump in the spectrum after filtering.
I also did a Compass Motor calibration.



After squishing some foam between the Pixracer and the mounting plate, the barometer is still producing weird signals, albeit not as extremely as before.

Todays autotune process produced some really bad PIDs- the Copter is super unstable and begins to oscillate with a low frequency at an increasing amplitude in a kind of “pendulum” motion.

Thanks for all your help so far! The importance of the notch filter wasn’t clear to me before.

Log: https://cloud.geekbox.info/index.php/s/SZ2wkYc9K9k9oS3

1 Like

Ah, I thought you got that working on that board/ESC. Significant that it doesn’t. I wonder why they went with _S ESC’s.

And yes, i did get bi-directional working on one set of Spedix ESC’s but not on another model.

Sorry for using the wrong name Andy, edited :slight_smile:

Initial parameters.zip (3.2 KB)

Xfacta put this handy spreadsheet together. Plug in a couple variables and get some good starting points for another go at an auto tune. Is the frame decently rigid?

Ah, this is cool stuff, thanks!
The frame is an AIRBLADE TRANSFORMER MINI 4 INCH LONG RANGE from Airblade UAV- which makes it a 4’’ quad, so I got even that wrong :grimacing:
But it is pretty sturdy.

1 Like

That’s a perfectly good frame. Shouldn’t have any issues getting a really solid tune on it. Considering it’s a 4" you should see the plots tracking nearly perfectly with a good tune.

So, I got the quad to fly reliably. Here is my process for everybody trying to set up a smaller quad in the 3’’ - 5’’ range:

Note that the default Arducopter PIDs are way too high for a small copter, you’ll have to reduce them before your first flight so you can at least hover. (see the picture of my PIDs for reference)

  1. I squished a piece of foam between the FC and the board it sits on to cover the barometer. My initial confusion came from the fact that the copter was hovering perfectly fine in AltHold, the extreme pressure dips and spikes only occurred sometimes when the copter was stopping from a fast forward flight. Some effect of the airflow over the quad changing rapidly, I guess.

  2. I used the Initial parameters spreadsheed by Xfacta (posted by @vosair above) for the 4’’ prop diameter. It calculated a INS_GYRO_FILTER of 92 for me, but the spreadsheet recommends to keep it at 20. I tried it with 20 first, which lead to unstable flight, so I used the calculated 92. Still not sure about this. Does Autotune work better with lower INS_GYRO_FILTER values?

  3. I set up the throttle-based notch filter, which instantly led to way better performance. dynamic notch filter doc in the wiki

  4. I used transmitter based tuning as explained here to find some initial PID values.

  5. Waited for a calm day and did the Autotune again, which led to values that were quite different from the manually tuned values, but now the copter is stable in every flight mode and during every maneuver.

That being said, I still get a slight, low-frequency (~2-3 Hz) constant “wiggle” during hover as well as EKF errors in conjunction with Compass Errors. But, since I also get quite severe distortion in the camera due to vibration, I’ll have to redesign the upper part of the copter anyway and I’ll use a smaller GPS/Compass combo mounted farther to the back to get away from the battery wires, so I’ll open a new topic to address these issues when I still can’t solve them after the revisions.

Thank you again for the help, couldn’t have done it on my own!

Regarding your INS_GYRO_FILTER the 20 in the spreadsheet is just a “safe” value in most cases. 92 sounds right for something that small.

Not surprising your autotune values were quite different after enabling the dynamic notch. That’s very common.

Something you can try to get rid of the compass errors is a motor compass calibration. Is the “wiggle” isolated to a single axis? A log and video would be helpful in diagnosing it.

Happy to help! Glad it’s flying.

This is true for craft with props sizes ~12" and up (my best guess). Where the curve levels off to 20Hz is up for discussion and per the individual craft.

1 Like