Tuesday, January 31, 2012

Matlab Function for Creating Arbitrary Waveform Files

This post features a Matlab function called convertToArb( ) that converts a vector / array of data into a waveform format that can be loaded onto Agilent's 3352xA function / arbitrary waveform generators (33521A one channel and 33522A two channel). This function converts a row or column vector into a 3352xA format .arb file (a waveform file that can be loaded onto the 33522A or 33521A). The vector data should contain voltage values ranging from 10 V to - 10 V. The convertToArb( ) function will generate a .arb file in the current Matlab open directory. The file can then be imported to the 33521A or 33522A via a USB memory stick. You can copy the code for the function below or you can download the function from Matlab Central (link at the end).

function convertToArb(data,samplerate,fName)

%check if data is row vector, if so convert to column
if isrow(data)
    data = data';
end
    
%data=importdata(filetoread1);
numberofpoints = length(data);

%Get max and min values from waveform data
data_min=min(data);
data_max=max(data);

%range has to be the maximum absolute value between data_min and data_max
range=abs(data_max);
if(abs(data_min)>abs(data_max))
    range=abs(data_min);
end
    
%Data Conversion from V to DAC levels
data_conv=round(data*32767/range);

fName = [fName '.arb']; %add file extension to file name

%File creation and formatting
fid = fopen(fName, 'w');
fprintf(fid,'%s\r\n','File Format:1.10');
fprintf(fid,'%s\r\n','Channel Count:1');
fprintf(fid,'%s\r\n','Column Char:TAB');
fprintf(fid,'%s%d\r\n','Sample Rate:',samplerate);
fprintf(fid,'%s%6.4f\r\n','High Level:',data_max(1));
fprintf(fid,'%s%6.4f\r\n','Low Level:',data_min(1));
fprintf(fid,'%s\r\n','Data Type:"Short"');
fprintf(fid,'%s\r\n','Filter:"OFF"');
fprintf(fid,'%s%d\r\n','Data Points:',numberofpoints);
fprintf(fid,'%s\r\n','Data:');
%Write data to file and close it
fprintf(fid,'%d\r\n',data_conv);
fclose(fid);

The input arguments for the convertToArb( ) function are as follows:
  • 'data' is the vector containing the waveform points that you want to convert to a .arb file
  • 'samplerate' is the sample rate setting for the 33521A or 33522A. The total time of your waveform is equal to: samplerate * number of points in the file.
  • 'fName' is the name you want to assign to the .arb file that is created, for instance "myArb" will create a "myArb.arb" file.
The following example Matlab script uses the convertToArb( ) function to create a waveform that consists of three different sine waves summed together.

%example script to demonstrate function convertToArb(data,samplerate,fName) 
xAxis = 0:.001:1; %create x axis for plot
count = length(xAxis); %get size of waveform
yAxis = zeros(1,count); %allocate array

for i = 1:count
    %build waveform that consists of three sinewaves summed together
   yAxis(i) = sin((2*pi)*xAxis(i)) + (.5*sin((2*pi)*xAxis(i)*3)) + (.3*sin(pi*xAxis(i)));
end

%call function to convert it to .arb file named myArb.arb
convertToArb(yAxis,1e6,'myArb');

Below is the resulting waveform generated with the example script captured on a scope.






Monday, January 23, 2012

Agilent Releases Seven High-Power Modules for the N6700 Modular Power System

Last week Agilent released 7 new high-power modules for the popular N6700 modular power system (optimized for system use) and the N6705B DC Power Analyzer (optimized for benchtop use). Three of the new  modules offer output power up to 300 W and the other four up to 500 W. The new modules bring the grand total of modules available for the N6700 / N6705 family up to 34, ranging from 18 to 500 W.

The new modules include advanced features such as:

  • Fast output changes (0 to 50 V in less than 2 ms)
  • Autoranging output capabilities 
  • Built-in voltage and current measurement digitizers (My personal favorite feature)
  • Optional polarity reversal relays
  • Power arbitrary waveform capabilities 
  • Active down programming capabilities
The N6705B and N6700 mainframes allow you to mix and match up to 4 modules per mainframe. The mainframes provide hardware timed output sequencing, at turn-on or turn-off, of the four power outputs. For larger channel needs, sequencing can be setup across multiple mainframes. Also the power outputs can be placed in series or parallel for increased power needs.

Below is a list of the new modules and their power, voltage, and current capabilities. For more information on each module, click on the model number to go to its product page.




Monday, January 16, 2012

Using the Power of the Cloud in Test and Measurement

Recently an article I wrote entitled "Using the Power of the Cloud in Test and Measurement" was published online by Wireless Design and Development. Below is the first couple paragraphs of the article to read and if you are interested in it follow the link at the bottom to read it in its entirety.

"The cloud" continues to become more and more pervasive in our everyday business and personal lives. Many people today use the cloud and do not even realize it. Gmail and Facebook, for example, are cloud-based services. The cloud, more formally known as cloud computing, refers to software, computation, and data storage/retrieval services, which from a user's perspective, happen somewhere out in the ether. Users don't need to know where the services are homed or how the services are provided.

The cloud model offers several benefits: We no longer have to worry about storage space or processing power because the cloud adjusts dynamically to satisfy these needs. Also, we can be confident that data is securely and safely backed up by the cloud service provider. But best of all, the cloud provides us with ubiquitous access to our data with devices like PCs, smart phones, and tablet computers. In this article, we will discuss how we can use the cloud to access test data and test system resources from anywhere, at any time.

