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

Improve calibration gradient detection algorithm #130

Open
Xenoamor opened this issue Feb 19, 2019 · 2 comments
Open

Improve calibration gradient detection algorithm #130

Xenoamor opened this issue Feb 19, 2019 · 2 comments

Comments

@Xenoamor
Copy link
Contributor

Xenoamor commented Feb 19, 2019

The current gradient detection algorithm does not work correctly in a noisy environment as discussed #120
image

This should be improved to prevent incorrect calibration

@JackNewman12
Copy link
Contributor

Potentially kneed could be used to find the knee/elbow for each calibration plot, not sure how robust it is. I guess it also depends if you want to add another library just for this feature.

Additionally,I found that my DPS5005 would display 15mA open circuit (after calibration). Connecting a multimeter I found that it was always reporting 15mA above the real power.
As part of making the calibration more robust it might be better to measure the open circuit current ADC and use the max value (say over 1 second?) as the zero crossing point.

@Xenoamor
Copy link
Contributor Author

Xenoamor commented Sep 4, 2019

I've never seen kneed before, it's likely a lot more robust then whatever I've implemented. If we don't want people to have to pip install it we can always just include the .py file directly (with credit of course)

Good thinking on the open circuit test. I think we can likely achieve this by just making sure that the V_DAC value is set to 0 though so we wouldn't have to remove the load.

output_dac = int(round(v_dac_k * output_voltage + v_dac_c))

Currently this line can give a value that is non-zero even when output_voltage is 0 which is not ideal. We should add a special case to ensure V_DAC == 0 is true. We can then be certain that this value is ~100% accurate and force our line of best fit to go through it

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

2 participants