HOME > Support >Manual >
QHY174M-GPS On-Line Technology Document
2018 年 10 月 24 日
This document is an on-line document on a cloud server. It is always updating without notifications.The author is Dr.Qiu

Drivers and software

1.System Driver
Note: This driver package includes the Native WDM driver. WDM driver is a monopolization driver. Please avoid this driver is working together with other image software. Otherwise two application will both request the frames and it will cause the unstable.

please download the software from this link:

This software is the default software for QHY5III series and QHY COLDMOS series camera to capture and recording the videos. You need download the lastest version from the SHARPCAP website. And replace the qhyccd.dll to the newest version (can be found in QHY174GPS-DEMO folder), Or use the version update software of QHYCCD to make sure all driver/software is the lastest one.

The current SharpCAP should support the QHY174 GPS function. It has a window to display the GPS time information. Please note the GPS data is also embeded in the top of the image head (some pixels on the from first image pixel data) . You can readout this information accroding this data structure in this document.

Basic Concept

Download "QHY174GPS Design" PPT (on ESOP conference, Paris,Obs, 2019.9.1)


CMOS Timing:  Normally speaking the CMOS works based on the CMOS input clock. So the exposure starting and ending time is sync with this clock.

CMOS Strobe and Trigger:  Some CMOS sensor has the strobe signal to indicate the starting and ending time of the shutter. It can be used for flash etc. But this signal maybe not precision to the real exposure starting and ending time.  The delay may exist. The Trigger is an input signal to CMOS sensor and the CMOS sensor will starting exposure after received this signal. It still not so precision and the delay may exist.

Global Shutter. Most Interline progressive CCD sensor is global shutter and all the pixel start and finish exposure at the same time. But most cmos sensor is rolling shutter. Rolling shutter is a line scan based exposure. Different line is exposure at different time. This is not very suitable for high precision time domain imaging. Some CMOS like the IMX174 used in QHY174GPS is the global shutter and the start/ending exposure time is the same for all pixels.

PPS signal. The PPS signal is come from the GPS module. It gives the precision time of one second begins. This time is well synced in all GPS satellite and it is about 50ns error (three delta error) with the UTC time? In QHY174 this signal is used to clear the local 0.1us(10MHz) counter to zero.

Local 0.1us Counter (LUC). In order to get the microsecond local clock. The QHY174GPS has a LUC. The LUC's clock is come from a 10MHz VCOX(voltage controlled oscillator crystal).  This counter is used to count the start and ending time of the shutter measure waveform.

Shutter Measure Waveform. This waveform is a signal in the QHY174GPS. It is defined by two register. One edge of this waveform is the exposure beginning time and another edge is ending time. The register need to be set to generate this waveform. The camera will use LUC to get the count of this waveform then get the precision start and ending exposure time which is sync with GPS PPS signal.

Calibration LED.  The camera has a built-in calibration LED. Which is located in one edge of the CMOS sensor. When the LED flash. The CMOS sensor may "see" this light. The Calibration LED can emit a light pulse. The width of the light pulse can be defined by a register. The position of the pulse can be defined by another register. The LED's control logic clock is synced with the CMOS input clock.  This pulse is used to calibration each exposure time's start and ending time. You can adjust start time of this pulse and check the image, for shutter starting time, When you increase the pulse position and found the LED pulse from invisible to visible. This position is just the starting position. When you increase the position and found the LED pulse from visible to invisible. This is the ending position.

Master/Slave Mode. The QHY174GPS works in two modes. Master mode is that the CMOS is free running and the camera will make the time stamp of each frame's starting and ending exposure time. The slave mode is that the Camera is triggered by the time. You need set a start time and the interval to each two frames. The camera will wait this time comes and begin to exposure continuous at this interval time.  In current FPGA code the slave mode does not support ROI.  The master mode support ROI.

JS: Julian second. In order to reduce the bit width of counter, this is a deducted Julian time. Defined by QHYCCD. The GPS time information in the image header is using JS to record.66

Use the software

A demo software called EzTimeStamp is comes with the QHY174GPS camera. This software has some basic function. You can use this software to learn how the QHY174GPS works.

