HP 6632B GPIB measurement - Page 1
Forum section: electronics / testgear

author: davorin
author_rank: Unknown
timestamp: May 27, 2014, 03:15:58 pm
content: Good evenin'I just picked up two HP 6632B power supplies as I read somewhere quickly that it not only can be programmed via GPIB to set voltage/current, but also to read back actual values.Going through the Agilent manual makes me now suspicious as all measurement commands there are labelled with "66312A, 66332A Only".So can I now rad out values via GPIB or not from the 6632B?

author: Andy Watson
author_rank: Super Contributor
timestamp: May 27, 2014, 03:32:25 pm
content: I have a pair of 6632B and have used them to read-back both voltage and current via the GPIB. If I remember correctly the "A" versions are all-singing all-dancing transient recording devices - almost an oscilloscope. HP make a big fuss about the capabilities of the A variants but if you read past this, or get the appropriate documentation from their website you'll find the instructions to operate and read the B versions.

author: davorin
author_rank: Unknown
timestamp: May 27, 2014, 03:33:44 pm
content: Do you have an example of the GPIB code used?Trying to use my Prologix-like USB adapter gives me always error -101 (invalid character) when issuing *IDN?.

author: Andy Watson
author_rank: Super Contributor
timestamp: May 27, 2014, 03:52:27 pm
content: This is in C. It works via an ancient NI GPIB PCI card under Linux. The device in question is opened and given the name dmm1. PS_address has the value 4, the GPIB address of the 6632B.Code:/* Initialise device and state(also sends IFC - clear interface message) */dmm1 = ibdev (0, PS_address, 0, 11, 1, 0x40a);Set up starting conditiondo {x = sprintf(sstr,"VOLT %5.2lf",Vset); // Change PS otuputibwrt (dmm1, sstr, x);sleep(10); // Wait for DUT to stabalise (a tungsten lamp)x = sprintf(sstr,"MEAS:VOLT?"); // Request voltage measurementibwrt (dmm1, sstr, x);ibrd(dmm1, buffer, 20); // Read back voltage - 20 characters was a belt and braces overestimate - the read actually times-outsscanf(buffer,"%lf",&Vout); // Convert the ASCII string to a doubleprintf("At %i, V1 output = %lf, ",z,Vout);x = sprintf(sstr,"MEAS:CURR?"); // Repeat for the current measurementetc.Edit: Just remembered. From the front panel, there is a menu accessible via the "System - Address" key, that allows you to change the "language" of the GPIB interface - make sure this is set to operate with the command set that you are using.

author: free_electron
author_rank: Super Contributor
timestamp: May 27, 2014, 03:53:36 pm
content: Meas:volt?Meas:curr?The more advanced functions like array recording , min/max are reserved for the 66321 dynamic version

author: davorin
author_rank: Unknown
timestamp: May 27, 2014, 03:59:58 pm
content: Plugged in the second 6632B....no error -101 anymore...and remembered to use Ctrl-Jas EOL.Code:HEWLETT-PACKARD,6632B,0,A.01.043.29722E+0Seems my LeCroy 9354AL isn't so picky about EOL (o;

author: Andy Watson
author_rank: Super Contributor
timestamp: May 27, 2014, 04:00:39 pm
content: Well those commands definitely work with my 6632B

author: davorin
author_rank: Unknown
timestamp: May 27, 2014, 04:03:35 pm
content: All things clear :-))Now onto next work...implementing read out via SNMP and log via Cacti/MRTG...Great thanks for the quick and excellent help :-)

author: davorin
author_rank: Unknown
timestamp: August 01, 2014, 04:27:32 pm
content: Doing now current logging via snmp which calls a Python script to read out the current from the 6632B.On the panel I see for example a value of around 0.53 - 0.58A...But with the Python script it reads out around 0.63A down to 0.48ADoes the display show an average value?Or is it possible to measure via GPIB also an average or is it always the actual current at that particular moment?

author: Andy Watson
author_rank: Super Contributor
timestamp: August 01, 2014, 04:35:54 pm
content: As far as I am aware, the reading returned over the GPIB is the same as on the meter. Do you need to allow time for the reading to settle? Is it possible that the python system has buffered the reading and what you are seeing happened several measurements back?

