Good quality estimation of tilt angles such as roll and pitch is desired when it comes to an UAV control. Without good quality signal a proper work of flight controller is nearly impossible. However, the task of filtering is not an easy task, especially when it comes to DSP (digital signal processing). It is even harder when digital filter is inadequate. In this post a mechanical filter is presented that allows to significantly improve attitude estimation in terms of roll, pitch and yaw.
Source of vibrations
The solemn source of vibrations are motors. When a motor is spinning and is not perfectly balanced it starts to vibrate. The frequency of the vibrations is relatively high and interferes with the signal to be measured. Moreover, when the frame is made of metal, i.e. aluminium, the vibrations are transferred to the IMU (Inetrial Measurement Unit). Most commonly used sensors in UAVs are gyroscopes and accelerometers which then combined allow to estimate angular position. The sensor are made in MEMS (microelectromechanical system) technology which means that the measuring structure, i.e. spring-mass system in gyroscopes, is mechanical and is made of silicon. The vibrations naturally influence the IMU.
Aliasing and sampling frequency
Aliasing is an unwanted phenomenon when higher frequencies are observed as low frequencies, thus the measurements are false. It is common knowledge that if you want to measure a signal that has a certain maximal frequency you have to sample it at least two times faster. It is known as Shannon theorem. It is commonly used practice to filter out all of the high frequencies with a filter — low-pass filter. It allows a designer to set a cut-off frequency above which there will be no signal, interferences, with equal or grater cut-off frequency.
For this a digital low-pass filter can be used. Majority of accelerometers and gyroscopes has a built-in digital filter where a designer can choose the cut-off frequency. And the problem is solved! Well, not so fast. The thing about aliasing is that you can not tell if it occurred or not. The motors produce vibrations which are transferred to the IMU. Using a ADC (Analog-Digital Converter) the physical quantity like acceleration or angular velocity is measured. After that it is filtered using a digital filter which should filter out the high-frequency noise. And here lies the problem, the signal already has been compromised. The aliasing can be observed. Digital filter can be used but it will have little or close to no effect on the measurements. Generally this is because the sampling frequency is to little in comparison to sampling rate of sensor.
Sponge — an ultimate mechanical filter
One way of getting rid of those high-frequency noise is to increase sampling rate so it would be at least two times faster then the maximal frequency of measured signal, or as some might say, where the most of the energy is. This would require to acquire a very fast sensor. Other way is to use a mechanical filter that would work as an analog filter. Also there is at least one other solution — to use completely analog sensor and analog filters. A piece of sponge is a very good start point.
This is how an IMU with highly advanced analog filter looks like
Below are some plots which show roll and pitch angle, and motor power. The first one shows the IMU with no sponge. It was attached to UAV’s frame with some foamy tape. The second plot shows results obtained with spongy IMU.
The question is why does it not work? The solution and the explanation involves a bit of basic physics. The short answer is, the cut-off frequency of the spongy filter was to high and the noises just passed through. There is a way to solve this problem. By adding additional weight to the IMU the cut-off frequency of the low-pass filer is lowered. Now, the modified IMU looks as on the photos below
A piece of lead was attached just below the PCB with the IMU. Now, the results are much, much better:
There is close to no influence of motors’ vibrations. How does it work? By increasing the weight of the IMU the required energy to move the IMU the same way as before has increased. Following well know formula for kinematic energy we have Ek = 1/2 m v^2. The motors are still creating the same amount of vibrations but the mass of the unit was increased, 4 times to be precise. By reformulating previous equation we have v = sqrt( 2 Ek / m ). The velocity gets smaller while the mass increases.
Wiring and the environment
Using a piece of sponge and adding additional weight will not solve the problem. It was also required to separate the IMU from the environment. The IMU is attached to the frame in two places. One is the sponge which connects the IMU and the frame, and the other one is the wiring. It was required to use light-weight wires which are compliant. This way the vibrations are not transferred to the measuring unit and do not disturb the system.