Thursday, July 31, 2014

Using an IVI Class Compliant Driver

Hi everybody!

In the past, I have talked about the different driver options that we offer.  One of them is the IVI-COM/IVI-C driver.  IVI actually stands for Interchangeable Virtual Instruments. Today I am going to talk about how you can make that abbreviation true using the fact that our power supply can use the IviDCPwr class.   I have received  a few questions in the past about how to do this and every time I do it, it takes me a while to remember all of the steps.  Posting it here will put it somewhere where people (including me!) can find it easily

To start off you need to download and install the following:
  • The Agilent N6700 IVI-COM/IVI-C  driver from Agilent’s website.  If you get the driver from somewhere else, I am not sure how it will work.
  • NI VISA since you will need NI-MAX
  • IVI Compliance package

Once you have all of this, you are ready to get started.

The first thing that you need to do is set your targeted instrument in NI-MAX.  I have a N6702A connected to my LAN.  Here's how it shows up in MAX:

After that, you want to go to the "IVI-Drivers" menu, select the "Driver Sessions" item and right click on it to select "Create new".   From there, click on the "software" tab and select the appropriate driver, in this case the AgN67xx driver.  

You can see here that the driver complies to the IviDcpwr class whcih is what we will be using.  

The next thing to do is in the "Hardware" Tab of the same menu.  You need to specify which instruments use this driver.  Click on "Add" to add your instrument.  It should look like this:

 One thing that I cannot stress enough is that you need to check that checkbox.  In you don't, this will not work and you will spend a little bit of time trying to figure out why you are getting resource not found errors.  Believe me I know this from experience!  After you double check everything make sure that you click on "Save IVI Configuration".

Now choose "Logical Names".  Right click on it and select "Create New".  I created a logical name called "MPS" (this stands for Modular Power System if you were wondering).  You need to refer it to the correct driver session:

Make sure to click on "Save IVI Configuration" again.

With that, you are ready to actually start!  I used Visual C++ 2010 to write my example.  Make sure that you have all of the IVI directories properly entered in your project.  Also make sure that you reference the ividcpwr.lib file in your "linker" settings. 

Here is my program listing:

#include <stdio.h>
#include "IviDCPwr.h"

void main()
ViStatus status;
ViSession session;
ViRsrc resource = "MPS";
ViConstString options  = "QueryInstrStatus=true, Simulate=false, DriverSetup= Model=, Trace=false";
ViBoolean idQuery = VI_FALSE;
ViBoolean reset   = VI_TRUE;
ViBoolean enabled = VI_TRUE;
ViChar ChannelName[16] = "";
        ViInt32 index = 2;
        ViInt32 bufferSize = 256;
ViConstString Cname;
ViReal64 Vmeasurement;
ViReal64 Ameasurement;

// This program initializes a session, programs a voltage and current on channel 2, 
// enables the output, and measures voltage and current.

status = IviDCPwr_InitWithOptions(resource, idQuery, reset, options, &session);
status = IviDCPwr_GetChannelName (session,index, bufferSize,ChannelName);

Cname = ChannelName;

status = IviDCPwr_ConfigureOutputEnabled (session,Cname,enabled);
status = IviDCPwr_ConfigureVoltageLevel (session,Cname,4.0);
status = IviDCPwr_ConfigureCurrentLimit(session, Cname, IVIDCPWR_VAL_CURRENT_TRIP, 1);

status = IviDCPwr_Measure (session,Cname,IVIDCPWR_VAL_MEASURE_VOLTAGE,&Vmeasurement);
printf("Measured Voltage on channel is : %f V \n",Vmeasurement);

status = IviDCPwr_Measure (session,Cname,IVIDCPWR_VAL_MEASURE_CURRENT,&Ameasurement);
printf("Measured Current on channel is : %f A \n",Ameasurement);

status = IviDCPwr_close (session);

printf("\n Done - Press Enter to Exit");

I am not going to go over the program in detail but here are the key things to note:
  • You need to include "IviDCPwr.h".  All the functions are in there.  You do not need to reference the instrument specific driver.
  • When you initialize the unit, you can refer to it by the name that you define in the "Logical Names" tab above.  In my case, I use "MPS".
  • This is a modular power supply.  The variable "index" is controlling the channel.  
  • I have tested this program and it works properly.
In theory, you should be able to swap this power supply out with another class compliant power supply with minimal programming changes (though in this case if you switch to a single output supply you would need to take out the references to the multiple channels).

One last thing that I want to note is that this will be the last Watt's Up blog posted under the Agilent banner.  Don't worry, we will still be posting the same great content but it will be under a Keysight Technologies banner.  I have been working for Agilent for 14 years now so it will be odd at first to have a new name but I am looking forward to posting many more blogs as a Keysight employee.  Goodbye Agilent Technologies it's been an interesting 14 years!

Wednesday, July 30, 2014

How does power supply overvoltage protection work?

In past posts, I’ve written about what overvoltage protection (OVP) is (click here), where it is sensed (click here), and its history (click here). Today I want to cover a little about how it works inside the power supply.

As a quick review, OVP is a built-in power supply feature that protects the device under test (DUT) from excessive voltage by shutting down the power supply output if it senses voltage that exceeds the OVP setting. Depending on the power supply design, the voltage may be sensed at the output terminals or at the sense terminals.

Most of Agilent’s older power supplies sense OVP at the output terminals and use a simple analog comparator circuit to determine when the output exceeds the OVP threshold set by the user. The OVP threshold is translated into an overvoltage reference voltage (OVref) that could come from a simple divider with a potentiometer for adjustment (uncalibrated and rather crude) or from a more sophisticated calibrated digital-to-analog converter (DAC) voltage. When the comparator sees the scaled output voltage exceed the OVref voltage, the overvoltage trip (OVtrip) signal is generated which shuts down the power supply output and, on some designs, fires an SCR across the output. See Figure 1 for a simplified representation of this arrangement.

Some of our newer designs look for an overvoltage condition on the sense terminals for better accuracy. In this scheme, the sense voltage feeds one comparator input through a differential amplifier while the other comparator input is driven by the user-set calibrated OVref voltage. See Figure 2. An output terminal OVP as described above must also be used as a backup with these designs (not shown in Figure 2) because some OV conditions are not caught when sensing OV on the sense terminals. For example, if the sense leads are shorted together, the output voltage will go up uncontrolled yet the sense voltage will remain at zero volts.

Some other OVP designs use a calibrated analog-to-digital converter (ADC) on either the output terminal voltage or the sense terminal voltage and compare the measured digital data to the user’s threshold setting. See Figure 3. To avoid nuisance OVP shutdowns, this scheme frequently requires several analog-to-digital conversions in a row exceed the threshold (for example, 4). This adds a minor delay to the OVP response time. With fast ADC conversion rates, the OVP response can still be just a few tens of microseconds and it is worth spending a little extra time to gain immunity against nuisance tripping. For example, the Agilent N6781A uses this technique. Since it does an ADC conversion every 5 us and requires 4 consecutive conversions exceed the OVP threshold to cause a shutdown, it will trip in less than 30 us.

So you can see that there are various ways to implement overvoltage protection. In all cases, rest assured that your DUT is protected against excessive voltage when using Agilent power supplies!

Tuesday, July 22, 2014

What does it mean when my Agilent power supply displays “Osc”?

When using certain higher performance power supplies from Agilent, like the N678xA series source-measure modules, you may discover that the output has shut down and an annunciator displaying “Osc” shows up on the front panel meter display, like that shown in Figure 1 for the N6705B DC Power Analyzer mainframe. 

Figure 1: DC Power Analyzer front panel meter displaying “Osc” on channel 1 output

As you would likely guess, Osc stands for oscillation and this means the output has been shut down for an oscillation fault detection. In this particular instance an N6781A high performance source measure module was installed in channel 1 of the N6705B DC Power Analyzer mainframe.

The N678xA series source measure modules have very high bandwidth so that they can provide faster transient response and output slew rates. However, when the bandwidth of the power supply is increased, its output stability becomes more dependent on the output wiring and DUT impedances. To provide this greater bandwidth and at the same time accommodate a wider range of DUTs on the N678xA modules, there are multiple compensation ranges to select from, based on the DUT’s input capacitance, as shown in the advanced source settings screen in Figure 2.

Figure 2: DC Power Analyzer front panel displaying advanced source settings for the N678xA

Note that “Low” compensation range supports the full range of DUT loading capacitance but this is the default range. While it provides the most robust stability, it does not have the faster response and better performance of the “High” compensation ranges.

As long as the wiring to the DUT is correctly configured and an appropriate compensation range is selected the output should be stable and not trip the oscillation protection system. In the event of conditions leading to an unstable condition, any detection of output oscillations starting up quickly shut down the output in the manner I captured in Figure 3. I did this by creating an instability by removing the load capacitance.

