Parameters
Channel API
These functions are available for all channel types. Some channel types may have additional functions available, these are documented in the following sections.
chX.info()
Provide a description of the channel type.
chX.ask(topic)
Read the current value of a topic from the device.
chX.echo(topic, dt=0.001)
Continuously read and print the value of a topic from the device every dt
seconds.
Throw an interrupt using Ctrl+C
to stop.
chX.dump()
Print all available topics for a given channel and their current values. Please consult the topics section for a more detailed description of available topics.
For example:
import ardi # import the ardi library
psu = ardi.autoconnect() # connect to the first device found
ch1 = psu.channels['ch1'] # bind the first channel to the variable ch1
ch1.info() # print a description of ch1
ch1.dump() # print all available topics for ch1
ch1.ask('v_mon') # read the voltage monitor of ch1
Topics
NOTE: This information is included as a reference. Reading these values via ask
or echo
is always safe. However, please do not attempt to modify these values, as doing so can cause permanent damage to the power supply and any connected hardware.
System
topic | type | units | description |
---|---|---|---|
firmware | str | – | firmware version |
hardware | str | – | hardware version |
cpu_temp | f32 | °C | CPU temperature |
n_channels | u8 | – | number of channels |
n_callbacks | u8 | – | number of active callbacks |
state | u8 | – | state machine state |
uptime | u32 | ms | system uptime in ms (resets every ~49.7 days) |
cause_of_panic | str | – | description of what caused the panic state |
System State
The system state is a single byte that encodes the current state of the power supply. The state is encoded as follows:
value | state | description |
---|---|---|
0 | STANDBY | high voltage is off |
1 | AUTOCAL | calibrating controller to connected loads |
2 | ARMED | high voltage is on, waiting on a trigger |
3 | ACTIVE | high voltage is on, outputs are active |
4 | PANIC | high voltage is off, problem detected |
HV Rail
topic | type | units | description |
---|---|---|---|
v_mon | i16 | V | rail voltage (from psu monitor) |
i_mon | i16 | μA | rail current (from psu monitor) |
Unipolar Channels
topic | type | units | description |
---|---|---|---|
state | u8 | – | state machine state |
pattern_dt | u32 | μs | voltage pattern update rate |
control_dt | u32 | μs | controller update rate |
v_pattern | u16 | V | programmed voltage pattern |
v_ref | u16 | V | instantaneous setpoint voltage |
v_mon | u16 | V | instantaneous measured voltage |
v_rail | u16 | V | instantaneous rail voltage |
v_err | u16 | V | voltage error |
kp | f32 | – | controller proportional gain |
ki | f32 | – | controller integral gain |
kd | f32 | – | controller derivative gain |
kf | f32 | – | controller filter gain |
u_max | u8 | – | charge PWM duty cycle limit |
u_min | u8 | – | drain PWM duty cycle limit |
e_min | u16 | – | error threshold for hold state |
p_out | u8 | – | controller output magnitude |
p_chg | u8 | – | charge PWM duty cycle |
p_drn | u8 | – | drain PWM duty cycle |
v_idle | u16 | V | idle voltage threshold |
p_idle | u8 | – | idle state drain duty cycle |
p_cal | u8 | – | calibration PWM duty cycle |
v_cal | u16 | V | calibration voltage target |
t_cal | u32 | μs | calibration time |
hasel_ok | bool | – | short detection flag |
badness | u32 | – | short detection counter |
v_bad | u16 | V | short detection voltage threshold |
max_badness | u32 | – | short detection threshold |
Bipolar Channels
topic | type | units | description |
---|---|---|---|
state | u8 | – | state machine state |
pattern_dt | u32 | μs | voltage pattern update rate |
control_dt | u32 | μs | controller update rate |
v_pattern | u16 | V | programmed voltage pattern |
v_ref | u16 | V | instantaneous setpoint voltage |
v_mon_a | u16 | V | channel A measured voltage |
v_mon_b | u16 | V | channel B measured voltage |
v_mon | u16 | V | differential measured voltage |
v_rail | u16 | V | measured rail voltage |
v_err | u16 | V | voltage error |
kp | f32 | – | controller proportional gain |
ki | f32 | – | controller integral gain |
kd | f32 | – | controller derivative gain |
kf | f32 | – | controller filter gain |
u_max | u8 | – | charge PWM duty cycle limit |
u_min | u8 | – | drain PWM duty cycle limit |
e_min | u16 | – | error threshold for hold state |
gnd_A | u8 | – | channel A ground PWM duty cycle |
gnd_B | u8 | – | channel B ground PWM duty cycle |
p_out | u8 | – | controller output magnitude |
p_chg_a | u8 | – | channel A charge PWM duty cycle |
p_drn_a | u8 | – | channel A drain PWM duty cycle |
p_chg_b | u8 | – | channel B charge PWM duty cycle |
p_drn_b | u8 | – | channel B drain PWM duty cycle |
p_gnd | u8 | – | grounding PWM duty cycle |
v_idle | u16 | V | idle voltage threshold |
p_idle | u8 | – | idle state drain duty cycle |
p_cal | u8 | – | calibration PWM duty cycle |
v_cal | u16 | V | calibration voltage target |
t_cal | u32 | μs | calibration time |
hasel_ok | bool | – | short detection flag |
badness | u32 | – | short detection counter |
v_bad | u16 | V | short detection voltage threshold |
max_badness | u32 | – | short detection threshold |