From 657ff278455c75d7ad712682f66900184e6a9430 Mon Sep 17 00:00:00 2001 From: grabowski Date: Thu, 12 Mar 2026 19:46:38 +0700 Subject: [PATCH] Rename CLI entry points from mppt/mppt-gui to bench/bench-gui Co-Authored-By: Claude Opus 4.6 --- README.md | 56 +++++++++++++++++++++++++------------------------- pyproject.toml | 4 ++-- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 549ffe5..674eb7c 100644 --- a/README.md +++ b/README.md @@ -47,16 +47,16 @@ uv sync ```bash # Check all bench instruments respond -uv run mppt identify +uv run bench identify # Check STM32 responds (reads params + telemetry) -uv run mppt stm32-read --stm32-port COM28 +uv run bench stm32-read --stm32-port COM28 ``` ### 2. Configure instruments for MPPT testing ```bash -uv run mppt setup +uv run bench setup ``` This sets wiring mode (1P2W), DC coupling, auto-ranging, efficiency formula (EFF1 = P6/P5), and display layout on the HIOKI. @@ -65,16 +65,16 @@ This sets wiring mode (1P2W), DC coupling, auto-ranging, efficiency formula (EFF ```bash # Single reading from all instruments -uv run mppt measure +uv run bench measure # Continuous text monitoring with CSV export -uv run mppt monitor --interval 1.0 --output data.csv +uv run bench monitor --interval 1.0 --output data.csv ``` ### 4. Launch the GUI ```bash -uv run mppt-gui +uv run bench-gui ``` The GUI provides: @@ -92,7 +92,7 @@ The GUI provides: #### Voltage sweep (1D) ```bash -uv run mppt sweep \ +uv run bench sweep \ --v-start 30 --v-stop 100 --v-step 5 \ --current-limit 20 \ --load-mode CP --load-value 200 \ @@ -102,7 +102,7 @@ uv run mppt sweep \ #### Load sweep at fixed voltage (1D) ```bash -uv run mppt sweep-load \ +uv run bench sweep-load \ --voltage 60 --current-limit 20 \ --i-start 0.5 --i-stop 15 --i-step 0.5 \ --settle 2.0 -o load_sweep.csv @@ -112,14 +112,14 @@ uv run mppt sweep-load \ ```bash # Constant Power mode -uv run mppt sweep-vi \ +uv run bench sweep-vi \ --v-start 60 --v-stop 100 --v-step 5 \ --l-start 50 --l-stop 500 --l-step 50 \ --load-mode CP --current-limit 20 \ --settle 2.0 -o map_cp.csv # Constant Current mode -uv run mppt sweep-vi \ +uv run bench sweep-vi \ --v-start 35 --v-stop 100 --v-step 5 \ --l-start 0.5 --l-stop 15 --l-step 0.5 \ --load-mode CC --current-limit 20 \ @@ -130,10 +130,10 @@ uv run mppt sweep-vi \ ```bash # Generate efficiency overlay, heatmap, and power loss plots (no instruments needed) -uv run mppt plot-sweep map_cp.csv +uv run bench plot-sweep map_cp.csv # Save plots without displaying -uv run mppt plot-sweep map_cp.csv --no-show -o plots/ +uv run bench plot-sweep map_cp.csv --no-show -o plots/ ``` Produces three PNG files: @@ -148,13 +148,13 @@ The tuning commands combine the testbench instruments (ground truth efficiency f #### Read current STM32 state ```bash -uv run mppt stm32-read +uv run bench stm32-read ``` #### Write a single parameter ```bash -uv run mppt stm32-write --param dt_10_20A --value 20 +uv run bench stm32-write --param dt_10_20A --value 20 ``` #### Sweep a parameter to find the optimum @@ -163,14 +163,14 @@ Sweeps a parameter from start to stop, measuring HIOKI efficiency + STM32 teleme ```bash # Optimize deadtime for the 10-20A bracket at 300W -uv run mppt tune-param \ +uv run bench tune-param \ --param dt_10_20A --start 14 --stop 40 --step 1 \ --voltage 60 --current-limit 20 \ --load-mode CP --load-value 300 \ --settle 3.0 -o dt_tune.csv # Tune Vfly proportional gain -uv run mppt tune-param \ +uv run bench tune-param \ --param vfly_kp --start -2 --stop 2 --step 0.1 \ --voltage 60 --current-limit 20 \ --load-mode CP --load-value 200 \ @@ -183,13 +183,13 @@ Automatically sweeps deadtime for each of the 6 current brackets (0-3A, 3-5A, 5- ```bash # Sweep and report best values -uv run mppt tune-deadtime \ +uv run bench tune-deadtime \ --voltage 60 --current-limit 20 --load-mode CP \ --dt-start 14 --dt-stop 50 --dt-step 1 \ -o deadtime_results.csv # Sweep, report, and apply best values to STM32 -uv run mppt tune-deadtime \ +uv run bench tune-deadtime \ --voltage 60 --current-limit 20 --load-mode CP \ --load-values 20,50,100,250,400,600 \ --apply @@ -200,7 +200,7 @@ uv run mppt tune-deadtime \ Simulate cloud passing or partial shading with a CSV-driven sequence: ```bash -uv run mppt shade-profile \ +uv run bench shade-profile \ --profile samples/cloud_pass.csv \ --settle 2.0 -o shade_results.csv ``` @@ -222,23 +222,23 @@ Keybindings: `p` ping, `r` read params, `f` toggle EMA filter, `l` show log path ```bash # Supply -uv run mppt supply set --voltage 48 --current 10 -uv run mppt supply on -uv run mppt supply off +uv run bench supply set --voltage 48 --current 10 +uv run bench supply on +uv run bench supply off # Load -uv run mppt load set --mode CP --value 200 -uv run mppt load on -uv run mppt load off +uv run bench load set --mode CP --value 200 +uv run bench load on +uv run bench load off # Emergency shutdown (load first, then supply) -uv run mppt safe-off +uv run bench safe-off ``` ## CLI Reference ``` -uv run mppt [-h] [--supply-address ADDR] [--load-port PORT] [--load-baud BAUD] +uv run bench [-h] [--supply-address ADDR] [--load-port PORT] [--load-baud BAUD] [--meter-address ADDR] [--timeout MS] [--stm32-port PORT] [--stm32-baud BAUD] {command} @@ -337,7 +337,7 @@ mppt-testbench/ | +-- debug_console/ Textual TUI for live debugging | +-- pyproject.toml uv-compatible package config +-- samples/ shade profile CSV examples -+-- pyproject.toml package config, entry points: mppt, mppt-gui ++-- pyproject.toml package config, entry points: bench, bench-gui ``` ## Dependencies diff --git a/pyproject.toml b/pyproject.toml index 315bcfe..4ba854e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,5 +24,5 @@ packages = ["testbench"] "HIOKI-3193-10/hioki3193" = "hioki3193" [project.scripts] -mppt = "testbench.cli:main" -mppt-gui = "testbench.gui:main" +bench = "testbench.cli:main" +bench-gui = "testbench.gui:main"