We have updated to the python code in our git repo.
It now includes;
The elusive Kalman filter.
Math needed when the IMU is upside down
Automatically calculate loop period.
A lot more comments.
What is a Kalman filter? In a nutshell; A Kalman filter is, it is an algorithm which uses a series of measurements observed over time, in this context an accelerometer and a gyroscope. These measurements will contain noise that will contribute to the error of the measurement. The Kalman filter will then try to estimate the state of the system, based on the current and previous states, that tend to be more precise that than the measurements alone.
A Kalman filter is more precise than a Complementary filter. This can be seen in the image below, which is the output of a complementary filter (CFangleX) and a Kalman filter (kalmanX) from the X axis plotted in a graph.
The red line (KalmanX) is better at filtering out noisep;
The code can be found here in our Git repository here And can be pulled down to your Raspberry Pi with;
We have been busy over the last 6 months creating something special! We have always liked the idea of LED cubes, however there was no easy way to drive these LED cubes with a Raspberry Pi.... until now.
VoxCube is an 8x8x8 RGB LED Cube which has been specifically designed for the Raspberry Pi, however it is also compatible with other microcontrollers. E.g. Arduino
Cubes can also be chained together, the image below is four VoxCubes being controller via a Raspberry Pi.