In order to ensure timing sequence and synchronization performance between different pulses not affected by temperature drift, a method of detecting temperature and compensating temperature drift based on FPGA was proposed, which can ensure data synchronization between different pulses at different temperatures. Because FPGA temperature influenced temperature drift, this method was used to detect temperature by using the temperature sensor of Virtex-6 FPGA family, and to compensate temperature drift by delaying reference clock according to temperature delay parameters at different temperatures, so that the timing sequence was not influenced by temperature drift. The temperature delay parameters were measured in the case of stable operation of the system for a long time and stored in ROM. When temperature changed, FPGA read the corresponding temperature delay parameter from the ROM. Through the point-frequency signal test, synchronization deviations between different pulses at different temperatures (-20°C∼60°C) are not more than 5ps. This method solves the problem of temperature drift effectively and has practical value.