I wanted to start a conversation around the roll and pitch of Arducopter drifting as you fly.
The reason is I just assembled new hardware and problems that weren't there before have now shown up in a bad way. Flying indoors in a 5ft space I was able to get up to 30° error in roll and around 10-15° in pitch. I was able to control it and it flew perfectly level the whole time, I just had to hold the stick into the corner of the radio. Lading and waiting corrects the issue.
What could cause this. I had been flying an older version of the IMU this whole time. This version has an analogue filter for the gyros where the new hardware has it as an option. You must solder the pads around the gyros to enable them. I was also flying with two slightly tweaked motors giving off a lot of vibration. This could affect the accels.
My question is: If you have a problem like this, what is the vibration level on your copter, and do you have the filter pads soldered?
And notice I didn't say "loss of control" or "it didn't fly stable". I had control, and it flew perfectly. It just lost it's reference to the ground and I had to compensate with the stick. Had it been worse than 45° I would have lost control.
There are three pairs of pads, each with a white outline. (look for GYRO-XY near the relay).
Jani Solders his to enable the filter. I have never flown this board until now. I will solder them to test the filters this week.
Replies are closed for this discussion.
The problem is that at this stage you allready have aliased data.
No matter how clever you are in the filtering you will not get rid of the aliased data.
It has to be gotten rid of before the sampling stage.
There are two options to do that:
Forgot to mention the program to run in is in the examples folder of the ADC library, called AP_ADC_RAW.
Be careful, it will rotate one of the motors at maximum throttle, without any warnings.
Just connect to the serial port and you will notice 3 coulumnn output.
If you want to send it to me just copy the entire output and paste to a text document.
Note the arducopter frame you have, the version of the oilpan and if the optional filters are enabled.
Looked at the Oilpan in eagle. There the lowpass filter is set at 750ohm against 0.1uF, i.e. a 1st order lowpass filter with -3dB at 2.1 kHz. That means a minimum of 4.2kHz sampling.
So I went for the soldering iron and augmented the z-gyro channel with 1.1uF capacitor, which results in -3dB point at 192 Hz. The result follows, the high frequency vibrations are much better contained, but the 800Hz disturbance still breaks through... What are these 800hz? Maybe a higher order analog filter is needed.
For the current ADC code, which basically samples at 200Hz at least 2.2uF capacitor is needed, to take the bandwidth down to 96Hz.
Click on the image to see the animation and compare to the other animation above.
Actually when I look at it it seems that these 800+Hz is aliasing from somewhere above.
Notice how the spike slides in from the border, i.e. disturbance frequency lowers as the disturbance source (motor) frequency gets higher. That sure looks like aliasing.
Good analysis Kári. How about a compromise solution. Stick with a single pole filter in hardware, but set its breakpoint a bit lower, maybe 50Hz, and increase the sampling rate of the ADC to some level that is sustainable in the current code, maybe 800 Hz. Now the 75Hz filter will have a chance to so something useful, because by 400 Hz it will be 18dB or so down.
Could you model that in your test?
Perhpas it could be usefull to use a switched cap analog filter for testing, or even on production IMU boards.
So that it is easy to have a 5th order filter with programmable corner frequency.
The corner frequency can be adjusted with a clock input : Fc = Fclock / 100. So it is possible to make dynamic adjustments.
Or it is possible to set a fixed Fc, with a simple external capacitor.
5th order is a good compromize between efficiency and stability / linearity.
For a better linearity from DC to Fc, butterworth is recommanded.
What about aliasing an X and Y gyros ?
It is basically the same problem on all the ADC channels.
Little different "personality" on the Accelerometer channels but still aliasing.
Would be interesting to make this test with dynamically balanced motors like AXI Gold range.
Those strong vibrations seems like resonnance. They should be quite easy to suppress, adding an impendance change in the arms (elastic join).
If actual sampling is done at 200 Hz, all noise higher than 90 Hz needs to be filtered or it will go back in the 0 - 100 Hz spectrum by aliasing.
Analog filtering is certainly mandatory, but eventually, there could be a problem with the gyro himself, if it does have a modal frequency where he can resonnate.
In this case, the best is to supress the mechanical vibrations.
It could be usefull to test the Gyro analog outputs with a spectrum analyser (or digital scope with FFT), to see the true noise spectrum.
I think 800Hz sampling is to heavy on the CPU. It leaves to little time for the main loop.
Besides 800Hz sampling would still give me this 800Hz disturbance noise aliased.
Maybe this 800Hz disturbance is something that is bound to my frame.
It is clearly something that is triggered by the motor spinning, but still it survives the "improved" analog filtering.
I am really curious to see some data for the official arducopter frames and the newer oilpans (with and without filters).
Maybe the simplest solution is to build vibrationless frame.... :)
Kári, dumb question, how do I open your .tgz file on a Windows machine? And will there be any other hurdles after that to get it to load and run on the Quad from Windows?