-
Notifications
You must be signed in to change notification settings - Fork 250
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
Calibration calc overflow #3090
base: main
Are you sure you want to change the base?
Conversation
…al into calibration-calc-overflow
nitpick but probably we should revert the |
Sorry, just trying to solve the problem i was having and its also my first cotribution in a OS repo, so i dont know very well how the things are done around here. |
Thanks for working on this! One thing I noticed is that the Besides that, for me it dies in |
i removed the async now. I was using Timer to delay and in the las minute changed for delay. |
HIL test gets run with every PR, qa test only gets looked at around release time or some specific circumstances. Could we convert the qa test to a automated HIL one instead? If we tie a pin to VCC (or maybe we can use some internal reference voltage for testing purposes) we should have some relatively stable results? We'll need to account for temperature changes etc in our asserts of course, but this should be achievable. |
The test conversion is feasible, but regarding the reference issue, I need to study more about the ESP itself. So far, I’ve only used some dev kits with a bench power supply for testing and comparison. I’ll look into it further in the coming days. |
Thank you! If you need some helps/tips along the way we'd be happy to help :). |
Submission Checklist 📝
cargo xtask fmt-packages
command to ensure that all changed code is formatted correctly.CHANGELOG.md
in the proper section.Extra:
Pull Request Details 📖
Description
The current implementation evaluates polynomials using the standard form:
[
P(x) = a_n x^n + a_{n-1} x^{n-1} + ... + a_1 x + a_0
]
This method requires multiple multiplications and additions, leading to overflow. Instead, we transition to Horner’s method, which restructures the polynomial to minimize operations:
[
P(x) = (...((a_n x + a_{n-1})x + a_{n-2})x + ...)x + a_0
]
This transformation significantly reduces the number of required operations from (O(n^2)) in some naive implementations to O(n), improving efficiency and numerical stability.
Solution
Tests
This is the generated output adc_comparison.log
resolve #3061