Add CP mode sanity check: validate current limit vs power at min voltage

CP=500W at V=50V needs 10A on the load side — if the supply I_limit
is only 20A and the MPPT has conversion losses, this can cause the
supply to current-limit and timeout. The check now catches this upfront:

  CP check: 500W / 50V = 10.0A (limit 20.0A) OK

Also raises ValueError if the worst-case current exceeds the limit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 16:06:48 +07:00
parent 3f46029204
commit a0795302a9
2 changed files with 40 additions and 3 deletions

View File

@@ -1192,7 +1192,14 @@ class TestbenchGUI(tk.Tk):
# Sanity check
max_v = max(abs(v_start), abs(v_stop))
bench.check_supply_capability(max_v, current_limit)
min_v = min(abs(v_start), abs(v_stop))
max_l = max(abs(l_start), abs(l_stop))
bench.check_supply_capability(
max_v, current_limit,
min_voltage=min_v,
load_mode=load_mode,
max_load_setpoint=max_l,
)
bench.supply.set_current(current_limit)
bench.supply.output_on()