MATRIX VISION - mvBlueCOUGAR-X/-XD Technical Documentation
Processing triggers from an incremental encoder

Basics

The following figure shows the principle of an incremental encoder:

Figure 1: Principle of an incremental encoder

This incremental encoder will send a A, B, and Z pulse. With these pulses there are several ways to synchronize an image with an incremental encoder.

Using Encoder Control

To create an external trigger event by an incremental encoder, please follow these steps:

  1. Connect the incremental encoder output signal A, for example, to the digital input 0 ("Line4") of the mvBlueCOUGAR-X .
    This line counts the forward pulses of the incremental encoder.
  2. Depending on the signal quality, it could be necessary to set a debouncing filter at the input (red box in Figure 3):
    Adapt in "Setting -> Base -> Camera -> GenICam -> Digital I/O Control" the "Line Selector" to "Line4" and set "mv Line Debounce Time Falling Edge" and "mv Line Debounce Time Rising Edge" according to your needs.
  3. Set the trigger "Setting -> Base -> Camera -> GenICam -> Acquisition Control -> Trigger Selector" "FrameStart" to the "Encoder0" ("Trigger Source") signal.
  4. Then set "Setting -> Base -> Camera -> GenICam -> Encoder Control -> Encoder Selector" to "Encoder0" and
  5. adapt the parameters to your needs.
    See also
    Encoder Control
Figure 2: wxPropView settings
Note
The max. possible frequency is 5 KHz.

Programming the Encoder Control

#include <mvIMPACT_CPP/mvIMPACT_acquire_GenICam.h>

  // more code
  GenICam::EncoderControl ec( pDev );
  ec.encoderSelector.writeS( "Encoder0" );
  ec.encoderSourceA.writeS( "Line4" );
  ec.encoderMode.writeS( "FourPhase" );
  ec.encoderOutputMode.writeS( "PositionUp" );
  // more code

Using Counter

It is also possible to use Counter and CounterEnd as the trigger event for synchronizing images with an incremental encoder

To create an external trigger event by an incremental encoder, please follow these steps:

  1. Connect the incremental encoder output signal A, for example, to the digital input 0 ("Line4") of the mvBlueCOUGAR-X .
    This line counts the forward pulses of the incremental encoder.
  2. Set "Setting -> Base -> Camera -> GenICam -> Counter and Timer Control -> Counter Selector" to "Counter1" and
  3. "Counter Event Source" to "Line4" to count the number of pulses e.g. as per revolution (e.g. "Counter Duration" to 3600).
  4. Then set the trigger "Setting -> Base -> Camera -> GenICam -> Acquisition Control -> Trigger Selector" "FrameStart" to the "Counter1End" ("Trigger Source") signal.
Figure 3: wxPropView setting

To reset "Counter1" at Zero degrees, you can connect the digital input 1 ("Line5") to the encoder Z signal.