Hello guys, attached is a bash script that I have used to calibrate all 3 outputs of my DP832A in one go. There are other similar scripts around, but one notable diference with my script is that I have used more calibration points and I have given more points to the lower end of the voltages and currents. As a result, when I measure this power supply against my 2450 SMU it gives excellent results with at most 1 mV, 1 mA discrepancy. I haven't tested the other scripts, it might yield the same result, YMMV ...
#!/bin/bash
VPOINTS=(
0.0
0.01
0.03
0.1
0.2
0.7
1.0
1.2
1.7
2.0
2.3
2.7
3.0
3.8
4.2
4.7
5.1
5.3
5.6
6.0
6.5
7.0
8.0
8.4
9.0
10.0
11.0
12.0
13.0
14.0
15.0
16.0
17.0
18.0
19.0
20.0
21.0
22.0
23.0
24.0
25.0
26.0
27.0
28.0
29.0
30.0
31.0
32.0
)
CPOINTS=(
0.0
0.001
0.002
0.005
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
1.2
1.5
1.7
2.0
2.2
2.5
2.7
3.0
3.2
)
get_device_ip ()
{
local DEVICE="$1"
local IPADDR=`lxi discover | grep "$DEVICE" | grep -oe '[0-9\.]*$'`
echo $IPADDR
}
get_dmm_ip ()
{
get_device_ip DM3068
}
get_ps_ip ()
{
get_device_ip DP832A
}
DMM_IP=`get_dmm_ip`
PS_IP=`get_ps_ip`
write_ps_cmd ()
{
local CMD="$1"
lxi scpi -a $PS_IP "$CMD"
}
write_dmm_cmd ()
{
local CMD="$1"
lxi scpi -t 10 -a $DMM_IP "$CMD"
}
read_dmm_vdc ()
{
V_SCPI=`write_dmm_cmd ":meas:volt:dc?"`
printf "%f\n" $V_SCPI
}
read_dmm_cdc ()
{
write_dmm_cmd ":meas:curr:dc max"
V_SCPI=`write_dmm_cmd ":meas:curr:dc?"`
printf "%f\n" $V_SCPI
}
read_ref ()
{
local POINT="$1"
if [ "$MODE" = "V" ]; then
REF=${VPOINTS[$POINT]}
elif [ "$MODE" = "C" ]; then
REF=${CPOINTS[$POINT]}
else
REF="somejunk"
fi
echo $REF
}
read_value ()
{
if [ "$MODE" = "V" ]; then
VALUE=`read_dmm_vdc`
elif [ "$MODE" = "C" ]; then
VALUE=`read_dmm_cdc`
else
VALUE="somejunk"
fi
echo $VALUE
}
calibration_loop ()
{
echo "CH = $CH, MODE = $MODE, DEV = $DEV"
write_ps_cmd ":output $CH,on"
for (( POINT = 0; POINT < $NUMPOINTS; POINT++ )); do
local REF=`read_ref $POINT`
echo "POINT = $POINT, REF = $REF"
write_ps_cmd ":calibration:set $CH,$MODE,$POINT,$REF,$DEV"
sleep 2
local VALUE=`read_value`
echo "VALUE = $VALUE"
write_ps_cmd ":calibration:meas $CH,$MODE,$POINT,$VALUE,$DEV"
done
write_ps_cmd ":output $CH,off"
}
calibrate_ch ()
{
echo "Multimeter IP Address = $DMM_IP"
echo "Power Supply IP address = $PS_IP"
local CH="$1"
local NUMV="$2"
local NUMC="$3"
write_ps_cmd ":calibration:start 11111,$CH"
write_ps_cmd ":calibration:clear $CH,all"
local MODE="V"
local NUMPOINTS=$NUMV
local DEV="1"
calibration_loop
local DEV="0"
calibration_loop
echo "SWITCH DMM to Current Measurement, press enter to continue ..."
read
MODE="C"
local NUMPOINTS=$NUMC
local DEV="1"
calibration_loop
local DEV="0"
calibration_loop
write_ps_cmd ":calibration:end `date +%d/%m/%Y`,$CH"
}
# put device into a known state
write_ps_cmd ":*RST"
calibrate_ch CH1 48 32
echo "SWITCH power supply output, press enter to continue ..."
read
calibrate_ch CH2 48 32
echo "SWITCH power supply output, press enter to continue ..."
read
calibrate_ch CH3 18 32