The hunt for horizontal and vertical scale differences

I’ve done a quick hunt for any physical / electronic scaling differences shown in my previous post.

3 passive test runs show that each sensor reads ≈1g when their axis is pointing downwards; so the sensors aren’t operating on different scales.

Next, most likely cause is integrating sensor outputs and the effect of propeller noise.  The following graph is from the same flight that showed the scale differences.



It’s not a great surprise that the Z-axis noise is smaller than X- and Y-axes.  After all, the props spin horizontally.  Perhaps reducing the X- and Y-axis noise levels physically might help?  The sensor board is already separated from the Raspberry Pi by some noise suppression standoffs (i.e. rubber posts), but they are rather stiff.  I don’t have anything to hand to try for the moment so I’ll just have to leave it on my ‘to do’ list.

Regardless propeller noise should be symmetrical.  So integrating it to produce speed values shouldn’t lead to any scaling discrepancies between horizontal and vertical.  Certainly not to the scale they are seen.

Perhaps there’s some aliasing between sampling, filter and noise frequencies meaning the noise is being included in the horizontal speed calculations.  That could lead to a fixed offset but you’d expect it to vary per run.  But this factor of 20 appears to be the same each time.

I could filter out the noise by reducing dlpf from 20Hz to 10 or 5.  A “higher resolution” plot of the same x-axis accelerometer data for 1s shows 31Hz as the main noise component.  There’s no signs of aliasing, and there are several samples per cycle so again, this noise shouldn’t be the problem.

X-axis high-res. noise plot

X-axis high-res. noise plot

The accelerometer resolution is set to ±2g (the highest resolution), with 16bit output meaning each bit increment represents about 0.6mms-2 (0.0006ms-2) which is more than high enough.  There’s clearly no signs of aliasing in the plot.

Which leaves only my code as the cause for this scaling, though I’ve been over it with a fine-toothed comb several times to no avail.  I think for the moment I’m going to have to just let it lie, and instead get myself back to drift control.


5 thoughts on “The hunt for horizontal and vertical scale differences

  1. Can you do a Fourier analysis of this data to show the frequencies involved? Also, have you tried seeing what sort of noise component comes from each motor running on it’s own at various speeds?

    • I did FFT all four props together and separately a while using an iPad app. audio spectrum analyser: Primary frequency by FFT is ~30Hz plus matching my diagnostics. Same regardless of 1 or all motors running. Many peaks at 2n * 30 but should be well suppressed by dlpf setting of 10 or 20Hz – currently running at 20Hz, might try 10Hz this evening.

      • Just realized what the 31Hz noise is from: I’ve recently been trying a scheme where the motion PID outputs update the attitude PID targets at 31Hz, and the attitude PIDs update the PWM at 97Hz – an idea from a research paper shared by another contributor here. So there are 31Hz kicks of motion updates. Should have spotted this sooner.

  2. To eliminate the noise possibility, how about if you take the props off, and just wave her around in the xy plane for the duration of the flight, and see if you get the same behaviour.

    • Not a bad idea, Phil, especially as I can do it indoors! Having proved the sensors all read the same, this would give me a way to check the scaling of XY vs. Z.

      Although, to be honest, I don’t want to really eliminate the noise possibility, because then the problem must be my code! 🙂

Leave a Reply to Dave Bolt Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.