In our global society, product design rarely moves from the drawing board to the manufacturing floor in the same geographical location. It is common for a product's hardware design to be developed in one country, its software design to be created in a second country, and its manufacturing to be completed in a third country. For this model to work well, team leaders often try to create a process that provides geographically separated team members real-time remote access to product test data, testing resources, and the ability to modify test system routines. If they are successful, they can avoid product delays and save money on test equipment. The cloud is a powerful tool for enabling this process.



Friday, January 6, 2012

Triggering a DMM with No Hands

Making a DMM measurement on a really really small pin on a chip is not an easy task. You drink a little less coffee that morning and carefully position your probe tip on the pin. Then your frozen scared to move your head to look at the DMM's display in fear the probe tip will slip off before you catch a glimpse of the reading. Has this ever happen to you? In this post we will look at easy way that a colleague of mine came up with to capture a DMM reading on the display without moving your head or your hands.

All you need is a DMM with external triggering capability, a mechanical switch, and some cabling. Here is the setup:

  • Set the DMM for manual external triggering. This means the DMM will only take a measurement on an external trigger event.
  • Position the switch on the ground under your bench by your feet.
  • Wire up the switch to the external trigger input of the DMM
From there position your probe tip on the tiny measurement pin and without taking your eyes off the measurement or moving your hands, toggle the switch with your foot. Remove your probes from the measurement point and look up to view your captured measurement on the DMM display.

When you close the switch with your foot the external triggering input of the DMM is pulled low, which in turn triggers a measurement on the DMM. To avoid the hassle of ordering a switch you could always cannibalize it from an old piece of electronics. For instance, my colleague used an old mouse. They wired a BNC adapter to a switch connected to one of the mouse buttons. The below figures show the mouse setup.




If you have any helpful comments or personal incites to add to this post just use the "Post a Comment" section below.






Tuesday, January 3, 2012

Passive or Active Scope Probe?

In this post we will look at what type of scope probe to use, passive or active, and discuss the trade offs of each. For general-purpose mid-to-low-frequency (less than 600-MHz) measurements, passive high-impedance resistor divider probes are good choices. These rugged and inexpensive tools offer wide dynamic range (greater than 300 V) and high input resistance to match a scope’s input impedance. These are the probes that often come with the scope when you purchase it. However, they begin to impose heavier capacitive loading as the frequency of the signal being measured goes up. The input capacitance of the probe and scope combine to create an impedance to between the signal being measured and ground. As the frequency of the signal goes up the impedance created by the capacitance drops. If the impedance drops to low it can effect your signal being measured, this is known as capacitive loading. For instance a capacitance of 10 pF presents only 100 Ohms of impedance to a 150 MHz signal so it is important to know the input capacitance of the passive probe and the scope you are using. Low-impedance (z0) passive probes (talk more about in last section) and active probes (talk more about next) offer higher bandwidths than high-impedance passive probes. All in all, high-impedance passive probes are a great choice for general purpose debugging and troubleshooting on most analog or digital circuits.

For high-frequency applications (greater than 600 MHz) that demand precision across a broad frequency range, active probes are the way to go. They cost more than passive probe and their input voltage is limited, but because of their significantly lower capacitive loading, they give you more accurate insight into fast signals.

In the two figures below we see screen shots from a 1-GHz scope measuring a signal that has a 1-ns rise time. In the first figure an Agilent 1165A 600-MHz passive probe was used to measure this signal. In the second figure an Agilent 1156A 1.5-GHz single ended active probe was used to measure the same signal. The blue trace shows the signal before it was probed and is the same in both cases. The yellow trace shows the signal after it was probed, which is the same as the input to the probe (showing the loading effects of the probe). The green trace shows the measured signal, or the output of the probe.
Passive probe: blue -- signal before probed, yellow -- signal after probed, green -- output of probe
Active probe: blue -- signal before probed, yellow -- signal after probed, green -- output of probe
A passive probe loads the signal down with its input inductance and capacitance (yellow trace). You probably expect that your oscilloscope probe will not affect your signals in your device under test (DUT). However, in this case the passive probe does have an effect on the DUT. The probed signal’s rise time becomes 1.9 ns instead of the expected 1 ns, partly due to the probe’s input impedance, but also due to its limited 600-MHz bandwidth in measuring a 350-MHz signal (0.35/1 ns = 350 MHz). The inductive and capacitive effects of the passive probe also cause overshoot and ripping effects in the probe output (green trace). The 1.85-ns rise time of the measured signal with the passive probe is actually faster than the probe’s input, due to these capacitive and inductive effects. Some designers are not concerned about this amount of measurement error. For others, this amount of measurement error is unacceptable.

We can see that the signal is virtually unaffected when we attach an active probe such as Agilent’s 1156A 1.5-GHz active probe to the DUT. The signal’s characteristics after being probed (yellow trace) are nearly identical to its un-probed characteristics (blue trace). In addition, the rise time of the signal is unaffected by the probe being maintained at 1 ns. Also, the active probe’s output (green trace) matches the probed signal (yellow trace) and measures the expected 1-ns rise time. Using the 1156A active probe's 1.5 GHz bandwidth (or 1-GHz system bandwidth when the probe is used with 1-GHz oscilloscope) makes this possible. Below is a table comparing high Z passive probes to active probes.


The above table I got from an older publication so the one mistake on the active probe side of the table is bandwidth "up to 13GHz." Agilent currently offers active probes up to 30 GHz. Also one other thing to note is there are low impedance passive probes known as "Resistive divider passive probe" that can have bandwidths up to 6 GHz. They are typically much lower cost than active probes. They must be used with a 50 Ohm input scope, have a lower amplitude capabilities than other passive probes, and do not work well with high impedance signals.

If you have any insights or useful comments to add please use the "Comments" section below.