Two-Frequency Ultrasonic System with Direct Digital Frequency Synthesizers and Vernier Caliper Phase Meter for Measuring Air Temperature

In this article

In this article, we present an improved algorithm for two-frequency continuous wave (TFCW) ultrasonic temperature measurement.This method is based on the transmission of a TFCW signal that is generated by two direct digital frequency synthesizers (DDFSs).The phase shift between the transmitted and received signals is measured using a vernier caliper phase meter (VCPM).The phase shift data is recorded to determine the ultrasound speed.The changes in the ultrasound speed are then calculated and used to determine the average temperature of bulk air.In a temperature-controlled chamber, two 40±2 kHz ultrasonic transducers are placed face to face with a fixed distance between them.The DDFS algorithm is programmed into a single-chip microprocessor to generate highly accurate TFCW signals for temperature measurement.Experimental results show that the proposed measurement system reaches a high accuracy of ±0.2°C within a temperature range from 0 to 80°C, with a resolution of 0.01%.The main advantages of this ultrasonic temperature measurement system (UTMS) include high accuracy, high resolution, low cost, and ease of implementation.

Introduction
3)(4) Most ultrasonic systems for air temperature measurement are based on the time-of-flight (TOF) method. (5)In the TOF method, the time required for an ultrasonic wave to travel from a transmitter to a receiver is measured.The speed of sound, c, is evaluated as c = d/T F , where d is the distance between the transmitter and the receiver, and T F is the time necessary to travel in between.8)(9) One alternative to the TOF method is called the phase shift method.It can be used to evaluate the ultrasound speed by computing the phase difference between the transmitted and received continuous waves.8)(9)(10)(11)(12) The ultrasonic phase shift method is based on the single-frequency continuous wave (SFCW) technique.If the ultrasonic transmitter is stimulated by a continuous sinusoidal signal, the corresponding received signal can be written as V(t) = Asin(ωt + θ).The symbol θ represents the phase shift and is linearly proportional to the distance between the transmitter and receiver.If the distance does not exceed a full wavelength, then the length can be determined directly from the phase shift θ of the received signal.Otherwise, a phase ambiguity will occur.Moreover, when the distance between the transmitter and receiver is fixed, we can use phase shift information to determine the variations of the ultrasound speed, which vary with air temperature.Huang et al. (1) showed that the measurable temperature range when using the SFCW method is approximately 50°C for one wave period when the distance between the transmitter and receiver is 100 mm.Hence, the range of air temperature that can be measured when the distance is 1 m is only about 5°C.
(14) Increasing the number of frequencies used for phase comparison extends the measurement range, at the cost of increased measuring time.
To improve the accuracy of measurement, an improved TFCW ultrasonic temperature measurement system is presented in this article.The system uses two different sinusoidal signals generated by the DDFS to stimulate the ultrasonic transmitter.The DDFS is useful for generating signals with extremely precise frequencies and fast switching speeds.(17) In particular, the property of fine frequency steps can make the frequency of the two transmitting signals of our system be very close (even smaller than 1 Hz).Therefore, the measurement range of temperature can easily be expanded just by using two signals, instead of increasing the number of transmitting signals.In conclusion, the total measuring time of the system can be saved.Furthermore, to improve the accuracy and resolution of the system, we use a vernier caliper phase meter (VCPM) to perform a precise phase measurement.The concept of the VCPM is derived from the vernier caliper. (18)At first, a coarse measurement is taken using the main scale, and then a fine measurement is performed to refine the final result using the movable vernier scale.The main advantage of the VCPM is that it does not require a very high clock frequency and expensive computational hardware, but the resolution of the VCPM is nearly the square of the resolution of a countingtype phase meter.In addition, the VCPM can easily enhance the resolution of phase measurement by increasing the divisor of the frequency divider.Therefore, the proposed TFCW ultrasonic system can achieve high accuracy and high resolution in temperature measurements.

Measuring Method
The ultrasonic system for measuring air temperature is shown in Fig. 1.The ultrasonic transmitter is installed on the left side of the chamber while the receiver is placed on the right side.The distance between the transmitter and receiver is 1 m.The setup allows us to measure the average air temperature of the chamber.The measuring method is described in the following sections.

TFCW method
The TFCW-based ultrasonic system for measuring temperature stems from the previously described single-frequency continuous wave method. (1)Increasing the number of frequencies used for phase comparison will increase the temperature range that can be measured.The TFCW method consists of two different continuous ultrasonic waves (frequencies are f 1 and f 2 , respectively) transmitted sequentially from an ultrasonic transducer.The respective phase shifts (θ 1 and θ 2 ) between the transmitted and received signals are measured and converted into digitized phase information.The distance d between the transmitter and the receiver can be expressed as (10,12) where int[] is the integer operation of the given number, Δf = f 2 -f 1 and Δθ = θ 2 -θ 1 .
From eq. ( 1), the reciprocal of ultrasound speed can be expressed as Therefore, if the ultrasound speed does not exceed the limitation caused by Δf, then the phase shift difference (Δθ) can be used to determine the ultrasound speed.Phase ambiguity will occur if the ultrasound speed exceeds the limitation set by the difference between the two frequencies (Δf).As a result, the maximum measurable speed fluctuations of the ultrasound in TFCW are dependent on the frequency difference.
The relationship between the speed of sound and temperature in air is derived from the ideal-gas equation based on Boyle's law.Sound propagates at a speed c, as defined in eq. ( 3), (2) where R, T, γ, and M represent the universal gas constant, absolute temperature (in Kelvin), specific heat ratio, and molecular mass, respectively.From eq. ( 3), we know that the speed of sound has been adopted to determine the environmental temperature in previous reports. (1,3,13,14)The universally accepted value for the speed of sound c, at 0°C and 760 mmHg with 0.03 mol% carbon dioxide, is 331.45±0.05m/s for audio frequencies. (19)Equation ( 4) demonstrates the conversion of units from Kelvin to centigrade for eq.( 3), incorporating the universally accepted value for speed of sound c t and disregarding humidity.
where t is the temperature (in Centigrade).The temperature t can then be expressed as To take the influence of humidity into account, eq. ( 5) needs correction.The approximated equation for the sound velocity ratio over the relative humidity range h and temperature t is (2) c h / c 0 = 1 + h (9.66 × 10 −4 + 7.2 × 10 −5 t + 1.8 × 10 −6 t 2 + 7.2 × 10 −8 t 3 + 6.5 × 10 −11 t 4 ), (6)   where c h and c 0 are the sound velocities in moist air and dry air, respectively.Consequently, eq. ( 6) can be used to calibrate the results of eq. ( 2). Figure 2 shows the variations in the sound speed when air temperature is present under 0% RH and 90% RH. Figure 2 demonstrates clearly that sound speed increases with temperature and humidity.The above computation algorithm can be input into a personal computer (PC) to measure the air temperature with high accuracy.
The ultrasonic transducers commonly used in air temperature measurement have a resonant frequency of 40 kHz.By using the SFCW method, the maximum phase shift is 2π, corresponding to a temperature fluctuation of approximately 5°C at a path length of 1 m.If the frequency difference between f 1 and f 2 is 1600 Hz when using the TFCW method, the maximum temperature fluctuations that can be detected will increase to approximately 125°C (5*int[f 1 /Δf]°C).Figure 3 illustrates how the measurable temperature range is expanded using the TFCW method.The phase difference (Δθ) is used as a main scale for an initial coarse measurement, and the phase shift (θ 1 ) is used as a fine scale to refine the final result of the measurement.

DDFS
To increase the accuracy and range of measurement of the system, we adopt a DDFS to generate the sinusoidal signal for the ultrasonic transmitter.DDFS is based on the principle that phase change accumulation can generate a digitized waveform at higher frequencies. (15)DDFS can be implemented with three distinct parts, as shown in Fig. 4. The phase value stored in the frequency control register is added to the value in the phase accumulator during each system reference clock period.Once during each clock cycle, the resulting phase value from 0 to 2π is applied to the sine lookup table (LUT).
The LUT converts the phase information into the properly corresponding sine amplitude.The DAC then uses the sine amplitude information to produce the output signal.
To generate a signal with a particular frequency, the desired phase increment must be loaded into the frequency control register.Equation (7) indicates the relationship between the output frequency (F OUT ), reference clock frequency (F CLK ), and phase increment (integer K).
where the number of bits in the phase accumulator is N.The Nyquist theory shows that the reference clock frequency must be greater than twice the output frequency.The phase increment K, rounded to the nearest integer, is given by where int[] is the integer operation of the given number.Since K is an integer, the smallest tuning step (ΔF OUT ) of the output frequency can be obtained from eq. ( 7) as According to eq. ( 9), the number of bits in the phase accumulator (N) is based on the smallest desired output frequency tuning step (ΔF OUT ) and can be selected according to eq. (10).

VCPM
To increase the accuracy of the measuring system, we use a VCPM to measure θ 1 and θ 2 .A vernier caliper is composed of two scales, the main scale and the movable vernier scale.The unit length L (L usually equals the length of the vernier scale) is divided into equal segments of physical length by the inscribed lines of the caliper scales.If unit length L is divided into M divisions on the main scale and into N divisions on the vernier scale (where M = αN − 1 and α is a positive integer), the smallest physical length measurable with the gauge is L/(MN) = L/[(αN − 1)N].A given measured length X can be represented as where 0 ≤ p, 0 ≤ m ≤ M, 0 ≤ n ≤ N, 0 ≤ e ≤1.In eq. ( 11), p, m, and n are all integers, and e is a real number.On a mechanical vernier caliper, the value p represents the integer part of the whole measured length out of the unit length L. The values of m and n are read from the main scale and the vernier scale, respectively.The resolution of the vernier caliper is L/(MN).The value e is the residual part of the length X that is less than the resolution of the vernier caliper, and so the term (L × e/M × N) can be eliminated.Equation (11) can be modified as The principle of the VCPM is derived from the vernier caliper's fundamental concept.In the VCPM, L is equivalent to the period of the input signal (T is equivalent to phase angle 2π).The phase shift (θ) is always less than 2π, and the value of p is zero.Thus, the measurement result of a phase shift can be expressed using eq.( 13): The VCPM block diagram shown in Fig. 5 is designed to emulate the vernier caliper, transforming a physical distance to a temporal length of wave period degrees.This method sets unit length L equal to the wave period of the input signal, and the caliper divisions are replaced with equal time slots within the period.Cutting the periods into multiple equal time slots can be implemented by using a phase-locked loop (PLL) circuit.Two frequency-multiplying PLL circuits generate two clocks in the VCPM, which function as the dividing lines inscribed in the two temporal scales, one for the main scale and the other for the vernier scale.

System Implementation
Figure 6 shows a block diagram of the TFCW ultrasonic temperature measurement system, consisting of two ultrasonic transducers with matching exponential horns, a DDFS signal generator, a preamplifier and gain-controlled amplifier, a VCPM, and a calibration system.A microcontroller (89S51) is used to control the operation of the UTMS and a PC is used to examine the measured results and perform calibration.The ultrasonic transmitter/receiver (400ST160/400SR160, Pro-Wave Electronics Corporation, Taiwan) is specified to have a 55° beam angle, 40 kHz center frequency, and 2 kHz bandwidth.The receiving sensitivity is −60 dB at 40 kHz (0 dB = 1 V/µbar).

Hardware of the system
The operation of each module is described as follows.

DDFS signal generator
Figure 7 shows the block diagram of a DDFS signal generator that is regulated using a microcontroller.A crystal oscillator is used to generate a stable signal with a basic frequency of 10 MHz, which is used as the reference clock for DDFS.The two phase increments (K1 and K2) are programmed into the two DDFSs before transmission and then a multiplexer is used to select the transmission signal.Therefore, the two sinusoidal signals are individually generated by two DDFSs and then selected to sequentially drive the ultrasonic transmitter.The frequency of the first sine wave is 40 kHz and the frequency of the second sine wave is 41.6 kHz.

