Page 1 of 1
Complementary Filtering
Posted: Thu Jan 15, 2015 9:44 pm
by hypamat
hi guys,
ive been playing with a MPU6050 accelerometer, gyro, and themo sensor, and it gives me the values, which is easy enough, but i have heard you can display a more accuracte figure if you do some calculations and use values from both accelerometer and gyroscope (complimentary filtering)
does anyone have any knowledge on this? like a simple calculation that can be done? ive found loads of info for arduino but none for flowcode pic
thanks,
matt
Re: Complementary Filtering
Posted: Fri Jan 16, 2015 10:27 am
by Benj
Hello Matt,
Have you seen this blog post, hopefully its exactly what your looking for.
http://www.flowcode.co.uk/blog/?p=82
Re: Complementary Filtering
Posted: Sat Jan 17, 2015 5:19 pm
by hypamat
thanks for your reply, but i really dont understand this! ive had a look at the example code, and it features a rs232 component, which i do not have licence for and also there is no accelerometer data being read as far as i can see, im just after something to read the sensor then display it on a lcd, i wish i understood what was going on in the example, but it seems really complex!
could you dumb it down a bit for me? lol
thanks,
matt
Re: Complementary Filtering
Posted: Mon Jan 19, 2015 5:47 pm
by Benj
Hi Matt,
I'm doing a few none standard things in the blog.
I have a firmware file which is sent to the ECIO which reads the sensor data and then passes the raw data to the USB connection.
The Flowcode simulation is then used to catch the USB data and do the processing.
The simulation code shows how to create the complementary filter to calculate roll and pitch which are then used to manipulate an item on the panel. Note that this code will not compile on the 8-bit PIC targets due to the lack of proper floating point support in the BoostC compiler.
You should be able to piece together the ECIO firmware and the Flowcode simulation programs to create a fully working complementary filter in firmware.