Test Voltage Regulator Using Data Acquisition Toolbox

Introduction

To illustrate how to use some of the Data Acquisition Toolbox™ test elements in the SystemTest™ software, this section provides a step-by-step example. The example shows how to use the elements that send data to a device under test (DUT) and receive data from a device under test, using both analog channels and digital lines.

This example samples the response of a 5-V voltage regulator that is stimulated with three different voltages of 4, 5, and 7.5 volts. The regulator has an enable function controlled by a digital signal. In this example, you collect 22,000 samples per second of the DUT response for 2 seconds.

All data going to and from the DUT is handled by a National Instruments® PCI-6035E data acquisition card. The example uses this card's analog output for the DUT stimulus, analog input for capturing the DUT response, and digital output for controlling the DUT's enable line. The test configuration is shown in the following figure:

The following sections contain the steps in this example.

Sending Analog Stimulus Data to the DUT

Stimulus data is sent to the DUT from an analog output channel of your data acquisition card.

  1. Open the SystemTest software in MATLAB® by typing systemtest at the MATLAB command line.

  2. This example does not use the Pre Test section, so select the Main Test section in the Test Browser pane.

  3. Add an Analog Output element by selecting New Test Element > Data Acquisition > Analog Output.

    The new element appears in the browser tree, and its properties appear in the Properties pane. The SystemTest software scans your computer for installed data acquisition adaptors and devices. This can take several seconds.

  4. Double-click the new Analog Output node in the browser tree, and enter a new name for this element, such as Stimulate DUT.

  5. Since we have three test cases, we need to create a test vector containing the three voltage settings to test against. Click the Test Vectors tab. The voltage values for the stimulus to the DUT are held in a test vector. Click New Vector to create a new test vector.

  6. In the Insert Test Vector dialog box, click the name TestVector1 and enter a new name for your vector, such as DUTstimulus.

  7. Click the default 1 : 1 : 10 entry in the Expression field, and replace it with the values for your test: [4, 5, 7.5] (be sure to include the brackets) and click OK. Notice that because there are three values in your vector, the browser tree now indicates that the Main Test will run three iterations. Each iteration will use one of the three values in the vector for the DUT stimulus voltage.

  8. In the Properties pane, select the adaptor and device to use for the test. This example uses the nidaq adaptor, and the device is a PCI-6035E.

  9. The example hardware configuration uses the card's analog output hardware channel 0 to provide the DUT's stimulus. So select the check box for this channel. The element will generate signals of 4, 5, and 7.5 volts, so keep the default output range of [-10.0 10.0].

  10. From the Data source list, select the DUTstimulus test vector.

  11. Enter a value of 1 for Output rate. You are using a single static value rather than a sampled waveform, so this is not critical.

  12. Enter a value of 1 for Number of times to output data. The card will hold its last programmed value, so you need to send it only once.

    The Properties pane now looks like the following figure:

Enabling the DUT with Digital Data

To send a digital enable signal to the DUT, use a digital output element.

  1. Select New Test Element > Data Acquisition > Digital Output.

  2. Double-click the new Digital Output element in the browser tree, and type a new name for this element, such as Enable DUT.

  3. Click the Test Variables tab.

  4. Click the New button to create a new variable. You will create two variables: one for enabling and one for disabling the DUT.

  5. Click the name Var1, and replace it with the text DUTenable.

  6. Click its empty Initial Value entry, and enter 1.

  7. Repeat steps 4 to 6 to create a second test variable, but name it DUTdisable with an initial value of 0.

  8. In the Properties pane for the Enable DUT element, select the adaptor and device for sending this data. Again, you are using the nidaq adaptor, and the device is a PCI-6035E.

  9. The hardware configuration uses the card's digital output port 0, line 3 for the enable signal, so select the check box for this line.

  10. From the Data source list, select the variable DUTenable.

    The Properties pane now looks like the following figure:

Receiving Analog Response Data from the DUT

The next element in the test samples the output from the DUT and assigns the acquired data to a test variable.

  1. Select New Test Element > Data Acquisition > Analog Input.

  2. Double-click the new Analog Input element in the browser tree, and enter a new name for this element, such as DUT Response.

  3. In the Properties pane, select the adaptor and device to use for the test. This example uses the nidaq adaptor, and the device is a PCI-6035E.

  4. The hardware configuration uses the card's analog input hardware channel 3 to read the DUT's response, so select the check box for this channel. The expected signal will be about 5 volts, so keep the default output range of [-10.0 10.0].

  5. Set a sample rate of 22000. Because of hardware limitations, the actual sample rate may not exactly match the value you specify.

  6. In the Acquire field, specify to acquire data for 2 seconds. Set seconds in the unit list to the right of the value field.

  7. In the Assign data to field, select New Test Variable from the list. This is where you specify what test variable to assign the acquired data to. The Edit dialog box appears.

  8. Enter a name for the test variable, such as DUTresponse, then click OK to create the test variable.

    The Properties pane now looks like the following figure:

Disabling the DUT with Digital Data

The next step is to disable the DUT with a digital output element that turns off the DUT's enable line. This element is similar to the Enable DUT element, except it sends a different value to the DUT.

  1. Select New Test Element > Data Acquisition > Digital Output.

  2. Double-click the new Digital Output element in the browser tree, and enter a new name for this element, such as Disable DUT.

    You already created the test variable DUTdisable, which you will use in this element.

  3. In the Properties pane for the Disable DUT element, select the adaptor and device for sending this data. Again, you are using the nidaq adaptor, and the device is a PCI-6035E.

  4. The hardware configuration uses the card's digital output port 0, line 3 for the enable signal, so select the check box for this line.

  5. From the Data source list, select the variable DUTdisable.

    The Properties pane now looks like the following figure:

Performing Data Analysis

At this stage, you might perform any analysis or visualization routines on the data generated by the DUT. You can do this in a MATLAB element.

  1. Select New Test Element > MATLAB.

  2. Double-click the new MATLAB element in the browser tree, and enter a new name for this element, such as Process Data.

  3. In the MATLAB Script edit field of the Properties pane, enter any MATLAB code that you need for analyzing your test variables. You might be interested in measuring ripple, noise, regulation, or many other characteristics. You can access the DUT response by referring to the test variable DUTresponse. The stimulus data is available in the test variable DUTstimulus.

    The following figure shows a MATLAB element with only some comments added in the Properties pane.

Defining Post Test Elements

In this example, it is recommended to include an element in the Post Test section to disable the DUT.

  1. Click the Post Test section in the browser tree.

  2. Create a digital output element set up like the element you made in Disabling the DUT with Digital Data.

    With the extra Disable DUT element, the test now looks like the following figure:

The Post Test section of the test could also perform any analysis that requires completion of all the iterations of the Main Test.

Saving and Viewing Test Results

Before running a test, you must specify which test variables you want to save as a test result. In the Save Results Properties pane, you select the test variable that you want to save and map it to a test result name.

The SystemTest software allows you to view the results you have chosen to save for your test using a workspace variable called stresults. It provides access to the test results object, which is useful for comparing the results of separate test runs and for postprocessing test results. For more information, see View Test Results at the Command Line.

Was this topic helpful?