OpenMower
OpenMower copied to clipboard
Improve ADC accuracy
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
Note: I'm using a picow, interested in feedback from someone using a pico as the 3.3v supply is slightly different
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?
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