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

ESP32: more accurately calculate loop rate #27967

Merged
merged 2 commits into from
Sep 1, 2024

Conversation

tpwrules
Copy link
Contributor

Sadly it turns out the loop rate is so low in some situations that most/all samples were rejected as invalid and the loop rate converged very slowly or did not change. Increase the margin to be classified as such, and print out such excessively over loop times if the specific scheduling debug flag is enabled.

@tpwrules tpwrules requested a review from davidbuzz August 31, 2024 21:01
Copy link
Collaborator

@davidbuzz davidbuzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed and tested on esp32 classic and esp32s3, and this PR shows the s3 is utterly failing to perform at all.

@davidbuzz
Copy link
Collaborator

davidbuzz commented Aug 31, 2024

testing results on esp32buzz board target:

loop_rate: actual: 129.444931Hz, expected: 400Hz
loop_rate: actual: 129.894363Hz, expected: 400Hz
loop_rate: actual: 130.037292Hz, expected: 400Hz

testing results on esp32s3empty board target:

loop_rate: actual: 26.092993Hz, expected: 400Hz
loop_rate: actual: 23.939949Hz, expected: 400Hz

this highlights how terribly the s3 is scheduling right now, it was so bad the scheduler thought it was good. sigh.

@tpwrules
Copy link
Contributor Author

This matches what I see on esp32s3empty. Working on figuring out how to make it faster.

Also warn about overtime on ESP32 which is most likely to hit it.
@tridge tridge merged commit e99b0fd into ArduPilot:master Sep 1, 2024
93 checks passed
@tpwrules tpwrules deleted the pr/esp-loop-rate branch September 1, 2024 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants