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

Insufficient polling rate #6

Open
RadianM opened this issue Sep 16, 2024 · 0 comments
Open

Insufficient polling rate #6

RadianM opened this issue Sep 16, 2024 · 0 comments

Comments

@RadianM
Copy link

RadianM commented Sep 16, 2024

poll_radar() polls at 10Hz - presumably to empty some undisclosed FIFO in the LD2410? But with a slow processor, as time goes on last_detection loses sync with reality - as can be seen by logging the various detection measurements for an extended period of time.

I think this is due to the FIFO being emptied at less that 10Hz because the Python Time library is not very accurate with sub-second delays. When this happens, readings are skewed back in time. As a work-around, and to support this theory, calling time.sleep(0.01) between calls to get_radar_data() ensures reading at something greater than 10Hz. (I estimate around 15Hz on my ancient Pi Zero test setup).

There doesn't seem to be any problem reading the LD2410 at higher rates than 10Hz - although I don't know what would happen with faster cpus.

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

1 participant