Gyroscope and filtering video tutorial – Episode 1

I’m not completely sure why, but I’ve been pushing this topic away for quite a long time now. But it’s finally time to present it in this blog too. So, here we go.

Something like 3 month ago I’ve started to record and publish a video series about basics of gyroscope data processing in modern flight controllers (Betaflight, INAV, Cleanflight). It started as a tutorial how to setup notch filters in INAV, but ended up as a much bigger thing. Series consist of 4 episodes where I use Blackbox logs to show gyroscope signal noise and how to fight with it. Over next few days I will be posting links to those videos here, but if you eager to see them sooner, just use this link.

In Episode 1 I talk about:

  • Gyroscope noise sources
  • How unfiltered, raw, gyroscope signal looks like
  • How noise sources manifests in gyro traces
  • How filtered gyroscope signal looks like

Ah yes, I’m running a YouTube channel too, feel free to subscribe ­čÖé

Read More

Yaw unstable at full throttle

Last weekend I’ve experienced quite serious problem with Reptile X4R 220 racing quadcopter: on full throttle quad was loosing stability. At first, it was starting to drift yaw to the right. Then, if throttle was not lowered, roll and pitch was also becoming unstable and quad was doing crazy things in the air.

I do not have a video footage of those issues, but Blackbox footage looks like this:

yaw unstable at full throttle 1

Roll, Pitch and Yaw sticks are at zero, throttle is raised from aroung 45% up to 90%. When throttle reaches around 80%, gyro starts to record movement on all axises. At one point, yaw gets a kick and reaches more that 200dps. Finally, I lowered throttle and quadcopter stabilized (moment of stabilization is not visible, but trust me, it is there).

The reason for such a behavior became pretty visible as soon as I displayed motor output:

yaw unstable at full throttle motor output

Flight controller requests much more power from Motor #1 than from other motors. Not only in this short scenario. Look at this graph:

yaw unstable at full throttle motors

FC requests more thrust from Motor #1 almost all the time. Why? Motor #1 provides less thrust than other motors. There are few possible reasons:

  1. Damaged propeller
  2. Damaged motor
  3. Damaged ESC
  4. ESC not calibrated

In my case, it was ESC calibration issue. While this might sound strange, ESCs loses calibration from time to time. Usually after a crash that resulted in detached battery.

Proper ESC calibration solved all the problems I was experiencing.

Read More

How to measure gyro noise frequency with Blackbox

Cleanflight / Betaflight / INAV lowpass filter tuning can be a hard thing to do if you have not idea what is noise frequency you want to cancel. Sure, you can blind test or read tutorials. But what if I tell you, you can measure it quite precisely using only Blackbox logs? Or measure rotation speed of motors? That would be nice, isn’t it? The only requirement are few seconds of Blackbox log with visible gyro (it can be also motor output or Pterm or even ACC reading) noise.

blackbox measure frequency 1

Continue reading “How to measure gyro noise frequency with Blackbox” »

Read More

Air Crash Investigation: gone in 6 seconds

“What goes up, must come down”. I had an opportunity to face this old truth 2 weeks ago, when my 600mm quadcopter felt from 30 meters straight into water.

It was supposed to be a simple flight:

  1. take off
  2. fly few hundred meters away with GPS assist
  3. engage Return To Home and land

Dozens of missions like this in last few months, so really, nothing special. Unfortunately, like I mentioned above, not everything went as planned. 2 minutes after take off, UAV lost stability and went down with screaming motors. Continue reading “Air Crash Investigation: gone in 6 seconds” »

Read More

Detecting Cleanflight PID tuning issues with Blackbox: gyro noise

After a short brake, let’s return to Blackbox series with new entry: “How much gyro noise is too much?”.

Almost all PID tuning tutorials states: reduce vibrations that affects gyroscope and accelerometer readouts. Yes, this true: any vibrations that appear during flight affects gyroscope and accelerometer readouts are bad and should be kept as low as possible. This can be done by balancing motors, propellers, using stiffer frame, adding dampeners, lowering LPF filters. But how much vibration induced gyro noise is too much? Let me answer with four Blackbox screenshots:

