Vous êtes sur la page 1sur 16

M AN866

Designing Operational Amplifier Oscillator Circuits


For Sensor Applications
The ratio oscillator provides an output frequency that is
Author: Jim Lepkowski
proportional to the square root of the ratio of two capac-
Microchip Technology Inc.
itors (i.e., freq. (C 4 / C3)1/2). The ratio oscillator can
be used to cancel the effect of a fluid-level sensor with
INTRODUCTION a varying dielectric constant, such as an oil level sen-
sor. An oil level sensor consists of two capacitances
Operational amplifier (op amp) oscillators can be used that are formed by tubes where the fluid serves as the
to accurately measure resistive and capacitive sen- dielectric media. The measurement capacitor (CMEAS)
sors. Oscillator design can be simplified by using the is partially covered by fluid and detects the level of the
procedure discussed in this application note. The deri- oil in the tank. In contrast, the compensation sensor
vation of the design equations provides a method to (CCOMP) is completely buried in the fluid. When the
select the passive components and determine the influ- ratio CMEAS / C COMP is calculated, the dielectric con-
ence of each component on the frequency of oscilla- stant of the oil is canceled. Air pressure and accelera-
tion. The procedure will be demonstrated by analyzing tion sensors can also use the ratio sensor to minimize
two state-variable RC op-amp oscillator circuits. the error that occurs from the variance of the dielectric
constant over temperature.
SENSOR APPLICATIONS
State-variable oscillators are often used in sensor con- TRANSDUCER SYSTEM
ditioning applications because they have a reliable A block diagram of a typical sensor system is shown in
start-up and a low sensitivity to stray capacitance. The Figure 1. The oscillation frequency can be found by
absolute and ratio state-variable oscillators can be counting the number of clock pulses (i.e., MHz) in a
used to accurately detect both resistive and capacitive time window that is formed by the square wave output
sensors. However, this application note will only ana- (i.e., kHz) of a comparator circuit. The counter and
lyze capacitive applications. The state-variable's three comparator circuits can be implemented with a
op-amp topology provides for a more dependable oscil- PICmicro microcontroller.
lation start-up than a single op amp oscillator. The vir-
tual ground voltage at the inverting terminal of the The PICmicro microcontroller can be used to provide
amplifiers provides for immunity from stray capaci- curve-fit temperature correction for precision sensing
tance, which is important in sensor applications, applications. Temperature correction can be accom-
because the sensor capacitance is often only 10 to plished by implementing a curve-fitting routine with
100 pF. In addition, the state-variable oscillator does data obtained by calibrating the sensor over the oper-
not require matched capacitors or capacitors that have ating range. The temperature correction data can be
a terminal connected to ground. stored in the E2 memory of the PICmicro microcontrol-
ler. A silicon IC sensor can provide the temperature of
The absolute oscillator provides an output frequency the sensor.
that is proportional to the square root of the product of
two capacitors (i.e., freq. (C 1 x C 2)1/2). Absolute
quartz pressure sensors and humidity sensors are
examples of capacitive sensors that can use the abso-
lute oscillator. Also, this circuit can be used with resis-
tive sensors, such as RTDs, to provide a temperature-
to-frequency conversion.

2003 Microchip Technology Inc. DS00866A-page 1


AN866

C C
1 2

RC Op-Amp
Oscillator Comparator

Temperature
Sensor PICmicro
Algorithm: Microcontroller
Count the number of clock pulses in a time window set by oscillator pulses.

Clock
Signal
Oscillator
Signal

FIGURE 1: Typical RC Operational Amplifier Oscillator Sensor System.

OSCILLATOR THEORY OSCILLATOR DESIGN PROCEDURE


An oscillator is a positive feedback control system that Listed below is a procedure to design RC operational
generates an output without requiring an input signal. A amplifier oscillators. Refer to the design equation sec-
sustained oscillation is initiated by factors such as tion of this application note for additional information on
noise pickup or power supply transients. Figure 2 deriving oscillator design equations.
shows a block diagram of an oscillator, along with the Step 1: Find LG and s
definition of the mathematical terms that describe an
oscillator. The oscillation frequency is determined by finding the
poles of the denominator of the transfer equation T(s),
The design equations of an oscillator are determined or equivalently, the zeroes of the numerator N(s) of the
by analyzing the denominator of the transfer equation characteristic equation (s). Masons Reduction Theo-
T(s) of the circuit. The poles of the denominator of T(s), rem, shown in Appendix A, provides a method of obtain-
or equivalently, the zeroes of the characteristic equa- ing s. Then s is found by breaking the feedback loop
tion (s), determine the time domain behavior and sta- and obtaining the gain equation at each op-amp in order
bility of the system. An oscillator is on the border line to calculate the loop-gain.
between a stable and an unstable system and is
formed when a pair of poles are on the imaginary axis.
The magnitude and phase equations of an oscillator
also must be analyzed. If the magnitude of the loop-
gain is greater than one and the phase is zero, the
amplitude of oscillation will increase exponentially until
a factor in the system, such as the supply voltage,
restricts the growth. In contrast, if the magnitude of the
loop-gain is less than one, the amplitude of oscillation
will exponentially decrease to zero.

+ V OUT A A A A
VIN A Amplifier Gain VOUT T ( s ) = ---------------- = ---------------- = ----------------- = ------ = ------------
V 1 A 1 LG s N(s)
IN -----------
D(s)
+
where: A x = LG loop gain
s characteristic equation
Feedback Factor
If VIN = 0, then T(s) = when s = 0

FIGURE 2: Oscillator Block Diagram.

2003 Microchip Technology Inc. DS00866A-page 2


AN866
Step 2: Solve N(s) = 0 with the MCP6024 with enough design margin that the
The second step in the procedure determines the non-ideal characteristics of the amplifier can be
zeroes of N(s). Rouths stability criterion, shown in neglected.
Appendix B, provides a method that determines the
zeroes of the characteristic equation without the ABSOLUTE STATE-VARIABLE
necessity of factoring the equation. OSCILLATOR
First, the Routh test consists of forming a coefficient
array from N(s). Next, the procedure substitutes s = j Circuit Description
for s, with the summation of the row set to zero. If the
row equation produces a non-trivial solution for , the The schematic of the absolute circuit is shown in
procedure is complete and the frequency of oscillation Figure 3. The state-variable oscillator consists of two
is equal to . If the row equation does not yield an integrators and an inverter circuit. Each integrator pro-
equation that can be solved for , the procedure con- vides a phase shift of 90, while the inverter adds an
tinues with the next row in the Routh array. Usually, it is additional 180 phase shift. The total phase shift of
necessary only to complete the first two or three rows 360 of the feedback loop produced by the three ampli-
of the Routh array to produce an equation that can be fiers results in the oscillation. The first integrator stage
solved for . consists of amplifier A1, resistor R1 and sensor capac-
itance C1. The second integrator consists of amplifier
Step 3: Sub-Circuit Design Equations
A2, resistor R2 and sensor capacitance C2. The inverter
The third step in the design procedure analyzes the stage consists of amplifier A3, resistors R 3 and R4 and
sub-circuits formed at each amplifier. The sub-circuit capacitor C4. The addition of capacitor C4 helps ensure
equations are formed by obtaining the gain equation oscillation start-up by providing an additional phase
and pole/zero locations for each amplifier. shift.
Step 4: VerifyLG 1 The absolute oscillator does not require a limit circuit if
The final step in the procedure verifies that the loop- rail-to-rail input/output (RRIO) amplifiers are used and
gain is equal to, or greater than, one after the R and C the gain of the inverter stage (A 3) is equal to one
component values have been chosen. This step is also (i.e., R3 = R4). The sinewave output of the signal will
required to verify that the amplifiers do not saturate, swing within approximately 50 mV of the VDD and VDD
which will result in an error in the oscillation frequency. power rails as shown in Figure 5.
A complementary output voltage comparator (A4) is
AMPLIFIER SELECTION CRITERIA used to convert the oscillators sinewave output to a
square wave digital signal. The comparator functions
The appropriate op amp to use in a sensor oscillator is as a zero-crossing detector and the switching point is
determined by the required accuracy and acceptable equal to the virtual ground voltage (i.e., VDD/2). Resis-
distortion of the oscillation frequency. The design equa- tor R9 is used to provide additional hysteresis (V HYS) to
tions assume that the amplifiers are ideal. However, op the comparator. Listed below is the hysteresis
amps have a finite gain bandwidth product (GBW), a equation.
limited slew rate (SR) and full power bandwidth (fP).
EQUATION:
The non-ideal characteristics of the amplifier will lower
the oscillation frequency at high frequencies and may R
V 8 (V
= -------------------- V )
also result in a design with poor start-up characteris- HYS R8 + R9 O ( max ) O ( min )
tics. Note that the total harmonic distortion specification
of the amplifiers is critical for oscillators that are used R8
as sine wave references. However, the shape of the V HYS -------------------- V DD
R8 + R9
waveform is not critical in most sensor applications
because only the frequency of the output is measured.
Several general design rules can be used to select an
op amp for an oscillator circuit. First, the GBW should
be a factor of 10 to 100 higher than the maximum oscil-
lation frequency. Next, the full-power bandwidth,
defined as fP = SR / (2VP), where VP is the voltage
swing (VO(max) - VO(min)) of the output signal, should be
at least 2 times greater than the maximum oscillation
frequency. For example, the MCP6024 quad amplifier
has a GBW = 10 MHz (typ.), SR = 7 V/s (typ.) and a fP
of 400 kHz, with VDD = 5V. An oscillator with a
maximum frequency of 100 kHz can be implemented

2003 Microchip Technology Inc. DS00866A-page 3


AN866

VDD

R6
VDD/2
R7

C4

C1
C2
R1 R4
A1 R2 R9
A2 R3
A3 R8
V1 A4
VDD /2
VDD/2 V2 V0
VDD/2 V3
VDD /2

FIGURE 3: Absolute Oscillator Schematic.

1 - R 4 1
A 2 = ---------------- A
3
= ------ --------------------------
sR C R 3 sR 4 C 4 + 1
2 2
V1 V3
V2

1 -
A 1 = ----------------
sR 1 C 1

FIGURE 4: Absolute Oscillator Signal Flow Diagram.

2003 Microchip Technology Inc. DS00866A-page 4


AN866
ABSOLUTE STATE-VARIABLE The procedure continues by analyzing row s 2 to deter-
mine when the equation is equal to zero.
Design Equations Let s = j
STEP 1: FIND LG AND S 2 2
a 1 s + a 3 = ( R 1 R 2 R 3 C 1 C 2 ) ( j o ) + R 4 = 0
2
A A A 0 = R4 R 1R 2 R3 C1 C2 o
T ( s ) = ----------------- = ------ = ------------ 2
1 LG s N(s) o = [ R4 ( R1 R2 R3 C1 C2 ) ]
-----------
D(s) 1/2
o = [ R 4 ( R 1R 2R 3 C1 C2 ) ]
The loop-gain is found by breaking the loop in the
signal flow diagram of Figure 4, as shown below. 1/2
P = 2 o = 2 [ R 4 ( R 1 R 2 R 3 C 1 C 2 ) ]

Note that C4 does not appear in the oscillation equa-


A1 A2 A3
tion. C4 and R 4 form a low-pass filter. The gain of ampli-
fier A3 will not be a function of C 4 if the oscillation
V1 V2 V3 frequency is less than the cut-off frequency of the filter.

If:
A 1 = 1 ( sR 1 C 1 ) 1. R1 = R2 = R
A 2 = 1 ( sR 2 C 2 )
2. C1 = C2 = C
A3 = Z 4 Z3
3. R3 = R4
= ( R 4 || C 4 ) R 3
Then:
= [ ( R 4 R 3 ) ( 1 ( sR 4 C 4 + 1 ) ) ] P = 2RC
LG = A A A
1 2 3
= [ 1 ( sR C ) ] [ 1 ( sR C ) ] [ ( R R ) ( 1 ( sR C + 1 ) ) ]
STEP 3: SUB-CIRCUIT DESIGN EQUATIONS
1 1 2 2 4 3 4 4
3 2
= R s R R R R C C C C +s R R R C C

Integrator A1
4 1 2 3 4 1 2 3 4 1 2 3 1 2
Gain A 1 = 1 ( 2fR 1 C 1 )
Pole f p1 = 1 ( 2R 1 C 1 )
s = N ( s ) D ( s ) = 1 LG
3 2 Integrator A2
= 1 [ R 4 ( s R 1 R 2 R 3 R 4 C 1 C 2 C 4 + s R 1 R 2 R 3 C 1 C 2 ) ] Gain A 2 = 1 ( 2fR 2 C 2 )
3 2
[ s R 1 R2 R3 R4 C1 C2 C 4 + s R1 R2 R3 C1 C2 + R4 ] Pole f p2 = 1 ( 2R 2 C 2 )
= -----------------------------------------------------------------------------------------------------------------
3 2
-
[ s R1 R2 R3 R4 C 1C 2C 4 + s R1 R2 R3 C 1C 2 ]
Integrator A3
3 2
Gain = [ ( R 4 R 3 ) ( 1 ( sR 4 C 4 + 1 ) ) ]
N (s ) = s R1 R2 R3 R4 C 1C 2C 4 + s R1 R2 R3 C 1C 2 + R 4 Gain R 4 R 3

STEP 2: SOLVE N(s) = 0 STEP 4: VERIFY LG 1


The zeros of the characteristic equation are determined
by using the Routh stability test. Assume:
1. R1 = R2 = R
3 2 2. C1 = C2 = C
N(s ) = a 0 s + a 1 s + a 2 s + a3
a0 = R1 R2 R3 R4 C1 C2 C 4 3. R3 = R4
a1 = R1 R2 R3 C1 C2
A1 = A 2 = A3 = 1
a2 = 0
LG = A1 A2 A3 = 1
a3 = R4
V1 = A1 V3
Routh Stability Test Coefficient Array V2 = A2 V1
row s3 a0 + a2 = 0 V3 = A3 V2
row s2 a1 + a3 = 0
Note that a voltage limit circuit should be added if rail-to-
rail input/output operational amplifiers are not used, or if
Row s3 produces a trivial solution ( = 0): the gain of the inverter is not equal to one (i.e., R3 R4,).
3
A limit circuit is required to prevent the frequency error
a 0 ( j o ) + 0 = 0 that will result from the saturation delay time of the
amplifiers.

2003 Microchip Technology Inc. DS00866A-page 5


AN866
ABSOLUTE STATE-VARIABLE The measured and calculated oscillation frequency is
shown in Table 1. Figure 5 shows the oscillation wave-
Test Results form when C1 = C2 = 220 pF. The error in the measured
oscillation is attributed to the accuracy of the test
The components used in the evaluation design are
equipment.
listed below. Note that the capacitive sensor (i.e., C1
and C2) was simulated with discrete capacitors.

R1 = R2 = R 6 = R 7 = 32.7 k
R3 = R4 = 10 k
R8 = 1 k
R9 = 1 M
C1 = C2 = see Table 1
C4 = 18 pF
VDD = 5.0V
A1, A2, A3 MCP6024 (quad RRIO,
GBW = 10 MHZ)
A4 MCP6541Push-Pull Output
Comparator

