Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
What is Developer Zone?
United States

Document TypeTutorial
NI Supported: Yes
Publish Date: Dec 04, 2009


Feedback


Yes No

Related Links - Developer Zone

Related Links - Products and Services

Functional Prototyping Series: Instrumenting and Testing Your Prototype

1 Ratings | 5.00 out of 5
Read in | Print | PDF

Overview

The Functional Prototyping Series is a collection of articles that walk you through the prototyping processs. Read on for key concepts, benefits of prototyping, product choice discussion, and additional technical resources.

Table of Contents

  1. Instrumenting and Testing
  2. Advantages
  3. Create a Software Test Bench
  4. Full System Test Bench
  5. Next Steps
  6. Related Resouces

Instrumenting and Testing

One purpose of a prototype is to quickly demonstrate an idea and a design to potential customers, investors, and colleagues. Another and equally important reason to prototype is to test and validate a design for basic software and hardware performance. Often problems become apparent only when you combine the electrical, software, and mechanical components of a functional prototype. 

By thoroughly testing in the prototyping stage, you can spot problems early before they represent a large sunk cost and fixing them is unrealistic. Prototype testing provides concrete evidence to back up performance claims and results in a more reliable final product that you can confidently take to deployment.

Advantages

  • Improving overall quality – Test your embedded prototype I/O for signal integrity by pushing the system to its limits.
  • Increase reliability – Make sure your embedded prototype can withstand the limits without faulting, and test safety systems developed to protect the product from overloading.
  • Enhance algorithm performance – Streamline your embedded program by testing throughout the product development cycle and removing all the quirks.

Create a Software Test Bench

Software Test Methods


Software-defined instruments are inherently flexible and easily automated. Because of this, today’s product design teams can streamline their development processes by reducing the number of hours consumed in manual testing and by minimizing the amount of instrumentation required in the lab.

With the NI LabVIEW graphical software platform, you can easily set up simple programs to test the quality and reliability of the main algorithm. When prototyping, pay attention to the following two main aspects of testing:

  1. Limit testing – Make sure that the software design provides quality data at the I/O channels throughout a range of data points. This helps keep the prototype within quality specifications throughout the product development cycle.
  2. Stress testing – Make sure the quality specifications are met for long periods of exposure and when all the I/O channels get pushed to the limits at the same time. The algorithm needs to be robust enough to take care of situations where there is an overload of data being processed.

Test without hardware by using simulation VIs to stretch the software algorithm to the limits. You can easily do this in LabVIEW by using a variety of signal generation VIs or by developing a VI that accurately depicts your actual I/O.

Figure 1. I/O Simulation Methods

With the development computer, you can thoroughly test software without actually using any hardware by simulating I/O. Simple but effective I/O simulation methods include the following:

  • Signal generation VIs – LabVIEW has a specific palette that is dedicated to signal generation. Choose from a large variety of VIs to effectively simulate I/O.
  • Custom VI – With the high-level LabVIEW graphical programming environment, it is easy to develop a test bench VI that depicts the I/O.
  • Existing data – LabVIEW has the functionality of extracting data from a variety of file types and databases. With LabVIEW, you can use modeled data to simulate data points for the I/O.

Embedded FPGA Testing Using Simulation of I/O Nodes

Prototyping with embedded field-programmable gate arrays (FPGAs) can be tricky. The development techniques differ between FPGA hardware and computer software for three main reasons.

  1. Compilation time – You need a significant amount of time to compile a design to hardware code and run it on the FPGA. Also, it normally takes multiple compiles to work out bugs.
  2. Absence of typical LabVIEW debugging features in hardware – Once the code is running in hardware – or is hardware – you cannot probe, single-step, process highlight, set breakpoints, and so on.
  3. FPGAs execute fast and deterministically – FPGAs are chosen for applications requiring high speed and determinism. Subsequently, designers are often concerned with exactly what is happening at every clock cycle of the FPGA, either for pure performance reasons or to characterize synchronization between parallel tasks.

LabVIEW FPGA provides functionality you can use to conduct basic FPGA algorithm testing by either simulating the I/O or using real I/O.

  • Execute VI on the development computer with simulated I/O – The FPGA VI executes on the PC when you press the run arrow. You can select to use either random data or custom I/O to write a test bench VI to assert the inputs and capture outputs.
  • Execute VI on the development computer with real I/O – At this time, this feature is available for only NI R Series plug-in devices. This option runs the VI on the PC and downloads a fixed personality to the R Series device to sample the I/O when the program executes the FPGA I/O Node. This is useful for early testing and prototyping, but keep in mind that the I/O is a software-timed sampling and most likely does not represent the timing you really want your VI to use.

    Note: Using real I/O requires hardware.

Measuring I/O Using Data Acquisition


Software testing can be limited because it does not provide the same feel of using real-world hardware. With LabVIEW, you can use commercial off-the-shelf hardware to perform real-world I/O testing.

