CLI tools for Korad power supplies, including lithium ion battery charging
Project description
psu-progs
A collection of utilities to put a computer-connected power supplies to good use.
The extraordinarily compact collection includes only a CLI tool for charging lithium-ion batteries with a Korad PSU.
Installation
pip install psu-progs
Quick-show-me-a-thing
# Charge a 1400mAh lithium-ion battery, with a Korad PSU connected at /dev/ttyACM0
korad-charge-lithium-ion -p /dev/ttyACM0 -c 1.4
Full command help
Usage: korad-charge-lithium-ion [OPTIONS]
Charge a Li-ion battery using a Korad K300XP power supply
Options:
-p, --port DEVICE Name of serial device the power supply can be
communicated through, e.g. /dev/ttyACM0
[default: /dev/ttyUSB1; required]
-c, --capacity FLOAT Labeled capacity of battery, in amp hours.
[required]
--charge-current FLOAT Current to use while in the constant-current
charging phase, in amps. If not specified,
this defaults to half the battery_capacity.
--charge-voltage FLOAT Voltage to use while in constant-voltage
phase. For Li-ion cells, this value should be
≤4.2. [default: 4.2]
--charge-cutoff-ratio FLOAT Ratio of the charge_current used to derive
the value of measured output current at which
to stop charging. [default: 0.1]
--channel INT Which channel to output power from (for power
supplies with multiple channels). [default:
0; 0<=x<=1]
--num-samples INT When measuring current, use the average of
this many number of samples. Using a value
over 1 is recommended, as anomalous blips may
be measured. This also addresses low readings
when output is first enabled. [default: 3;
x>=0]
--max-successive-failures INT After this number of continuous errors are
encountered while attempting to read the
output current, stop charging. [default: 5;
x>=0]
--help Show this message and exit.
Developing
This package uses poetry for dependency management. To get started hacking around the codebase:
- Create a new virtualenv (or skip this step and let poetry do it for you)
pip install poetry
poetry install
- Good luck!
Contributing
If you have other utilities you'd like to add, or other PSUs you'd like to support, pull requests are welcomed! I may not be able to physically test all contributions, but I sure can review and merge :)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
psu_progs-0.1.1.tar.gz
(7.8 kB
view hashes)
Built Distribution
Close
Hashes for psu_progs-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4821c6ef5bd7fc387125c9ff66047d6cd5270082e87a094037a5da059f575fce |
|
MD5 | 0e6b83cf47717f4083952eb767a9d391 |
|
BLAKE2b-256 | 602e9bdf2e93b07d7ecbb8d274827a2c5e3ea1ae348b257f34508e282d236cbd |