Impedance measurement using multiharmonic least-squares waveform fitting algorithm

Impedance measurement using multiharmonic least-squares waveform fitting algorithm

Available online at www.sciencedirect.com Computer Standards & Interfaces 30 (2008) 323 – 328 www.elsevier.com/locate/csi Impedance measurement usin...

306KB Sizes 1 Downloads 210 Views

Available online at www.sciencedirect.com

Computer Standards & Interfaces 30 (2008) 323 – 328 www.elsevier.com/locate/csi

Impedance measurement using multiharmonic least-squares waveform fitting algorithm Pedro M. Ramos ⁎, A. Cruz Serra Instituto de Telecomunicações and Department of Electrical and Computer Engineering, Instituto Superior Técnico, Technical University of Lisbon, IST, Av. Rovisco Pais 1, 1049-001 Lisbon, Portugal Received 6 June 2006; received in revised form 4 September 2007; accepted 25 September 2007 Available online 5 October 2007

Abstract In this paper, a multiharmonic least-squares waveform fitting algorithm is used to measure impedances. By using analog to digital converters, a function generator, a reference impedance and the fitting algorithm, we show that it is possible to obtain the frequency response of a unknown linear impedance at the frequencies that correspond to the harmonics of the stimulus input signal. Results show that, with a 400 Hz triangular signal, harmonics up to the 49th can be used to measure the impedance frequency response of a parallel RLC circuit with experimental standard deviations below 1.5% for the impedance magnitude and 1° for the impedance phase. © 2007 Elsevier B.V. All rights reserved. Keywords: Impedance measurement; Least-squares methods; Waveform fitting

1. Introduction The sine-fitting algorithms described in [1,2] and analyzed in [3] best fit a digitized signal with a sine wave by adjusting three or four parameters. The resulting parameters describe the sine wave that minimizes the least-square error to the sampled record. Sine-fitting numerical methods are a good approach to measure impedances. These algorithms are relatively immune to additive Gaussian noise since they can use a high number of acquired points to determine the parameters of the sine wave. Their properties enable very good-accuracy impedance measurement using 16-bit data acquisition boards and inexpensive sine wave generators. By fitting two sinewaves (the voltage across the unknown impedance and the voltage across a well-known reference impedance) the impedance magnitude and phase can be determined. The results presented in [4] for impedances with magnitudes ranging from 100 Ω to 1 kΩ at 1 kHz determined with a 12-bit

⁎ Corresponding author. Tel.: +351 218418485; fax: +351 218418472. E-mail address: [email protected] (P.M. Ramos). 0920-5489/$ - see front matter © 2007 Elsevier B.V. All rights reserved. doi:10.1016/j.csi.2007.09.002

data acquisition board (DAQ), show experimental relative standard deviations for the measured magnitude below 0.002% while the experimental standard deviations of the phase are below 0.001°. These standard deviations are obtained by the results of repeated measurements. In [5], a new algorithm was presented that can simultaneously determine the sine wave parameters of two voltages with the same frequency. This algorithm, named seven-parameter, determines the seven parameters of the two sine waves: the common frequency, the two amplitudes, the two dc components and the two phases. Using this algorithm with a 16-bit DAQ, a sensor with impedance magnitudes varying from 35 mΩ to 43 mΩ was characterized by sweeping the frequency in the 500 Hz to 1250 Hz range. Experimental standard deviations below 0.6% for the impedance magnitude and below 0.4° for the phase were obtained. It should be noted that the lowest amplitude of the acquired sine waves was 0.18 mV which corresponds to 116 LSB in the ± 50 mV DAQ input range used. One drawback of this method is that it requires the stability of the measurand throughout the lengthy measurement procedure. To circumvent the problem associated with the need for long-term stability when performing frequency sweeps, one

324

P.M. Ramos, A.C. Serra / Computer Standards & Interfaces 30 (2008) 323–328

