Triggers

Last modified by Lev Andronov on 2025/05/20 11:24

Trigger types

There are two types of triggers supported by API:

1. Camera trigger

This will trigger the camera. On each trigger, the camera will send a single frame.

2. Frame Grabber trigger

In this mode, the camera should run in continuous mode. When the Frame Grabber is triggered, it will allow for a single frame to be acquired in the allocated buffer.

WARNING: Please ensure that you do not enable both trigger modes simultaneously, as this could cause failure.

Detailed information can be found in sections Camera Trigger and Acquisition (Frame Grabber) Triggers of the KAYA Frame Grabber Feature Guide


Triggers examples

Software trigger

Basic example to configure single frame acquisition with a software trigger.

  1. Open Vision Point, select the frame grabber, and scan for cameras
  2. Open the camera parameters browser and navigate to Acquisition Control -> Trigger Selector
  3. Set "TriggerMode" = "On"
  4. Set "TriggerSource" = "Software"
  5. Start the transmission on the camera
  6. Every time you click "Execute" at the "Trigger Software" will trigger the camera to image acquisition

Timer trigger

This example describes how to set up a timer as a trigger. Before configuring, open Vision Point, select the frame grabber, and scan for cameras.

Step 1: Configure the timer to create a square wave:

  1. In the frame grabber parameters browser navigate to "Frame Grabber I/O Control" -> "Timer Control"
  2. Set "TimerTriggerSource" = "Continuous"
  3. Set "TimerSelector" = "Timer0"
  4. Set "TimerDelay" and "TimerDuration" to get the desired frequency. See examples below:
Parameter10KHz10HzDescription
TimerDelay50.0 (50us)50000.0 (50ms)100ms total clock pulse which gives 10 FPS
TimerDuration50.0 (50us)50000.0 (50ms)100us total clock pulse which gives 10,000 FPS

Step 2: Configure the frame grabber to send triggers to the camera

  1. In the frame grabber parameters browser navigate to "Extended Stream Features" -> Choose "Camera Selector id" -> "Camera Trigger Control"
  2. Set "CameraTriggerMode" = "On"
  3. Set "CameraTriggerActivation" = "AnyEdge"
  4. Set "CameraTriggerSource" = "Timer0Active"

Step 3: Configure the camera to receive the triggers from the frame grabber

  1. In the camera parameters browser navigate to "Acquisition Control" -> "Trigger Selector"
  2. Set "TriggerMode" = "On"
  3. Set "TriggerSource" = "LinkTrigger0"

Step 4: Configuration is complete, start the acquisition to view the results.

External trigger via GPIO

Info about pinout for the General Purpose Input Output are located in Frame Grabber and Simulator Hardware Reference & Installation Guide

Steps to configure the camera to be triggered from external source of frame grabber GPIO:

  1. Connect trigger source to dedicated pins on the GPIO of the frame grabber, e.g. pin 18 [GND] and 19 [TTL0] for the Komodo II\III.
  2. In Digital I/O section of the grabber set "LineSelector" = "TTL0" and configure related parameters (if required).
    1. Check incoming trigger signals by refreshing status of parameter "LineStatusAll" (see image below). Changes in the trigger state can be seen by refreshing the "LineStatusAll" parameter value (if no changes are observed, it may be because the trigger is too fast. Reduce the trigger frequency to check the trigger changes, and return it to the desired state for regular operation).
  3. Configure trigger mode for the camera. Usually, this can be achieved by setting "TriggerMode" to "On", but this is a camera specific setting which may require additional configurations and have a different naming.
  4. Redirect the GPIO triggers through the frame grabber to the camera trigger by setting "CameraTriggerMode" to "On", "CameraTriggerActivation" to "AnyEdge" and "CameraTriggerSource" to the GPIO input (see image below).

camera_trigger_control.png

The Frame Grabber stream trigger ("Trigger Control") should not be enabled with the camera trigger ("Camera Trigger Control"); this may cause a collision between the two trigger logics, which may result in unexpected behavior.


Two frame grabbers triggering sync

Short description on how to enable syncronized triggering of two KAYA frame grabbers. This scenario requires GPIO pin-to-pin connection.

Connect two frame grabbers accroding to the instructions from "Frame Grabber and Simulator Hardware Reference & Installation Guide" section GPIO Connectors and section GPIO Pinout.

In case of Komodo II/III it will be pin 18 to pin 18 (GND) and pin 19 to pin 19 (TTL0).

  1. For all cameras on all grabbers
    1. Set "TriggerMode" on camera to "1"
    2. Set "TriggerSource" on camera to "LinkTrigger0"
  2. For the master grabber:
    1. Set "LineSelector" to "TTL0"
    2. Set "LineMode" to "Output"
    3. Set "LineSource" to "TimerActive0"
    4. Timer configuration
      1. Set "TimerSelector" to "Timer0"
      2. Configure FPS using formula = 1e+6/ExpectedFPS
      3. Set "TimerDelay" = Frametime/2
      4. Set "TimerDuration" = Frametime/2
      5. Set "TimerTriggerSource"
    5. Configure each connected camera
      1. Choose "CameraSelector"
      2. Set "CameraTriggerMode" to "1"
      3. Set "CameraTriggerActivation" to "AnyEdge"
      4. Set "CameraTriggerSource" to "TTL0"
  3. For the slave grabber
    1. Set "LineSelector" to "TTL0"
    2. Set "LineMode" to "Input"
    3. Set "LineSource" to "0"
    4. Configure each connected camera
      1. Choose "CameraSelector"
      2. Set "CameraTriggerMode" to "1"
      3. Set "CameraTriggerActivation" to "AnyEdge"
      4. Set "CameraTriggerSource" to "TTL0"

Frame rate trigger

The following example illustrates how to configure "Timer2" to define the frame rate of stream trigger for incoming data frames from the camera.

Step 1: Configure "Timer2" trigger source to be active in a continuous mode:

  1. Set "TimerSelector" to "Timer2"
  2. Set "TimerDelay" and "TimerDuration" to get the desired frequency.
  3. Set "TimerTriggerSource" to "KY_CONTINUOUS" mode

Step 2: Configure the frame grabber stream trigger control:

  1. Set "CameraSelector" to select the destination camera
  2. Set "TriggerActivation" to "AnyEdge"
  3. Set "TriggerSource" as "KY_TIMER_ACTIVE_2"
  4. Set "TriggerMode" to "On."

Step 3:  Configure the camera trigger:

  1. Set "TriggerMode" in the Camera tab to "On".
  2. additional configurations might be needed to set up a trigger in the camera

Send N triggers

How to send N triggers from Frame Grabber to camera?

Example with trigger rate 200 (your camera need to support this rate) and 5000 triggers. The timer 0 will be activated by software trigger for debug purposes (later it can be changed to TTL source)

  1. First set a timer that will be high for the duration of the triggers generation (all 5000 triggers)
    1. Set "TimerSelector" = 0
    2. Set "TimerDelay" = 10
    3. Set "TimerDuration" = 25000000.0 // 25 seconds of operation, maximum 34 seconds
    4. Set "TimerActivation" = "RisingEdge"
  2. Set "TimerTriggerSource" = 43 // software trigger
  3. Set a second timer that will generate the triggers to the camera and select its source as a second timer. The trigger activation should be "Level High"
    1. Set "TimerSelector" = 1
    2. Set "TimerDelay" = 2500
    3. Set "TimerDuration" = 2500 // frame rate of 200 fps
    4. Set "TimerActivation" = "LevelHigh"
    5. Set "TimerTriggerSource" = 48 // timer 0 trigger
  4. Configure the camera trigger
    1. Set "CameraSelector" = 0 // camera index
    2. Set "CameraTriggerActivation" = "AnyEdge"
    3. Set "CameraTriggerSource" as "KY_TIMER_ACTIVE_1"
    4. Set "CameraTriggerMode" = "On"
  5. To activate 1 run (5000 triggers), use the Timer0 trigger software execute for debug. Then you can change the trigger source to TTL or any other IO.
    1. Execute "TimerTriggerSoftware"
  6. Make sure to check the "RXFrameCounter" to get the exact frames captured by the Frame Grabber and NOT the frame count in the bottom of the GUI picture window.

Restriction: The minimum FPS that the camera should support is approximately 146, because the timer duration is limited to around 34.35 seconds, so it needs time to generate 5000 triggers.

Triggers known issues

Lost frames at high FPS

When sending triggers it’s necessary to calculate the expected frame rate and set the delay accordingly.

  • Trigger Interval: 12 ms
  • Formula: 1 sec / 12 ms = 83.33 fps (approx.) 

If the trigger rate is too fast, the last image may be lost.

Use our online FPS Calculator to ensure that your camera's frame rate and bandwidth settings are properly configured, also you can download Iron Excel Calc.

No frame at short triggers

It is a known issue that Iron cameras do not process triggers with durations shorter than 1.5 microseconds.

KAYA Instruments © 2024. All Rights Reserved.