Figure 3: Oscillation protection being tripped as captured in companion 14585A software

In rare circumstances, such as with some DUTs drawing extremely high amplitude, high frequency load currents, which may lead to false tripping, the oscillation protection can be turned off, as shown in Figure 4.

Figure 4: N678xA oscillation protection disable in N6705B DC Power Analyzer advance protection screen

Oscillation protection is a useful mechanism that can protect your DUT and your power supply from an excessively high AC voltage and current due to unstable operating conditions. Now you know what it means next time you see “Osc” displayed on the front panel of you Agilent power supply and what you need to do to rectify it!


Monday, July 14, 2014

Extending the usable bandwidth of the DC source when performing AC disturbance testing on your DUT

A lot of various products that run off of DC power, often destined to be used in automobiles and other types of vehicles, but even quite a number in stationary applications as well, require validation testing for impact of having AC disturbances riding on top the DC powering them.

 Conducting this type of testing is often a big challenge for the test engineer in finding a solution that adequately addresses the disturbance test requirements. It usually requires multiple pieces of hardware:
  • A DC power supply is used to provide the DC bias voltage and power.
  • A power amplifier is used to generate the AC disturbance.
  • A separate ARB /function generator is needed to produce the reference signal for the disturbance

Coupling the DC power supply and power amplifier together is extremely problematic. While it would be great to just directly connect the two in series, this rarely can be done in practice as the power amplifier usually cannot handle the DC current of the power supply. A variety of custom approaches are then typically taken, all with their associated drawbacks.

An article about this very topic was published last year, written by a colleague I work with, Paul Young in our R&D group. As he noted it’s great when the power source can provide both the DC power as well as the AC disturbance as this is a big savings over trying to incorporate multiple pieces of equipment. Paul’s article “Extending the Usable Bandwidth of a Programmable Power Supply for Generating Sinusoidal Waveforms” (click here to review) is an excellent reference on this and the inspiration for my blog posting this week.

Our N6705B DC Power Analyzer in Figure 1 and recently introduced N7900A series Advanced Power System (APS) 1KW and 2KW power supplies in Figure 2 have proven to be very useful for doing a variety of testing where transients and audio disturbances are needing to be introduced on top of the DC that is powering the DUT.

Figure 1: Agilent N6705B DC Power Analyzer and N6700 series DC power modules

Figure 2: Agilent N7900A series 1KW and 2KW Advanced Power System and N7909A Power Dissipator

The reasons for these products being useful for disturbance testing are due to their built in ARB generation capability in conjunction with having a respectable AC bandwidth, on top of being able to source the DC power. Everything can be done within one piece of equipment.

A very common test need is to superimpose a sinusoidal disturbance in the audio range. One example of this is in automobiles. The alternator “whine” AC ripple induced on top of the DC output falls within this category. Our 1KW and 2KW N7900A series APS are good for applications needing higher DC power. However, at first glance the specified AC bandwidth of 2 kHz on does not look like it would work well for higher audio frequencies. The AC response of an N7951A from 1 kHz to 10 kHz is shown in Figure 3. This was captured using the 14585A companion software to set up its ARB.  There is noticeable roll off for higher frequency, as expected.

Figure 3: N7951A APS AC response characteristics captured using companion 14585A software

However, it’s worth noting that the roll off is gradual and very predictable. In the case of superimposing a relatively small AC signal on top of the DC output it is easy to compensate by measuring the attenuation at the given frequency and applying a gain factor to correct for it, as I did as shown in Figure 4. As one example, for 5 kHz, I programmed 2.38 volts peak to get the desired 1 volt peak.

Figure 4: N7951A APS AC response characteristics after gain correction

As can be seen it was simple to now get a flat response over the entire range. A limiting factor here is sum of the programmed DC value plus programmed AC peak value needs to be within the voltage programming range of the power supply being used. In practice, when the AC disturbance is reasonably small it is easy to cover a wide range of frequency.

Another factor to consider is capacitive loading. Some DC powered products sometimes have a fairly substantial filter capacitor built in across the DC power input. This will increase the peak current drain from the power supply when AC is applied on top of the DC. As an example a 100 microfarad capacitor will draw a peak current of 6.28 amps when a 10 kHz, 1 volt peak AC signal is applied. There may also be series impedance limiting the peak current, but whatever this AC peak current is it needs to be included when determining the size of the power supply needed.

With these basic considerations you will be able to perform AC disturbance testing over a much greater bandwidth as well!