Global TMW:
Login  |  Register          Free Newsletter Subscription
Subscribe
Email
Print
Reprint
Learn RSS

Stabilize measurements with Linux

Two applications show that the open-source operating system keeps on running.

Martin Rowe, Senior Technical Editor -- Test & Measurement World, 3/1/2003

Linux drivers
Custom Linux

The Linux operating system (OS) has frequently been touted as a reliable, stable alternative to Windows in test applications. Recently, engineers at Boeing (St. Louis, MO) and Sandia National Labs (Livermore, CA) developed test systems that employ the OS, demonstrating that Linux lives up to its promise.

Boeing engineers developed a real-time, Linux-based system that simulates signals from "man-in-the-loop" controls, such as sticks, throttles, and rudders. Engineers at Sandia used embedded Linux to develop a handheld general-purpose data-acquisition system.

Both applications show that Linux is a viable, stable OS for use with instrumentation. Linux can run on embedded computers and, with real-time extensions, perform timely measurements. But on the down side, using Linux often requires more programming expertise than using Microsoft Windows or Apple MacOS.

Real-time aerospace application

Figure 1 A single-board computer running both real-time and standard Linux simulates signals from aircraft controls such as sticks, throttles, and rudders.

Coincidentally, the lead engineers in the Boeing and Sandia applications have the same name—Richard Jennings. Boeing's Senior Specialist Engineer Richard Jennings needed a real-time system to acquire aircraft control signals. Windows was too slow for the job, as was standard Linux. Jennings needed a system that responds to instrument commands in less than 1 ms, but response times from Windows and standard Linux can run as long as 30 ms.

To get real-time response, Jennings combined standard Linux with the Realtime Linux Application Interface (RTAI, www.aero.polimi.it/~rtai). The two distributions run on separate processors on a dual-processor, single-board computer (SBC) installed in a PCI passive-backplane chassis (Figure 1).

One processor, running standard Linux only, handles communications with an external computer over an Ethernet link. The external computer runs the simulation of aircraft dynamics and provides a graphical user interface (GUI).

The second processor, which runs standard Linux and RTAI simultaneously, performs real-time control on the 14 I/O cards in the passive-backplane chassis:

  • two 32-channel analog-output cards from United Electronic Industries (Canton, MA: www.ueidaq.com),
  • one 64-channel analog-input card from National Instruments (Austin, TX; www.ni.com),
  • nine 96-channel digital I/O cards from Measurement Computing (Middleboro, MA; www.mccdaq.com), and
  • two eight-port RS-232 interface cards from Comtrol (Hopkinton, MA; www.comtrol.com).

Because Jennings needed a real-time OS to control the instrument cards, he had to either write his own drivers or modify Linux drivers obtained from the card manufacturers. For the analog-output cards, Jennings obtained the source code from UEI for the card's Linux driver and modified it to run under RTAI. He wrote his own drivers for the digital I/O cards because Measurement Computing doesn't offer Linux drivers for its products.

For the NI analog-input card, Jennings also wrote his own real-time driver. (For previous applications, he had used an ISA-bus version of the card and had written a DOS driver; he used the DOS driver as a model for the Linux/RTAI driver.) The Comtrol serial-port cards run under standard Linux, so they didn't require a real-time Linux driver. (To learn more about writing Linux drivers for instrument cards, see "Get Those Boards Running Under Linux," Ref. 1.)

When a user starts the system, standard Linux performs all initialization required and initializes the real-time RTAI tasks. The real-time RTAI tasks control the instrument cards while standard Linux processes handle "soft" real-time tasks such as RS-232 communications. RTAI processes and standard Linux processes communicate through shared memory and mailboxes. Together, they send measurement data to the simulation computer, and in turn, receive commands to control simulation hardware.

Embedded Linux

Besides running on desktop, notebook, and single-board computers, Linux runs on embedded computer systems. Sandia Labs' Richard Jennings, a principal technologist, developed a general-purpose data-acquisition system based on PC/104 embedded computers.

Figure 2 A PC-Card card stack controls a data-acquisition card with LabView for Linux. Courtesy of Sandia National Labs.

The system runs a stripped-down version of Linux and controls a National Instruments PC-Card data-acquisition card (Figure 2). The PC/104 embedded computer stack uses a PC-Card adapter to communicate with the card. Jennings wrote the application software using the Linux version of LabView, and he reports that Linux crashed only once—the result of a driver error.

Richard Jennings, Sandia

LabView runs on Windows, Linux, and Macintosh operating systems, and Jennings chose Linux because he believes it is the most stable and customizable OS. He removed unneeded components from the open-source OS, reducing its size from more than 100 Mbytes to less than 20 Mbytes. That's impossible under the closed Windows and Mac OSs. Stripping Linux is difficult, but it is a necessary step for embedded applications. "Custom Linux," above, discusses methods you can use to shrink the OS.

Jennings obtained the driver he needed for his data-acquisition card from an open-source project called Comedi (www.comedi.org), which contains Linux drivers for instrument cards from several manufacturers. After downloading the driver, Jennings had to compile the source code and install it into his application.

The engineers at Boeing and Sandia chose Linux because it enabled them to develop stable, reliable applications. Both applications required detailed knowledge of Linux, but not all Linux data-acquisition applications require such programming expertise. If you use downloaded drivers, you may have to compile them, but you don't need to know Linux's inner workings to do that. "Linux drivers," p. 34, provides a list of data-acquisition hardware manufacturers that provide Linux drivers.


Author Information
Martin Rowe has a BSEE from Worcester Polytechnic Institute and an MBA from Bentley College. Before joining T&MW in 1992, he worked for 12 years as a design engineer for manufacturers of semiconductor process equipment and as an applications engineer for manufacturers of measurement and control equipment. E-mail: m.rowe@tmworld.com.


Reference
  1. Ivchenko, Alex, "Get Those Boards Talking Under Linux, Test & Measurement World, May 2000. p.36. www.tmworld.com/archives.
 

Linux drivers

The Comedi Web site (www.comedi.org) contains drivers for many data-acquisition cards including those from Data Translation, Keithley Instruments, Measurement Computing, and National Instruments. The following companies also offer drivers for Linux; all companies make their drivers available free for downloading:

Acqiris (Monroe, NY) provides Linux drivers for its high-speed digitizer cards in PCI and CompactPCI formats. www.acqiris.com/Home/EntreProduct17.html

Adlink (Irvine, CA) offers a Linux software development kit for its PCI and CompactPCI data-acquisition cards. www.adlinktechnology.com/products/SoftwareSolutions/PCISDASK.htm

ines (Hannover, Germany) has drivers for its PCI and PC-Card IEEE-488 inter-face cards. www.inesinc.com/linux.htm

IOtech (Cleveland, OH) offers Linux drivers for its DaqBoard/2000 series of cards. www.iotech.com/prlinux.html

Microstar Labs (Bellevue, WA) lets you download Linux drivers for its DAP series of data-acquisition cards. www.mstarlabs.com/software/linux.html

National Instruments (Austin, TX) has drivers for its IEEE 488 interface cards and for VXI instruments through its NI-VISA for Linux driver set, but the company doesn't supply drivers for its data-acquisition cards. Drivers for E series data-acquisition cards are available through Comedi. www.ni.com/linux

United Electronic Industries (Canton, MA) offers Linux drivers for its data-acquisition cards. In addition, the company developed LabView virtual instruments (VIs) that let you control the company's cards directly from LabView. www.ueidaq.com

Custom Linux

Building an embedded Linux distribution isn't easy. Sandia's Richard Jennings explains that you can customize an off-the-shelf Linux distribution such as one from Debian (www.debian.org) by installing a minimal system (approximately 50 Mbytes of hard-disk space), then remove the components you don't need. This technique quickly produces a smaller OS, he says, but it probably won't make Linux small enough for most embedded applications.

He says that you can also start from the ground up using the Linux Bootdisk HOWTO (Ref. A, B). With this technique, you get a very small Linux distribution, but to use it, Jennings recommends that you have intimate knowledge of the Linux boot process.

A third option, one that Jennings and Gary W. Johnson describe in LabView Graphical Programming (Ref. C), uses an embedded Linux distribution such as PeeWeeLinux (www.peeweelinux.com). PeeWeeLinux is a modular embedded Linux based on Red Hat Linux (www.redhat.com). Johnson and Jennings' book contains a CD-ROM that includes the libraries necessary to run LabView compiled into an installable image file.

References

A. Fawcett, Tom, "The Linux Bootdisk HOWTO," www.linux.org/docs/ldp/howto/Bootdisk-HOWTO.

B. Moody, Paul, "One approach to an embedded Linux," Linux Weekly News, www.lwn.net/1998/0430/miniHOWTO.html.

C. Johnson, Gary W., and Richard Jennings, LabView Graphical Programming, 3rd ed., McGraw-Hill, New York, NY, 2001.

Email
Print
Reprint
Learn RSS

Talkback

We would love your feedback!

Post a comment

» VIEW ALL TALKBACK THREADS

Related Content

Related Content

 

By This Author

Sponsored Links



 
Advertisement
SPONSORED LINKS

More Content

  • Blogs
  • Podcasts

Blogs


Sorry, no blogs are active for this topic.

» VIEW ALL BLOGS RSS

Podcasts

Advertisements





NEWSLETTERS

Click on a title below to learn more.

Test Industry News (3 Times Per Month)
Machine-Vision & Inspection (Monthly)
Communications Test (Monthly)
Design, Test & Yield (Monthly)
Automotive, Aerospace & Defense (Monthly)
Instrumentation (Monthly)
Resource Center E-Alert (Monthly)
©2008 Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy
Please visit these other Reed Business sites