can apply a multiple harmonic signal that can thus deliver the frequency response of the unknown impedance requiring only one acquisition. In order to detect the harmonic response of the impedance, the multiple harmonics of signals must be measured in a manner similar to what is done in the single tone situation [1,2]. Multiharmonic signals cannot be fitted with simple sine-fitting algorithms. In [6] a method was presented that fitted each harmonic in the fitting residuals of the previous harmonic in a sequential manner. However, this algorithm is very dependent on the accuracy of the estimated frequency of the fundamental component; on the number of acquired periods and the error of each iteration propagates to the following iterations. In [7] the authors presented an improved sine-wave fitting procedure for characterizing data acquisition channels and analog-to-digital converters which is also capable of fitting multiple-harmonics of an input signal. In [8], a different method was proposed based on the spectral analysis and fitting by interpolating the acquired samples. However, these methods are difficult to implement and finetune. Based on the simple and widely use sine-fitting algorithm normalized in [1,2], the method used in this paper best-fits the acquired data with multiple harmonics at predefined frequency ratios from the fundamental. The results of the method are the harmonics amplitudes and phases together with the dc component and the signal frequency. This method is capable of determining the harmonic amplitudes of a near full-range triangular signal up to the 49th harmonic by using a 16-bit DAQ. Non-ideal amplitudes 80 dB below the fundamental can also be accurately measured. Contrary to the methods presented in [7] and [8], the algorithm used in this paper requires only the construction of a matrix and the numerical calculation of its pseudoinverse in each iteration. 2. Waveform fitting for impedance measurements

sample ym (m = 1…M) there is a corresponding time instant tm. The vector y contains all the valid samples. 2.2. Waveform fitting The first step in the waveform fitting method is the same as in the traditional four-parameter algorithm [1,2] and it corresponds to the initial estimation of the signal frequency fˆ. Since the presence of other harmonics does not influence the results obtained with an Interpolated Discrete Fourier Transformation (IpDFT), this is the method used to accurately estimate the frequency of the fundamental [3]. The initial estimates of the harmonics amplitudes, phases and of the dc component are obtained using a linear least-squares (LS) step much like the three-parameter method [1,2]. The input signal can be written as yðt Þ ¼ C þ

H X

½Ah cosðhxt Þ þ Bh sinðhxt Þ

ð2Þ

h¼1

where Ah and Bh are the in-phase and quadrature amplitudes of harmonic h and ω = 2πf. Dh and ϕh are obtained from Dh ¼

qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi A2h þ B2h

ð3Þ

and   8 Bh > 1 >  if Ah z 0 tan < Ah   /h ¼ Bh > > : tan1  þ p if Ah b 0: Ah

ð4Þ

The LS solution vector h iT xˆ ¼ Aˆ1 Bˆ 1 Aˆ2 Bˆ 2 N AˆH Bˆ H Cˆ

ð5Þ

is determined by h 1 i xˆ ¼ DT D DT y ¼ Dy y:

ð6Þ

2.1. Multiharmonic signal A periodic signal y(t) that meets the Dirichlet conditions can be described by the Fourier series yð t Þ ¼ C þ

H X

Dh cosð2phft þ /h Þ

ð1Þ

h¼1

where C is the dc component, f is the signal frequency, Dh and ϕh are the amplitude and phase of harmonic h. In (1), only the first H harmonics are considered for the description of y(t). It should be noted that some of the harmonic amplitudes may be zero and need not be considered in the algorithm, thus reducing the computation burden. The data samples are acquired at a fixed sampling rate fS. If there are samples with output codes corresponding to the ADC converter limits, they are disregarded since they correspond to ADC saturation. It should be noted, however, that the use of saturated samples is not advisable since it leads, as shown in [9] even for amplitudes near the ADC full range, to biased estimation of the amplitude. Assuming a total of M valid samples, to each

D† is the pseudoinverse matrix of D. D has M rows and 2H + 2 columns 2

3 cosðxt1 Þ sinðxt1 Þ cosð2xt1 Þ sinð2xt1 Þ : : : cosð Hxt1 Þ sinð Hxt1 Þ 1 6 cosðxt2 Þ sinðxt2 Þ cosð2xt2 Þ sinð2xt2 Þ : : : cosð Hxt2 Þ sinð Hxt2 Þ 1 7 7: D ¼6 4 v v v v v v v 5 : : : cosð HxtM Þ sinð HxtM Þ 1 cosðxtM Þ sinðxtM Þ cosð2xtM Þ sinð2xtM Þ

ð7Þ With the initial estimates of the parameters, an iterative process begins where all the parameters are adjusted to minimize the LS error. The estimate vector of iteration i is h iT ðiÞ ðiÞ ðiÞ ðiÞ ðiÞ ðiÞ ðiÞ xˆ ðiÞ ¼ Aˆ 1 Bˆ 1 Aˆ 2 Bˆ 2 : : : AˆH Bˆ H Cˆ xˆ ðiÞ : The reconstructed waveform of iteration i is yˆ(i − 1).

ð8Þ

P.M. Ramos, A.C. Serra / Computer Standards & Interfaces 30 (2008) 323–328

Fig. 1. Measurement circuit. ZR is the reference impedance, Z is the unknown impedance and FG is the function generator. The ADC is in the DAQ board.

