Friday, November 29, 2013

Using Labview without Using an Instrument Specific Driver

Hi everyone!

Labview is presently one of the most popular programming languages for programming test and measurement equipment.   Here at Power and Energy Central, we often get requests for more Labview programming examples for our products (which is definitely something on my agenda).   We also get requests for Labview drivers (which do exist for many of our products).  I thought that I would use this month’s blog posting to demonstrate how to program without using a driver.  There are a few advantages to this approach.  The first and main one is that it gives you access to the full SCPI command set of the instrument.  Anything you can do with the instrument is available to you.  The second advantage is that you do not need to worry about downloading and setting up drivers. 

I am going to work through an example using my Agilent N6700B on LAN.  We are going to use VISA calls in Labview to communicate with the instrument.  The first thing that we are going to need to do is get the VISA init string from the Agilent IO Libraries (or whatever IO Library you are using).  You can see the init string from my N6700B below (from the Agilent IO Libraries):

With the VISA address in hand, start up Labview and choose a blank VI.  Go to the Functions Pallette -> Instrument IO -> VISA ->Advanced and choose Open.  This function will open up a VISA session with your instrument.  There are quite a few inputs to this function but I usually just set up the instrument address and the VISA Open timeout:

After opening a session, we are ready to send our first commands.  I usually like to send a *RST and a *IDN?  so I know that I am in a known state and fully communicating with my instrument.   To send a command, you are going to go to the VISA menu and choose Write.  There are a few lines that you will need to connect here.  In Labview, you will always connect the “VISA Resource Name Out” and “error out” lines through your entire program (you will see that throughout this example).   The command is the other input.  This will need to be a string.  

Since we sent a query, we need to read out the output buffer.  This is done by choosing read in the VISA menu.   You need to do with the read are set the byte count to be read (I set it to 100 bytes so it is totally out of the way).   You also need a string indicator so that you can read and display the results of the *IDN query.

I am going to finish out my program by setting my supply to 4 V, turning the output on, and measuring the voltage.  All of these steps will use the same reads and writes that we used before.  The last thing I will do is use a VISA Close.  Using a Close will de-allocate all the resources and release the instrument.  This is generally good programming practice and is often overlooked.  Here is what the final program looks like:

After I run the completed program, I get the following results:

We can see that the results are as we expected and our program is working.

From this example, you can see that doing simple things is pretty easy in Labview.   If you are interested in downloading the example, please leave a comment here and I will post it so that you can get it.  As always, if you have any questions please feel free to post in our comments.  Take care!

Wednesday, November 27, 2013

Why can’t you put electronic loads in series?

The quick answer to the above question is: because you will likely damage at least one of the loads with excessive voltage! For the longer answer, read on….

