- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
In my project(program in attached file), I am using a MPU6050 for selfbalancing purposes. I got the raw MPU data, processed it, and obtained an angle. However, when I push the device, it returns a 'noise value' as shown below:
The angle of the MPU6050 is :0 deg
The angle of the MPU6050 is :0 deg
The angle of the MPU6050 is :0 deg
The angle of the MPU6050 is :-62 deg
The angle of the MPU6050 is :21 deg
The angle of the MPU6050 is :1 deg
The angle of the MPU6050 is :1 deg
The angle of the MPU6050 is :0 deg
The angle of the MPU6050 is :0 deg
The angle of the MPU6050 is :0 deg
The angle of the MPU6050 is :0 deg
Usually a kalman filter is used for this (I think), but I don't know how to do this/I don't understand it. Does anyone know how to do this?
Thank you and have a nice day.
Solved! Go to Solution.
- Labels:
-
PSOC5 LP MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A Kalman filter is used to predict the next output based on a series of inputs; it is usually based on knowledge of system performance, for example how fast a system can move or a sensor can realistically respond. For simple impulse noise rejection, look at a median filter. This is good for rejecting impulse noise. There are a few community threads on this topic.
I took your data and padded it with 0 for a few samples before and after.
The raw data is in red, a moving average looks back at the last 5 samples.
The IIR looks back with last_out*(1-1/8) + input/8.
The median filter looks at the middle of 5 samples, 2 previous, current, and2 future; this will of course
require a 3 sample delay. It does the best job of limiting the spike noise, assuming that your system
doesn't really move fast enough to generate real jumps of 61 counts.
---- Dennis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I could not find any solution readily available for this. I could see some C code implementing the same on searching on the internet. Are you trying to do something similar ?
Also check digital filter component available in creator https://www.infineon.com/cms/en/design-support/tools/sdk/psoc-software/psoc-3-5-components/filter/?u...
Best Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As an overview, the Gyro will precess, but the accelerometers will not (usually).
So, a Kalman filter fuses all the data together and "knocks out" the precession.
for more head scratching:
https://github.com/tcleg/Six_Axis_Complementary_Filter/blob/master/C/six_axis_comp_filter.c
https://create.arduino.cc/projecthub/Aritro/getting-started-with-imu-6-dof-motion-sensor-96e066
https://github.com/seanboe/SimpleFusion?ref=https://githubhelp.com
https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050
https://create.arduino.cc/projecthub/Aritro/getting-started-with-imu-6-dof-motion-sensor-96e066
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A Kalman filter is used to predict the next output based on a series of inputs; it is usually based on knowledge of system performance, for example how fast a system can move or a sensor can realistically respond. For simple impulse noise rejection, look at a median filter. This is good for rejecting impulse noise. There are a few community threads on this topic.
I took your data and padded it with 0 for a few samples before and after.
The raw data is in red, a moving average looks back at the last 5 samples.
The IIR looks back with last_out*(1-1/8) + input/8.
The median filter looks at the middle of 5 samples, 2 previous, current, and2 future; this will of course
require a 3 sample delay. It does the best job of limiting the spike noise, assuming that your system
doesn't really move fast enough to generate real jumps of 61 counts.
---- Dennis