The correction vector Δx(i) has the values to update all the parameters and is obtained by  y h i Dxˆ ðiÞ ¼ DðiÞ y  yˆ ði1Þ :

ð9Þ

The matrix D(i) for each iteration is

D ð iÞ

2 H 3     X ði1Þ ði1Þ ði1Þ ði1Þ ˆ ˆ ˆ ˆ  A ht sin x ht ht cos x ht þ B 1 1 1 1 6 7 h h 6 h¼1 7 6 H 7     6 X 7 ð i1 Þ ð i1 Þ ði1Þ ði1Þ 6 7 ˆ ˆ  A h ht2 sin xˆ ht2 þ B h ht2 cos xˆ ht2 7: ¼6 6D h¼1 7 6 7 6 7 v 6 X    7 ði1Þ ð i1 Þ 4 H 5 ði1Þ ði1Þ ˆ ˆ ˆ ˆ  A h htM sin x htM þ B h htM cos x htM h¼1

ð10Þ The new estimate vector is xˆ

ðiÞ

¼ xˆ

ði1Þ

ðiÞ

þ Dxˆ :

325

Fig. 3. Magnitude and phase of the impedance under test measured with a HP4192A impedance measurement instrument.

It should be noted that a different version of this algorithm was published in [10]. In that method instead of determining the correction vector as in (9), the new estimate vector (the last element then corresponds to the angular frequency correction) is obtained by using y instead of [y − yˆ(i − 1)] in the right hand side of (9). The overall numerical algorithm consists therefore on: (i) using the IpDFT determine the initial frequency estimative; (ii) with the IpDFT result, obtain the initial estimations of the harmonic amplitudes and phases using (5), (6) and (7); (iii)using (7), (9), (10) and (11) obtain the new estimative vector; (iv) if the LS error has not improved in this iteration below the predefined threshold repeat step (iii); (v) the method has converged and the harmonic amplitudes and phases can be obtained with (3) and (4). 2.3. Impedance measurement

ð11Þ

The iterative method ends when the LS error improves below a certain threshold.

Fig. 2. Experimental FFT amplitude spectrum (line) and waveform detected harmonic amplitudes applying the method here described (marks) of a 9 V peakto-peak, 1 kHz, triangular signal acquired at fs = 100 kS/s in the ±5 V range.

A simple technique for impedance measurement based on sine-fitting algorithms was presented in [4]. The electric circuit is shown in Fig. 1. The ADC channels are used in bipolar differential mode and are simultaneously acquired for the determination of

Fig. 4. Acquired records corresponding to the voltage across the reference impedance (CH1) and the unknown impedance (CH2). The records were acquired at fs = 101.01 kS/s in the ±0.5 V range.

326

P.M. Ramos, A.C. Serra / Computer Standards & Interfaces 30 (2008) 323–328

Fig. 5. Average magnitude and experimental relative standard deviation of the impedance under test obtained with the waveform fitting method (marks). The magnitude obtained with the HP4192A (Fig. 3) is also plotted.

Fig. 6. Average phase and corresponding experimental standard deviation of the impedance under test obtained with the waveform fitting method (marks). The impedance phase obtained with the HP4192A (Fig. 3) is also plotted.

the sine wave parameters. Since most DAQ devices only have one ADC, they sample the channels in a sequential order and a small inter-channel delay is introduced. This delay depends only on the sampling frequency and is corrected by adjusting the time stamps of the second channel. To measure a linear impedance using the waveform fitting method, a multiharmonic signal is applied and the individual harmonic responses of the circuit are determined to obtain the impedance frequency response. The impedance amplitude at each harmonic is

In Fig. 2, the FFT amplitude spectrum is shown together with the detected amplitudes of the first 50 harmonics obtained with the waveform fitting method here described. Harmonics 68 dB below the fundamental can still be detected. Another notable result is the detection of the second and fourth harmonics which are 81 dB and 88.5 dB below the fundamental respectively. It should be noted that, since this particular DAQ does not have a flexible anti-aliasing filter whose cutoff frequency depends on the sampling rate, the full analog bandwidth is presented to the ADC (approximately 400 kHz). This means that the harmonics near 50 kHz are affected by the higher order harmonics. However, the results in Fig. 2 compare the FFT results with the fitted harmonics and the results do not depend on the purity of the acquired triangular signal. For the results in Fig. 2, all 50 harmonics were considered. However, the waveform fitting method is capable of fitting only a subset of harmonics depending on the application. In the triangular wave, only the odd harmonics may be considered thus reducing the number of parameters to estimate and the computational time. In comparison with the four parameter sine-fitting algorithm described in [1,2], this algorithm poses more stringent conditions to ensure convergence due to the RMS weight introduced by the higher harmonics. This can easily be understood by realizing that a slight change in frequency (which happens when the algorithm is converging) can decrease the LS error if the frequency adjustment is so that the new frequency is nearer the real signal frequency. However, if the frequency adjustment leads away from signal frequency, the LS error will increase. In

