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
2 Point calibration fix #232
Conversation
@redoxcode do you have some time to sync this branch to HEAD, and fix the lint and test errors? We'd love to include this in our next release. |
@awonak sync is done. I will try to work out why tests fail. |
ok, there where some bugs in the implementation and some corner cases I missed (like when the input is below the 0 point calibration). But I think its good now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@redoxcode Thanks for taking the time to dig into this, and thanks to @francoisgeorgy for describing the issue and solution in the first place. All of these changes look good to me. This should help some of our 0v reading issues.
Also, selfishly, I'm glad that the test failures didn't end up being issues in the turing machine tests themselves.
LGTM, thank you for improving the calibration process @redoxcode & @francoisgeorgy |
This PR should fix an oversight in the way the calibration values are applied when using only 2 Points.
The issue was described here: #221 (comment)
In short: If we are not mistaken the adc offset measured when 0V is applied, is currently not taken into account.
Old:
result = 'adc raw value' / 'calibration at 10V'
New:
result = ('adc raw value' - 'calibration at 0V') / ('calibration at 10V' - 'calibration at 0V)
(some tests still fail, but it's only one contrib script (tests/contrib/test_europi_turing_machine.py) so I guess it's an issue of this test and not the code changes)