TABLE 1: ABSOLUTE OSCILLATOR TEST RESULTS


Capacitor Calculated Oscillation Measured Oscillation
Values Period (Frequency) Period (Frequency)
C1 = C 2 = 47 pF 9.66 s (103.6 kHz) 10.0 s (100.0 kHz)
C1 = C 2 = 56 pF 11.5 s (86.9 kHz) 12.0 s (83.3 kHz)
C1 = C 2 = 82 pF 16.9 s (59.4 kHz) 16.6 s (60.2 kHz)
C1 = C2 = 100 pF 20.6 s (48.7 kHz) 21.0 s (47.6 kHz)
C1 = C2 = 150 pF 30.8 s (32.6 kHz) 30.0 s (33.3 kHz)
C1 = C2 = 220 pF 45.2 s (22.1 kHz) 46.0 s (21.7 kHz)

Output of A3 Amplifier (V 3)

Comparator Output (VO)

FIGURE 5: Absolute Oscillator Test Results (C1 = C2 = 220 pF).

2003 Microchip Technology Inc. DS00866A-page 6


AN866
RATIO STATE-VARIABLE A Bode plot of the differentiator stage is provided in
Figure 8. The values of resistors R 3, R4 and R5 are
OSCILLATOR selected to set the break frequencies of the differenti-
ator stage so that the gain of the stage is equal to -C3/
Circuit Description C4 at the oscillation frequency. Resistor R5 is also
The schematic of the ratio circuit is shown in Figure 6. used to provide a DC current path around capacitor C3
This circuit consists of two integrators and a differenti- in order to initiate oscillation at power-up.
ator circuit. The integrators formed by amplifiers A1 and
A2 are identical to the integrators used in the absolute
circuit. The differentiator stage is formed by amplifier
A3, resistors R3, R4 and R5, and the sensor capacitors
C3 and C4 to provide a 180 phase shift. The compara-
tor (A4) used to convert the sinewave output to a
square wave digital signal is identical to the absolute
oscillator circuit.

VDD /2
VDD

Q1 C4 R6
C1 C3
C2 VDD /2
R1 R4
A1 R2 R7
A2 R3 R5
A3
VDD/2 V1
VDD/2 V2 VDD/2 V3
R9
R8
A4

VDD/2

FIGURE 6: Ratio Oscillator Schematic.

1
- R ( sR C + 1 )
4 5 3
A 2 = ----------------- A = ---------------------------------------------------------------------------------------
sR C 3 ( sR 3 C 5 C 3 + R 3 + R 5 ) ( sR 4 C 4 + 1 )
2 2
V1 V3
V2

1 -
A 1 = ----------------
sR 1 C 1

FIGURE 7: Ratio Oscillator Signal Flow Diagram.

2003 Microchip Technology Inc. DS00866A-page 7


AN866

Gain (dB) Assumptions


C 3 1. C3 > C4
20log 10 -------
C 4 2. R3 < R4 < R5
R
3. R3 < < R5 and R4 -----5-
1 -
F z1 = -------------------- Oscillation 10
2 R5 C3 Range

0 Frequency (Hz)

1 F 1 -
= --------------------
F p1 = --------------------- p2 2 R 3C 3
R4 2R C
20log -------------------- 4 4
10 R + R
3 5

FIGURE 8: Bode Plot of Differentiator Amplifier.

Voltage Limit Circuit In single-supply applications, it is not necessary to use


both maximum and minimum limit circuits. Only one of
The ratio oscillator uses a limit circuit to accommodate the limit circuits is required due to the symmetry of the
the varying gain requirement of the circuit. It may be sinewave that is centered around the virtual ground
necessary to add a voltage limit or clamp circuit to the voltage at the non-inverting terminal of the amplifiers
oscillator to prevent the amplifiers from saturating and (VDD/2). In the reference design of Figure 6, VDD is
avoid slew rate limitations. The voltage limit circuit equal to 5V and VQ1-base is equal to 2.5V. Thus, the
formed by PNP transistor Q1 is used to create the max- oscillation waveform at V2 will swing from 1.8V to 3.2V
imum voltage limit. The clamping voltage of the limit or 2.5V 0.7V.
circuit is provided below:
Note that the transistor adds a small capacitance (CQ1)
to the integrator capacitor of the circuit (C2). If C2 is rel-
EQUATION:
atively small, the effective capacitance of the limit cir-
V Max_Limit = V Q1_base + V Q1_base-to-emitter cuit (CLimit) can be reduced by connecting a diode in
series between the emitter junction and the output of
V Max_Limit V Q1_base + 0.7V the amplifier (i.e. 1/CLimit = 1/CQ1 + 1/CDiode).

2003 Microchip Technology Inc. DS00866A-page 8


AN866
RATIO STATE-VARIABLE

Design Equations
STEP 1: FIND LG AND S

A A A
T ( s ) = ----------------- = ------ = ------------
1 LG s N(s)
-----------
D(s)

The loop-gain is found by breaking the loop in the sig-


nal flow diagram of Figure 7, as shown below.

A1 A2 A3

V1 V2 V3

A 1 = 1 ( sR 1 C 1 )
A 2 = 1 ( sR 2 C 2 )
A 3 = Z4 Z 3
= [ ( R 4 || C 4 ) ( R 3 + ( R 5 || C 3 ) ) ]
= [ R 4 ( sR 5 C 3 + 1 ) ( sR 3 R 5 C 3 + R 3 + R 5 ) ( sR 4 C 4 + 1 ) ]

LG = A1 x A 2 x A 3:
[ R 4 ( sR 5 C 3 + 1 ) ]
LG = [ 1 ( sR 1 C 1 ) ] [ 1 ( sR 2 C 2 ) ] ----------------------------------------------------------------------------------
( sR 3 R 5 C 3 + R 3 + R 5 ) ( sR 4 C 4 + 1 )
4 3 2
= ( sR 4 R5 C3 + R 4 ) s R1 R 2 R 3 R 4 C1 C2 C 3 C 4 + s ( ( R 1 R 2 C1 C 2 ) ( R 3 R 5 C 3 + R 3 R 4 C 4 + R4 R5 C 4 ) ) + s ( R1 R2 C 1 C 2 ) ( R3 + R5 )

s = N(s) / D(s) = 1 - LG:

s 4 R R R R R C C C C + s 3 ( R R C C ) ( R R C + R R C + R R C ) + s 2 ( R R C C ) ( R + R ) + sR R C + R
1 2 3 4 5 1 2 3 4 1 2 1 2 3 5 3 3 4 4 4 5 4 1 2 1 2 3 5 4 5 3 4
s = -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
s 4 R R R R R C C C C + s 3 ( ( R R C C ) ( R R C + R R C + R R C )) + s 2 ( R R C C ) ( R + R )
1 2 3 4 5 1 2 3 4 1 2 1 2 3 5 3 3 4 4 4 5 4 1 2 1 2 3 5

STEP 2: SOLVE N(s) = 0


Row s 4 produces an equation that cannot be solved
The zeroes of the characteristic equation are with simple algebra. Therefore, the next row is
determined by using the Routh stability test: analyzed:
4 2
4 3 2 a 0 ( j o ) + a 2 ( j o ) + a 4 = 0
Ns = a 0 s + a1 s + a2 s + a 3 s + a4
a = R R R R R C C C
0 1 2 3 4 5 1 2 4
a1 = ( R1 R 2C 1 C2 )( R 3 R5 C3 + R3 R4 C 4 + R 4 R5 C4 )
a2 = ( R1 R 2C 1 C2 )( R 3 + R 5)
a = R R C
3 4 5 3
a4 = R4

Routh Stability Test Coefficient Array


row s4 a0 + a2 + a 4 = 0
row s3 a1 + a3 = 0

2003 Microchip Technology Inc. DS00866A-page 9


AN866
STEP 3: SUB-CIRCUIT DESIGN EQUATIONS
The procedure continues by analyzing row s3 to deter-
mine when the row equation is equal to zero.
Integrator A1
3 2 Gain A 1 = 1 ( 2 fR 1 C 1 )
a s + a s = s a s + a = 0
1 3 1 3
Pole f = 1 ( 2 R 1 C 1 )
Let s = j
2
j o a 1 o + a 3 = 0 Integrator A2

2 a Gain A 2 = 1 ( 2 fR 2 C 2 )
3
o = ------
a1 Pole f = 1 ( 2 R 2 C 2 )
R R C
4 5 3
= ---------------------------------------------------------------------------------------------------------------------- Differentiator A3
( R1 R2 C1 C 2 ) ( R 3 R5 C3 + R 3 R 4 C4 + R 4 R 5 C 4 )
DC Gain = R 4 ( R 3 + R 5 )
1/2
( R 4R 5C3 ) C3
o = ---------------------------------------------------------------------------------------------------
- Gain at Oscillation = ------
( R 1 R2 C1 C2 ) ( R3 R 5 C3 + R 3 R4 C4 + R4 R5 C4 ) C4
Pole f p1 = 1 ( 2 R 4 C 4 )
If: Pole f p2 = 1 ( 2 R 3 C 3 )
1. R1 = R2 = R Zero fz = 1 ( 2 R 5 C 3 )
2. C1 = C2 = C
Then: STEP 4: VERIFY LG 1
2 Assume:
P = ------
o
1. R5 >> R3 and R4 >> R3, then A3 = - C 3 / C4
1/2
R 3C4 C4 R3
P = 2RC ----------- + ----- + ----- 2. V2 = VMax_Limit (i.e. place limit circuit at A 2)
R 5C3 C3 R
4 Next, calculate the voltages at the output of each
If: amplifier starting at V 2.
1. R5 >> R3 V 2 = V Max_Limit
2. R4 >> R3 C
V 3 = A 3 V 2 = -----3- V Max_Limit
Then: C4
C 1/2 1 -V
V 1 = A 1 V 3 = ---------------------
P 2RC -----4 2 fR 1 C 1 3
C3

Oscillation will be sustained if:


A 2 V 1 V Max_Limit

1
---------------------
- V 1 V Max_Limit
2 fR C
2 2

2003 Microchip Technology Inc. DS00866A-page 10


AN866
RATIO STATE-VARIABLE The measured and calculated oscillation frequency is
shown in Table 2. Figure 9 shows the oscillation wave-
Test Results form when C3 = 100 pF and C4 = 47 pF. Note that the
voltage limit circuit adds distortion to the waveform of
R1 = R2 = R 6 = R 7 = 32.7 k amplifier A2. In most sensor applications, waveform
C1 = C2 = 220 pF distortion is inconsequential because the measure-
C3 = C4 = see Table 2 ment is proportional to frequency and not the amplitude
of the oscillation.
R3 = 5 k
R4 = 3.3 M
R5 = 10 M
R8 = 1 k
R9 = 1 M
VDD = 5.0V
A1, A2, A3 MCP6024 (quad RRIO,
GBW = 10 MHZ)
A4 MCP6541 Push-Pull Output
Comparator
Q 1 2N3906

TABLE 2: RATIO OSCILLATOR TEST RESULTS


Capacitor Calculated Oscillation Measured Oscillation
Values Period (Frequency) Period (Frequency)
C3 = 47 pF C 4 = 47 pF 45.2 s (22.1 kHz) 47.0 s (21.3 kHz)
C3 = 47 pF C4 = 100 pF 65.9 s (15.2 kHz) 68.0 s (14.7 kHz)
C3 = 47 pF C4 = 220 pF 97.8 s (10.2 kHz) 98.4 s (10.2 kHz)
C3 = 56 pF C 4 = 47 pF 41.4 s (24.2 kHz) 43.0 s (23.3 kHz)
C3 = 56 pF C4 = 220 pF 89.6 s (11.2 kHz) 92.0 s (10.9 kHz)
C3 = 100 pF C4 = 47 pF 31.0 s (32.3 kHz) 33.0 s (30.3 kHz)
C3 = 100 pF C4 = 220 pF 67.0 s (14.9 kHz) 70.0 s (14.3 kHz)

Output of A 2 Amplifier (V2)

Output of A 3 Amplifier (V3)

FIGURE 9: Ratio Oscillator Test Results (C3 = 100 pF, C4 = 47 pF).

2003 Microchip Technology Inc. DS00866A-page 11


AN866
APPENDIX A: MASONS REDUCTION APPENDIX B: ROUTH STABILITY
THEOREM TEST
The oscillation frequency is determined by finding the The Routh Stability Test [5] can be used to test the
poles of the denominator of the transfer equation T(s) characteristic equation to determine whether any of the
or equivalently the zeroes of the numerator N(s) of the roots lie on the imaginary axis. Rouths test consists of
characteristic equation (s). Masons theory is espe- forming a coefficient array from N(s). Next, the proce-
cially useful for analyzing oscillators that have multiple dure substitutes s = j for s, and the summation of the
feedback loops. row is set to zero. If the row equation produces a non-
Masons theorem [5] states that the transfer function trivial solution for , the procedure is complete and the
from input X to output Y is: frequency of oscillation is equal to . If the row equa-
tion does not yield an equation that can be solved for
o, the procedure continues with the next row in the
EQUATION:
Routh array. This technique arranges the numerator of
the characteristic equation (i.e., denominator of the
i P i s i i P i s i transfer equation) into the array listed below.
Y
T ( s ) = --- = ------------------- = -------------------
X s N (s )
----------- EQUATION:
D (s )
Where: N(s) = aosn + a1sn-1 + a2sn-2 + a 3sn-3 +...
+ an-1s + an
Pi = the direct transmittance or path form input X to
output Y
Note for simplicity, only the first three rows of the Routh
si = the system determinant. (si = 1 if P i touches coefficient array are shown below.
all of the loops)
sn a0 a2 a4.... an
s = 1 - Lj + LkLl - LmLnLo +....
sn1 a1 a3 a5.... an1
Lj = the sum of all loops (i.e. loop gains)
sn2 b1 b2 b3.... b.n2
LkLl = the sum of products of pairs of non-
touching loops where the coefficients b1, b2, b3, etc., are defined as:

LmLnLo = the sum of products of gains of non b1 = (a1a2 - a0a3) / a1


touching loops taken three at a time. b2 = (a1a4 - a0a5) / a1
b3 = (a1a6 - a0a7) / a1
The Routh stability criterion states:
1. A necessary and sufficient condition for stability
is that the first column of the array does not con-
tain sign changes.
2. The number of sign changes in the entries of the
first column of the array is equal to the number
of roots in the right half splane.
3. If the first element in a row is zero, it is replaced
by , and the sign changes when 0 are
counted after completing the array.
4. The poles are located in the right half plane or
on the imaginary axis if all the elements in a row
are zero.

2003 Microchip Technology Inc. DS00866A-page 12


AN866
CONCLUSION BIBLIOGRAPHY
Operational amplifier oscillators can be used to pro- 1. Celma, C., Martinez, P., and Carlosens, A.,
duce a frequency that is proportional to resistive and Approach to the Synthesis of Canonic RC
capacitive sensors. Design equations defining the Active Oscillators Using CCII, IEE Proc. Cir-
oscillation frequency are readily available for several cuits, Devices and Systems, Vol. 141, No. 6,
common oscillators, such as Wein bridge and phase December 1994, pp. 493497.
shift oscillators. However, detailed design equations 2. Lepkowski, J. and Young, C, AND8054 -
that show the relationship of the resistors and capaci- Designing RC Oscillator Circuits with Low Volt-
tors are generally not available. Thus, there is a need age Operational Amplifiers and Comparators
for a design procedure that derives the equations in for Precision Sensor Applications, ON
order to select the resistor and capacitor components Semiconductor, Phoenix, Arizona, 2002.
that maximize the accuracy of the oscillation frequency. 3. Martinez, P., Aldea C. and Celma, S., Approach
The design procedure was demonstrated by analyzing to the Realization of State-Variable Based Oscil-
two state-variable oscillators for capacitive sensing lators, IEEE International Conference on Elec-
applications. tronics Circuits and Systems, Vol. 3, 1998,
p.139142.
4. Sidorowicz, R., An Abundance of Sinusoidal
RCOscillators, Proc. IEE, Vol. 119, No. 3,
March 1972, pp. 283293.
5. Truxal, J., Introductory System Engineering,
McGrawHill, N.Y., 1972.
6. Van Valkenburg, M., Analog Filter Design,
Saunders College Publishing, Fort Worth, 1992.

2003 Microchip Technology Inc. DS00866A-page 13


AN866
NOTES:

2003 Microchip Technology Inc. DS00866A-page 14


Note the following details of the code protection feature on Microchip devices:
Microchip products meet the specification contained in their particular Microchip Data Sheet.

Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.

There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip's Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.

Microchip is willing to work with the customer who is concerned about the integrity of their code.

Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as unbreakable.

Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break microchips code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.

Information contained in this publication regarding device Trademarks


applications and the like is intended through suggestion only
and may be superseded by updates. It is your responsibility to The Microchip name and logo, the Microchip logo, dsPIC,
ensure that your application meets with your specifications. KEELOQ, MPLAB, PIC, PICmicro, PICSTART, PRO MATE and
No representation or warranty is given and no liability is PowerSmart are registered trademarks of Microchip
assumed by Microchip Technology Incorporated with respect Technology Incorporated in the U.S.A. and other countries.
to the accuracy or use of such information, or infringement of
patents or other intellectual property rights arising from such FilterLab, microID, MXDEV, MXLAB, PICMASTER, SEEVAL
and The Embedded Control Solutions Company are
use or otherwise. Use of Microchips products as critical
registered trademarks of Microchip Technology Incorporated
components in life support systems is not authorized except
with express written approval by Microchip. No licenses are in the U.S.A.
conveyed, implicitly or otherwise, under any intellectual
Accuron, Application Maestro, dsPICDEM, dsPICDEM.net,
property rights. ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-
Circuit Serial Programming, ICSP, ICEPIC, microPort,
Migratable Memory, MPASM, MPLIB, MPLINK, MPSIM,
PICC, PICkit, PICDEM, PICDEM.net, PowerCal, PowerInfo,
PowerMate, PowerTool, rfLAB, rfPIC, Select Mode,
SmartSensor, SmartShunt, SmartTel and Total Endurance are
trademarks of Microchip Technology Incorporated in the
U.S.A. and other countries.

Serialized Quick Turn Programming (SQTP) is a service mark


of Microchip Technology Incorporated in the U.S.A.

All other trademarks mentioned herein are property of their


respective companies.

2003, Microchip Technology Incorporated, Printed in the


U.S.A., All Rights Reserved.

Printed on recycled paper.

Microchip received QS-9000 quality system


certification for its worldwide headquarters,
design and wafer fabrication facilities in
Chandler and Tempe, Arizona in July 1999
and Mountain View, California in March 2002.
The Companys quality system processes and
procedures are QS-9000 compliant for its
PICmicro 8-bit MCUs, KEELOQ code hopping
devices, Serial EEPROMs, microperipherals,
non-volatile memory and analog products. In
addition, Microchips quality system for the
design and manufacture of development
systems is ISO 9001 certified.

DS00866A-page 15 2003 Microchip Technology Inc.


M
WORLDWIDE SALES AND SERVICE
AMERICAS ASIA/PACIFIC Japan
Microchip Technology Japan K.K.
Corporate Office Australia
Benex S-1 6F
2355 West Chandler Blvd. Microchip Technology Australia Pty Ltd
3-18-20, Shinyokohama
Chandler, AZ 85224-6199 Marketing Support Division
Kohoku-Ku, Yokohama-shi
Tel: 480-792-7200 Fax: 480-792-7277 Suite 22, 41 Rawson Street
Kanagawa, 222-0033, Japan
Technical Support: 480-792-7627 Epping 2121, NSW
Tel: 81-45-471- 6166 Fax: 81-45-471-6122
Web Address: http://www.microchip.com Australia
Tel: 61-2-9868-6733 Fax: 61-2-9868-6755 Korea
Atlanta Microchip Technology Korea
3780 Mansell Road, Suite 130 China - Beijing
168-1, Youngbo Bldg. 3 Floor
Alpharetta, GA 30022 Microchip Technology Consulting (Shanghai)
Samsung-Dong, Kangnam-Ku
Tel: 770-640-0034 Fax: 770-640-0307 Co., Ltd., Beijing Liaison Office
Seoul, Korea 135-882
Unit 915
Boston Tel: 82-2-554-7200 Fax: 82-2-558-5934
Bei Hai Wan Tai Bldg.
2 Lan Drive, Suite 120 No. 6 Chaoyangmen Beidajie Singapore
Westford, MA 01886 Beijing, 100027, No. China Microchip Technology Singapore Pte Ltd.
Tel: 978-692-3848 Fax: 978-692-3821 Tel: 86-10-85282100 Fax: 86-10-85282104 200 Middle Road
#07-02 Prime Centre
Chicago China - Chengdu
Singapore, 188980
333 Pierce Road, Suite 180 Microchip Technology Consulting (Shanghai) Tel: 65-6334-8870 Fax: 65-6334-8850
Itasca, IL 60143 Co., Ltd., Chengdu Liaison Office
Tel: 630-285-0071 Fax: 630-285-0075 Rm. 2401-2402, 24th Floor, Taiwan
Ming Xing Financial Tower Microchip Technology (Barbados) Inc.,
Dallas Taiwan Branch
4570 Westgrove Drive, Suite 160 No. 88 TIDU Street
Chengdu 610016, China 11F-3, No. 207
Addison, TX 75001 Tung Hua North Road
Tel: 972-818-7423 Fax: 972-818-2924 Tel: 86-28-86766200 Fax: 86-28-86766599
Taipei, 105, Taiwan
China - Fuzhou Tel: 886-2-2717-7175 Fax: 886-2-2545-0139
Detroit
Microchip Technology Consulting (Shanghai)
Tri-Atria Office Building
32255 Northwestern Highway, Suite 190
Co., Ltd., Fuzhou Liaison Office EUROPE
Unit 28F, World Trade Plaza
Farmington Hills, MI 48334 Austria
No. 71 Wusi Road
Tel: 248-538-2250 Fax: 248-538-2260 Microchip Technology Austria GmbH
Fuzhou 350001, China
Kokomo Tel: 86-591-7503506 Fax: 86-591-7503521 Durisolstrasse 2
2767 S. Albright Road A-4600 Wels
China - Hong Kong SAR Austria
Kokomo, IN 46902 Microchip Technology Hongkong Ltd.
Tel: 765-864-8360 Fax: 765-864-8387 Tel: 43-7242-2244-399
Unit 901-6, Tower 2, Metroplaza Fax: 43-7242-2244-393
Los Angeles 223 Hing Fong Road Denmark
18201 Von Karman, Suite 1090 Kwai Fong, N.T., Hong Kong Microchip Technology Nordic ApS
Irvine, CA 92612 Tel: 852-2401-1200 Fax: 852-2401-3431 Regus Business Centre
Tel: 949-263-1888 Fax: 949-263-1338 China - Shanghai Lautrup hoj 1-3
Microchip Technology Consulting (Shanghai) Ballerup DK-2750 Denmark
Phoenix
Co., Ltd. Tel: 45-4420-9895 Fax: 45-4420-9910
2355 West Chandler Blvd.
Room 701, Bldg. B France
Chandler, AZ 85224-6199
Far East International Plaza Microchip Technology SARL
Tel: 480-792-7966 Fax: 480-792-4338
No. 317 Xian Xia Road Parc dActivite du Moulin de Massy
San Jose Shanghai, 200051 43 Rue du Saule Trapu
Microchip Technology Inc. Tel: 86-21-6275-5700 Fax: 86-21-6275-5060 Batiment A - ler Etage
2107 North First Street, Suite 590 China - Shenzhen 91300 Massy, France
San Jose, CA 95131 Microchip Technology Consulting (Shanghai) Tel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79
Tel: 408-436-7950 Fax: 408-436-7955 Co., Ltd., Shenzhen Liaison Office Germany
Toronto Rm. 1812, 18/F, Building A, United Plaza Microchip Technology GmbH
6285 Northam Drive, Suite 108 No. 5022 Binhe Road, Futian District Steinheilstrasse 10
Mississauga, Ontario L4V 1X5, Canada Shenzhen 518033, China D-85737 Ismaning, Germany
Tel: 905-673-0699 Fax: 905-673-6509 Tel: 86-755-82901380 Fax: 86-755-8295-1393 Tel: 49-89-627-144-0
China - Qingdao Fax: 49-89-627-144-44
Rm. B505A, Fullhope Plaza, Italy
No. 12 Hong Kong Central Rd. Microchip Technology SRL
Qingdao 266071, China Via Quasimodo, 12
Tel: 86-532-5027355 Fax: 86-532-5027205 20025 Legnano (MI)
India Milan, Italy
Microchip Technology Inc. Tel: 39-0331-742611 Fax: 39-0331-466781
India Liaison Office United Kingdom
Marketing Support Division Microchip Ltd.
Divyasree Chambers 505 Eskdale Road
1 Floor, Wing A (A3/A4) Winnersh Triangle
No. 11, OShaugnessey Road Wokingham
Bangalore, 560 025, India Berkshire, England RG41 5TU
Tel: 91-80-2290061 Fax: 91-80-2290062 Tel: 44-118-921-5869 Fax: 44-118-921-5820

05/30/03

DS00866A-page 16 2003 Microchip Technology Inc.

Vous aimerez peut-être aussi