jZ ðhf Þj ¼

ðDh ÞCH2 jZR ðhf Þj ðDh ÞCH1

ð12Þ

where (Dh)CH1 is the amplitude of harmonic h in channel 1 of the ADC (measuring the voltage across the reference impedance), (Dh)CH2 is the amplitude of harmonic h in channel 2 of the ADC (measuring the voltage across the unknown impedance) and |ZR(hf )| is the reference impedance magnitude at the frequency harmonic h. Likewise, the impedance phase at the frequency of harmonic h is /ðhf Þ ¼ ð/h ÞCH2 ð/h ÞCH1 þ/R ðhf Þ

ð13Þ

where ϕ(hf ) is the impedance phase, (ϕh)CHi is the phase measured in channel i of the ADC and ϕR(hf ) is the phase of the reference impedance. There is no requirement regarding the input signal purity since the results depend only on the actual harmonic amplitudes applied by the function generator. 3. Experimental results 3.1. Performance analysis of the waveform fitting A 9 V peak-to-peak 1 kHz triangular signal generated by a Wavetek Model 39 was acquired with a National Instruments low-cost 200 kS/s, 16-Bit, Analog Input Multifunction DAQ (NI-6013) at a sampling rate of fS = 100 kS/s in the ± 5 V range.

Table 1 Average values and corresponding experimental standard deviations obtained with the waveform fitting method for the fundamental, the last harmonic and for the harmonic at which the impedance amplitude is higher h

1 15 49

σ|Z|/|Z|

ϕ

|Ω|

|%|

[°]

[°]

[mV]

[mV]

51.4 3045.1 270.2

0.003 0.167 1.321

74.2 15.0 − 83.1

0.002 0.104 0.779

377.88 0.69 0.15

9.72 1.04 0.02

|Z|

σϕ

(Dh)CH1

(Dh)CH2

P.M. Ramos, A.C. Serra / Computer Standards & Interfaces 30 (2008) 323–328

the four-parameter, the frequency adjustments will cause an LS error which is nearly proportional to the frequency error and the sine amplitude if the frequency error is low enough. As shown in [11] the LS error curve is V-shaped whose width is highly dependent on the number of acquired points. With multiharmonic signals and waveform-fitting algorithms, a slight frequency adjustment Δf for the signal fundamental is a hΔf adjustment for harmonic h causing a quicker variation of the LS error since all the harmonics amplitudes quickly increase the LS error (the V-shaped curve width is much lower). 3.2. Impedance measurement results In Fig. 3, the impedance spectrum of a parallel RLC circuit measured by a suitable analyzer is shown. The resonance occurs at 6.2 kHz where the impedance presents its maximum magnitude of 3176 Ω and a phase of 0°. To measure this impedance using the waveform fitting method, a 400 Hz triangular signal was used together with a 2 kΩ high-precision (±0.01%) resistance as the reference impedance. The DAQ board NI-6013 was used in the ±0.5 V range at a sampling rate of fS = 101.01 kS/s (this sampling rate was chosen to avoid coherent sampling of the input signal). The generator amplitude is adjusted so that the highest amplitude DAQ channel stimulates 90% of the ADC input range. To determine the average values and corresponding experimental standard deviations 1000 acquisitions were performed. For each measurement 10,000 points per channel were acquired. In Fig. 4 the first 4 ms of the acquired records are shown for one acquisition. For channel 1, the voltage resembles the generator triangular signal while channel 2 has considerably lower amplitude and its shape is very different from the generator signal due to the impedance frequency behavior. In the waveform fitting method only the odd harmonics up to the 49th were used. The results obtained for the impedance magnitude are shown in Fig. 5. The average impedance magnitude results match the values measured with the HP4192A. The experimental relative standard deviation of the magnitude is lower at low frequencies where the input harmonic amplitudes are higher. In Fig. 6, the impedance phase results are shown. Again, the higher experimental standard deviations correspond to the higher harmonics which have lower amplitudes. The peak impedance magnitude corresponds to the 15th harmonic. In Table 1, the results for this frequency, for the fundamental and for the highest considered harmonic are presented. For the last harmonic, the amplitude of channel 2 is only 1.37 LSB. 4. Conclusions In this paper, a method for multiharmonic impedance measurement with a single acquisition has been presented. The method, using multiharmonic least-squares waveform fitting, can determine, with a simple setup and one acquisition measurement, the frequency response of a unknown impedance with low

