Source code for device_client.client_paschen_powersupply
from device_client import DeviceClient
from device.power_supply_ki2290 import PowerSupply_KI2290
description = """
High voltage power supply 5kV
To control the power supply manually, use **Voltage ON for** command. Device is
also capable of automatic linear voltage sweeps, see the **Sweep** command.
Either of these tasks can be stopped anytime using the **Stop** button. Refer
to values section for a ~real-time feedback.
The **Sweep** command can be useful when trying to determine the breakdown
voltage. Start at a low enough voltage and sweep up. If breakdown occurred,
there should be a current spike in the measured V-A characteristics near the
breakdown voltage. Try using smaller voltage ranges to improve precision.
*Make sure that the output switch (bottom left on the device panel) is in the
middle position. Otherwise an "operation interrupted" error will be thrown.*
#### Voltage ON for
Manually start voltage output for a limited time duration.
- *voltage* = value in volts, between 0 and 5000.
- *duration* = time in seconds, max 60s.
#### Sweep
Start a voltage sweep. Voltage output is turned on and the voltage value is
incrementally increased/decreased. After each step, the device waits for a fixed
amount of time (0.5s) so that the output has chance to stabilize. When finished,
datafile with measured voltage and current values (V-A characteristics) is
returned.
- *start* = first voltage value in volts, between 0 and 5000.
- *stop* = last voltage value in volts, between 0 and 5000.
- *steps* = number of steps, positive integer, max 100.
"""
[docs]
def connect(name, password, server):
client = DeviceClient(name, password,
title="Power supply KI2290", description=description)
hw = PowerSupply_KI2290(log_callback=client.emit_log)
# client.register_command(hw.set_voltage, "Set voltage", inputs=[{"unit": "V"}])
def output_voltage(voltage, duration):
hw.set_voltage(voltage)
hw.output_on_for(duration)
client.register_command(output_voltage, "Voltage ON for", inputs=[
{"unit": "V"}, {"unit": "s"}
])
def sweep(dc, start, stop, steps):
hw.sweep(dc, start, stop, steps, stabilize=1.0)
client.register_command(sweep, "Sweep", pass_self=True, inputs=[
{"unit": "V"}, {"unit": "V"}, {"unit": "#"}
])
client.register_command(hw.stop, "Stop")
client.register_command(hw.output_off, "Voltage OFF")
client.register_background_task(hw.update_frontend)
client.keep_server_updated(
hw.is_ready, 0.5, server, retry_on_error=True
)