Skip to content
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

Observed frequency is 48.57 Hz rather than 52 Hz (IMU datasheet) #125

Closed
gauteh opened this issue May 15, 2023 · 6 comments
Closed

Observed frequency is 48.57 Hz rather than 52 Hz (IMU datasheet) #125

gauteh opened this issue May 15, 2023 · 6 comments

Comments

@gauteh
Copy link
Owner

gauteh commented May 15, 2023

I am using the LSM6DSOX and ISM330DHCX in FIFO mode at 52 Hz or 208 Hz. For 52 Hz the real frequency turns out to be
 about 48.57 Hz, and proportionally so for 208 Hz. I am confirming this through the number of samples collected between GPS
 fixes and when comparing a signal against another type of sensor. The observed frequency is stable at this rate.

 

Could this be real or is there something wrong in my application? The FIFO is checked using an RTC and is never allowed to 
run full (the overflow, full, overflow_latched) bits are checked. I drain (pop) the number of samples available at the RTC
 interrupt, but do not reset it. Does operating the FIFO or draining it halt the FIFO or reduce the number of samples?

 

I observe the same both with the LSM6DSOX and the ISM330DHCX.

 

IMU configuration: [github.com/gauteh/sfy/blob/main/sfy-buoy/src/waves/mod.rs#L231](https://github.com/gauteh/sfy/blob/main/sfy-buoy/src/waves/mod.rs#L231)

FIFO drain function: [github.com/gauteh/sfy/blob/main/sfy-buoy/src/waves/mod.rs#L395](https://github.com/gauteh/sfy/blob/main/sfy-buoy/src/waves/mod.rs#L395)
@gauteh gauteh changed the title observed frequency is 48.47 Hz observed frequency is 48.57 Hz May 15, 2023
@gauteh
Copy link
Owner Author

gauteh commented May 17, 2023

We are probably doing this correctly: https://community.st.com/s/question/0D73W000000bAS4SAM/detail?fromEmail=1&s1oid=00Db0000000YtG6&s1nid=0DB0X000000DYbd&s1uid=0053W000001snzQ&s1ext=0&emkind=chatterCommentNotification&emtm=1684313246967&emvtk=E54ccDtPqWVECsAa5CCiLUY.7M7t1PbWVtlIXpFI4Uk%3D

@akkermei

You are not making any errors in your application, consider that the spread can span the +-10% range so 
having 48.57 Hz instead of 52Hz is acceptable.

@jerabaul29
Copy link
Collaborator

Ouch, +-10% is a lot of uncertainty. But if they say so... Good to keep in mind for future use :) .

@gauteh gauteh changed the title observed frequency is 48.57 Hz Observed frequency is 48.57 Hz rather than 52 Hz (IMU datasheet) May 17, 2023
@gauteh gauteh closed this as completed in 6063b9e May 24, 2023
@gauteh
Copy link
Owner Author

gauteh commented May 24, 2023

There was a bug in the dataset generation where I forgot to take the offset in the FIFO into account when generating the time vector. Fixed on main. This was a post-processing bug, so by re-running dataset-exports the error is gone and the frequency is much closer to 52 Hz (and no correction is usually necessary).

@gauteh
Copy link
Owner Author

gauteh commented May 25, 2023

I spoke too soon (again...): the variation in frequency is real, but I do not think it is an error on our part. For the buoys tested at sintef the frequencies are:

Run4: GPS estimated frequency for 23: 48.59990507831039 Hz
Run4: GPS estimated frequency for 16: 48.57685009487666 Hz
Run4: GPS estimated frequency for 25: 49.06564446574029 Hz
Run4: GPS estimated frequency for 1: 55.89519650655022 Hz
Run4: GPS estimated frequency for 2: 55.80381471389645 Hz

So within the 10%. The last two buoys are the SINTEF-built ones, with ISM330DHCX. The others are LSM6DSOX. Also they might be from the same batch.

@gauteh
Copy link
Owner Author

gauteh commented May 25, 2023

image

@gauteh
Copy link
Owner Author

gauteh commented May 26, 2023

ODR specified in the datasheet refers to typical value, so the actual ODR may differ from typical value.

You can get actual ODR of the device following equation "ODRactual" stated in section 6.4 Timestamp of both AN for LSM6DSOX and ISM330DHCX:

https://www.st.com/resource/en/application_note/an5398-ism330dhcx-alwayson-3d-accelerometer-and-3d-gyroscope-with-digital-output-for-industrial-applications-stmicroelectronics.pdf

https://www.st.com/resource/en/application_note/an5272-lsm6dsox-alwayson-3d-accelerometer-and-3d-gyroscope-stmicroelectronics.pdf

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

No branches or pull requests

2 participants