327

uncertainties. For the example presented, a triangular signal was used to measure a RLC parallel circuit and the relative standard deviations for the amplitude are below 1.5% while the standard deviations for the phases are below 1°. However, these results may be further improved if specially tailored input signals with higher amplitudes at the higher harmonics are used. With the use of an arbitrary waveform generator (AWG) it is possible to design input signals with the desired harmonic amplitudes that can even span higher frequency ranges by distributing the harmonics in a different arrangement. Considering a 1–2–5 sequence it is possible to achieve a kind of logarithmic frequency range. This would mean, for example, designing a signal with the harmonics: 1, 2, 5, 10, 20, 50 and 100 to span two frequency decades. It should also be noted that, with specially designed signals generated by an AWG, the added spectral components need not be integer multiples of the first frequency. As long as the relations are known, they can be used for each frequency component in the algorithm. For example, this may be used if the frequency span is very short when compared to the first frequency (e.g., if the desired frequency span is 10 kHz to 20 kHz, one solution would be to use a signal with frequency components at 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 and 20 kHz). 5. Further work Further work also includes improving the convergence of the waveform fitting algorithm which is limiting the number of acquired points for processing. As in the single tone case, the increased number of samples makes the convergence more difficult [3,11]. In addition to this effect, the inclusion of harmonics (due to their higher frequency) and their amplitudes further hampers the convergence of the proposed method. These issues have now been addressed in [12] where the convergence of the algorithm is discussed in depth. With the changes proposed in [12] this algorithm can, in future work, be applied to records with more samples and to harmonic signals with more components and with higher amplitudes (to further reduce the experimental standard deviations). Acknowledgments This work was sponsored by the Portuguese national research project reference PTDC/EEA-ELC/72875/2006. References [1] IEEE standard for digitizing waveform recorders, IEEE Standard 1057 (1994). [2] IEEE standard for terminology and test methods for analog-to-digital converters, IEEE Standard 1241 (2000). [3] T. Bilau, T. Megyeri, A. Sárhegyi, J. Márkus, I. Kollar, Four-parameter fitting of sine wave testing result: iteration and convergence, Comput. Stand. Interfaces 26 (1) (Jan. 2004) 51–56. [4] Pedro M. Ramos, M. Fonseca da Silva, A. Cruz Serra, Low frequency impedance measurement using sine-fitting, Measurement 35 (1) (Jan. 2004) 89–96. [5] Pedro M. Ramos, A. Cruz Serra, A new sine-fitting algorithm for accurate amplitude and phase measurements in two channel acquisition systems, Measurement, (in press) (doi:10.1016/j.measurement.2006.03.011).

328

P.M. Ramos, A.C. Serra / Computer Standards & Interfaces 30 (2008) 323–328

[6] P. Arpaia, A. Cruz Serra, P. Daponte, C. Líbano Monteiro, A critical note to IEEE 1057-94 standard on hysteretic ADC dynamic testing, IEEE Trans. Instrum. Meas. 50 (4) (Aug. 2001) 941–948. [7] R. Pintelon, J. Schoukens, An improved sine–wave fitting procedure for characterizing data acquisition channels, IEEE Trans. Instrum. Meas. 45 (2) (Apr. 1996) 588–593. [8] J. Schoukens, Y. Rolain, R. Pintelon, Fully automated spectral analysis of periodic signals, IEEE Trans. Instrum. Meas. 52 (4) (Aug. 2003) 1021–1024. [9] I. Kollar, J.J. Blair, Improved determination of the best fitting sine wave in ADC testing, IEEE Trans. Instrum. Meas. 54 (5) (Oct. 2005) 1978–1983.

[10] Pedro M. Ramos, M. Fonseca da Silva, Raul C. Martins, A. Cruz Serra, Simulation and experimental results of multiharmonic least-squares fitting algorithms applied to periodic signals, IEEE Trans. Instrum. Meas. 55 (2) (April 2006) 646–651. [11] M. Fonseca da Silva, Pedro M. Ramos, A. Cruz Serra, A new four parameter sine fitting technique, Measurement 35 (2) (March 2004) 131–137. [12] Pedro M. Ramos, A. Cruz Serra, Least-squares multiharmonic fitting: convergence improvements, IEEE Trans. Instrum. Meas. 56 (4) (August 2007) 1412–1418.