Hi again.
I have just followed a tutorial online creating an "arduino gyro game". I won't be using the game but i will use the module to show me how level my van is parked.
After some googling around and some trial and error i found out that i need to put 3 more files in my sketch folder to get this thing to work.
Kalman.h
Kalman.cpp
I2C.ino
These are to be found in the kalman libraries after that was installed. Not sure if this all had to do with the issue but better save than sorry, so as much info given as possible.
So i got this thing running and it works "fine" but i would like to have some more elegant readings. Some sort of averaging. At this point when the MPU6050 lays still the angle output will vary a out 0.5 degrees jumping up and down. Screenshot added to show what i mean.
Now i found something about changing the Q_bias in the Kalman.h file but this won't do anything for me.
I changed this bit from the kalman.h
private:
/* Kalman filter variables */
float Q_angle; // Process noise variance for the accelerometer
float Q_bias; // Process noise variance for the gyro bias
float R_measure; // Measurement noise variance - this is actually the variance of the measurement noise
Into
private:
/* Kalman filter variables */
float Q_angle = 0.1; // Process noise variance for the accelerometer
float Q_bias = 0.1; // Process noise variance for the gyro bias
float R_measure = 0.1; // Measurement noise variance - this is actually the variance of the measurement noise
I know that q_bias is a bit extreme there but i tried various values between 0.1 and 0.003
The output is still jittery. Anybody knows where i need to change what to get some smoother output on my screen?
Actual sketch as attachment since it is over 9k caracters
arduino_gyro_game3.ino (13.4 KB)