-
Notifications
You must be signed in to change notification settings - Fork 0
eGrabber and JAI camera configuration
The Euresys frame grabber and the JAI camera communicate GenICam interface. There is a huge set of parameters that you can tune through this interface (eg. triggering mode, exposure, etc.). You can set these parameters through various programmatic libraries (eg. eGrabber but also true for many other GenICam machine vision libraries), running a script (in eGrabber Studio you can run a JavaScript file to set things up), or manually through the eGrabber Studio GUI.
Tip
Refer to the GenICam Standard Features Naming Convention (SFNC) (Internet Archive link) if the names and values of different features prove too be too descriptive.
Caution
With GenICam, the sequence of operations matters. For example, to set TTLIO12 as an input line, we have to first set LineSelector to "TTLIO12" and then set LineMode to "Input". If we had set LineSelector to "TTLIO11" first, we'd be changing a different behavior by setting the same LineMode parameter to "Input".
This pages explains the necessary configurations for two operating modes:
- Example mode 1 (current / Spotlight): Frame grabber receiving an external trigger signal (eg. from an Arduino board) and passing it to the camera
- Example mode 2 (legacy setup / FlyTrack): Triggering the camera using a trigger signal generated by the frame grabber
Here, we will use an external microcontroller (Arduino Nano ESP32) to generate a LVTTL (3.3V) trigger signal. We pass the signal to the frame grabber via TTLIO (in this case TTLIO12 through the external IO connector). Then, the frame grabber sends this signal to the camera. For this example, the exposure time is controlled through trigger width (whenever the trigger signal is HIGH, the shutter is open, vice versa).
To do this, the following configurations are required:
Warning
Note that the behavior can still vary depending on other parameters, but theses are what's relevant.
- Tell the frame grabber to treat TTLIO12 as an input line:
- Under Interface ("InterfaceModule" in the eGrabber C++ API), set LineSelector to "TTLIO12"
- Under Interface ("InterfaceModule" in the eGrabber C++ API), set LineMode to "Input"
- Set LIN1 to TTLIO12:
- Under Interface ("InterfaceModule" in the eGrabber C++ API), set LineInputToolSelector to "LIN1"
- Under Interface ("InterfaceModule" in the eGrabber C++ API), set LineInputToolSource to "TTLIO12"
- Tell camera to rely on external control:
- Under Device ("DeviceModule" in the eGrabber C++ API), set CameraControlMethod to "EXTERNAL"
- Disable trigger control for AcquisitionStart and AcquisitionEnd. Counterintuitively, these must be turned off because they are separate signals that tell the camera wether it's "acquiring" data at all. If it's not, then no image is taken even if the FrameStart trigger is active.
- Under Remote Device ("RemoteModule" in the eGrabber C++ API), set TriggerSelector to "AcquisitionStart"
- Under Remote Device ("RemoteModule" in the eGrabber C++ API), set TriggerMode to "Off"
- Under Remote Device ("RemoteModule" in the eGrabber C++ API), set TriggerSelector to "AcquisitionEnd"
- Under Remote Device ("RemoteModule" in the eGrabber C++ API), set TriggerMode to "Off"
- Enable trigger control for FrameStart. This controls when the camera should actually open the shutter:
- Under Remote Device ("RemoteModule" in the eGrabber C++ API), set TriggerSelector to "FrameStart"
- (You do not need to set TriggerMode to "On" because it's grayed-out — the TriggerMode must be "On" if CameraControlMethod is "EXTERNAL").
- Under Remote Device ("RemoteModule" in the eGrabber C++ API), set TriggerSource to "CXPin"
- Set exposure control to trigger width (shutter open if and only if TTL signal is HIGH):
- Under Remote Device ("RemoteModule" in the eGrabber C++ API), set ExposureMode to "TriggerWidth"
To verify that this works, click the
A sample boilerplate program is available at opt/examples/egrabber_cpp_boilerplate:
Important
The camera's data stream can only be accessed by one program. You must close eGrabber Studio before running the test C++ program.
cd opt/examples/egrabber_cpp_boilerplate
mkdir build
cd build
cmake ..
make
./main
# press ESC to exitTODO: Add Arduino program to generate the LVTTL trigger signal.
Here, we will generate a trigger signal from the frame grabber, and pass this signal to the camera. The exposure time is set separately.
TODO.