author: davorin
author_rank: Unknown
timestamp: August 01, 2014, 04:41:58 pm
content: The reading is quite fast:Code:klingler@nuc:~$ time python ./6632b.py618.575real0m0.077suser0m0.016ssys0m0.007sBut could be also due to the fact it is measuring an embedded Arm computer..namely a CuBox-i2 (o;Here's an image of the graph:

author: babysitter
author_rank: Frequent Contributor
timestamp: August 01, 2014, 07:48:57 pm
content: Quote from: davorin on May 27, 2014, 03:33:44 pmUmm... its in my hobby room, but have you set the language to SCPI ?If it starts up in disconnect state, it is probably in SCPI, if it starts with output active, possibly its expecting COMPatibility language. That is my quick check.

author: davorin
author_rank: Unknown
timestamp: August 01, 2014, 09:41:31 pm
content: Dunno why you quote an old message here from me....as it has been resolved long time ago (o;Also I'm using now a Beiming USB/GPIB adapter...the Prologix clone doesn't have any line drivers...so it wasn't possible to address more than 3 switched on devices...I guess the GPIB readout just isn't suitable for highly dynamic loads changing power consumption every millisecond (o;

author: davorin
author_rank: Unknown
timestamp: August 03, 2014, 10:34:11 am
content: Hmm...just looked and looked over again in the 6632B user guide....it only mentions that it can sink current up to 5A...But nowhere it is described how to enter the current sinking mode...not how it can be turned on/off/changed via GPIB....

author: Andy Watson
author_rank: Super Contributor
timestamp: August 03, 2014, 10:51:08 am
content: It matches the positive current setting - if I remember correctly. Look for the section in the manual that describes operation in different "quadrants".

author: DRT
author_rank: Regular Contributor
timestamp: August 03, 2014, 10:53:49 am
content: Yes, if you want it to sink 5A, set it to +5A then set the output voltage lower than your external source.

author: davorin
author_rank: Unknown
timestamp: August 03, 2014, 10:55:17 am
content: So just in terms of GPIBVOLT 0CURR 1OUTPUT ON?In the user guide I just find this paragraph:Figure 2-1 also shows a single range ? two quadrant capability. This means that the dc source is capableof sourcing as well as sinking current over the output voltage range from zero volts to the ratedmaximum. The negative quadrant is identical to the positive quadrant. However, the negative currentcannot be set independently; it tracks the value programmed for the positive current. Thus, if the positivecurrent is set to 1 A, the negative current is also set to 1 A.

author: davorin
author_rank: Unknown
timestamp: August 03, 2014, 11:11:44 am
content: Hmm...seems to work....tested with an old 9V battery (o;But seems to be unusable for current loads under 10mA.....1mA reads out as 6mA...and 10mA as 11mA...What happens when voltage drops below the programmed value?

author: Andy Watson
author_rank: Super Contributor
timestamp: August 03, 2014, 11:35:31 am
content: Quote from: davorin on August 03, 2014, 11:11:44 amI guess it stops sinking current and goes into the normal voltage regulating mode.

author: davorin
author_rank: Unknown
timestamp: August 03, 2014, 11:47:40 am
content: Still learning heavily Python....but not bad...especially with the pyplot library for displaying measurement results...Simple program to current sink between 0.01A and 0.1A and measuring the voltage across an old 9V battery....and writing to PDF and PNG at once:Code:import matplotlib.pyplot as pltimport timefrom Gpib import *fig = plt.figure()x = []y = []inst = Gpib(0,5)inst.write("VOLT 0")inst.write("OUTPUT ON")for i in range (0, 10):sink = (i + 1) * 0.01inst.write("CURR " + str(sink))time.sleep(0.1)inst.write("MEAS:VOLT?")voltage = inst.read(200)x.append(sink)y.append(voltage)plt.scatter(sink, voltage)plt.draw()print voltageinst.write("OUTPUT OFF")plt.ylabel('Voltage')plt.xlabel('Current')plt.ylim(0,9)plt.xlim(0,0.1)plt.grid()plt.show()fig.savefig('foo.png')fig.savefig('foo.pdf')And here's the output:

author: davorin
author_rank: Unknown
timestamp: August 03, 2014, 01:31:48 pm
content: Hmm..weird....just measured a small 5V/3A power supply like it is used for embedded computing....Just stepping through current sinks from 0.1A to 1A and the voltage drops down to 3.6V:Something wrong here?

author: Andy Watson
author_rank: Super Contributor
timestamp: August 03, 2014, 01:46:02 pm
content: Consistent with 0.5 ohm in the test leads! Where are you sensing the voltage?

author: davorin
author_rank: Unknown
timestamp: August 03, 2014, 02:04:30 pm
content: The voltage is sensed internally...and the leads are 1m long with 2.5mm2, or AWG 14....Maybe try the 2nd 6632B or the 6633A....Could it also be due to miscalibration?Just measured with a cheap DMM across the power source..doesn't drop below 5V @ 1A....Can't be 1.5V voltage drop across 2m of 2.5mm2/AWG14 wire...

author: Andy Watson
author_rank: Super Contributor
timestamp: August 03, 2014, 02:08:20 pm
content: Oops, I misread the graph. Yes, 1.5 V is a lot. What does your DVM say at the terminals of the HP6632?

author: davorin
author_rank: Unknown
timestamp: August 03, 2014, 04:32:09 pm
content: Stupid me ;-)The power leads are fine....but just the short connection between power leads and power supply under testwas made with cheap chinese cables with crocodile clamps....the cable looks rather thick,but the wire inside isn't (o;Well...the lab is still in the setup phase...lots of improvements to make...And lots of thick silicon wires to order...though didn't find so far thicker than 2.5mm2 :-(But the graph looks much better now:

author: davorin
author_rank: Unknown
timestamp: August 03, 2014, 04:47:25 pm
content: Just discovered that at the back the internal sensing jumpers are not installed at all....Measured now with sense leads at the power supply source....though it looks better as in the new screenshot...I discover a difference between the HP and the DVM readings....especially when sinking more current the HP shows a bigger voltage drop:Code:DVM0A5.45VDVM1A5.26V-0.19VDVM2A5.06V-0.39VDVM3A4.87V-0.58VHP0A5.428VHP1A5.201V-0.23VHP2A4.971V-0.46VHP3A4.739V-0.69V

author: mzzj
author_rank: Super Contributor
timestamp: August 03, 2014, 09:26:38 pm
content: Quote from: davorin on August 03, 2014, 11:11:44 am6632B's have some trouble with really low currents at least when the 6632b is sourcing. Most of my second-hand units wont go below 2-10mA or so.Measurement should be accurate tough, the problem is just in the adjustment (12bit adjustment resolution problem or some sort of offset).In case you haven't notice: 6632B has also low-current range with 20mA max and 0,001 mA measurement resolution!

author: davorin
author_rank: Unknown
timestamp: August 03, 2014, 09:29:44 pm
content: What you mean by low-current range?Is it controllable via GPIB and does it only affect sourcing but not sinking?Well my intention is mainly to test power supplies....which fit perfectly in the 0 - 5A range....so I expect them to deliver 2 - 10mA without problems...At least I'm happy I know how the sinking works...through the help of this forum, as the manuals were of no help...and I hope my little scripts will help other peoples here (o;

author: Neganur
author_rank: Unknown
timestamp: August 04, 2014, 05:38:32 am
content: According to page 24 of the programmer's manual:"Current RangesThe dc source has two current measurement ranges. The command that controls the ranges is:SENSe:CURRent:RANGe MIN | MAXWhen the range is set to MIN, the maximum current that can be measured is 20 milliamperes."I only ever set it via the front panel when I want to see small loads, but maybe you could give it a try.Remember that your cables may drop a significant amount of voltage when you measure higher currents, so the U/I-curve can be wrong.Edit: forgot to say that the current measurement in MIN range has an accuracy of 2.5 uA which is nice. Just can't adjust the current sinking with that accuracy.Also, just tried sending the MIN command. The display changes to 0.001mA as usual. There is no response to the command. (i.e. no reply for the Send & Read, only Send)

author: bingo600
author_rank: Super Contributor
timestamp: August 04, 2014, 10:40:25 am
content: PYLT is a prologix framework Made by PHKhttps://github.com/bsdphk/pylt/Bingo