Close

More testing, firmware, and increasing accuracy

A project log for LiPow - The USB C LiPo Battery Charger

USB Power Delivery Based Lithium Polymer Battery Charger

alex-klimajAlex Klimaj 06/29/2019 at 05:242 Comments

I've spent some more time testing and have implemented a calibration step to the firmware that makes the ADC cell voltage measurements accurate to within about +-20mV. It is currently in the bug fixes branch on github. I'm going to spend some more time testing before I push to master.

Once you flash this firmware, you will need to run the calibration. It gets saved into one time programmable memory, so you will only have to do it once.

Hook up a DC power supply set to 3V-4V to the balance connection cells 1-4 and to the positive of the XT60 connector. Measure the input voltage with a multimeter, then in the LiPow command line, run "cal" followed by the voltage input in mV. It is a float and my meter is 5 digit so I've been entering something like "3849.3". It will take that input voltage and calculate the ADC scalars to compensate for the 1% resistor voltage dividers. You can check the output by running the "stats" command and checking that the voltages all are close to your input voltage. If you are happy with the calibration, you can save it to one time programmable flash with the "write_otp" command. You can run that command up to ~30 times and it will always use the latest saved calibration. You should only need to do it once though if you get a good calibration the first time. You can reflash the firmware without erasing the calibration once it is in the one time programmable memory.

Here is the branch.
https://github.com/AlexKlimaj/LiPow-Firmware/tree/bug_fixes

Discussions

Zxx-Eric wrote 05/13/2020 at 06:54 point

Hello, how is the calibration wired?
Do you have relevant wiring pictures and detailed calibration steps? Thank you

  Are you sure? yes | no

Alex Klimaj wrote 05/18/2020 at 22:40 point

I have it documented here. I should move it to the main github page.
https://github.com/AlexKlimaj/LiPow-Firmware/issues/27

  Are you sure? yes | no