You can easily debug physical hardware I/O by using a digital multimeter or a data acquisition device. LabVIEW combined with the NI-DAQmx driver provides an easy-to-use, high-level interface to perform complex data acquisition tasks with DAQmx Express VIs.

Figure 2. Testing With DAQ

Use the DAQmx Express VI to:

  • Measure the physical outputs of the embedded prototype and analyze the quality and reliability of the signal
  • Provide the embedded prototype with real signals to push the software algorithm to its limits and stress the test system

Full System Test Bench

System ID


The LabVIEW System Identification Toolkit is a library of VIs and an assistant for developing models of a system based on a large set of raw data. With these tools, you can complete the entire system identification process from analyzing the raw data to validating the identified model. Use the System Identification Assistant to develop a model that reflects the behavior of a certain dynamic system in even less time.

System identification is a method of developing mathematical models of a dynamic system based on a set of measured stimulus and response data. You can use system identification in a wide range of applications, including mechanical engineering, biology, physiology, meteorology, economics, and model-based control design.

A model-based control design process often involves identifying a plant model, analyzing and synthesizing a controller for the plant, simulating the closed-loop system, and deploying the controller to real-time hardware

The LabVIEW System Identification Toolkit:

  • Assists you in identifying large multivariable models of high-order systems from real-world data
  • Provides two tools, an assistant and a library of VIs, for identifying discrete single-input single-output and multiple-input multiple-output linear systems
  • Helps you complete the entire system identification process from analyzing the raw data to validating the identified model
  • Integrates with other add-ons including the LabVIEW Real-Time and LabVIEW Control Design and Simulation modules

The System Identification Toolkit provides VIs that you can use to preprocess raw data from a dynamic system and develop a model that reflects the behavior of that system. With the Data Preprocessing VIs, you can analyze the response of a plant or dynamic system to a certain stimulus. After analyzing the data, you can use the Parametric Model Estimation, Nonparametric Model Estimation, Partially Known Model Estimation, Recursive Model Estimation, and/or Frequency-Domain Model Estimation VIs to estimate a model for the plant or dynamic system. Finally, you can use the Model Validation or Model Analysis VIs to determine whether the model accurately describes the dynamics of the identified system.

Hardware-in-the-Loop (HIL) Applications


Embedded control systems play an important role in controlling the different components of a typical mechanical system. Software simulation of the system before actual testing is not always helpful because the simulation does not run in real time with actual analog and digital signals. This dilemma has led to the adoption of HIL simulation as a standard method for testing embedded control systems before final deployment.

Testing a complete embedded prototype can be difficult, especially when trying to test how all of the components of a whole system interact together. When testing prototype embedded control systems, safety, availability, or cost considerations can make it impractical to perform all of the necessary testing using the complete system. You can use HIL simulation to simulate the parts of the system that pose these challenges. This gives you the power to thoroughly test the embedded control device in a virtual environment before proceeding to real-world tests of the complete system. With this capability, you can maintain reliability and time-to-market requirements in a cost-effective manner even as the systems you are testing become more complex.

Figure 3. An HIL test system consists of three primary components: a software interface, a real-time processor, and I/O interfaces

The diverging challenges of shorter time to market, greater reliability, and increasing product complexity necessitate an HIL test platform that helps you:

  • Configure and monitor the UI and test management utilities such as NI VeriStand on the host
  • Use the real-time simulator to produce real-world electrical interactions between the embedded controller and the test system
  • Set up tests such as physical loads and fault insertions – an HIL test system can accurately simulate real-world conditions and test the response to fault situations

The LabVIEW graphical development environment and the NI PXI modular hardware platform are ideal for creating HIL systems to achieve highly realistic simulations for controller testing.

Figure 4. Graphical System Design

NI VeriStand is a software environment for configuring real-time testing applications including HIL tests. It helps you configure a multicore-ready, real-time engine to execute tasks such as the following:

  • Analog, digital, communication bus, and field-programmable gate array (FPGA)-based I/O
  • Triggerable, multifile data logging
  • Real-time stimulus generation
  • Calculated channels
  • Event alarming and alarm response routines

NI VeriStand can also import control algorithms and simulation models from LabVIEW software and third-party environments. You can monitor and interact with these tasks using a run-time editable UI that includes many useful tools for value forcing, alarm monitoring, I/O calibration, and stimulus profile editing. While no programming knowledge is required to use NI VeriStand, it is designed to be customized and extended using a variety of software environments, including NI LabVIEW, NI TestStand, Microsoft Visual Studio .NET, C/C++, and Python.

Next Steps

National Instruments offers a variety of tools for testing an embedded prototype. Combining the LabVIEW platform with tools such as NI-DAQmx and NI VeriStand helps you thoroughly test quality, reliability, and performance throughout the product development cycle.

For more information on the next steps in the prototyping process, return to the Functional Prototyping Series.

Related Resouces

More Information on Prototyping

1 Ratings | 5.00 out of 5
Read in | Print | PDF

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).