Drive a battery simulator by state of charge, capacity and open-circuit voltage
Present a programmable battery to your DUT: set capacity, open-circuit voltage and
state of charge, then watch how firmware behaves as the pack drains.
Static holds the state of charge where you set it. Dynamic lets it evolve with
the load current, which is what you want when testing a real discharge curve.
Call this first, before any other battery method, on an instrument that also
serves a power-supply net. A Keithley 2281S is a supply until told otherwise, and
the battery setters have nothing to act on until it is switched over.
set_voc() is a request, not an assignment. The instrument derives terminal
voltage from the loaded model and the state of charge. On a Keithley 2281S with the
LI_ION4_2 model, setting SOC to 50 moved voc to about 4.007 V regardless of an
earlier set_voc(3.7). Read state() to learn what the pack actually presents.
A battery net and a power-supply net can share one physical instrument. Switching
to battery mode changes what that instrument is for both, and the box serializes
them under a single per-instrument lock.
state() returning Ok does not mean the instrument answered — check error,
which is populated when the gather itself failed.
esr is the model’s equivalent series resistance, which is what makes terminal
voltage sag under load rather than tracking open-circuit voltage exactly.