Synchronizing Ladybug5 Cameras
Technical Application Note TAN2013009
Revised July 19, 2013
Technical Application Note (TAN2013009): Synchronizing Ladybug5 Cameras
This application note describes how to synchronize Ladybug5 cameras over USB 3.1 by determining the relationship between the image timing and the camera’s current time. This is useful for Ladybug5 users who need to correlate their images with external information such as LIDAR or GPS.
For users familiar with synchronizing Firewire cameras, it is important to note that the cycle time generated in USB 3.1 behaves differently to cycle time in 1394.
While Firewire cycle time is driven by the 24.576 MHz Firewire clock, USB 3.1 is driven by the USB Isochronous Timestamp Packet (ITP). The accuracy of the ITP is determined by the host PC. The tick’s average period is 125 µs.
The CYCLE_TIME register for Ladybug5 is located at 1EA8h. The timestamp format is as follows:
Because of the inaccuracy of the USB 3.1 IPT interval, the four least significant bits of the timestamp do not accurately reflect the cycle_offset and should be discounted.
Cycle_count—increments from 0 to 7999, which equals one second.
Second_count—increments from 0 to 127.
Due to the limitations on the accuracy and resolution of USB 3.1 timestamps, synchronization between the Ladybug5 and the host system requires a different approach than the Firewire Ladybug3.
t = time read from CYCLE_TIMET = time read from host
1. Capture a Ladybug5 frame with embedded timestamp information. (t1)
2. Call ladybugGrabImage() to retrieve the frame.
3. Read CYCLE_TIME register immediately when ladybugGrabImage() returns. (t2)
4. Read system time immediately when ladybugGrabImage() returns. (T2)
5. Calculate the difference between t1 and t2 = Δt. This is the transmission time using CYCLE_TIME as reference.
6. Calculate the system time when shutter closes using host’s clock as reference. T2 – Δt = T1 Synchronization between the camera and the host is achieved when t1 can be matched with T1. Depending on the user’s application this synchronization process can be done repeatedly (for example, every 1 second) to keep the synchronization over extended period of time.