Minggu, 08 September 2013

R, L, C and ESR

 R, L, C and ESR. hxRLCMeter



Content
 The article describes an amateur measuring device on ATMega8. Some schematics are from similar developments, the firmware is written from scratch. 
Provides a detailed description of the principles of measurement of various quantities by the microcontroller. Printed circuit board and firmware included.
 Video of the instrument:

 

Description of the instrument
The device is designed for measuring the capacitance, inductance, resistance, and ESR electrolytic capacitor.
ESR can be measured in the circuit.
The device has a recreational purpose and does not pretend to high accuracy. In amateur practice, mainly required to know the approximate value to collect circuit. Precision measurements in the table below is based on a measurement known components, the spread parameter which is typically up to 10%.
Table. Measuring ranges and accuracy
Parameter
Measurement range
Accuracy
The resistance of
The 1st - 2 MW
at least 10% in the range up to 400K, not more than 20% in the range of 400K-2 MW
Capacity
1pF - 3mkF
at least 10%
Inductance
1mkG - 100mg
at least 10%
ESR
0.01Om - 10 Ohm
better than 20%
Additional effort, the measurement accuracy can be improved by an order, even without changing the circuit. I did not continue to develop as the device is fully satisfy me in its current form. Also, I do not have precise instruments for calibration.
On the front panel are LCD-display (8 digits), with measurement of R, L, C, socket for measuring ESR, and the zero button. On the side panel are buttons toggle and power. Alternatively, you can measure the ESR in the scheme of the probes connected on the top panel.
As the housing body is taken from the router DLink DI-524.

Operation


Measurement of resistance
To measure the resistance element, it is switched sequentially with known resistance. Just see Scheme 4 resistance (R22-R25) for different ranges, which in turn are connected microcontroller.
Resistor in series with the process due to the nature schemes included resistor R21 (100 ohms) to prevent a short circuit when switching switches SW1-SW4.
As the keys are used transistors 2N7002, unsoldered from the motherboard.
A chain (R21 + Rx + Rcal) in turn provides a filtered power supply (Uavcc, 5V) and the measured voltage drop (Usence) resistors Rcal (R22 - R25).
Rx = Rcal * Uavcc / Usence - Rcal - R21 Resistance Drain-open and closed transistors are ignored.
From all the measurements is selected the one which gives the best accuracy. For this simplified device calculates the derivative of this function. Given that razryadnot ADC is 1024 units, it is enough to calculate the change with an increase in Rx Usence on Uavcc/1024. The value of the smallest change is accepted as the most accurate.


Capacitance measurement
Capacitance measurement is based on measuring the oscillation frequency of the LC-circuit. This unknown capacitance is connected in parallel with a certain inductance L1 and capacitance C1.


The natural frequency of the oscillation circuit is calculated as:
F = 1 / (2 * pi * sqrt (L * C))
The spread of the parameters of parts can significantly change the frequency of oscillation, so a direct measurement of the frequency can not give reliable results. 
Calibrated measurement parameters using the components L1, C1, C4.
To do this, the instrument measures the frequency resonant circuits L1C1 and L1 (C1 + C4): Chain D4D5C12 allows you to connect the capacitor C4 to the oscillator circuit, changing the potential on pin C1EN microcontroller.
Increased accuracy requirements imposed only to the calibration capacitor C4.
The frequency of the oscillation circuit L1C1:
F1 = 1 / (2 * pi * sqrt (L1 * C1))
The frequency of the oscillation circuit L1 (C1 + C4):
F2 = 1 / (2 * pi * sqrt (L1 * (C1 + C4)))
The frequency of the oscillation circuit L1 (C1 + Cx)
F3 = 1 / (2 * pi * sqrt (L1 * (C1 + Cx)))
From the above equations we derive the value of Cx, depending only on C4:
Cx = C4 * (F1 / F3) ^ 2 / (F1 / F2) ^ 2
Calibration of the instrument (measurement of F1 and F2) is made when you switch to measure capacitance, so at this point the device to the jack nothing should be connected. You can also re-run the calibration using the zero (the empty nest). Instrument calibration is stored in the EEPROM.
The capacitance value of C1 does not have to exactly match the value specified in the scheme. Instead, it suffices to measure C1 knowingly and precision instrument to make the capacitance value in the firmware.


