Technical Application Notes
Click an item to read from the list below.

Technical Application Notes


 

 

Using PPS to Synchronize with External GPS

Applicable products

Ladybug®5+

10835

Application note description

This application note describes how to configure the Ladybug5+ camera's PPS feature to synchronize timestamps with an external GPS device that provides a PPS output.

Preparing for use

Before you use your camera, we recommend that you are aware of the following resources available from our downloads page:

  • Getting Started Manual for the camera—provides information on installing components and software needed to run the camera.
  • Technical Reference for the camera—provides information on the camera’s specifications, features and operations, as well as imaging and acquisition controls.
  • Firmware updates—ensure you are using the most up-to-date firmware for the camera to take advantage of improvements and fixes.
  • Tech InsightsSubscribe to our monthly email updates containing information on new knowledge base articles, new firmware and software releases, and Product Change Notices (PCN).

Overview

Pulse per second (PPS) is a common feature in GPS units and IMUs to provide an accurate timing signal to assist with precision synchronization of various devices to a common clock. It is commonly provided as a TTL signal at either 3.3 V or 5 V.

The Ladybug5+ is able to directly accept PPS signals and NMEA data streams over the GPIO pins. This allows the LD5+ to maintain an internal precision time that is continuously synchronized with GPS time. Therefore, the timestamps attached to each image frame may be considered to be within microseconds of GPS time. The Ladybug5+ does not process or output GPS positioning data.

The Ladybug5+ cannot accept an RS232 signal from the GPS device. If your signal is RS232, you need to convert it to TTL for use with this feature.

Test configuration

ItemDescription
Camera Ladybug5+
Firmware 1.08.3
Software Ladybug SDK 1.15
GPS device u-blox EVK-M8T

Technical notes

Data formats supported

The camera supports the following NMEA sentence types:

  • GGA—fix information. This is required with either of the following:
  • ZDA—date and time
  • RMC—recommended minimum data for GPS

Timestamp

The LadybugImageInfo contains the timestamp and shutter time information.

In trigger mode, the GPS timestamp is stored at the end of integration. The timestamp accuracy has a positive offset of 45 μs ±8 μs.

In free running mode, the GPS timestamp is stored at the start of integration.

To calculate the mid point of a frame's timestamp:

Mid Point = Timestamp - 45 μs - 0.5 x Shutter Time

GPIO pin assignments

The GPIO pin 4 IO2 is used for GPS data.

The GPIO pin 11 IO3 is used for PPS signal, active on low to high transition.

The GPIO pin 12 is used as a signal ground for IO2 and IO3.

The camera has a 12-pin GPIO connector on the bottom of the case; refer to the diagram below for wire color coding. The GPIO is a Hirose waterproof 12-pin female connector (Mfg P/N:LF10WBP-12SD).

DiagramColorPinFunctionDescription
Green 1 OPTO_GND Ground for opto-isolated IO pins
Blue 2 I0 Opto-isolated input (default Trigger in)
Brown 3 O1 Opto-isolated output
Orange 4 IO2 Input/Output / GPS data
White 5 +3.3 V Power external circuitry up to 150 mA
Black 6 GND Ground for bi-directional IO, VEXT, +3.3 V pins
Red 7 VEXT Allows the camera to be powered externally
Red 8 VEXT Allows the camera to be powered externally
Red 9 VEXT Allows the camera to be powered externally
Green 10 OPTO_GND Ground for opto-isolated IO pins
Yellow 11 IO3 Input/Output / PPS signal
Black 12 GND Ground for bi-directional IO, VEXT, +3.3 V pins

Opto-isolated electrical characteristics

Values are for reference only and could vary between cameras.

External voltage resistor combinations at lowest frame rate
External
Voltage
External
Resistor
OPTO_OUT 
Low Voltage
OPTO_OUT
High Voltage
Current
3.3 V 200 Ω 1.46 V 3.3 V 9.1 mA
5.0 V 1.0 KΩ 0.87 V 5.0 V 4.2 mA
12 V 2.0 KΩ 1.13 V 12 V 5.6 mA
12 V 2.4 KΩ 0.95 V 12 V 4.7 mA
24 V 4.7 KΩ 0.95 V 24 V 5.0 mA
30 V 4.7 KΩ 0.88 V 30 V 6.3 mA

 

Opto-isolated input circuit

Opto-isolated output circuit

Opto-isolated input timing characteristics

Opto-isolated input timing characteristics at low frame rate
ParameterSymbolOpto-isolated
Input low voltage VIL ≤ 0.81 V
Input high voltage VIH ≥ 2.26 V
Propagation delay low to high tPDLH 13.4 μs
Propagation delay high to low tPDHL 9.2 μs
Typical positive pulse width tMPPW 15 ms
Typical negative pulse width tMNPW 0.98 ms

 

Opto-isolated input timing characteristics at high frame rate
ParameterSymbolOpto-isolated
Input low voltage VIL ≤ 0.81 V
Input high voltage VIH ≥ 2.36 V
Propagation delay low to high tPDLH 9.6 μs
Propagation delay high to low tPDHL 8.3 μs
Typical positive pulse width tMPPW 15 ms
Typical negative pulse width tMNPW 0.28 ms

