Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Suggestion: Add getGyrOffsets() and getAccOffsets() #1

Open
fralbo opened this issue Aug 7, 2021 · 5 comments
Open

Suggestion: Add getGyrOffsets() and getAccOffsets() #1

fralbo opened this issue Aug 7, 2021 · 5 comments

Comments

@fralbo
Copy link

fralbo commented Aug 7, 2021

Hello,
It could be interesting to add a getGyrOffsets() and a getAccOffsets() methods because I think there is no necessity to compute new offsets every time we power it up.
So, we could save the data computed once and set it in the chip on subsequent power up.

@wollewald
Copy link
Owner

@fralbo , first of all I have to say that I tried to work with the offset registers of the ICM-20948, but I couldn't make that work correctly. Finally I have implemented my own methods.

The first is the more complex one where you determine the min / max raw values by turning the ICM20948 slowly. These are values you have to insert anyway into the setAccOffsets and the setGyrOffsets functions. Correction and offset factors are calculated from these min/max values. The correction values are for the slope (delta angle / delta raw) and the offsets are for the zero points.

The autoOffsets() function is mainly for the measurement of angles up to 60°. It just ensures you start with 0° on the x and y-axis. autoOffsets optimizes the offsets just for this purpose. I would not recommend it for other purposes. It can even have a negative effect on x and y values at bigger angles, since the slope is not recalculated.

So, internally are not only offsets used, but also correction values for the slope. I would need to implement another function to request these values (offset and correction) and another function to re-apply them. This is not much effort to add. But the two calibration methods are are anyway difficult to understand for many users. I fear that most people are lost when they find another function for calibration.

Happy to hear your thoughts.

@fralbo
Copy link
Author

fralbo commented Aug 8, 2021 via email

@wollewald
Copy link
Owner

Hi Alain,

I have started to look into the implementation of the DMP functions, but then I noticed that this would exceed my capacities. The only filters I have implemented are the noise filters. They work fine but doesn't help you.

At least for my library I can say that the angle measurements which are solely based on the acceleration sensor will not work on a motorbike that is moving. If you are driving through a curve gravity and centrifugal forces will balance so that the x and y acceleration sensor will not detect a change. Or in other words: if you would detect an angle while driving through a curve you would fall. What you should see, is an increase of acceleration in z-direction.

Not sure if I can help.

Regards, Wolfgang

@fralbo
Copy link
Author

fralbo commented Aug 9, 2021 via email

@fralbo
Copy link
Author

fralbo commented Aug 9, 2021 via email

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants