DP821A calibration - Page 1
Forum section: electronics / testgear

author: taydin
author_rank: Frequent Contributor
timestamp: December 22, 2019, 07:48:03 pm
content: My DP821A stopped working exactly one week after the warranty has expired (now that's what I call a smart power supply) It was getting stuck during boot, with a completely black screen.I investigated it and the problem came out to be the main ARM controller had a BGA issue. While trying to desolder the BGA, I overheated the board and once the ARM was off the board, there were multiple traces damaged. So, I ordered a replacement digital board and installed it. The boot problem went away, but the power supply was completely out of calibration. I adjust the voltage to 8V, what comes out is 8.26V. Current measurement was also off by several hundred milliamps. I could have sent the unit back for calibration, but that would have taken a very long time (there are no places that can do that here, it would have to go to Germany and come back, with huge shipping expensese).

author: taydin
author_rank: Frequent Contributor
timestamp: December 22, 2019, 07:53:05 pm
content: So I researched DP800 calibration on the net. Rigol has a document that explains DP800 calibration, but it is based on the GUI of the unit, and it is EXTREMELY BUGGY and very hard to use. There are dozens calibration values to be entered and it would take foverer to get it done using the GUI. And there wouldn't be any guarantee that everything was entered correctly.So I continued researching and came across a fellow EEVBlog member that has a calibration script for the DP832, using the SCPI protocol. This was very helpful for me. But there was one issue. The SCPI calibration document stated that it is important to do the calibration at specific, fixed voltages and currents. The script contained the values for the DP832, but I didn't know what those voltages and currents are for the DP821A. I tried to look them up for the GUI of the unit, but it is completely hopeless. It had a table that went up to 32V for the 8V output and to 8V for the 60V outputThe current table was also completely off in terms of the outputs capabilities.

author: taydin
author_rank: Frequent Contributor
timestamp: December 22, 2019, 07:58:09 pm
content: So I continued research. Somebody had posted a program that can descrampe the firmware of the DP800 power supplies. I did that for the version that is installed on this card, and I tried to find a SCPI command that will give me the table of the calibration voltages and currents (the card has version 1.16). I couldn't find any such command.But I found evidence that suggests that there is a 80 entry table for both current and voltage calibration constants. It seemed like the firmware maintain a table for arbitrary voltage/current reference values and their corresponding REAL values. And when a measurement is made (ADC) or when something is generated (DAC), it does some kind of lookup from this table to figure out what to use.So I went with this theory and came up with a completely arbitrary list of calibration values, for both voltage and current. Here are those tables. One is for the voltage, starting from 0.01V and going up to 69V. The current table starts from 0.001A and goes up to 10.49ACode:VPOINTS=(0.00.010.030.10.20.71.01.21.72.02.32.73.03.84.24.75.15.35.66.06.57.08.08.49.010.011.012.013.014.015.016.017.018.019.020.021.022.023.024.025.026.027.028.029.030.031.032.033.034.035.036.037.038.039.040.041.042.043.044.045.046.047.048.049.050.051.052.053.054.055.056.057.058.059.060.061.062.063.064.065.066.067.068.069.0)CPOINTS=(0.00.0010.0020.0050.010.020.030.040.050.060.070.080.090.10.20.30.40.50.60.70.80.91.01.051.21.51.72.02.22.53.04.05.06.07.08.09.010.010.49)

author: taydin
author_rank: Frequent Contributor
timestamp: December 22, 2019, 07:59:32 pm
content: I also prepared the following bash script to implement the calibration process for both 60V/1A output and the 8V/10A output.Code:#!/bin/bashVPOINTS=(0.00.010.030.10.20.71.01.21.72.02.32.73.03.84.24.75.15.35.66.06.57.08.08.49.010.011.012.013.014.015.016.017.018.019.020.021.022.023.024.025.026.027.028.029.030.031.032.033.034.035.036.037.038.039.040.041.042.043.044.045.046.047.048.049.050.051.052.053.054.055.056.057.058.059.060.061.062.063.064.065.066.067.068.069.0)CPOINTS=(0.00.0010.0020.0050.010.020.030.040.050.060.070.080.090.10.20.30.40.50.60.70.80.91.01.051.21.51.72.02.22.53.04.05.06.07.08.09.010.010.49)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 DP821A}DMM_IP=10.2.1.150PS_IP=10.2.1.152write_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" ]; thenREF=${VPOINTS[$POINT]}elif [ "$MODE" = "C" ]; thenREF=${CPOINTS[$POINT]}elseREF="somejunk"fiecho $REF}read_value (){if [ "$MODE" = "V" ]; thenVALUE=`read_dmm_vdc`elif [ "$MODE" = "C" ]; thenVALUE=`read_dmm_cdc`elseVALUE="somejunk"fiecho $VALUE}ps_set_sense (){if [ "$SENSE" = "on" ]; thenwrite_ps_cmd ":output:sense $CH,on"elif [ "$SENSE" = "off" ]; thenwrite_ps_cmd ":output:sense $CH,off"fi}calibration_loop (){echo "CH = $CH, MODE = $MODE, DEV = $DEV, SENSE = $SENSE"ps_set_sensewrite_ps_cmd ":output $CH,on"for (( POINT = 0; POINT < $NUMPOINTS; POINT++ )); dolocal REF=`read_ref $POINT`echo "POINT = $POINT, REF = $REF"write_ps_cmd ":calibration:set $CH,$MODE,$POINT,$REF,$DEV"sleep 2local VALUE=`read_value`echo "VALUE = $VALUE"write_ps_cmd ":calibration:meas $CH,$MODE,$POINT,$VALUE,$DEV"donewrite_ps_cmd ":output $CH,off"}calibrate_ch1 (){local CH="CH1"write_ps_cmd ":calibration:start 11111,$CH"if [ -n "$VOLTAGE" ]; thenlocal MODE="V"write_ps_cmd ":calibration:clear $CH,$MODE"local SENSE="none"local NUMPOINTS=79local DEV="1"calibration_looplocal DEV="0"calibration_loopfiecho "SWITCH DMM to Current Measurement, press enter to continue ..."readif [ -n "$CURRENT" ]; thenMODE="C"write_ps_cmd ":calibration:clear $CH,$MODE"local SENSE="none"local NUMPOINTS=24local DEV="1"calibration_looplocal DEV="0"calibration_loopfiwrite_ps_cmd ":calibration:end `date +%d/%m/%Y`,$CH"}calibrate_ch2 (){local CH="CH2"write_ps_cmd ":calibration:start 11111,$CH"if [ -n "$VOLTAGE" ]; thenlocal MODE="V"write_ps_cmd ":calibration:clear $CH,$MODE"local SENSE="off"local NUMPOINTS=24local DEV="1"calibration_looplocal DEV="0"calibration_loopfiecho "SWITCH DMM to Current Measurement, press enter to continue ..."readif [ -n "$CURRENT" ]; thenMODE="C"write_ps_cmd ":calibration:clear $CH,$MODE"local SENSE="on"local NUMPOINTS=39local DEV="1"calibration_looplocal DEV="0"calibration_loopfiwrite_ps_cmd ":calibration:end `date +%d/%m/%Y`,$CH"}# put device into a known statewrite_ps_cmd ":*RST"VOLTAGE=1CURRENT=1calibrate_ch1echo "SWITCH power supply output, press enter to continue ..."readcalibrate_ch2

author: taydin
author_rank: Frequent Contributor
timestamp: December 22, 2019, 08:01:40 pm
content: Once this calibration process completed, I verified both outputs and both the generated voltage and the voltage that the DP821A reads back and displays are spot on to within a millivolt and a milliampSo hopefully this will help somebody to do the same calibration.

author: taydin
author_rank: Frequent Contributor
timestamp: December 22, 2019, 08:03:33 pm
content: But there is one thing that I wasn't able to calibrate, and that's the SENSE support in the 8V/10A output. There is no documentation on how to do that, and when I tried doing that using the GUI, it's completely hopeless. And I don't know of any SCPI command that would be related to this. If anybody knows how to calibrate the SENSE support, please let me know and I can verify that the procedure works.

author: Gandalf_Sr
author_rank: Super Contributor
timestamp: December 23, 2019, 11:10:10 am
content: I think it's possible to adapt your script to a DP832A. Please can you give more details on what software you used to run the script and how you measured the voltages. Perhaps a view of what the GUI looks like as you run the script?Looking at your script, I think it may run in a Windows Powershell (Command prompt) window? You say there's a user that's already done this for a DP832/A, please can you provide a link? I think the thread isherebut my question is how to get set up with the PC so that I can run your script. I think it should be possible to modify so that the value is set and then my Keysight 34461A is made to read the value but how to set up the current? Is that done using current limit?

author: tv84
author_rank: Super Contributor
timestamp: December 23, 2019, 11:25:34 am
content: Quote from: taydin on December 22, 2019, 08:03:33 pmThese are the commands related to Calibration:013E - SET SET :CALibration:SET013F - MEAS MEAS :CALibration:MEAS0140 - STORe STOR :CALibration:STORe0141 - CLEar CLE :CALibration:CLEar0142 - STARt STAR :CALibration:STARt0143 - END END :CALibration:END0144 - SENSE SENSE :CALibration:SENSE

author: genghisnico13
author_rank: Regular Contributor
timestamp: December 23, 2019, 11:28:04 am
content: Quote from: Gandalf_Sr on December 23, 2019, 11:10:10 amit's a Bash script, the Linux "[much better] equivalent" of Powershell (don't kill me for even comparing them).Now with the Linux subsystem on Windows 10 you should be able to run it without problems, I can't help you with the how since I haven't used Windows in a couple of years.

author: TurboTom
author_rank: Super Contributor
timestamp: December 23, 2019, 12:15:30 pm
content: Quote from: taydin on December 22, 2019, 08:03:33 pmI don't think that a separate calibration of the sense function is necessary at all. The sense input is hardware-wise basically the same as the feedback input that's used during "normal" (i.e. not using the sense terminals) operation. Since the calibration takes place without any (considerable) output current flowing, there isn't any difference between the situation during the calibration and a possible later operation using the sense lines that eliminates the voltage drop across the power connection lines.Cheers,Thomas

author: Gandalf_Sr
author_rank: Super Contributor
timestamp: December 23, 2019, 12:18:16 pm
content: Quote from: genghisnico13 on December 23, 2019, 11:28:04 amThanks. I do have a small laptop (pathetic Atom processor) that runs Ubuntu; what would be useful is step-by-step instructions on how to run the script on that laptop.

author: Gandalf_Sr
author_rank: Super Contributor
timestamp: December 23, 2019, 01:19:06 pm
content: Quote from: genghisnico13 on December 23, 2019, 11:28:04 amI've just researched installing the Linux subsystem on Windows 10, it looks pretty straightforward. I've also been reading up on creating and running bash scripts, that looks pretty easy too. I'll play with it over the holiday and report back.

author: taydin
author_rank: Frequent Contributor
timestamp: December 23, 2019, 03:40:37 pm
content: Quote from: Gandalf_Sr on December 23, 2019, 11:10:10 amMy setup was a DP821A and a DM3068 on the same LAN. I have usedhttps://lxi-tools.github.io/to send and receive SCPI messages. I haven't used powershell, so I'm not sure how compatible it is. But I'm suspecting it might only be targeting SH compatibility. This script requires BASH shell, as it uses a few things that are bash specific.Basically, I use :CALI:SET to let the DP821A output a certain voltage/current, and then I read the measured voltage/current from the DM3068, and then I use CALI:MEAS to give this measured value to the DP821A.The thread I read (and which provided the firmware descrambler) is here:https://www.eevblog.com/forum/testgear/need-help-hacking-dp832-for-multicolour-option/

author: taydin
author_rank: Frequent Contributor
timestamp: December 23, 2019, 03:42:27 pm
content: Quote from: tv84 on December 23, 2019, 11:25:34 amThanks a lot for this. Good starting point to experiment with the sense. The only ones that I don't know about are the STORE and the SENSE.

author: taydin
author_rank: Frequent Contributor
timestamp: December 23, 2019, 03:46:09 pm
content: Quote from: TurboTom on December 23, 2019, 12:15:30 pmWhen I read the Rigol "official" calibration document (which explains how to use the GUI to do the calibration), it says that to calibrate CH2, just short the SENSE lines to the OUTPUT lines. Just like you say, that should take care of both the SENSE case and NOSENSE case. I did this during calibration, but it didn't work as expected.Basically when calibrated this way, CH2 works fine WITH SENSE ONLY. Without the sense wires, the calibration is quite a bit off. But I will try again.

author: taydin
author_rank: Frequent Contributor
timestamp: December 23, 2019, 03:49:09 pm
content: In the GUI, there are two additional calibration menus that are not mentioned in the documentation. One is ADC Cal, and the other is Sense Cal.I have run ADC cal, and it just waits for a while and then fails (the unit is working, so I'm assuming this is a software bug).I have run SEnse cal, and there is only one test point, which outputs 8.4V. It isn't certain how this test is intended to run.

author: taydin
author_rank: Frequent Contributor
timestamp: December 23, 2019, 04:11:27 pm
content: I tested the sense functionality again.DP821A is set to 8V, 10A limit. Sense is OFF and no cable is plugged into sense terminals.DL3021 is set to draw 9A. Sense is OFF and no cable is plugged into sense terminals.I turn on DP821A output and it outputs 8V. load draws 9A and the load sees 7.67V. Everything normal so far.Here is the odd thing. Even though sense is OFF for both power supply and load, once I plug in sense wire to DP821 sense terminals and bring it over to the load output terminals, the voltage that the load sees changes! It increases to 7.82V. And when I enable sense on the DP821A, it absolutely has no effect at all! nothing is changed.

author: RoGeorge
author_rank: Super Contributor
timestamp: October 11, 2021, 01:32:26 am
content: Quote from: taydin on December 22, 2019, 08:01:40 pmVery helpful calibration script, thank you!It helped my understand the SCPI calibration syntax and procedure. I didn't had any bench DMM with SCPI, but I have a mtx3283 that can be read remote by modbus, so I made a Linux executable to return the measured value from the handheld DMM (max display 100_000), then modified a little the script to read from the mtx3283 and calibrated my Rigol DP832A power source (3 chanels, 2 x 32V/3.2A and 1 x 5.3V/3.2A).From my manual tests and findings:- it looks like there are 80 labels shown in the calibration GUI, but I was able to set more than 80 calibration points (I've tried 85), and apparently it allows in manual mode to go to the row 85 and put a value manually, from the calibration GUI of DP832A.- in the automated calibration I've used all the 80 points with a logarithmic distribution table of valuesCH1 and CH2 voltage calibration points (0.000 ... 32.000V)Code:VPOINTS=(0.0000.0010.0020.0030.0040.0050.0060.0070.0080.0090.0100.0110.0120.0130.0140.0150.0160.0170.0190.0210.0240.0270.0310.0350.0390.0440.0500.0570.0640.0730.0820.0930.1050.1180.1340.1510.1710.1930.2180.2460.2780.3140.3550.4010.4530.5120.5780.6530.7370.8320.9401.0621.1991.3541.5301.7271.9512.2032.4882.8103.1743.5844.0484.5715.1625.8306.5847.4358.3979.48310.71012.09513.65915.42517.42019.67322.21725.09028.33531.999)CH3 voltage calibration points (0.000 ... 5.300V)Code:VPOINTS=(0.0000.0010.0020.0030.0040.0050.0060.0070.0080.0090.0100.0110.0120.0130.0140.0150.0160.0170.0180.0200.0220.0240.0270.0290.0320.0350.0390.0420.0470.0510.0560.0620.0680.0740.0820.0900.0980.1080.1180.1300.1430.1560.1720.1880.2070.2270.2490.2730.3000.3290.3610.3960.4340.4760.5230.5740.6290.6900.7570.8310.9121.0001.0971.2041.3211.4491.5891.7441.9132.0992.3022.5262.7713.0403.3353.6594.0144.4034.8315.299)CH1, CH2 and CH3 current calibration points (0.000 ... 3.200A)Code:CPOINTS=(0.0000.0010.0020.0030.0040.0050.0060.0070.0080.0090.0100.0110.0120.0130.0140.0150.0160.0170.0180.0200.0210.0230.0250.0280.0300.0330.0360.0390.0430.0460.0500.0550.0600.0650.0710.0770.0840.0920.1000.1090.1180.1290.1400.1520.1660.1810.1960.2140.2330.2530.2760.3000.3270.3550.3870.4210.4580.4980.5420.5900.6420.6990.7610.8280.9010.9801.0671.1611.2631.3741.4961.6271.7711.9272.0972.2822.4832.7022.9403.200)- 1 second delay is too small for my mtx3283, I used 15 seconds for each point. This makes the calibration rather slow (80 points for V write, 80 for V read, 80 for I write, 80 for I read) for all the points and channels: 15seconds x 3channels x (80VADC + 80VDAC + 80IADC + 80IDAC) = 4 hours total calibration time