Bad vibration accelerometer data

I work in a bicycle computer application. I was hoping to work out the slope tendency with the help of an accelerometer, but it doesn't work so well.

I set the test code, getting the sensor data. I just look like the speed of the user interface and keep a moving average of more than 128 samples, which is about 6 seconds. With the phone in my hand, the data is good, and I can calculate a good angle compared to my flat flat calibration vector.

With a phone mounted on a bicycle, things are not so good. I expect that I will have a good noise, but I was hoping that a large number of samples in a large time window would eliminate vibration effects and general cycling. Unfortunately, this simply does not work, the magnitude of the acceleration vector is not actually around 9.8, but falls below, which indicates that something is wrong somewhere.

Here is a graph of the data from the test drive part. enter image description here

As you can see, when at first it is static, the value is fine, but as soon as I leave, it falls. I'm pretty sure the problem is with vibration. At first I go down and I feel a strong vibration, and then I rise, and the vibration is less, and the value returns to 9.8, but then I quickly go down the bad road, and the value ends in less than 3.

This is with the help of SonyErricson Xperia Active, which uses the sensor. The major axis is in green and flat, since I believe that it should be without vibration, which should be around 8.5. There is no obvious clip on the data, but I get more below 8.5 values ​​than above 8.5 values. Even if the sensor is configured for it with the most sensitive 2g range, it looks like the vibration should be fine. I have a maximum value here of just over 15, and a minimum of -10, and ib a + - 20 ragnge is simply not centered correctly on 8.5 it should be.

I will dig out my other phone, which seems to have a slightly different BMA150 sensor and try with this, but if it is not perfect, I think I will have to give up this idea.

+4
source share
2 answers

I suspect that the accelerometer is not linear in such large ranges of G. If so, and if there is any asymmetry, it will do what you see.

The solution for this is to impose a little more accelerometer, foam rubber, a plug, anything, perhaps set it to a heavier stage to filter the vibration more.

Or (not a very good solution) try modeling the error and compensate for it.

+1
source

I used the same phone and coincidentally the same averaging interval of 6 seconds for the application a few years ago, and I do not remember to see the behavior on the graph.

I am wondering if the problem is how the 6 second averages accumulate. One of the problems was that the sampling interval was not constant, but it depends on how busy the processor is. The sample was received at the specified time, but the call to the event handler depends on the scheduler. When the processor is unloaded, sampling occurs at a constant frequency, but as the processor runs more intensively, the sampling frequency becomes slower and more unstable. You can write your application to maintain low CPU utilization during fetching. We made a selection for 6 seconds, doing nothing, then stopped the selection and processed the last set of samples, but this was only partially successful, since you cannot manage other applications running at the same time, and the scheduler uses all the processor resources for them. In Xperia Active, I discovered that it can sometimes go out for a few seconds between samples that I attributed to garbage collection in one of the JVMs. The solution for us was to time stamp each sample, then perform some quality checks on the set of samples and discard those that did not pass the quality check. This is a bad decision, because determining what is good enough is inaccurate, and when a user launches another application that uses a lot of resources, most sample sets can be discarded, so additional logic is required to process this application.

The current Android API, unavailable to Xperia Active, should have eliminated this, as samples can be downloaded as described at https://source.android.com/devices/sensors/hal-interface.html#batch_sensor_flags_sampling_period_maximum_report_latency .

If the algorithm took a certain number of samples, rather than counting them, and the processor worked harder, because the bike was faster, although I'm not sure why it would do this, it would produce something like the first graph, because when the bike the decreasing amount of descent decreases, and rising to the hill, it rises. There are many assumptions, but the average value of 6 seconds, giving a value of less than 3 m / s ^ 2, seems implausible from my experience with this sensor.

+1
source

Source: https://habr.com/ru/post/1413764/


All Articles