Super smooth gyro traces, no noise

smooth gyro traces

This is how it should looks like! Perfect trace. If it is archived without lowered LPF filters, then kudos for balancing everything!

Somehow noisy gyro traces

somehow noisy gyro traces

Little noise appears, but amplitude is low, everything is under control.

Noisy gyro traces

reasonably noisy gyro traces

Gyro noise is visible. It is not a problem yet. If it was a result of raised LPF cutoff frequency, extra noise might be worth lowered signal delay. I would start to think how to reduce it on a hardware level. Perhaps bearings are dying, or propellers should be rebalanced?

Extremely noisy gyro traces

extremely noisy gyro traces

This is how unflyable gyro noise level looks like! If you see have problems with flight performance, you know what is causing it. This have to be fixed ASAP before everything else.

Read More

Detecting Cleanflight PID tuning issues with Blackbox: not enough P

This is third part of Cleanflight PID tuning tutorial with Blackbox. Previously I’ve showed examples of:

This time it is time for something slightly different: not enough P gain. Usually this problem can be identified without any log analysis. Symptoms are quite visible: multirotor is sluggish during maneuvers, has a tendency to change attitude on its own, constant course corrections are required. In worse cases, it is unflyable. But how does it look like on Blackbox logs.

First of all, symptoms are not so clearly visible. There are no huge oscillations for example. Zoomed out log might event look good on a first glance. For example like this:

blackbox pid tuning not enough P overview

Continue reading “Detecting Cleanflight PID tuning issues with Blackbox: not enough P” »

Read More

Detecting Cleanflight PID tuning issues with Blackbox: excess D gain

Welcome to second part of Blackbox PID tuning tutorial. Last time I have showed few examples how excess P gain might look like. Today I will write few words about next common PID tuning problem: too much D. Derivative (future) part of PID controller is very useful, since it allows to smoothen control loop output when it is┬áreaching the target. So, at the end of move (roll, pitch, yaw, anything else) multicopter will start to “slow down” before target is reached. It’s just like accelerator pedal in a car. When you want to reach 50 you start to release it before you reach 50, and not in the exact moment you reached target speed. If you would, you would have to use brake to slow down to 50. Derivative part helps not to overshoot. Without it, movement would be shaky, not smooth.

Unfortunately, D is tricky. Like everything that tries to see the future, it is unreliable and can introduce noise. We do not like noise. Not enough D = shaky, mechanical, movement and overshooting. Too much D = extra noise, vibrations, damped response.

How excess D would look like in Blackbox logs? Like this:

Too much D gain on Cleanflight Continue reading “Detecting Cleanflight PID tuning issues with Blackbox: excess D gain” »

Read More

Detecting Cleanflight PID tuning issues with Blackbox: excess P gain

Almost all quadcopter PID tuning tutorials can be summarized into one sentence: “Increase P until you see oscillations, then lower it”. Plus some thoughts about I and very vague advices about D and that is all. When I got into the hobby, I’ve read all of those tutorials. And I did know more about PID tuning than before that. I even had more questions than before. How to recognize high frequency oscillations, how to recognize low frequency oscillations. Lower P? OK, but how much? And D? How to tune this bloody D? As a result, every time I tried, I ended up with very snappy but shaky quadcopter that maybe responded very quickly to commands, but was very shaky and was making strange noises.

And then came Cleanflight and Blackbox. Live became simpler. What I’ve learned from Blackbox logs is that I wanted high P so much, I had too much of it in the end. Actual oscillations begins before we see or hear them and excess D introduces jello. Blackbox simplified things, but still, logs analysis is something like an art. You have to know what to look for. Continue reading “Detecting Cleanflight PID tuning issues with Blackbox: excess P gain” »

Read More