The user guide of EzTimeStamp

Install QHY5III series system driver
Run Easy Timestamp Software.
Click "Connecer.t" Button if camera connected to computer it will find the camera and the series number.
Click "Master mode" Button. The camera will start working and the picture will be shown
You can set the exposure time and the gain of the camera
In the status bar you will see the GPS information of each frame. The GPS status is indicate the GPS working status. :

0: GPS is just powered up.
1: GPS begin to work but not received any time information
2: GPS get the time information but has not locked.  The PPS signal and the location information has not come. In this status the time is still not precision
3. GPS get locked. The PPS signal comes. The time is precision.

You may need to wait some time to get it locked.

The button of "onAir" is using QHYCCD BroadCast WDM video driver to send the video streaming out . You can use this function to do live video broadcast.

How to do the precise calibration of the start/ending exposure time with the on-camera calibrate LED

If you want to get very precised time of the start and end of exposure, the on-camera calibrate LED need to be used to do the calibration. 

The theory of the calibration is :.  There is two register in the camera , which can be set. The register value is the distance from the vertical sync signal.  When this two position is defined, the messurement waveform will be generated inside the camera. And the camera will use GPS clock to messure the rasing edge and falling edge of this messurement waveform. The messured time is called TA, TB in the software.

TA= Exposure start time
TB= Exposure end time

The on-camera LED will emit a very short flash light. The time of this flash is assoicated with the two position. So when you adjust the position, you can control the time that the flash generated. And if the flash happens during the exposure period, you will see this light from the image, if the flash happens outside of the exposure period, You will not see this light.   

When you increase the position, if you see the light in the image and later you see the light is gone, it means you are moving the time position of the flash at the end of the exposure.

If you see there is no light and when increase the position you see the light later, it means you are moving the time position of the flash at the beginning of the exposure. 

So you can find the position of the beginning and ending of the exposure. 

Please following this step to try the calibration

1. Cover the telescope / lens to block any light
2. Set the gain to max value to allow you see the LED light.
3. Select a exposure time . eg. 5ms
4. Click LED cal to enable the LED calibration. You will see there is two adjust bar come out. Left group is the register of define the ending of the exposure . Right group is the register of defining the beginning of the exposure time.
5. Set the left group to the value of 2850.
6. Increase the value a little bigger and a littler smaller, You will see the light on the image disappear/ appear. Finally you can set the value just to 2850.  You have successfully to find the position of the ending exposure. 
7. Set the right group to the value of ......
8. Increase the value a little bigger and a littler smaller, You will see the light on the image disappear/ appear. Finally you can set the value just to ......you have successfully to find the position of the beginning exposure.
9.Please check if the DT value. DT means the Delta T. It is the time difference of the beginning and ending of the exposure. It should be about the exposure time(unit is 0.1us). For example,For 5ms exposure time, it should be about 50000.  If it is about this value , it shows the calibrate value is right.
10. Click the "save" button. The calibrate value will be save into the INI file of the EzTimeStamp. At the same time you will find the color of the "5ms" button color changed from green to yellow. It shows the calibration date of the 5ms is saved. In future you do not need to calibrate it again. Software will read this calibrated value from INI when startup. 


