Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dp100_skill

A single-file CLI for the ALIENTEK DP100 / ATK-MDP100 USB bench power supply, plus a Claude Code skill so an AI agent can drive your bench supply safely in automated hardware tests.

No vendor software, no ATK-DP100DLL, no .NET. Just Python talking raw USB HID, with hidapi as the only dependency. Works on macOS, Linux and Windows.

What it does

  • Read live telemetry: input/output voltage, current, power, temperature.
  • Set output voltage and current limit; turn the output on and off.
  • Configure OVP/OCP over-voltage and over-current protection correctly (see Gotchas).
  • Manage all 10 stored presets.
  • Capture timed V/I/power traces as a table, CSV or JSON Lines, with min/avg/max and total energy.
  • Power-cycle a device under test N times, for boot and reset testing.
  • Sweep voltage in steps, for brownout and margin testing.
  • --json on every command and meaningful exit codes, for scripting.
  • --dry-run on every write, and a persistent safety ceiling.

Install

Requires uv (brew install uv). It installs hidapi automatically from the script's inline metadata, so there is no pip install step and no virtualenv to manage.

git clone git@github.com:kapouchima/dp100_skill.git
cd dp100_skill
uv run scripts/dp100.py selftest    # verifies the link, never touches the output

To use it as a Claude Code skill:

ln -s "$PWD" ~/.claude/skills/dp100

Claude then picks it up automatically and follows the safety rules in SKILL.md.

Usage

# Read
uv run scripts/dp100.py status                 # measured V/I/W, setpoint, protections
uv run scripts/dp100.py get                    # active setpoint only
uv run scripts/dp100.py preset list            # all 10 stored presets

# Control  (-v volts, -i current limit in amps)
uv run scripts/dp100.py on -v 3.3 -i 0.5       # set values and enable output
uv run scripts/dp100.py set -v 5               # change level, keep on/off state
uv run scripts/dp100.py off                    # disable, preserving setpoint

# Protection  (--auto-protect derives OVP/OCP from the setpoint)
uv run scripts/dp100.py protect --ovp 3.9 --ocp 0.7
uv run scripts/dp100.py on -v 3.3 -i 0.5 --auto-protect

# Test sequences
uv run scripts/dp100.py monitor -d 10 --interval 0.05 --format csv > trace.csv
uv run scripts/dp100.py monitor -d 5 --summary-only --json
uv run scripts/dp100.py cycle -c 5 --off-time 1 --on-time 3 --end-off
uv run scripts/dp100.py ramp --start 3.3 --stop 2.4 --step 0.05 --dwell 0.5 --end-off

# Safety ceiling, enforced before every write
uv run scripts/dp100.py limits --max-volts 5 --max-amps 1

Use --mv/--ma instead of -v/-i for exact integer millivolts/milliamps, and --dry-run to preview any write. Full option list: --help.

Exit codes: 0 success, 1 device error, 2 bad usage, 3 refused by a safety limit, 4 DP100 not found.

Safety

Important

There are no limits configured by default, and none are baked into the code. Out of the box the only ceiling is the supply's own input-limited maximum. If you point an LLM at this skill without setting a limit first, the model has full control of the output within the hardware's range. Set a ceiling matched to your bench before you let an agent drive it.

# Refuse anything above 5 V / 1 A, for every command, from now on
uv run scripts/dp100.py limits --max-volts 5 --max-amps 1

# Check what is currently in force
uv run scripts/dp100.py limits

# Remove the ceiling again
uv run scripts/dp100.py limits --clear

Once set, the limit is enforced before every write and there is no flag to override it: an over-limit request fails with exit code 3 and the output is never touched. Limits persist in ~/.config/dp100/config.json.

DP100_MAX_VOLTS / DP100_MAX_AMPS can tighten the ceiling for a single shell. When both a stored and an environment limit are present the lower one wins, so an environment variable can never loosen what you have stored:

DP100_MAX_VOLTS=3.6 uv run scripts/dp100.py on -v 3.3 -i 0.5

Pick the limit from what is attached, not from what the supply can do. For a 3.3 V board, --max-volts 3.6 means a stray -v 12 is rejected rather than destroying it.

Why this matters: a factory DP100 ships with its own protection effectively disabled, OVP 30.5 V and OCP 5.05 A on every preset, so a fault can put 30 V into a 3.3 V board. Independently of the ceiling, this tool also refuses a setpoint above the supply's input-limited maximum, refuses an OVP below the setpoint (which would trip instantly), never changes protection implicitly, and reports which stored preset it overwrote when you ask it to.

Gotchas

Protection needs a preset write. The DP100 keeps a volatile setpoint (voltage, current, on/off) separate from 10 persistent presets, which also hold OVP/OCP. The device silently discards OVP/OCP sent with a volatile write, so changing protection means overwriting a preset and activating it. protect and --auto-protect handle this and tell you which preset changed.

Output is capped by the input. The DP100 is a buck converter. A 12.5 V input allows only ~12.16 V out; status shows the current ceiling as max out.

"Output OFF" can still read a voltage. With no load attached, the output capacitor holds its charge. Trust the output field, not the measured voltage.

Troubleshooting

If dp100 list finds nothing, it is almost always USB mode: the DP100's USB-A port must be in USBD (device) mode, toggled by double-tapping the left arrow button. Use a real A-to-A data cable, not charge-only, prefer a direct port over a dock chain, and close any other program holding the device (only one process can talk to it at a time).

How this compares

jjcarrier/vicon is the other good CLI for this supply (MIT, CLI+TUI, JSON) and is worth a look if you don't mind building against the .NET 10 SDK. Most other DP100 projects are browser UIs, unlicensed, or wrap the Windows-only vendor DLL. This project exists to have no runtime beyond Python, and to carry the safety model and agent-facing docs a Claude skill needs.

The protocol is documented in references/PROTOCOL.md, consolidated from those projects and verified against hardware. It corrects two errors in the published sources: the BASIC_SET sub-opcode map, and the fact that volatile writes ignore OVP/OCP.

Verified against ATK-DP100 hardware 1.4 / app 1.4 (built 2025-04-06) on macOS with a 12 V input.

License

MIT, see LICENSE.

About

Alientek DP100 power supply LLM skill

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages