|
High-performance data acquisition on USB
With the right software, USB 2.0 ports can deliver very fast performance, even faster than traditional parallel buses like PCI. Thorsten discusses the architectural points and some insights behind the design of USB 2.0 Data Acquisition (DAQ) hardware and software that can enable very fast data capture and analysis.
Because USB was originally developed to replace low-speed peripheral cabling, many engineers fail to see its potential as a high-performance DAQ channel. The original USB specification offered only a modest bit rate, but USB 2.0 handles 480 Mbps, fast enough to handle 60 MBps data streams. Even with the protocol reserving some bandwidth for interrupts and control transfers and the header overhead on data packets, the bus can easily sustain more than 10 MBps of continual data transfer. This is fast enough to support extremely high-performance DAQ hardware. Start capturing data fast Software for handling the data also becomes simpler to implement. The host system USB drivers separate data streams into logical channels called pipes. This means the host system software will automatically form a logical connection from a DAQ channel to a destination within the application software, simplifying software and hardware setup. Applications simply need to identify the logical pipe they wish to connect with and the system software ensures data travels to the right destination. Application software does not need to know the details of peripheral addressing, interrupt placement, or other installation-dependent parameters as it must for PCI plug-in cards. The USB also has electronic advantages. The bus can power the peripheral (within limits) so that the DAQ system does not need its own power source. This further eases system installation and use and has the added benefit of removing the sensitive A/D converters and amplifiers from the electrically noisy environment inside a system enclosure. Unlike PCI plug-in cards, a USB-based DAQ module is easily shielded for achieving high bit-level resolution. Better bulk transfers The proper mode to use for DAQ on USB is the bulk transfer mode (see Figure 1). This mode supports resending corrupted packets, thus ensuring data accuracy, and allows fairly large 512-byte blocks, keeping overhead effects down. The drawback is that bulk transfers do not have guaranteed timing. The USB host controller assigns bandwidth for bulk transfers but reserves priority for interrupt and control transfers. Thus, the bandwidth obtained by using bulk transfers is an average – not a sustained – data rate while the DAQ module must send data at a constant speed.
Getting rid of uncertainty The alternative approach calls for the DAQ module to incorporate FIFO buffering to hold data while waiting for the bus to become available. Dual buffers are needed in the module, one to fill while the other is emptying. The larger the buffers, the more tolerant of shifting bandwidth availability the module becomes and the closer its data rate can approach the average bandwidth available. In addition to the FIFO buffering on the DAQ module, the software drivers should allocate buffer space in the host system at the receiving end. This decouples the host system’s data processing activity from the DAQ so that neither activity can delay or impede the other’s performance.
On the host side, careful driver design can reduce latency by speeding the host system’s response to incoming USB data. Traditional Windows drivers allocate buffer space in response to an incoming USB transfer, taking many milliseconds getting ready to receive data once the DAQ module declares data is ready to send. Drivers that are proactive instead of reactive, preallocating buffer spaces of the right size can decrease host latency by an order of magnitude. Speed, accuracy, and more But a high data rate is not all that is required of a high-performance DAQ module, such as shown in Figure 2. Issues such as accuracy, aperture uncertainty, and noise levels are equally important. Further, the inclusion of additional capabilities such as digital I/O lines, counter/timers, analog outputs, and quadrature encoders can greatly increase the utility of a DAQ module.
More accurate conversions
Accuracy also involves timing, however, especially in a multichannel DAQ module. To properly compare and correlate sampled signals it is important to know the relative timing of samples from one channel to the next. Most DAQ systems use a single A/D converter with a multiplexer front end to handle multiple channels. This architecture results in each channel’s signal being sampled at a different time, forcing the use of interpolation to bring the signal data into temporal alignment and resulting in relative timing errors or phase noise. Ideally, the samples for all channels should be made simultaneously to eliminate phase noise. High-performance DAQ modules do not use a multiplexer. Each channel has its own track-and-hold stage with an independent successive-approximation A/D converter (see Figure 4). The converters use a common clock and the track-and-hold stages have a common trigger so that the modules offer true simultaneous sampling. The channels have an aperture delay of 35 ns with uncertainty (aperture jitter) of 1 ns, and channels are well matched so that the difference between channels is less than 5 ns. This virtually eliminates phase noise in data.
A complete, fast USB DAQ system
Supporting these additional signal lines means the data channel must be fast enough to handle the additional signal and control bits without affecting the module’s sampling rate. USB 2.0 is fast enough and has proven it can provide the needed capacity, rendering significant ease-of-use benefits. Designers no longer need to pry open a system to assemble a high-performance DAQ system – they can simply plug one into an available USB port. |
|











