Commit d233eb9d authored by Daniel Friesel's avatar Daniel Friesel
Browse files

add --voltage-only, --current-only. Up to 24 Hz sample rate now!

parent 3b9c08c0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ through voltage/current slopes for automated I-V curve measurements.
It has been successfully used with "RND 320-KA3005P" (single-channel) and "RND
320-KA3305P" (dual-channel) supplies. Observed attributes:

* Time resolution: **a few Hz**
* Time resolution: 10 .. 24 Hz
* Voltage range: 0 .. 30 V
* Voltage resolution: 10 mV
* Current range: 0 .. 5 A
+23 −3
Original line number Diff line number Diff line
@@ -253,6 +253,8 @@ def measure_data(
    voltage_range=(None, None, None),
    current_range=(None, None, None),
    on_off=False,
    log_voltage=True,
    log_current=True,
):
    global terminate_measurement

@@ -311,8 +313,14 @@ def measure_data(
    print("# Timestamp Voltage Current", file=output_handle)
    while not terminate_measurement:
        ts = time.time()
        if log_current:
            current = korad.get_current()
        else:
            current = None
        if log_voltage:
            voltage = korad.get_voltage()
        else:
            voltage = None
        if voltage is not None and current is not None:
            print(f"{ts:.3f} {voltage:5.2f} {current:5.3f}", file=output_handle)
        elif voltage is not None:
@@ -527,6 +535,11 @@ def main():
        metavar="START STOP STEP",
        help="Vary voltage limit from START to STOP over the course of the measurement. Adjust by STEP V per second.",
    )
    parser.add_argument(
        "--voltage-only",
        action="store_true",
        help="Log voltage only (ignore current readings). Useful to increase sample rate for CC measurements.",
    )
    parser.add_argument(
        "--current-limit",
        type=float,
@@ -538,6 +551,11 @@ def main():
        metavar="START STOP STEP",
        help="Vary current limit from START to STOP over the course of the measurement. Adjust by STEP A per second.",
    )
    parser.add_argument(
        "--current-only",
        action="store_true",
        help="Log current only (ignore current readings). Useful to increase sample rate for CV measurements.",
    )
    parser.add_argument(
        "--on-off",
        action="store_true",
@@ -600,6 +618,8 @@ def main():
            voltage_range=voltage_range,
            current_range=current_range,
            on_off=args.on_off,
            log_voltage=not args.current_only,
            log_current=not args.voltage_only,
        )

    data = parse_data(log_data, skip=args.skip, limit=args.limit)