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

[Firmware] Add timestamps to UnfusedData #195

Open
TheButlah opened this issue Feb 26, 2023 · 1 comment
Open

[Firmware] Add timestamps to UnfusedData #195

TheButlah opened this issue Feb 26, 2023 · 1 comment
Labels
Area: Firmware Relating to the firmware subprojct Priority: High Type: Refactor Refactor or architectural changes

Comments

@TheButlah
Copy link
Collaborator

We need to add hardware timestamps to UnfusedData. We may want to be generic on the timestamp type, so that we can represent when things are hardware timestamps vs software timestamps.

Fusion algos will need this, as several can use a dt to improve performance: https://github.com/jmagnuson/ahrs-rs#field_access

@TheButlah TheButlah added Priority: High Area: Firmware Relating to the firmware subprojct Type: Refactor Refactor or architectural changes labels Feb 26, 2023
@TheButlah
Copy link
Collaborator Author

After some research into this, I now believe that reading timestamps from the fifo is not the right approach. Rather, we should sample the mcu timestamp at each new data ready interrupt, and then use that to track an exponential moving average of the estimated sample rate, in terms of MCU time (which is lower ppm/drift than the internal clock on most IMUs). We can use that sample rate to update the sample rate of the fusion algorithm, possibly on some fixed interval task.

In other words, the sample rate of the data stream should be tracked, rather than associating the deltaT or absolute time of each sample with the unfused data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Firmware Relating to the firmware subprojct Priority: High Type: Refactor Refactor or architectural changes
Projects
None yet
Development

No branches or pull requests

1 participant