Preamplifier and gain-controlled amplifier
The ultrasonic transducer has different responses to different frequencies.To avoid error from acoustic attenuation effects, the gain of the amplifier must change automatically when the frequency of the ultrasound is varied.Therefore, the error effects related to acoustic attenuation are minimized in this gain-controlled amplifier module.The received signal is then transferred into a square wave by the zero-crossing circuit and made into a TTL-compatible signal using a 0-5 V limiter circuit.This square wave signal is then sent to the VCPM.

VCPM
In Fig. 5, the VCPM consists of two PLL frequency multipliers, a D-type flip-flop, and two edge-triggered registers.The PLL frequency multiplier comprises a phase detector (PD), a low-pass filter (LPF), a voltage-controlled oscillator (VCO), and a binary counter.
Two digital clock sources, a main clock and a vernier clock, which are M and N times the output frequency of the transmitted ultrasonic signal, are used.In order to minimize the main and vernier clock frequencies, the constant α = (M + 1)/N is selected as 1.The timing diagrams of the main and vernier clocks are shown in Figs.8(c  The trigger signals of the registers are the output signal of zero-crossing circuit #2 and the inverted D-type flip-flop output signal (shown in Figs.8(b) and 8(f)).In the UTMS, the main scale is taken as M = 100 and the vernier scale as N = 101, so the resolution of the phase shift is 1/(100 × 101) = 1/10100.

89S51 single-chip microprocessor
Our system is regulated using an 89S51 single-chip microprocessor.The main functions of the microprocessor include controlling the TFCW signals of the ultrasound and obtaining the digital phase shift data.

Calibration system
The TFCW ultrasonic air temperature measurement system must be calibrated with a known temperature.The calibration procedure was performed at a constant distance over the entire range.As shown in Fig. 6, we used a temperature-controlled chamber equipped with an interior fan to make the temperature of bulk air inside the chamber uniform.The actual air temperature inside the chamber is sensed by an RTD (PT 1000).The measured voltage of the RTD is converted into temperature reading with an NI 4350 temperature meter.Moreover, the humidity in the chamber is sensed and recorded by a humidity meter (TES-1365, TES Electrical Electronic Corporation, Taiwan).The meter's readings are sent to the PC and used as the standard values of temperature and humidity.The PC records the elapsed time of the ultrasound, phase shift data, and the data of standard temperature and humidity.The PC uses these data to examine the errors of the UTMS and establish a calibration system.

Software of the system
The system's software block diagram is shown in Fig. 9. On activation, the transmitter's frequency control module and phase accumulators of all the DDFS blocks are in the initial mode.Next, the signals (with frequencies f 1 and f 2 ) are individually generated and sequentially selected via a multiplexer, and are then transmitted to the ultrasonic transmitter.The transmitted and received signal phases, f 1 and f 2 , are then detected in order to compute phase shift values.The system calculates the phase shift difference Δθ from θ 1 and θ 2 .Finally, the target temperature is calculated from θ 1 and Δθ using eqs.( 2) and (5), respectively.

Results and Discussion
The experiment was conducted in a programmable-temperature chamber.A TFCW prototype was tested in the chamber by comparing a series of phase shift measurements with simultaneously gathered temperature measurements via the RTD.These data are then sent to the PC and used to verify the temperature measured using our system.
In the tests, the distance between the transmitter and receiver was set to 1 m. Figure 10 shows a logged data graph of the difference in phase shifts Δθ of the two ultrasonic signals under distinct setting temperatures.This TFCW temperature measurement system successfully takes into account the finite bandwidth of conventional inexpensive transducers.Because our system is based on phase detection, the acoustic attenuation problems associated with the time-of-flight method are avoided.The ultrasound speed can be calculated precisely by the TFCW method.As presented here, the system measures two phase shifts using two ultrasonic frequencies for the reconstruction of the temperature readings.Figure 11(a) shows the reconstructed temperature calculated from the phase shift when the actual temperature rises from 0 to 80°C. Figure 11(b) shows the errors between the actual temperature measured using the RTD and the mean reconstructed temperature measured using the TFCW UTMS.Through repeated experiments, when the temperature is below 80°C, the difference between the reconstructed temperature and actual temperature consistently remains within ±0.2°C.The standard error of measurement is calculated as where RT i is the temperature of the UTMS, AT is the temperature measured using the RTD, and m 1 is the number of measurements.The average error is 0.12°C and the standard error is 0.1°C.The time required to determine a temperature using the TFCW method is longer than the time associated with the SFCW method because the two distinct ultrasonic signals must be sent in sequence.Each signal requires its own sound travel time as well as time for the transducer to achieve adequate acoustic resonance.At a range of 1 m, the total waiting time required for each signal is 15 ms.
Comparison of the frequency divider and DDFS algorithms shows that the latter generates more accurate frequencies.For instance, if the system clock is 10 MHz and the two signal frequencies f 1 and f 2 are set at 40 and 41.6 kHz, respectively, for a frequency divider algorithm, the dividers should be set at 250 and 240 to generate frequencies of approximately 40 and 41.67 kHz.The generated frequencies cause f 2 to shift from 41.6 to 41.67 kHz and this frequency shift will cause measurement error.However, when using the DDFS algorithm with a 10 MHz system clock and a 32-bit phase accumulator, the smallest tuning step of the output frequency is less than 0.1 Hz; the error caused by the frequency shift of the DDFS is relatively small and can be ignored.Furthermore, the DDFS can easily enhance the measurement range of the UTMS by adjusting the frequency difference Δf.Therefore, it is an adequate solution for high-temperature measurement.
Furthermore, in comparison with the traditional counting-type phase meter, the resolution of the VCPM is approximately the square of the condition of using the same reference clock.Moreover, the VCPM can easily enhance the resolution by increasing the divisor of the frequency divider.

Conclusions
In this article, we present a TFCW ultrasonic temperature measurement system with DDFS and VCPM.Advantages of the DDFS system include fine frequency steps, smooth frequency transitions, and fast switching times.The DDFS generates TFCW ultrasonic signals with more accurate frequencies, which improve the maximum measurement range and accuracy of the UTMS.Furthermore, we use a VCPM to carry out the precise measurement of phase shift.The VCPM can achieve a high resolution nearly the square of the counting-type phase meter.
Experimental results indicate that when the distance between an ultrasonic transmitter and receiver is fixed at 1 m, the system has a high accuracy of ±0.2°C and a resolution of 0.01% within a temperature range from 0 to 80°C.The main advantages of this UTMS include high accuracy, high resolution, low cost, and ease of implementation.

Fig. 1 .
Fig. 1.Ultrasonic system for measuring the air temperature inside a chamber.

Fig. 2 .
Fig. 2. Speed of sound in air as a function of air temperature at 0 and 90% RH.

Fig. 3 .
Fig. 3. (a) Phase shift difference (Δθ) used as a main scale for the ultrasonic temperature measurement.(b) Phase shift (θ 1 ) used as a fine scale for the ultrasonic temperature measurement.
) and 8(d), respectively.Two counters are used to count the positions of the time slots in the measured signals of the ultrasound sensor.The counting values are then fed into the two edge-triggered registers, recording both the measured values of the main scale (m) and the vernier scale (n).The D-type flip-flop is used to compare the phase between the main clock and the vernier clock and to detect the changing lead/lag point (shown in Figs.8(c) and 8(d)).Measured values in the two registers are sent to an 89S51 microprocessor.

Fig. 8 .
Fig. 8. (a) Waveform of the output signal of zero-crossing circuit #1.(b) Waveform of the output signal of zero-crossing circuit #2.(c) Waveform of the main clock.(d) Waveform of the vernier clock.(e) Waveform of the output signal of D-type flip-flop.(f) Waveform of the inverted output signal of D-type flip-flop.

Fig. 11 .
Fig. 11.(a) Collected data illustrating the relationship between reconstructed temperature versus the actual temperature.(b) Error plots of temperature.