Note: Performance measured at Vcc = 5 Vpk-pk

Opto-isolated output timing characteristics

Opto-isolated output performance at low frame rate
ParameterSymbolOpto-isolated
Output low voltage VL 0.87 V
Output high voltage VH 5 V
Output threshold high voltage VTHH 4.59 V
Output threshold low voltage VTHL 1.28 V
Cycle rise time tR 8.7 μs
Cycle fall time tF 1.26 μs
Opto current   4.2 mA

 

Opto-isolated output performance at high frame rate
ParameterSymbolOpto-isolated
Output low voltage VL 0.87 V
Output high voltage VH 5 V
Output threshold high voltage VTHH 4.59 V
Output threshold low voltage VTHL 1.28 V
Cycle rise time tR 8.5 μs
Cycle fall time tF 1.22 μs
Opto current   2.2 mA

Note: Performance measured at Vcc = 5 V, Rext = 1.0 KΩ

Non-isolated electrical characteristics

Values are for reference only and could vary between cameras.

External voltage resistor combinations
External VoltageExternal ResistorCurrent
3.3 V 1.0 KΩ 3.1 mA
5.0 V 1.0 KΩ 4.8 mA
12 V 2.0 KΩ 6 mA
12 V 2.4 KΩ 5 mA
24 V 4.7 KΩ 5.2 mA
30 V 4.7 KΩ 6.5 mA

Non-Isolated input and output GPIO circuit

Non-isolated input timing characteristics

Non-isolated input performance
ParameterSymbolNon-isolated
Input low voltage VL 0.85 V
Input high voltage VH 4.94 V
Input threshold high voltage VTHH 4.54 V
Input threshold low voltage VTHL 1.26 V
Cycle rise time tR 10.8 μs
Cycle fall time tF 2 μs
Current   4.1 mA

Note: Performance measured at Vcc = 5 V, Rext = 1.0 KΩ

Non-isolated output timing characteristics

Non-isolated output performance
ParameterSymbolNon-isolated
Output low voltage VL 0.23 V
Output high voltage VH 4.95 V
Output threshold high voltage VTHH 4.48 V
Output threshold low voltage VTHL 0.7 V
Cycle rise time tR 2.6 μs
Cycle fall time tF 0.23 μs
Current   4.8 mA

Note: Performance measured at Vcc = 5 V, Rext = 1.0 KΩ

Configuring PPS/GPS synchronization

To configure time synchronization you must enable PPS and enable GPS time synchronization.

Using Ladybug API

There are two functions:

  • ladybugSetGpsTimeSync()
  • ladybugGetGpsTimeSync()

These take a camera context and a GpsTimeSyncSettings structure as follows:

  • unsigned int baudRate
  • bool enablePps
  • bool enableGpsTimeSync

Using camera registers

Enable PPS
OffsetNameFieldBitDescription
0x1EAC PPS Presence_Inq [0] Presence of the feature
0 = not available
1 = available
      [1-30] Reserved
    PPS_Enable [31] Enable PPS
0 = disabled
1 = enabled

 

Set baud rate and enable receive buffer (enable GPS time sync)
OffsetNameFieldBitDescription
488h SIO_CONTROL_CSR_INQ SIO_Control_Quadlet_Offset [0-31] 32-bit offset of the SIO CSRs from the base address of initial register space
Base + 0h SERIAL_MODE_REG Baud_Rate [0-7] Baud rate setting
0 = 300 bps
1 = 600 bps
2 = 1200 bps
3 = 2400 bps
4 = 4800 bps
5 = 9600 bps (recommended)
6 = 19200 bps
7 = 38400 bps
8 = 57600 bps
9 = 115200 bps
A = 230400 bps
Base + 4h SERIAL_CONTROL_REG RE [0] Enable receive
Indicates if the camera's ability to receive data is enabled. Enabling this register causes the receive capability to be immediately started. Disabling this register flushes the the data in the buffer.
0 = disabled
1= enabled

For a complete list of registers, see the FLIR Machine Vision Camera Register Reference.

Verifying configuration

You can view the time synchronization status from the LadybugImageInfo:

  • unsigned int ulGpsFixQuality
  • bool bPpsStatus
  • bool bGpsStatus

You can also verify the configuration using camera registers.

Verify time synchronization
OffsetNameFieldBitDescription
0x1E9C GPS_PPS_TIME_SYNC_VERIFICATION Presence_Inq [0] Presence of the feature
0 = not available
1 = available
      [1-23] Reserved
    GPS_Fix_Quality [24-27] Represents the quality setting from a GGA NMEA sentence
      [28-29] Reserved
    GPS_Signal [30] GPS signal
0 = invalid
1 = valid
    PPS_Signal [31] PPS signal
0 = invalid
1 = valid

 

API Example

The API example ladybugGPSTimeSync demonstrates the configuration. The example is provided in the Ladybug SDK, available from the downloads page.