M ~ E S S O R S AND
MICROS~TEMS ELSEVIER
Microprocessors and Microsystems 20 (1996) 297-301
Technical application
Microcontroller based LCR meter M.A. Atmanand, V. Jagadeesh Kumar Department of Electrical Engineering, Indian Institute of Technology, Madras 600 036, India Received 19 March 1995; revised 10 May 1996
Abstract
A microcontroller based scheme for LCR measurement is described. The unknown element (an inductor or a capacitor or a resistor) is measured employing a non conventional ac bridge. The element to be measured forms one arm (side) of the bridge and the second (series) arm is made up of a simple resistor. A Multiplier type Digital to Analog Converter (MDAC), controlled by a microcontroller, serves as the other two arms. The microcontroller, after obtaining quadrature condition between the bridge output and one of the designated bridge voltages, acquires the current through and voltage across the series connected resistor. With these values and the value of digital input to the MDAC, the parameters of L or C or R values are evaluated by the microcontroller and displayed in appropriate display fields. The scheme was implemented using an Inte18751 microcontroller. An overall accuracy of the order of +1.0% was achieved for the prototype with a 12-bit MDAC having an accuracy of 4-0.2%. Keywords: LCR measurement; Microcontroller-application; Quasi-balanced bridge; PSD-application
1. Introduction
Measurement of components (inductance L, Capacitance C or resistance R) is essential in many fields of electrical and electronics engineering. Several schemes for LCR measurement have been developed for general as well as specific applications. These methods can be normally grouped into (a) bridge methods and (b) direct methods. In a class of direct methods o f measurements, a known current is passed through the unknown impedance Z (where Z could be L, C or R) and the resulting voltage across it is measured and used for computation [1,2]. Direct methods are also reported, wherein the unknown impedance is connected in series with a standard resistance and the series combination is excited by a sinusoidal source [3,4]. The various voltages across the standard resistance, impedance and the source are used for the computation o f impedance. The earliest and the most accurate methods of measurement o f an unknown impedance are the bridge methods [5,6]. Since in these ac bridges, balance is obtained by varying two parameters, convergence towards balance would involve several steps. Complex automatic balancing techniques have 0141-9331/96/$15.00 © 1996 Elsevier Science B.V. All rights reserved PH S0141-9331(96)01095-2
been developed for a specific application of these bridges [7,8]. To overcome the problem of balancing in conventional ac bridges, quasi balancing methods have been proposed. These quasi balanced bridge-forms require adjustment of only one variable element and hence convergence to the balance condition, in general, is obtained with few steps. However, in conventional quasi balanced bridge forms, two independent quasi balances are obtained and the parameters of the unknown Z computed therefrom. In most of these types of bridges, balancing involves achieving a "minimum" on the detected output. The sensing of such a minimum detected voltage/ current becomes difficult in most cases and under certain conditions the detection becomes impossible [9]. We now propose a new approach to a conventional quasi balanced bridge. With an added Phase Sensitive Detector (PSD), the "quasi balance" condition is indicated by obtaining a zero at the output of the interposed PSD. Hence sensing of quasi balance can be easily implemented. Instead of obtaining a second quasi balance, here certain circuit responses are measured and the value of Z is computed. Hence, unlike the conventional ac bridges, the accuracy of the proposed method would be mainly dictated by the accuracy with which the circuit responses are measured.
M.A. Atmanand, V. Jagadeesh Kumar/Microprocessors and Microsystems 20 (1996) 297-301
298
2. Principle Of operation
+ +
The unknown impedance Z (L or C or R) is connected in series with a resistance Rs and the combination forms one of the ratio arms of an ac bridge. A resistive potential divider, with one section having resistance ( 1 - m)Rp and the other having resistance mRp forms the other two arms of the bridge. The bridge is excited by a sinusoidal voltage Vs at the required frequency a; as shown in Fig. 1(a). The phasor diagram of the voltages for variation in "m" is represented in Fig. l(b) for an inductor. The potential divider is adjusted by varying 'm' such that the bridge output voltage vd and VR, the voltage drop across Rs due to current i, are in quadrature (i.e. a 90 ° phase difference between the signals). Then the value of the unknown inductor can be deduced as L-
1 Vd ~m
+
,~-m)Vs ,
s J
_+i
+
mVs : -'~ Vd Rp
RS
VR
(1)
I
and the resistive component of the inductance RE as,
RL -- (1 - m ) V R _ m mI (1 - m) Rs
(2)
where Vd, VR and I are the respective rms values ofvd, VR and i. The bridge is nearly the same for the measurement of a capacitance except that arms mRp and ( 1 - m)Rp are interchanged. The balance condition of the bridge for the present configuration is indicated by Vd and the voltage across the capacitance, Vz in quadrature. Referring to the phasor diagram of Fig. l(c) for this case, and considering the parallel equivalent circuit for a capacitor, we have, | VdI Vd C - w(1 - m------~Vz VR -- ~(1 -- m)VzRs
(3)
b
(1-m)Vs
--
m~Cs
Vd
and m I 1 m Gc - (1 - m) V R -- R s (1 - m)
(4)
where C is the capacitance and Gc its conductance. The quality factor (Q) for an inductor and dissipation factor D (tan 6) for a capacitor can be found to be, Q-
1 (l-m)
Vd VR
(5)
and
tan ~5 = m Vz
Vd
Fig. 1. (a) Bridge network used for measurement of Z; (b) phasor diagram for quasi-balanced condition with inductive impedance; (c) phasor diagram for quasi-balanced condition with capacitive impedance.
(6)
For the measurement of an unknown resistance R x either of the above procedures could be adopted. If Rx is measured with the inductor option, its value would be straight away indicated by Eq. (2). On the other hand, if Rx is measured in the capacitor mode, the value 1/Rx is indicated by Eq. (4).
From Eqs. (1) to (6) it can be seen that determination of the component parameters, after quasi balancing the bridge as indicated above, involves only the measurement of the rms values of relevant circuit responses and evaluating appropriate equations. These steps can be easily implemented with a microprocessor/microcontroller. Such a scheme employing a microcontroller is described here.
3. Measurement scheme using microcontroller
The block schematic of the microcontroller scheme is
299
M.A. Atmanand, V. Jagadeesh Kumar/Microprocessors and Microsystems 20 (1996) 297-301
I Comparator (LM311)[ W'I
"
]
RMSto df1~5°8)-~ converter (AD636) "i MUXI d.c.
MDAC VZ 7521) -t-I d~l --~ [Ti+IAD mV, ~ VS +
+
II~--"~
A2 .
"1
PSD [ (CD4051 &
i]v iConverte
P2 Mieroeontroller (IntelS751H) t ""
(LT$543) AI~ , ~'N~x134 = ~ - ,iaeriv~ (74]
LF357)
I (Lr356)
Fig.2.Blockdiagramofthemicrocontroller basedLCRmeter. given in Fig. 2. The unknown element in seriescombination with a resistance Rs is connected to Vs as explained earlier. The resistive potential divider [mRp and (I - m)Rp] is implemented with a Multiplying type Digital to Analog Converter (MDAC), whose reference is connected to v s through a buffer. Instrumentation amplitierAl and A2 convert Vz and vd to single ended (ground referenced) quantities. The current i is converted to a proportional voltage by an opamp current-to-voltage converter. The signals i, vR, vd and Vz are connected to an rms-to-dc converter through an 8-to-1 analog multiplexer. The voltage vd is also given as input to a synchronous type Phase Sensitive Detector (PSD) [10]. The reference input of the PSD is selected as either VR or Vz, by the DPDT switch S1, depending on either L or C is to be measured. The other pole of S 1 is employed to indicate the type of impedance being measured to the microcontroller through the selection of a logical input as "0" for C and "1" for L. A second switch S2, of SPST type, indicates to the microcontroller whether RL or Q for the inductance (Gc or tan 6 for the capacitance) is to be computed and displayed. The dc output of the PSD and the output from the rrns-to-dc converter are multiplexed by a 2-to- 1 analog multiplexer and the multiplexer output is given to the input of an analog to digital converter (ADC). The ADC is interfaced to the microcontroller with required interface logic. The microcontroller
controls the MDAC, 8-to-1 and 2-to-1 multiplexers, the ADC and a set of seven segment displays through necessary interfaces. For the measurement of excitation frequency w, the bridge voltage Vs, converted to a square wave by a sine to square converter, is given to one of the counters of the microcontroller. The quadrature condition to be met for quasi-balancing is achieved with the help of the PSD. For a synchronous type PSD output is a dc voltage VpSD, given by: Vps D = Kps D Vp cos ¢
where KpsD is the P S D constant, Vp the peak voltage of the input sinusoid and ~ the phase between the input and the reference signals of the PSD. If V ~ D is zero with a finite Vp then it turns out nicely that the input and reference sinusoids of the P S D are at quadrature, the required condition for quasi balance in our case. The rnicrocontroller is programmed to quasi balance the bridge by setting a suitable binary value for "m" on the M D A C so as to obtain a zero output on the PSD. After quasi balance is achieved, the rms values of relevant voltages and current are acquired, appropriate equations are evaluated and the results displayed by the microcontroller. The possible systematic errors of the proposed scheme are discussed in the next section.
300
M.A. Atmanand, V. Jagadeesh Kumar/Microprocessors and Microsystems 20 (1996) 297-301
4. Error analysis Error analysis is performed for a typical parameter, say L as follows: Referring to Eq. (1) the maximum absolute error would be
- ~ : AVdVd+ ~ f + ~ - + ~ From Eq. are (i) the (ii) the (iii) the
I
I
Initialise;Setm= 0.5 PSD
Select reference
(7) Decrement ~ mVssettingI
(7) above, it is found that the sources of error
~,~?~
error in the rms-to-dc converter and the ADC error in the measurement of frequency and error in the MDAC.
By using rms-to-dc converters and ADC of high accuracy, the error due to this source can be minimised. The accuracy of frequency measurement depends upon the ratio of the bridge excitation frequency to the clock frequency of the microcontroller and can be improved by using higher clock frequencies. The resolution of the M D A C is the limiting factor for the setting of "m" and its influence in the overall error can be minimised by choosing a more accurate and high resolution MDAC. The systematic errors due to the terms in Eq. (7) simply add up to provide the worst case error AL/L. The value of m should be large for minimising the component Am/m, which could be realised by suitably choosing an appropriate R s. It may be mentioned here that in the case of measurement of a pure resistor, the error due to frequency measurement does not figure. Hence the overall error in the case of measurement of pure resistors will be smaller than that compared to measurement of other parameters. To check the feasibility of the proposed scheme, a prototype was built using an Intel 8751 microcontroller [11] and tested. The details of the prototype and test results are discussed next.
5. Experimental results and conclusions The prototype was built with commonly available ICs like AD 7521 as MDAC, AD 637 as rms-to-dc converter, MAX 134 as ADC. The important IC numbers are marked in Fig. 2. The program for the 8751 is burnt into the E P R O M of 8751. The complete flow chart of the software is shown in Fig. 3 and is self explanatory. The prototype was employed for measurement on laboratory standard inductors and capacitors (available in decade box form) at frequencies of 100 Hz and I kHz. The results were compared with measurements made with a Hewlett Packard HP 4274A multi frequency LCR meter having a basic accuracy of ±0.1%. Accuracies of the order of ±0.5% for inductors in the range
Incr mo.m /
Vs settln~
ReadI, VR, I Va& Vz I
]Corn,ute.,] 1 ( ~ ]
i C°Ri,
I
I
~-
I
0 "-
I
I
I o° ute I
Q ute ]
] Compute ¢dc I
[Compute I tan ~
. computed result Fig. 3. Flowchart of the software.
20 mH to 200 mH and + 1% for capacitors in the range 1 nF to 10 nF were obtained with the prototype. The major source of error in the prototype is due to the limited resolution and linearity of the M D A C used (for AD 7521, the resolution is +0.025% and accuracy, +0.2% respectively) for setting "m". This would lead to a finite error in the setting of zero at the output of the PSD. As mentioned earlier the accuracy of the rmsto-dc converter and the ADC also contribute to the overall inaccuracy of the system but are insignificant compared to that of the MDAC. Hence employing an M D A C having better resolution coupled with good accuracy, one can increase the accuracy obtainable. To conclude, a new microcontroller based method for the measurement of L, C and R has been devised and experimentally verified.
M.A. Atmanand, V. Jagadeesh Kumar/Microprocessors and Microsystems 20 (1996) 297-301
References [1] C.J. Alonzo, R.H. Blackwell and H.V. Marantz, Direct reading fully automatic vector impedance meters, Hewlett Packard J. (January 1967) 12-20. [2] R.J. Reis, Measurement of an unknown impedance in an automatic tester, IBM Tech. Disc. Bull., 24 (1981) 3147-3148. [3] Khalid M. Ibrahim and Majid A.H. Abdul-Karim, Digital impedance measurement by generating two waves, IEEE Trans. Instrum. Meas., IM-34 (1985) 2-5. [4] Saleem M.R. Taha, Digital measurement of the polar and rectangular forms of impedances, IEEE Trans. Instrum. Meas. IM-38 (1989) 59-63. [5] B. Hague and T.R. Foord, Alternating Current Bridge Methods, Pitman, London, 1971.
301
[6] B.M. Oliver and J.M. Cage, Electronic Measurement and Instrumentation, McGraw Hill, New York, 1971. [7] O. Petersons, A self-balancing high voltage capacitance bridge, IEEE Trans. Instrum. Meas., IM-13 (1964) 216-224. [8] R.D. Cutkosky, An automatic high-precision audio frequency capacitance bridge, IEEE Trans. Instrum. Meas., IM-34 (1985) 383-389. [9] K. Karandeyev, Bridge and Potentiometer Methods of Electrical Measurements, Peace publishers, Moscow, 1975. [10] K.L. Smith, The ubiquitous phase sensitive detector, applications and principle of operation, Wireless World (August 1972) 367 370. [11] Embedded controller handbook, Vol. 1 and 2, Intel, Santa Clara, 1988.