xioTechnologies / Fusion

MIT License
927 stars 230 forks source link

Accuracy and Precision Compared to the MadgwickAHRS #84

Closed mecitpmk closed 1 year ago

mecitpmk commented 1 year ago

Hello Mr.Sebastian,

I have a some research about the library which you provide in this repository.

When I work with the old version of MadgwickAHRSupdateIMU which you provided at "19/02/2012 SOH Madgwick Magnetometer measurement is normalised" , I record the Pitch and Roll angles for a 60 seconds and i get the results as follows :

Pitch angle error : 0.001990 Degree Roll angle error : 0.001998 Degree

However, when I implement same structure with Fusion repository and record them for a 60 seconds i get bad result than the first one. The results as follows for Fusion Lib. :

Pitch angle error : -0.005449 Degree Roll angle error : 0.009339 Degree

Settings : gyroMisalignments , gyroscopeSensitivity , accelerometerMisalignment and accelerometerSensitivity was setted as default.

Calibration Process for both repo (MadgwickAHRS version and Fusion version) offsets calculated as follows :

Therefore, although all the process are same with the MadgwickAHRS version the deviation in the pitch and roll angle is much higher. By the way, I didn't forget to put FusionOffsetUpdate in every calculation process and I dont work with Magnetometer.

What is your suggestion in that case how I can improve the accuracy ?

Thank you, Abdulmecid Pamuk

xioTechnologies commented 1 year ago

The calibration process you have described is unlikely to achieve an accuracy better than 1°. I don't see how your system is capable of evaluating a difference in error of 0.007°. Am I missing something?

mecitpmk commented 1 year ago

The error which I described like "Pitch angle error : 0.001990 Degree" calculated like this ; Summed all the collected pitch angle and divided to the collected sample amount in .csv file.

I assumed while there is no motion, the mean of the pitch angle should be close to the 0.0000 or sth.

By the way, I applied 6th Order LPF into raw accelerometer data , and 2th Order for the Gyroscope. Thats why, my pitch and roll angle means smaller than 1°.

The value which we get is acceptable of the system requirements but, I just want to trying make the system even better and precise.

Thank you, Abdulmecid Pamuk

xioTechnologies commented 1 year ago

The difference in error you have reported far exceeds the capabilities of your system. It would be like someone using a voltmeter with 1 mV accuracy, and averaging it to claim they have achieved 7 μV accuracy. I hope you see the problem with that. Either way, I don't think I can be of much more help here.

mecitpmk commented 1 year ago

I see your statement much clear right now. Thank you for the extending our horizon with the clear examples. Before the closing issue Mr.Sebastian, I have one more question;

Is it possible to implement Q1.31 fixed-point format to the your old repos? Do I need extra scaling to prevent overflow (while calculating auxiliary variables and gradient descent algorithm)? I’m totally open your suggestion.

Best Regards, Abdulmecid Pamuk

xioTechnologies commented 1 year ago

I advise against a fixed-point implementation. It would not be an easy task and it would introduce a significant risk of errors. Furthermore, I doubt the efficiency would improve much beyond the current floating-point implementation, especially given that FPUs are now common in many microcontrollers.

mecitpmk commented 1 year ago

Thank you for everything Mr.Sebastian.

Now I’m closing the thread and again thank you.