[By the way…this is a milestone post for Watt’s Up? since it is post # 100, so thank you to our readers…and Happy Thanksgiving to those in the US or celebrating elsewhere!]

I’ll start with a brief explanation of what an electronic load is, and what it is used for. I am specifically talking about DC electronic loads here. A DC electronic load is a two-terminal electrical instrument that draws power from a DC source. Loads are used to test DC sources. Any device that has a source of DC output power, such as a DC power supply, a DC-to-DC converter, a battery, a fuel cell, or a solar panel, can have power drawn from it with an electronic load. Click here to see Agilent’s DC electronic loads.

For example, to test a fixed-output DC power supply that is rated for 20 V, 5 A, 100 W, you would connect the power supply output to an electronic load with ratings that are equal to or greater than the power supply ratings and that can draw a constant current from the power supply. Since the power supply is regulating the voltage (20 V), the load must regulate the current it draws from the power supply (up to 5 A). If your DC power supply is a constant current source, the load must be capable of drawing power while regulating voltage. You can set most electronic loads to draw power by regulating either constant voltage (CV) or constant current (CC). You can also set many electronic loads to regulate constant resistance (CR) across their input terminals, and some can regulate constant power (CP).

If the power supply to be tested has a higher output voltage than a single electronic load can handle, you may be tempted to put multiple load inputs in series to accommodate the higher voltage. After all, you can do this will power supply outputs to get higher voltage (click here)….why not with loads?

Putting electronic loads in series can cause one of the load inputs to be exposed to a voltage beyond its capabilities that could result in damage to the load. You are putting loads in series because a single load does not have a high enough voltage rating to handle the voltage of your DC power source. But since one of the load inputs could become a low impedance (nearly a short circuit) during test, all of the voltage from your DC source could appear across the other load input in series. There are several scenarios that can result in this destructive situation. To understand these scenarios, you first have to understand how an electronic load works.

Loads work by controlling the conduction of FETs across their input terminals. The control is realized by using a feedback loop to adjust a measured level (such as the input current) so that it equals a reference level (such as the set current). My colleague, Ed Brorein, posted about this topic last year (click here).

When you put multiple electronic loads in series to accommodate higher voltage, one problem scenario occurs when you set both loads to operate in CC mode. You set the same current on both loads. The exact same current flows through both loads (see figure below), but due to small errors in the accuracy of the settings, the real set values will never be exactly equal. Therefore, one of the loads will be trying to draw a higher current (Load 2 in the figure) than the other load (Load 1 in the figure). Since Load 1 will limit the current at the lower value (9.99 A in this example), Load 2 can never attain its real set point (10.01 A in this example). So its internal feedback loop continues to tell the FETs to conduct more and more current until the FETs are fully on looking nearly like a short circuit. This results in nearly all of the power supply voltage appearing across the Load 1 input which can damage it.

If you operate one load input in CC and one in CV, at first this looks like it will result in a stable operating point. However you have to think about how you get to that stable operating point. If you set the loads first before you connect the voltage, before the voltage is applied, the CC load is not satisfied (no current is flowing) so it goes to a short and the CV load is also not satisfied (no voltage is present) so it goes to an open. When the test voltage is applied, all of the voltage initially appears across the open CV load and can damage it. There are other procedures to follow that could temporarily result in a stable operating point (such as slowly increasing the test voltage if you have that ability), but if any fault condition occurs in any of the loads, they try to protect themselves by either turning the FETs on hard (a short) or opening the FETs. In either case, the large destructive voltage will appear across one of the loads in the series connection resulting in damage.

One of my colleagues, Bob Zollo, wrote an article entitled “Why Can’t You Put Electronic Loads In Series To Get More Voltage?” that appeared in Electronic Design on November 4, 2013. For some additional information about this topic, click here to read the article.

So you can see that putting loads in series can too easily result in damage to at least one of the load inputs. I strongly recommend that you do not do it!

Wednesday, November 13, 2013

How to Make More Accurate Current Measurements

There are a number of ways to make current measurements, including magnetically coupled probes, Hall-effect devices, and even some more exotic field sensing probes, but a good quality resistive shunt really cannot be beat in terms of accuracy, bandwidth, and overall general performance.

We likewise make considerable use of high performance shunts in our DC power products to provide extremely accurate current read-back of load currents, spanning the full range of output loading. Not only is the quality and design of the shunt itself critical, but how you treat it and make use of it are all equally important to get great current measurement performance. At the surface it may seem simple; it’s just measuring the voltage drop across a resistor. In reality it is no simple task. It requires appropriate metrological resources to validate the performance.  There are a lot of potential sources of error to recognize, quantify, and contend with.

When working with folks I sometimes encounter those who prefer to develop in their own current measurement into their test systems, instead of relying on the current read-back system already build into their system DC source. There are times when this is the right thing to do and is fine when done correctly. However some of the time there is the preconception that the DC source cannot provide an accurate measurement. The reality is there is a wide selection of DC sources available spanning a wide range of performance, Most likely something will be available that adequately addresses one’s needs. A second issue is, when developing current measurement capabilities for a test system, is truly recognizing all the potential sources of error. It goes well beyond having a good DVM and a good shunt resistor in the test system.  

A colleague here in our R&D group, Mark Peffley, wrote a comprehensive article that was just published. It covers a myriad of things in depth to be taken into consideration in order to make accurate current measurements, including:
  • Temperature dependencies
  • Self-heating and thermal equilibrium
  • Temperature gradients
  • Thermo-electric effects
  • Additional sources of offset errors
  • Voltage drop considerations
  • Shunt selection practical considerations
  • And more!
So using a shunt is a great foundation for making highly accurate current measurements. That’s why we use them in our power products. But, as Mark points out, there is a lot more to it than just Ohm’s law. When using one of our power products we factor all these things in so that they become a non-issue for the user. However, if you do plan to add current measurement into your test systems then I highly recommend reading Mark’s article “Obtain Accurate Current Measurement” (click here to access) as it is a great reference on the subject!

Wednesday, November 6, 2013

Paralleling power supplies for more power without compromising performance!

A year ago my colleague here, Gary, provided a posting “How can I get more power from my power supplies?” (Click here to review). He describes connecting power supplies in series for higher voltage or in parallel for higher current. Along with suggested set ups a list of requirements and precautions are also provided.

Connecting multiple power supplies in parallel operating as voltage sources is always problematic as there will be some imbalance of voltage between them. That’s why, in this previous posting, one unit operates as a voltage source and the remaining paralleled units operate in constant current. The compliance voltage limit of all the units operating in constant current need to be set higher than the master in operating in constant voltage in order to maintain this operation. This is illustrated in Figure 1.

Figure 1: Operating power supplies in parallel for higher power

As long as a high level of loading is maintained the paralleled units remain in their respective operating modes (in this case at least 2/3 loading). However, what happens if you cannot maintain that high level of loading? It is possible in practice to operate at lighter loads with this approach. In this case it is important to set the voltage levels of all the units the same. Now what happens is when the units are fully loaded they operate as already described, with the lowest voltage unit remaining in constant voltage. But when they are unloaded the lower voltage units transition to unregulated operation and the highest voltage unit then maintains the overall output in constant voltage. This is shown in Figure 2, for 0 to 1/3 loading.

Figure 2: Conditions of power supplies connected in parallel at light loading

There is a bit of performance compromises as a result. The transition between the lowest and highest voltage limits adds to the voltage regulation. Also, due to different units experiencing mode crossover transitions between constant voltage, constant current and unregulated operating modes transient voltage performance suffers considerably.

An improvement on this direct paralleling approach is having a master-slave arrangement with control signals to maintain current sharing across units. Our N5700A and N8700A series power supplies use such a control arrangement as depicted in Figure 3, taken from the N5700A user’s guide.

Figure 3: N5700A Connection for parallel operation (local sensing used)

With this arrangement the master unit, operating in constant voltage, provides an analog current programming output signal to the slave unit, operating in constant current. In this way the two units equally share the load current across a wide range of load current.

Still, having multiple units with only one in constant voltage does not provide as good of dynamic performance as a single voltage source of higher power.  A unique and innovative approach was taken with our N6900A / N7900A series Advance Power System (APS) to support seamless parallel operation without compromising performance. The paralleling arrangement for our N6900A / N7900A series APS is depicted in Figure 4.

Figure 4: N6900A / N7900A series APS Connection for parallel operation

The N6900A / N7900A series APS paralleling arrangement also uses an analog control signal for driving current sharing. However with this arrangement there is no master or slaves. All units remain in constant voltage while equally sharing current. This provides the user with an easy way to scale a power system as required without having to worry about compromising performance.