Viewpoint Systems, Inc.
800 West Metro Park
Rochester, NY 14623
Phone: 585.475.9555
Fax: 585.475.9645
Viewpoint Data Management, LLC.
800 West Metro Park
Rochester, NY 14623
Phone: 585.475.9555
Fax: 585.475.9645
Viewpoint News, Fall 2007By now, most of you know that National Instruments offers a version of LabVIEW that runs on a realtime operating system. This LabVIEW Realtime (LV RT) operating system (OS) removes all those “invisible” applications that run in the background and that interfere with your LV application under a typical OS (e.g., Windows). Loop execution timing jitter is reduced just by removing these interfering applications. Nevertheless, loop jitter will still be present and can be large without proper understanding of some common sources of timing jitter.
This article describes some tips on minimizing jitter and summarizes some applications we have implemented with LV RT showing a range of what is possible with LV RT.
Background
Starting 2 or 3 years ago, Viewpoint Systems now increasingly uses LV RT for implementing a wide variety of solutions. However, we have learned (sometimes the hard way!) that you need to be aware about RT development: it is not exactly the same as regular LV.
Programming Challenges
Below is a list of some stumbling blocks that need consideration when using LV RT. These items can significantly affect execution performance and jitter.
In general, LabVIEW applications written for RT require special attention to avoid introducing jitter due to software-induced holdoffs and latencies. Despite the high-priority of the TCL, it is still possible for LV RT to require execution of some code to complete before the TCL is given CPU time. In addition, latencies due to data-dependent processing time add jitter in the execution timing of downstream code.
Performance Decisions
The split between the “slow” and “fast” speeds are roughly around 1 to 10 ms range. And, on the complexity axis, “simple” and “complex” are divided by a number of factors that include handling acquired data, data processing and analysis, and algorithmic logic.
Generally, a “simple” app has no need to buffer acquired data (because aggregate rates are low enough), applies simple arithmetic to channels (some calculated channels and level checking for triggering or state changes), and uses a state machine with only a few states. All other applications are “complex”.
Of course, these descriptors are rules of thumb and results will vary.
Performance Experience
Model-based Control and Acquisition
Of course, in these types of tests, we also use either normal LV or LV RT for test management and measurements.
We run the model(s) on PXI, FPGA, or both.
For example, we’ve run a model (essentially a rate-limited PID) for a SISO (Single Input, Single Output) analog hydraulic controller on the FPGA at a 20 µs loop period. This model used the fixed-point arithmetic under LV 8.5. The model was originally from Simulink and was recoded into the FPGA code. Another version of this same application used a 3 M gate FPGA to handle 8 channels of RMS measurements, 2 channels of demodulation from an LVDT, and 2 of the rate-limited PIDs all running at 125 µs loop period.
Some other more complex situations required a PXI controller. One system emulated the load for an aircraft flight surface and had about 30 channels of analog and digital I/O running at 1 ms loop period. This system used control algorithms to move both the flight surface and the simulated load. Another PXI-based system tested a Gatling gun controller by connecting it to a PXI box that simulated an actual Gatling gun’s mechanical and electrical properties, such as acceleration, fire control timing, and position feedback. This system had about 50 digital I/O channels and IEEE-1553 communications running under LV RT at 1 ms loop period.
Smart Data Monitor combined with Logging
The data logged is usually either a snapshot of values (waveforms of single samples) or a buffer of most recent history on all channels. This latter usage is nice because it allows some understanding of why the event occurred.
The small physical size of the cRIO makes it an ideal solution for these applications. We typically use the Ethernet port to extract the collected data via FTP for review elsewhere.
Machine Control
A typical application concerns glass containers being manufactured at about 300 per minute along an assembly line. During the 200 ms per container, analog sensor waveforms collected at 10 kS/s indicate quality of each container, digital sensors collected at 10 kS/s indicate product position, and digital outputs must be synchronized to product position to within a few milliseconds.
The challenge in this application was not the sample rates, which were nominal for a PXI or cRIO. Instead, the challenge was the synchronization of the digital sensor timing information with the positioning of the analysis window on the analog waveforms and the digital control on the reject station. Thus, some rapid, on-the-fly data analysis adjustments were required, forcing the need for rapid, deterministic algorithm timing.
Custom Instrumentation
We’ve used the FPGA to build “circuitry” that performs the same function as actual circuitry. Some examples are:
All these examples took an input signal, manipulated it, and created an output signal. It is easy to imagine other applications in this arena that would utilize the cRIO processor too. For example, to construct a frequency-band power meter, the input analog signal could be processed with an FFT, and an analog output could be created from the amount of power in a specified frequency band (or bands, if you wanted to output multiple analog signals).