-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using the library uNavAHRS #5
Comments
The uNavAHRS tried a few different KF and EKF filters using IMU and magnetometer data to determine attitude. Integrating the gyro is used for high rate updates of the orientation (time updates) and accel / mag is used to correct for drift in the integration (measurement updates) and estimate gyro errors (i.e. the gyro bias). There are ways to avoid performing the measurement update during acceleration or a magnetic disturbance; however, in a long coordinated turn, you'll always have issues since the acceleration is low the accelerometer during measurement updates will drive the attitude back to wings level. There are tricks that can be done to help, by feeding in airspeed, but they aren't great. The 15 state EKF in this library is just an updated version of uNavIns. Gyro and accel are integrated in the time update to estimate position and attitude. GNSS data is used as a measurement update to arrest the drift in the integration and to estimate gyro and accel biases. Magnetometer is no longer needed since we're using GNSS data as a truth source. Highly recommend the Optimal State Estimation book by Dan Simon. It's a complex topic that requires tuning for the application. We use the 15 state EKF often for our projects, but it's hard to make it into a library that will universally work with Arduino across all the microcontrollers, sensors, and applications people will try it on. |
Thank you, I read theoretical materials on Kalman filtration from time to time, but it’s been this way since childhood that the “dry” theory never sticks in my head.
The simplest calculation of roll and pitch angles can be performed using acceleration data, as an example:
You can also turn it on/off by angular velocity, if it exceeds some limits, and also by roll angle greater than a certain value, for example, when the roll angle is more than |
Quaternions do avoid gimbal lock, but that's only a concern at +/- 90 degrees of pitch using typical Euler rotations. The issue with turning off measurement updates for a long period of time is that the gyro integration will drift. You can compensate if you have the body velocity, which is what the code you cite is doing and what VectorNav does with the VN-100, but that requires an additional source of data. There are tons of commercial products similar to what you show - they are typically employing schemes of pre-filtering the data (low pass filter the accels, high pass filter the gyro) and selectively turning off the measurement update during acceleration or magnetic disturbances. They all would still have problems in a prolonged turn. Out of the box, uNavAHRS isn't employing any of those tricks. The filter initialization time was a way of trying to auto tune the EKF based on the sensor noise. It didn't work very well and is one of the reasons why you won't see that code on my repos. Our 15 state EKF has hand-tuned gains. If I remember correctly, the biases were removed in the code and that output was just there to see how the filter was converging. |
My regards |
In my project to create a spatial position device, until recently I used a simple Madwick filter.
Everything works fine on the ground.
After testing in flight, it is clear that the filter cannot cope with the compensation of centrifugal forces.
As far as I understand, the uNavAHRS project is @flybrianfly old development?
I managed to configure uNavAHRS to work with the development board.
The information in the GitHub repository is scanty, the issue cannot be opened, and there are also few examples of work.
I'm wondering if the uNavAHRS code can compensate for centrifugal forces if I use an accelerometer, gyroscope and magnetometer?
Also I didn't quite understand the function
Filter.getGyroBiasX_rads();
How does it measure errors and compensate for them itself?
I substitute the following values into the filter:
But nowhere is it indicated in what units the magnetic field data should be supplied to the filter.
As far as I understand, you are using the library units, she defines common unit conversions.
When running the
uNavAHRS
code, I often getnan.
In a forum thread several years ago, there were lively discussions, but now they have stopped... and I realized that the project has ceased to be relevant.
I am also puzzled by obtaining data for the operation of a slip indicator - a sealed tube with a ball inside.
It would be cool if the library provided values to determine coordinated reversal.
My programming skills are not good enough and I read more theory.
I found the code for the iNav project, where, as I understand it, they were able to compensate for centrifugal forces in flight and, depending on the inclination, reduce the effect (weight of the accelerometer) of the centrifugal acceleration force.
As far as I understand, the force of centrifugal acceleration can be compensated by knowing the turning speed, and somewhere I found a solution using airspeed and GPS.
And @bolderflight probably used this method in the uNavINS project.
But what if the sensor is only an accelerometer and a gyroscope, and possibly a magnetometer?
I hope you can shed some light on my research.
Can I use this code for the purpose of determining orientation in space?
Really appreciate the help.
The text was updated successfully, but these errors were encountered: