Synchronizing Motion, Vision, and Data Acquisition

Publish Date: Aug 24, 2016 | 52 Ratings | 3.85 out of 5 | Print

Overview

Many systems using motion control often do more than just motion control. Frequently, systems combine motion control with functions such as image acquisition or data acquisition. One of the challenges in integrating different processes is getting them to synchronize and work together. RTSI is one of the keys to getting the motion control, image acquisition, and data acquisition to work in a coordinated fashion.

Table of Contents

  1. What is RTSI?
  2. Which Functions are Available over RTSI and How Is It Configured?
  3. How is RTSI Used for Motion Control?
  4. References

1. What is RTSI?

RTSI stands for Real-Time System Integration bus, a dedicated high-speed digital bus designed to facilitate system integration by low-level, high-speed real-time communication between National Instruments devices. Using RTSI, motion devices are able to share high-speed digital signals with data acquisition, image acquisition, or digital I/O devices with no external cabling and without consuming bandwidth on the host bus. RTSI also has built-in switching, so you can route signals to and from the bus on the fly through software.

For PCI boards, the physical bus interface is an internal 34-pin connector, and signals are shared via a ribbon cable inside the PC enclosure. RTSI cables are available for chaining two, three, four, or five boards together. PXI modules require no cabling at all because the built-in PXI Trigger Bus handles RTSI functions.

Note: Although the RTSI connector has 34 pins, only seven are available for user signals. The software-configurable RTSI switch is used to accommodate more than seven signal options for each board. The switch is a digital many-to-few selector switch; you can route any available signal to any RTSI pin. You can also route more than one signal to a single RTSI pin or to connect two RTSI pins to the same signal.

RTSI functionality varies depending on the board type. For example, on 7344 Series motion controller devices, you can directly read and write to the RTSI pins. You can also configure them as high-speed capture inputs or breakpoint outputs. High-speed capture inputs are used as a trigger to capture and store position or initiate motion events. Breakpoint outputs are used to trigger other devices by asserting at preset positions. On E Series DAQ devices, 15 timing signals are available to RTSI -- timebase, acquisition clock, and general-purpose counter signals. On National Instruments image acquisition devices, a variety of trigger and video synchronization signals are available.

RTSI provides high-speed, hardware-based synchronization capability to any automated measurement or machine control application, and makes it easy for you to:

  • Build high-axis-count motion systems
  • Clock data acquisition based on position
  • Integrate motion and vision

Back to Top

2. Which Functions are Available over RTSI and How Is It Configured?

The functions available to RTSI vary by device type. Below is a list of popular National Instruments devices and the functions available on each. In the "Direction" column, output means from device to RTSI bus and input means from RTSI bus to device.

Table 1. RTSI Functionality for the PCI/PXI-7344 Control Devices
Function
Direction
Description
LabVIEW VI
High-Speed Capture Input Capture position or trigger event when asserted
Select Signal.flx
Breakpoint Output Assert at preset position
Select Signal.flx
RTSI Software Port Input or output Read or write directly to RTSI bus
Select Signal.flx


The motion libraries for LabVIEW contain a Select Signal VI, which is used to route the signals. The LabVIEW Motion online help for this VI contains specific information about routing the signals.

Table 2. RTSI Functionality for E-Series Data Acquisition Devices
Function
Direction
Description
LabVIEW VI
TRIG1
Input or output
Trigger for the analog input
Route Signal.vi
TRIG2
Input or output
Trigger for the analog input
CONVERT
Input or output
Convert signal for analog input
UPDATE
Input or output
Update clock for the analog output
WFTRIG
Input or output
Trigger for the analog output
GPCTR0_SRC
Input or output
Source for counter 0
GPCTR0_GATE
Input or output
Gate for counter 0
GPCTR0_OUTPUT
Output
Output from counter 0
STARTSCAN
Input (both for PXI)
Scan clock for analog input
AIGATE
Output
Gate for analog input
SISOURCE
Output
Sample clock for analog input
UISOURCE
Output
Sample clock for analog output
GPCTR1_SRC
Output
Source for counter 1
GPCTR1_GATE
Output
Gate for counter 1
RTSI_OSC (20 MHZ)
Input or output
Timebase for all board clocks


Table 3. RTSI Functionality for the PCI/PXI-1408, PCI/PXI-1422, PCI-1424 Image Acquisition Devices
Function
Direction
Description
LabVIEW VI
Disabled
None
The trigger line is disabled
IMAQ Trigger Drive VI
Acquisition in Progress
Output
High when acquisition is in progress
IMAQ Trigger Drive VI
Acquisition done
Output
Asserted when the entire acquisition is finished
IMAQ Trigger Drive VI
Pixel Clock
Output
Pixel clock times the sampling of pixels (only on the PCI/PXI-1408)
IMAQ Trigger Drive VI
Unasserted
Output
Write line to unasserted state
IMAQ Trigger Drive VI
Asserted
Output
Write line to asserted state
IMAQ Trigger Drive VI
Horizontal Synchronization Signal
Output
Horizontal synchronization signal produced at the beginning of each line by the camera
IMAQ Trigger Drive VI
Vertical Synchronization Signal
Output
Vertical synchronization signal produced at the beginning of each field by the camera
IMAQ Trigger Drive VI
Frame start
Output
High when a frame is being captured
IMAQ Trigger Drive VI
Frame done
Output
Asserted at the end of each frame that is captured
IMAQ Trigger Drive VI
Disabled
None
Triggering is disabled
IMAQ Trigger Configure VI
Trigger start of acquisition
Input
When the assertion edge of the trigger is received, the acquisition is started
IMAQ Trigger Configure VI
Trigger start of buffer list
Input
When the assertion edge of a trigger is received, the buffer list is acquired. If the acquisition is continuous, buffer index 0 will always wait on a trigger before acquiring
IMAQ Trigger Configure VI
Trigger each buffer
Input
Each buffer waits for a trigger before acquiring an image into the buffer
IMAQ Trigger Configure VI
Trigger each line
Input
Each line is triggered. This is useful when using an encoder to acquire line scan images. Only supported with Line Scan camera
IMAQ Trigger Configure VI


Table 4. RTSI Functionality for the PXI-6533, PCI-DIO-32HS High-Speed Digital I/O Devices
Function
Direction
Description
LabVIEW VI
REQ1
Input or output
Handshaking request 1
Route Signal.vi
REQ2
Input or output
Handshaking request 2
Route Signal.vi
ACK1
Input or output
Handshaking acknowledge 1 or start trigger
Route Signal.vi
ACK2
Input or output
Handshaking acknowledge 2 or start trigger
Route Signal.vi
STOPTRIG1
Input
Stop trigger
Route Signal.vi
STOPTRIG2
Input
Stop trigger
Route Signal.vi
PCLK1
Input or output
Data clock
Route Signal.vi
PCLK2
Input or output
Data clock
Route Signal.vi

 

Back to Top

3. How is RTSI Used for Motion Control?

RTSI signals can be used to synchronize high-axis-count motion applications, or to synchronize data or image acquisition. More detail on each of these applications is given below.

Application 1. Coordinated Multi-axis, Multiple-Device High-Performance Controller
Two or more 7344 Series motion controllers can be used to create a single, high-axis-count, coordinated real-time controller. While the Vector Space feature of the 7344 Series board is used to closely coordinate axes located on the same board, if axes need to be coordinated and reside on separate devices, RTSI must be used. You can use direct reads and writes from RTSI to synchronize motion between axes on different devices. Note that although several devices are involved, the motion control system retains its hard real-time performance by using RTSI and onboard programming without having to use a real-time operating system.

The following code details how to directly read and write to RTSI from your 7344 Series controller. The code writes RTSI 0 high, performs a move, and writes RTSI 0 low on completion. The wired diagram is shown in Figure 1.

Note that storage VIs on each end of the code make this an onboard program. We first prepare RTSI 0 for reading and writing, then load a target position. Just before the move, we set bit 1 high using the Must On feature of Set I/O Port MOMO.flx. (Port 5 is specified for this VI to indicate the RTSI port.) We then start the move and wait for it to complete. We must use Select_MOMO.flx to change the axis number into a bit map for input to Wait on Condition.flx. Finally when the move is over, we reset RTSI 0 using the Must Off feature of Set I/O Port MOMO.flx and end the program.


Figure 1. The Block Diagram Showing Direct Writes to RTSI 0


Application 2. Position Referenced Data Acquisition
You can also use RTSI to clock your data acquisition based on the position from the motion controller. The Breakpoint Output feature of the 7344 Series device is used to assert a digital output at specific positions during the move. This digital output is routed over RTSI to the National Instruments E Series DAQ device scan clock input. The DAQ device takes one scan (one sample from each active channel) at every breakpoint. This arrangement finds application in torque and force measurement systems, antenna directionality characterization, and any measurement systems where data versus position is of interest.

The following code shows how to implement the Breakpoint Outputs over RTSI. This onboard program configures the RTSI line, then activates RTSI 0 half way through the move. The wired diagram is show in Figure 2.



Figure 2. The Block Diagram Showing How To Activate the Breakpoint for Axis 1 over RTSI 0


Application 3. Logging Position Information for Video Frames
Another common application is to use RTSI to capture and record the position of video frames. The High-Speed Capture Input feature of the 7344 Series board is used to capture and log position based on the Frame Start pulse. The Frame Start pulse is routed over RTSI from a National Instruments IMAQ 1408 image acquisition device. A typical application for video frame/position logging is auto-focusing. Note that the principles shown here illustrate a powerful technology that finds application in many other position logging and event synchronization scenarios.

The following code shows how to implement high-speed capture and position logging over RTSI. The wired diagram is shown in Figure 3.

The code routes the capture line for axis 1 to RTSI 0, loads a target position, and begins the move. Each time RTSI 0 is activated, the captured position is stored in variable location 1 for retrieval by the host. Note the capture is re-enabled each time through the loop. In addition, Select.flx is used to create a bitmap for Enable High-Speed Position Capture.flx. The only difference between this VI and Select_MOMO.flx is the number of elements in the output cluster.

This code is meant to illustrate concepts of the high-speed capture rather than to serve as a working example of data manipulation. It is clear that onboard buffering or capture reads directly from the host would be more practical in this case. Also, the code leaves no means to exit the loop.



Figure 3. The Block Diagram Showing How To Accept High-Speed Capture for Axis 1 over RTSI 0

Back to Top

4. References

 

The following documents contain more information about using RTSI with your National Instruments product:
NI-DAQ Function Reference Manual
NI-DAQ User Manual
LabVIEW Measurements Manual
NI-IMAQ Function Reference Manual
NI-IMAQ VI Reference Manual
NI-Motion Help: RTSI

Back to Top

Bookmark & Share


Ratings

Rate this document

Answered Your Question?
Yes No

Submit