OpenMower icon indicating copy to clipboard operation
OpenMower copied to clipboard

Improve ADC accuracy

Open olliewalsh opened this issue 1 year ago • 4 comments

Use the charge current ADC when undocked to determine ADC offset, tweak the resistors values, and disable SMPS powersaving during ADC.

With this I get v_battery pretty close to the measured value

olliewalsh avatar Aug 07 '23 02:08 olliewalsh

Note: I'm using a picow, interested in feedback from someone using a pico as the 3.3v supply is slightly different

olliewalsh avatar Aug 07 '23 14:08 olliewalsh

Thank you for the PR! Looks good!

  • Should we use the "raw" voltage for battery overvoltage protection instead of the corrected one? I'm thinking about what happens if the offset is "wrong" (e.g. is at 3V) and breaks overvoltage shutdown. For the overvoltage shutdown the noise and offset don't really matter I think

  • Do you know what the average error is you get? I assume it's <1V. Should we lower the 3V check?

ClemensElflein avatar Aug 08 '23 09:08 ClemensElflein

Thank you for the PR! Looks good!

  • Should we use the "raw" voltage for battery overvoltage protection instead of the corrected one? I'm thinking about what happens if the offset is "wrong" (e.g. is at 3V) and breaks overvoltage shutdown. For the overvoltage shutdown the noise and offset don't really matter I think
  • Do you know what the average error is you get? I assume it's <1V. Should we lower the 3V check?

Replaced the logic to check the high-level mode && GPS to determine that it's mowing, ensures it doesn't try to adjust the offset while docking. Switched to v_charge instead of charge_current adc as current is affected by regen AFAICT while v_charge is not (behind a diode). Limited offset to +-3% to ensure it's sane

olliewalsh avatar Apr 23 '24 01:04 olliewalsh