1.Why can not get the GPS signal locked?
GPS moduel need at least three starts to get the full data of the time and position. You need to put the GPS antenna to a position out door and without the the blocking by buildings. If some sky area is blocked, the antenna can not recieve enough saterllitle.
Another suggestion is using the high sensitivty GPS signal. We recommand to use the following type of the GPS anteena. It will be more faster to get the signal locked and can get the GPS signal more stable.
2.Shall the LED calibration been done each time?
NO need to do this each time. For a fixed exposure time, under the same USB traffic setting and 8bit/16bit setting and same ROI parameters(includes all start x position, start y position, x size, y size), the calibration data is the same. So if you not changing the exposure time, usb traffic and 8bit/16bit setting, you can use the same calibration data.
3.How to set the calibration and is there any rules?
One rule is that if the exposure > one frame readout time , the start position and end position will be fixed to a constant value. For example, when in 8bit, 1920*1200,USBTRAFFIC=0, one frame readout time is about 7.25ms (1/138FPS). So for all exposure time > 7.25ms, the start position can be fixed to 2860 and the end position can be fixed to 6280.
Another rule is that the start position is keep the same value if the USBTRAFFIC and 8/16BIT not changed. For example, in USB traffic =0 . In 8BIT it is always 2850 and in 16BIT it is always 4190.
If you changed the USB traffic, both start position and end position will be changed, so
we suggestion you always use USB traffic zero if your computer is fast enough. And if the USB traffic is too big. The position value may become very big even to exceed the maxium range. so that we do not recommend to use bigger USB Traffic.
The following is some calibration data we tested in the lab and you can using it:
8BIT 1920*1080 USBTRAFFIC=0
16BIT 1920*1080 USBTRAFFIC=0

If you change the ROI. The start position is the same with the non-ROI image.
3. If I have more than one QHY174GPS, Will the calibration data different for different QHY174GPS camera?
Normally speaking the calibration data is the same for different QHY174GPS
4. Why my QHY174GPS display the wrong time/location data in 16bit mode.
The old FPGA firmware of the QHY174GPS only support 8bit mode for GPS data. If you meet ths problem, contact QHYCCD to get the support to upgrade the FPGA in QHY174GPS to the last version. Then it will be ok for 16bit.

Programming with QHYCCD API

Please refer the help document of the QHYCCD API to do the basic image operations. The following is the additional API to operate the GPS part.

Adjust the VCOX frequency.
The VCOX is 10MHz output but the frequency will drift with the temperature and time. In order to get accurate 10MHz frequency you can set it . For first you need to know the current frequency of it. You can read the clock count of each two PPS signal.  If it is 10MHz, the count will be 10,000,000. (Please note when the GPS is not locked, there is no PPS signal and the count will be 10,000,500, this is no use, please do not use this value to calibrate the VCOX).

Please do not adjust the frequency beyond the counter of 10,000,500.  Because the FPGA will regard the 10,000,500 is the condition that the PPS signal losing.

set_GPS_VCOX_Freq(unsigned short i);  The input range of i is 0-4095

Set the Calibration LED Enable
set_GPS_LEDCAL_Mode(unsigned char i);
i=0:disable LED light    1:enable LED light

Set LED pulse position for shutter starting exposure
set_GPS_POSA(unsigned char is_slave,unsigned long pos,unsigned char width);

is_slave:  0:master mode  1: slave mode. This value should be set depend on which mode camera is using.
pos: LED pulse light position
width: LED pulse light width
When you changed the exposure. You must set this position. The measurement circuit will use this position as the shutter starting time.

Set LED pulse position for shutter ending exposure
set_GPS_POSB(unsigned char is_slave,unsigned long pos,unsigned char width);

is_slave:  0:master mode  1: slave mode. This value should be set depend on which mode camera is using.
pos: LED pulse light position
width: LED pulse light width
When you changed the exposure. You must set this position. The measurement circuit will use this position as the shutter ending time.

Set Master/Slave Mode
set_GPS_MasterSlave(unsigned char i);
i=0: Master mode   1:Slave mode

When in slave mode, set the parameter.
set_GPS_SlaveMode_Parameter(unsigned long target_sec,unsigned int target_us,unsigned int deltaT_sec,unsigned int deltaT_us,unsigned int expTime)

The target_sec is the "JS" that QHYCCD defined. It is reference to a time.

Data Structure of the Image Head

The camera records the GPS information and insert into each frame's head. This function can be enabled by the API of

and can be disabled by call the API:

ImageHead Shift

Sequence Number is a hardware counter of the frames. It will start from zero and each frame it will add one. It will start from the cmos camera start working

0  Sequence Number MSB
1  Sequence Number
2  Sequence Number
3  Sequence Number LSB

4 temporary Sequence Number   (Normally no use)

5 Image Width  MSB
6 Image Width LSB

7 Image Height MSB
8 Image Height LSB

Latitude is the current latitude report by GPS. 
9    latitude MSB
10  latitude
11  latitude
12  latitude LSB

Latitude is the current longitude report by GPS.
13  longitude MSB
14  longitude
15  longitude
16  longitude LSB

17 Start_Flag

Shutter start time  (JS)
18 Start Second MSB
19 Start Second
20 Start Second
21 Start Second LSB

22 Start micro second MSB
23 Start micro second
24 Start micro second LSB

25 End flag

Shutter end time  (JS)
26 End Second MSB
27 End Second
28 End Second
29 End Second LSB

30 End micro second MSB
31 End micro second
32 End micro second LSB

33 now flag:  this can be used for the GPS statu indicator   bit[7..4] is the

The now time is the time that of the vertical sync of the CMOS sensor. It does not the precision time of shutter open or close
34 now second MSB
35 now second
36 now second
37 now second LSB

38 now micro second MSB
39 now micro second
40 now micro second LSB

The counter value of two PPS. it should be about 10,000,000. But since the temperature of the crystal. It is not exactly the 10,000,000. You can adjust the VCXO to let it close to it.  And when the PPS signal lost, it will become 10,000,500. When exceed this value, FPGA will generate a second to instead of the GPS PPS signal to avoid the second counter lost one second.
41 count of PPS MSB
42 count of PPS
43 count of PPS LSB

Reference codes:

    unsigned int seqNumber=0;
    unsigned int seqNumber_old=0;
    unsigned char tempNumber=0;
    unsigned short width=0;
    unsigned short height=0;
    unsigned int latitude=0;
    unsigned int longitude=0;

    unsigned char start_flag=0;
    unsigned int  start_sec=0;
    unsigned int  start_us=0;

    unsigned char end_flag=0;
    unsigned int  end_sec=0;
    unsigned int  end_us=0;

    unsigned char now_flag=0;
    unsigned int  now_sec=0;
    unsigned int  now_us=0;

    unsigned int max_clock=0;

            latitude= 256*256*256*imageHead[9]+256*256*imageHead[10]+256*imageHead[11]+imageHead[12];

            start_us =256*256*imageHead[22]+256*imageHead[23]+imageHead[24];

            end_us =256*256*imageHead[30]+256*imageHead[31]+imageHead[32];

            now_us =256*256*imageHead[38]+256*imageHead[39]+imageHead[40];

        decodeJS(start_sec,timeZone,JD,h,m,s);    //this function can convert the JS to the JD time
and maybe you can use the following API(windows or Linux) to convert the JD time to local time. 

Void decodeJS(unsigned int JS,double timeZone,double &JD,unsigned char &h,unsigned char &m,unsigned char &s){

unsigned int k;



JD=double(JD)+ 0.5+ ((double)(h+timeZone)*3600+(double)m*60+(double)s)/3600/24;


How to use Slave Mode to sync all QHY174GPS camera to start exposure together
no matter where the camera located in, no matter how long distance between them. You can get the sync exposure start time for all QHY174GPS camera. This is a wonderful function and you can build you observe team very fastly and let them get sync capture, up to 1us precision, arround the whole earth.

To activr the slave mode is very simple. Just use two API:

//  set the parameters at first
set_GPS_SlaveMode_Parameter(target_sec,target_us,deltaT_sec,deltaT_us,expTime) ;
// switch camera to slave mode

the target_sec is the JS we defined in our system. The second you get from the image head is just this value.
expTime unit is us. Please note the deltaT must > expTime.

eg. Today is 2017.10.19 0:30 and we can get the JS=695925030
Now we want to let the camera start exposure at 0:40:000000 (10minutes later). The exposure time is 100ms per frame. The interval is 200ms per frame.


set_GPS_SlaveMode_Parameter(target_sec,target_us,deltaT_sec,deltaT_us,expTime) ;

If want to switch back from the slave mode to master mode ,just call:


Meet us
Contact us

  503, Block A, Singularity Center, Shahe Town, Changping District, Beijing, China, 102206




Copyright  2011-2018  QHYCCD    Question  |  Navigation  |  Forum