Measurement of inductance
Measuring the inductance based on the same principle as the capacitance measurement. Unknown inductance connected in series with an inductance L1. 
Increased accuracy requirements imposed only to the calibration capacitor C4.
The frequency of the oscillation circuit L1C1:
F1 = 1 / (2 * pi * sqrt (L1 * C1))
The frequency of the oscillation circuit (L1C1 + C4)
F2 = 1 / (2 * pi * sqrt (L1 * (C1 + C4)))
The frequency of the oscillation circuit (L1 + Lx) C1:
F2 = 1 / (2 * pi * sqrt ((L1 + Lx) * C1))
Derive the formula for calculation of Lx, depending only on C4:
  Lx = ((F1/F3) ^ 2 - 1) * ((F2/F3) ^ 2 - 1) * (1/C4) * (1 / (4 * pi ^ 2 * F1 ^ 2)) 
Because of the characteristics of the circuit, the calibration mode, the inductance is not possible - it should be implemented in the measuring container. So before the first use, or to get more accurate results, briefly switch to measure capacitance. Subsequently, the calibration is stored in the EEPROM.


Measurement of ESR
ESR measurement is based on measuring the voltage drop across the unknown element of a sinusoidal signal of 100 kHz.At this frequency, the reactance of the capacitor is close to zero and can be ignored. The value of the voltage drop reflects the resistance of the element.
The amplitude of the applied sinusoidal signal does not exceed 80 mV, which allows measuring ESR, not vypaivaya capacitors of the circuit. At this voltage, silicon and germanium transitions are not open and do not affect the measurement result. However, it should be borne in mind that low impedance is the fact serviceability capacitor as measured by the total resistance of the circuit, for example - of parallel capacitors. On the other hand, high resistance probably faulty.


100 kHz square wave is generated by the microcontroller on the MOSI pin and extends filter R28C24 R29C23 R30C25, which leaves only a sinusoidal harmonic of 100 kHz.
Emitter follower Q1 generates a sinusoidal current at the chain R27 R14 TR1-1.
Parallel winding TR1-1 included a chain R16C37Rx. Therefore, the resistance Rx affects the current flowing through the primary winding of TR1.
Diodes D5, D7 and capacitor C16 are used to protect the device when connected to a circuit with a charged.
The resistor R37 is necessary in order to eliminate the influence of parasitic oscillation circuit formed by the capacitor C16, and the winding of the transformer wire leads. By introducing additional resistance, we reduce the "Q" and the amplitude of the resonance circuit.
Empowered by the transformer voltage is rectified chain D8C17 and enhanced operational amplifiers U5: A b U5: B 3 and (3 * 21) times. The first value is used to measure large values ​​of resistance (> 3 ohms), the second - small.
The device applies a pulse transformer WYEE-16C of the duty of the computer power supply Codegen-300X, taken without rewinding.
The measured resistance of the non-linear effect on the current flowing through the winding TR1. Also at the measured output voltage transformer strongly affects parameter spread parts. Therefore, the device is calibrated by a set of known resistance. The calibration is saved in the EEPROM.
Nutrition
A short press of the button SW5 provides power to the device, after which the microcontroller supports the power supply by means of a reed relay RL1. The unit will automatically turn off after 5 minutes of inactivity, if jacks nothing is connected, or after 15 minutes when connected.
To force the power off, press and hold SW5, until the screen turns off.
The device measures the battery voltage (for display discharge) through a resistor RV3.
And the circuit board are for variant powered by a 9V battery. In a real device I decided to use three AA batteries. In this case, instead of 78L05 put the jumper, and a stable 5V power is supplied to the inverter collected on mc34063.


Make contacts relay in this case should stand in the chain "+" on the battery. 
should also file a "+" battery after a relay to pin 3 RV3
Setting up the instrument
To configure the device will need an oscilloscope and RS232-TLL cable, and a set of calibration resistor 0.1 ohm (3 pieces), 0.2, 0.3, 0.6, 1.0, 2.2, 3.6, 4.7, 6.6, and 10 ohms.
Setting the resistance measurement
Setting the measurement of resistance is reduced to checking for opening the pulse gate field-effect transistors.
By the resistors R21-R25 are increased requirements in terms of accuracy, but the exact match of resistance values ​​shown in the scheme is not required. Instead, it suffices to measure the available resistors obviously a precision instrument, and to indicate the measured values ​​of the resistance in the firmware.


Setting the capacitance measurement
You must make sure that the output pin of U1 is present meander, the frequency of which depends on the connected capacity. Setting the inductance

You must make sure that the output pin of U1 is present meander, the frequency of which depends on the connected inductance.  Setting ESR measurements

Setting ESR - the most complicated.
1.Please use the RS232-TTL cable to the connector J6.
2. We switch SW4 is set to "ON".  
At pin 19 U4 is set to "0", the device switches to "ESR". Displayed on the terminal prompt:
MODEESR: ....
3. Oscilloscope check the availability of 100 kHz square wave pulse on pin 17 U4 (packs of 0.5 seconds with a pause of 1 second).
 

4. After passing through the filter R28C24 R29C23 R30C25 impulses become almost a sine wave.
and fed to the base of transistor Q1 through a divider R15R33, which must be chosen so that when connected to a 10 ohm resistor schupam lower point slightly higher than the voltage sinusoid opening tranzictora (~ 600mV), and the amplitude of the signal created based on the resistor R14 fluctuations scale ~ 80mV .

4. Check if there is a sine wave on the second side of the transformer.

6. Calibrate operational amplifiers.
ESR meter test leads are short-circuited. Adjust the bias voltage U5: A resistor RV1. Achieve, that when a pulse sine wave output voltage of 1 U5: A rose to ~ 300 mV.
7. This was followed by the same adjustment amplifier U5: B resistor RV2, controlling output 7 oscilloscope.
8. Connect the test leads to the ESR meter calibration resistor with a resistance of 10 ohms (this is the upper limit of the measuring instrument.) 
When a pulse, the output voltage 1 U5: A must rise to the level of ~ 3.5V. If the voltage exceeds 3.7V, the need to pick up the gain, defined resistances R20R13.
Resistors R32R18R31 define the gain of the second amplifier, which is used for measuring low resistance values.
In the original scheme gain factors are used, and 21 3. If they will change - you need to fix the constant ESR2_MUL = 21/3 in the firmware.
9. By connecting various known resistance to schupam ESR meter, you need to make sure that the smaller values ​​correspond to lower resistance values ​​of voltage at the output 1 U5: A, and vice versa (the dependence of non-linear).
10. We start the software calibration. 
Probes ESR meter short or push button SB1 (hold for 1 sec.) The device stores the voltage on the ESR1 and ESR2. They are displayed in the terminal as a zero = ... and should be in the range of 10-200 if the levels at the outputs of the operational amplifiers are configured correctly.
MODEESR: ESR1 = 67 (zero: 67) 
ESR2 = 21 (zero: 20) 
ESR = 1 
res * 1000 = 0

11. Connecting calibration resistance 0.05 ohms (two parallel resistor 0.1), the terminal sends the character "c", "a".Thus the instrument stores the calibration value for the resistance of 0.1 ohms in the EEPROM. In response, the text is displayed:
Done: xx

And the printed calibration table. This also repeat for the remaining gauge resistors respectively pressing "c", "b", "c", "d", etc. Denominations calibration resistors can be changed in the firmware in the table s_ESR_CAL_R.
At the end of using the values ​​would be nice to build a schedule to make sure that all "seems to be true." I got this:

Fill flash
Fill flash is via connector J3 (nestandarny format under my programmer). When programming the device to be switched to a mode other than the ESR, and hold the power button all the time.
The repetition of the scheme and used items
I developed the scheme for themselves, so it uses the details that I had, or that I was easier to get. In particular, the device uses specific indicator LCD controller mpd7225, taken from the broken tape Sony. Obviously, with the repetition of the scheme it should be replaced by any other 8-segment display interface SPI, and replace procedures of communication with the indicator in the firmware (file LCD_D7225.h, LCD_D7225.c). You can also remove the chain R9-R12, D1-D3, U3, serving to harmonize levels of 5V-3.3V.


Files: 
Source Project

Tidak ada komentar:

Posting Komentar