A more intelligent approach to dcpwr.set_range()

44 views
Skip to first unread message

Alson van der Meulen

unread,
Aug 3, 2017, 3:41:49 PM8/3/17
to pytho...@googlegroups.com
Hi,

I am currently working on supporting a Keithley 237 SMU based on
Hermann's work. The SMU supports any combination of the voltage ranges
of 1.1/11/110/1100 V and the current ranges for every order of magnitude
from 1 nA to 100 mA (except that 1100V / 100 mA does not exist). Say I
want to source 10 V at 1 uA:
k236.outputs[0].configure_range('voltage', 10)
k236.outputs[0].configure_range('current', 1e-6)

Currently dcpwr._configure_output_range() calls dcpwr.get_range() (which
would fail anyway, but that is a minor bug), which for the first
invocation will pick the lowest range that includes 10 V regardless of
the current setting (e.g. 11V / 1 nA range). The second
configure_range() invocation will again call get_range(), but this time
it will search for the lowest current range that includes 1 uA, for
example 1.1 V / 1 uA (or 1100 V / 1 uA). Trying to source 10 V will now
produce an error, or a less accurate value when sourcing 10 V on the
1000 V range.

This is what the IviDCPwr spec says about ConfigureRange:
"Setting a voltage range can invalidate a previously configured current
range. Setting a current range can
invalidate a previously configured voltage range."

By my interpretation, that means that:
k236.outputs[0].configure_range('voltage', 1000)
k236.outputs[0].configure_range('current, 0.1)

Might set the range to 110 V / 0.1 A because there is no range that
includes both 1000 V and 0.1 A. But does not force us to mess up ranges
unnecessarily. My suggestion is that we try to respect the previous
setting of the other quantity, i.e. configure_range('current') tries to
respect the last configure_range('voltage') call. If this is not
possible, configure_range('current') will pick the range with the
highest voltage that includes the request current value (and visa versa
for voltage).

My proposed implementation is to add _output_current_last_range_value
and _output_voltage_last_range_value attributes to dcpwr.
_configure_output_range() will store the values there, and pass the
value that is not being modified to get_range.

Since it does not seem like there is any implementation that is
currently using multiple range, and that it is currently broken in
ivi.dcpwr, the impact on other parts of the code should be minimal.

Any thoughts?

Alson
Reply all
Reply to author
Forward
0 new messages