Microchip TC1025 Bruksanvisning

Läs nedan 📖 manual på svenska för Microchip TC1025 (28 sidor) i kategorin Inte kategoriserad. Denna guide var användbar för 5 personer och betygsatt med 4.5 stjärnor i genomsnitt av 3 användare

Sida 1/28
2004 Microchip Technology Inc. DS00895A-page 1
AN895
INTRODUCTION
This application note shows how to design a
temperature sensor oscillator circuit using Microchip’s
low-cost MCP6001 operational amplifier (op amp) and
the MCP6541 comparator. Oscillator circuits can be
used to provide an accurate temperature measurement
with a Resistive Temperature Detector (RTD) sensor.
Oscillators provide a frequency output that is propor-
tional to temperature and are easily integrated into a
microcontroller system.
RC oscillators offer several advantages in precision
sensing applications. Oscillators do not require an
Analog-to-Digital Converter (ADC). The accuracy of the
frequency measurement is directly related to the quality
of the microcontroller’s clock signal and high-frequency
oscillators are available with accuracies of better than
10 ppm.
RTDs serve as the standard for precision temperature
measurements because of their excellent repeatability
and stability characteristics. A RTD can be character-
ized over it’s temperature measurement range to
obtain a table of coefficients that can be added to the
measured temperature in order to obtain an accuracy
better than 0.05°C. In addition, RTDs have a very fast
thermal response time.
Two oscillator circuits are shown in Figures 1 and 2 that
can be used with RTDs. The circuit shown in Figure 1
is a state variable RC oscillator that provides an output
frequency that is proportional to the square root of the
product of two temperature-sensing resistors. The
circuit shown in Figure 2, which is referred to as an
astable multi-vibrator or relaxation oscillator, provides a
square wave output with a single comparator. The state
variable oscillator is a good circuit for precision
applications, while the relaxation oscillator is a good
alternative for cost-sensitive applications.
FIGURE 1: State Variable Oscillator.
FIGURE 2: Relaxation Oscillator.
Author: Ezana Haile and Jim Lepkowski
Microchip Technology Inc.
Attributes:
Precision dual Element RTD
Sensor Circuit
Reliable Oscillation Startup
Freq. (R1 x R2)1/2
C1
VDD
VDD/2
R1 = RTDA
C2
VDD/2
R2 = RTDBR4
VDD/2
R3
R8
VDD/2
R7
VDD/2
R5
R6
VOUT
C5
C4
A2A3A5
A4
A1
VDD
R3
Attributes:
Low Cost Solution
Single Comparator Circuit
Square Wave Output
Freq. = 1/ (1.386 x R1 x C1)
V
OUT
C1VDD
R
1 = RTD
R4
R2
VDD
A1
Oscillator Circuits For RTD Temperature Sensors
AN895
DS00895A-page 2 2004 Microchip Technology Inc.
WHY USE A RTD?
RTDs are based on the principle that the resistance of
a metal changes with temperature. RTDs are available
in two basic designs: wire wound and thin film. Wire
wound RTDs are built by winding the sensing wire
around a core to form a coil, while thin film RTDs are
manufactured by depositing a very thin layer of
platinum on a ceramic substrate.
Table 1 provides a comparison of the attributes of
RTDs, thermocouples, thermistors and silicon IC
sensors. RTDs are the standard sensor chosen for
precision sensing applications because of their
excellent repeatability and stability characteristics.
Also, RTDs can be calibrated to an accuracy that is
only limited by the accuracy of the reference
temperature.
TABLE 1: ATTRIBUTES OF RTDS, THERMOCOUPLES, THERMISTORS AND SILICON IC
SENSORS
WHY USE AN OSCILLATOR?
There are several different circuit methods available to
accurately measure the resistance of a RTD sensor.
Figure 3 provides simplified block diagrams of three
common RTD-sensing circuits. A constant current,
voltage divider or oscillator circuit can be used to
provide an accurate temperature measurement.
The constant current circuit uses a current source to
create a voltage that is sensed with an ADC. A constant
current circuit offers the advantage that the accuracy of
the amplifier is not affected by the resistance of the
wires that connect to the sensor. This circuit is
especially useful with a small resistance sensor, such
as an RTD with a nominal resistance of 100, where
the resistance of the sensor leads can be significant in
proportion to the sensor’s resistance. In remote
sensing applications, the sensor is connected to the
circuit via a long wire and multiple connectors. Thus,
the connection resistance can be significant. The
resistance of 18 gauge copper wire is 6.5 m/ft. at
25°C. Therefore, the wire resistance can typically be
neglected in most applications.
The constant current approach is often used in
laboratory-grade precision equipment with a 4-lead
RTD. The 4-lead RTD circuits can be used to provide a
Kelvin resistance measurement that nulls out the
resistance of the sensor leads. Kelvin circuits are
relatively complex and are typically used in only very
precise applications that require a measurement
accuracy of better than 0.1°C.
Another advantage of the constant current approach is
that the voltage output is linear. While linearity is
important in analog systems, it is not usually a critical
parameter in a digital system. A table look-up method
that provides linear interpolation of temperature steps
of 5°C is adequate for most applications and can be
easily implemented with a microcontroller.
The voltage divider circuit uses a constant voltage to
create a voltage that is proportional to the RTD’s
resistance. This method is simple to implement and
also offers the advantage that precision IC voltage
references are readily available. The main
disadvantage of both the voltage divider and constant
current approach is that an ADC is required. The
Attribute RTD Thermocouple Thermistor Silicon IC
Temperature Range -200 to 850°C -184 to 1260°C -55 to +150 C -55 to +125° °C
Temperature (t)
Accuracy
Class B = ±[0.012 +
(0.0019t) -6x10 -7t2]
Greater of ± °2.2 C
or ±0.75%
Various,
± °0.5 to 5 C
Various,
± °0.5 to 3 C
Output Signal 0.00385 /C Voltage (40 µ/°C) 4% R/ t for
0 t C°C 70°
Analog, Serial, Logic,
Duty Cycle
Linerarity Excellent Fair Poor Good
Precision Excellent Fair Poor Fair
Durability Good, Wire wound
prone to open-circuit
vibration failures
Good at lower temps.,
poor at high temps.,
open-circuit vibration
failures
Good, Power
Specification is
derated with
temperature
Excellent
Thermal Response
Time
Fast (function of
probe material)
Fast (function of
probe material)
Moderate Slow
Cost Wire wound - High,
Thin film - Moderate
Low Low Moderate
Package Options Many Many Many Limited, IC packages
Interface Issues Small ∆ ∆R/ t Cold junction com-
pensation, Small V
Non-linear resistance Sensor is located on
PCB
2004 Microchip Technology Inc. DS00895A-page 3
AN895
accuracy of the voltage-to-temperature conversion is
limited by the resolution of the ADC and the noise level
on the PCB.
Oscillators offer several advantages over the constant
current and voltage RTD sensing circuits. The main
advantage of the oscillator is that an ADC is not
required. Another key attribute of oscillators is that
these circuits can produce an accuracy and resolution
that is much better than an analog output voltage
circuit. The accuracy of the frequency-to-temperature
conversion is limited only by the accuracy of the
counter or microcontroller time processing unit’s high
frequency clock signal. High frequency clock signals
are available with an accuracy better than 10 ppm over
an operating temperature range of -40°C to +125°C. In
addition, the temperature sensitivity of the reference
clock signal can usually be compensated with a simple
calibration procedure.
Designers are often reluctant to use oscillators due to
their lack of familiarity with these circuits. A negative
feature with oscillators is that they can be difficult to
troubleshoot and may not oscillate under all conditions.
However, the state variable and relaxation oscillators
provide very robust start-up oscillation characteristics.
FIGURE 3: Common RTD Sensor Signal Conditioning Circuits.
VREF
R
RRTD
VOUT Amplifier Anti-Aliasing
Filter
RC Oscillator PICmicro®
Microcontroller
PICmicro®
Microcontroller
RRTD
VOUT Amplier Anti-Aliasing
Filter ADC PICmicro®
Microcontroller
Precision
Current
Source Attributes:
Insensitive to resistance of
leads with Kelvin connection
Temperature proportional to
resistance (Temp.
RRTD)
Constant current source
circuits typically require a VREF
and several op amps
Attributes:
Most popular method
Temperature proportional to
resistance (Temp. 1 / RRTD)
Precision VREF ICs are readily
available
Attributes:
Does not require ADC or VREF
Excellent noise immunity
Accuracy proportional to quality
of microcontroller clock
Clock
Clock
Clock
RC Oscillator
Voltage Divider Circuit
Constant Current Circuit
IREF
VOUT = IREF x RRTD
VOUT = [RRTD / (R +RRTD)] x VREF
freq. RRTD
ADC
RRTD
AN895
DS00895A-page 4 2004 Microchip Technology Inc.
STATE VARIABLE OSCILLATOR
Circuit Description
The schematic of the circuit is shown in Figure 1. The
state variable oscillator consists of two integrators and
an inverter. Each integrator provides a phase shift of
90°, while the inverter adds an additional 180° phase
shift. The total phase shift of the three amplifiers is
equal to 360°, with an oscillation produced when the
output of the third amplifier is connected to the first
amplifier.
The first integrator stage consists of amplifier A1, RTD
resistor R1 (RTDA) and capacitor C1. The second
integrator consists of amplifier A2, RTD resistor R2
(RTDB) and capacitor C2. For a dual RTD sensing
application, R1 R
2 and C1 and C2 should be the same
value. The inverter stage consists of amplifier A
3,
resistors R3 and R4 and capacitor C4. The addition of
capacitor C4 helps ensure oscillation start-up.
A dual-element RTD is used to increase the difference
in the oscillation frequency from the minimum to the
maximum sensed temperature. The state variable
oscillator’s frequency is proportional to the square root
of the product of the two RTD resistors
(frequency (R1 x R2)1/2). In contrast, a single-
element RTD will produce a frequency output that is
proportional to the square root of the RTD
(frequency (R1)1/2). If the RTD resistance changes
by a factor of two over the temperature sensing range,
a dual-element sensor will provide an output that
doubles in frequency. A single-element RTD will
produce an output that varies by only 41% (i.e., 2).
The state variable circuit offers the advantage that a
limit circuit is not required if rail-to-rail input/output
(RRIO) amplifiers are used and the gain of the inverter
stage A3 is equal to one (i.e., R3 = R4). In contrast, most
oscillators require a limit or clamping circuit to prevent
the amplifiers from saturating. The gain of the
integrator stages A1 and A2 is equal to one at the
oscillation frequency, as shown by the detailed design
equations provided in Appendix B: “Derivation of
Oscillation Equations”.
Amplifier A4 is used the provide the mid-supply
reference voltage (V
DD /2) required for the single-
supply voltage circuit. Resistors R5 and R6 form a volt-
age divider, while capacitor C5 is used to provide noise
filtering.
Comparator A5 is used to convert the sinewave output
to a square wave digital signal. The comparator
functions as a zero-crossing detector and the switching
point is equal to the mid-supply voltage (i.e., V
DD/2).
Resistor R8 is used to provide additional hysteresis
(VHYS) to the comparator.
Design Procedure
A simplified design procedure for selecting the resis-
tors and capacitors is provided below. A detailed deri-
vation of the equations is provided in Appendix B:
“Derivation of Oscillation Equations”.
The state variable oscillator design equations can be
simplified by selecting identical integrator stages (A1
and A2) and by using an inverter (A3 with a gain of one).
The identical integrator stages are implemented by
using a dual-element RTD sensor and selecting C1= C2.
A unity-gain inverter stage is achieved if R3 = R4.
Listed below is the hysteresis equation for comparator
A5. The comparator functions as a zero-crossing
detector that is offset by the voltage V
DD/2.
Simplified Equations:
Assume:
1. R1 = R2 = R (RTDA = RTDB)
2. C1 = C2 = C
3. R3 = R4
Design Procedure:
1. Select a desired nominal oscillation frequency
for the RTD oscillator. Guidelines for selecting
the oscillation frequency are provided in the
“System Integration” section of this
document.
2. C = 1/(2πRofo).
where: Ro = RTD resistance at 0°C
3. Select an op amp with a GBWP 100 x f
max.
where: fmax = 1 / (2πRminC) and Rmin = RTD
resistance at coldest sensing temperature.
4. Select R
3 = R4 equal to 1 to 10 times Ro.
5. Select C4 using the following equations:
f-3dB = 1 / (2πR4C4)
C4 R 1 / (2π4f-3dB)
where: f-3dB op amp’s GBWP
VHYS
R7
R7R8
+
------------------- VO UT m a x( ) VOUT min( )
( )×=
VHYS
R7
R8
------ VDD
×if R8 >>R7
2004 Microchip Technology Inc. DS00895A-page 5
AN895
State Variable Test Results
The components used in the evaluation design are
listed in Table 2. The circuit was tested with lab stock
components. The specifications of the 100 nF
capacitors are not as good as the NPO porcelain
ceramic capacitors used in the RSS error analysis
shown in Table 4. The maximum capacitance available
with the ATC700 series NPO capacitors is 5100 pF.
The decrease in magnitude of C1 and C2 will increase
the oscillation frequency from 21 kHz to 39 kHz for a
RTD sensed temperature of -55°C to +125°C. If smaller
magnitude capacitors are used, a MCP6024 op amp
with a GBWP of 10 MHz is recommended to minimize
the op amp error on the accuracy of the higher
oscillation frequency.
The test results are shown in Table 3 and Figure 4. The
oscillation frequency was calculated using the
measured values of R1, R2, R3, R
4, C1 and C2. The
dual-element RTD sensors (R1 and
R2) were tested by
simulating a change in temperature with discrete
resistors and measuring the resistance to a resolution
of 100 m. Capacitors C1 and C2 were measured to
have a capacitance of 100.4 nF and 100.8 nF,
respectively.
s
FIGURE 4: State Variable Oscillator Test Results (R1 = R2 = 1000).
TABLE 2: STATE VARIABLE
COMPONENTS
R1, R2 = Dual Platinum Thin-Film
RTD Temperature Sensor
Omega 2PT1000FR1345
RO = 1000
Accuracy = Class B
R3, R4, R5, R6, R7 = 1 k
R8 = 1 M
C1,C2 = 100 nF
C4 = 20 pF
C5 = 1 µF
VDD =
VSS =
5.0V
Ground
A1, A2, A3, A4 =MCP6004 op amp
(quad RRIO,
GBWP = 1 MHZ)
A5 =MCP6541 Push-Pull
Output Comparator
TABLE 3: STATE VARIABLE OSCILLATOR TEST RESULTS
Simulated
Temperature (°C)
Resistor Values
(R1 = R2 =)()
Calculated Frequency
(Hz)
Measured Frequency
(Hz)
Error
(%)
Error
(°C)
-50.4 806 1961 1957 +0.20 0.52
-20.8 920 1718 1715 +0.16 0.42
0 1000 1581 1577 +0.24 0.62
26.0 1100 1440 1443 -0.23 0.60
51.9 1200 1317 1321 -0.29 0.75
75.3 1290 1225 1223 +0.24 0.62
98.7 1380 1146 1144 +0.20 0.52
122.1 1470 1076 1073 +0.25 0.65
Output of Amplifier A3 (V3)
Comparator Output A5
(V
OUT
)
AN895
DS00895A-page 6 2004 Microchip Technology Inc.
Error Analysis
Error analysis is useful to predict the manufacturing
variability, temperature stability and the drift in accuracy
over time. The majority of the error, or uncertainty in the
state variable oscillation frequency, results from the
resistors and capacitors. The errors caused by the PCB
layout and op amp are small in comparison. The
frequency errors that result from the PCB layout can be
minimized by using good analog PCB layout tech-
niques. The error of the amplifier is minimized by
selecting an op amp with a GBWP of approximately
100 times larger than the oscillator frequency.
Table 4 provides a Root Sum Squared (RSS)
estimation of the resistor and capacitor errors on the
frequency output of the state variable oscillator. Note
that capacitor C4 is not included in the table because it
will not be a factor in the oscillation equation, if it’s
magnitude is relatively small. The equation that
specifies the accuracy of a class B RTD is given in
Appendix A: “RTD Selection”. The RTD has a
temperature accuracy of ±0.15°C at room temperature
and 0.35± °C at +125°C. Together, the state variable
oscillator and a class B dual-element RTD will provide
a temperature measurement accuracy of
approximately ±0.67°C at room temperature and
± °1.07 C at +125°C.
Temperature compensation can be used to improve the
accuracy of the circuit. The component tolerance error
term of resistors R3 and R4, capacitors C1 and C2 and
the RTD resistors R1 and R2 can be minimized by
calibrating the oscillator to a single known temperature.
The magnitude of the resistor and capacitor
temperature coefficient terms can be minimized by
selecting low temperature coefficient components and
by calibrating the circuit at multiple temperatures.
Resistors with small temperature coefficients are
readily available. However, the temperature coefficient
of a capacitor is relatively large in comparison. A
constant change in the capacitance can easily be
compensated, though the temperature coefficient of a
capacitor is usually not linear. The temperature
coefficient of most capacitors is small at +25°C and
much larger at the extreme cold and hot ends of the
temperature range.
The aging or long-term stability error of the circuit is
minimized by selecting components with a small drift
rate. This term can also be reduced by using a burn-in
procedure. Temperature compensation and burn-in
options are discussed in the “Oscillator Component
Selection Guidelines section of this document. The
state variable circuit and a class B RTD can be used to
provide a measurement accuracy better than ± °0.1 C
with temperature compensation and a burn-in
procedure.
TABLE 4: ERROR ANALYSIS OF RESISTORS, CAPACITORS AND RTD ON OUTPUT OF STATE
VARIABLE OSCILLATOR (NOTE 4)
Error Term Item
Sensitivity
(Notes 1,
2 and 5)
Error @ +25°C Error @ +125°C Comments
Resistor Tolerance R3, R4-0.5, +0.5 100 ppm 100 ppm Tolerance = 0.01%
RNC90
Resistor TC R3, R4-0.5, +0.5 0 ppm 200 ppm TC = 2 ppm/°C
Resistor Aging R3, R4-0.5, +0.5 50 ppm 50 ppm R at 2000 hours,
0.3W and +125°C
Capacitor Tolerance C1, C2 -0.5, -0.5 2500 ppm 2500 ppm Tolerance = 0.25%
NPO Porcelain Ceramic
(ATC700B series,
American Technical
Ceramic)
Capacitor TC C1, C2 -0.5, -0.5 0 ppm 3000 ppm TC = 30 ppm/°C
Capacitor Aging C1, C2 -0.5, -0.5 0 ppm
(zero aging effect)
0 ppm
(zero aging effect)
C at 2000 hours, 200%
WVDC and +125°C
Capacitor Retrace C1, C2 -0.5, -0.5 200 ppm 200 ppm C temperature hysteresis
RTD Accuracy R1, R2 -0.5, -0.5 643 ppm 1340 ppm Class B dual element RTD
Note 1: The sensitivity of the resistors is defined as the relative change in the oscillation frequency per the relative
change in resistance ((fo/fo)/(R/R)).
2: The sensitivity of the capacitors is defined as the relative change in the oscillation frequency per the
relative change in capacitance ((fo/f
o)/(C/C)).
3: The temperature accuracy error (t) was calculated using the equations provided in Table 7.
4: ppm is defined as parts-per-million (i.e., 200 ppm = 0.02%).
5: The sensitivity equations are defined in Appendix C: “Error Analysis.
2004 Microchip Technology Inc. DS00895A-page 7
AN895
Worst-Case Error Note 3
freq. (f) 3493 ppm / 0.349% 7390 ppm / 0.739%
± ° ± °temp. ( t) t = 0.91 C t = 1.93 C
RSS Error Note 3
freq. (f) 2592 ppm / 0.259% 4140 ppm / 0.414%
± ° ± °temp. ( t) t = 0.67 C t = 1.07 C
TABLE 4: ERROR ANALYSIS OF RESISTORS, CAPACITORS AND RTD ON OUTPUT OF STATE
VARIABLE OSCILLATOR (NOTE 4) (CON’T)
Error Term Item
Sensitivity
(Notes 1,
2 and 5)
Error @ +25°C Error @ +125°C Comments
Note 1: The sensitivity of the resistors is defined as the relative change in the oscillation frequency per the relative
change in resistance ((fo/fo)/(R/R)).
2: The sensitivity of the capacitors is defined as the relative change in the oscillation frequency per the
relative change in capacitance ((fo/f
o)/(C/C)).
3: The temperature accuracy error (t) was calculated using the equations provided in Table 7.
4: ppm is defined as parts-per-million (i.e., 200 ppm = 0.02%).
5: The sensitivity equations are defined in Appendix C: “Error Analysis.
AN895
DS00895A-page 8 2004 Microchip Technology Inc.
RELAXATION OSCILLATOR
Circuit Description
The relaxation oscillator shown in Figure 5 provides a
resistive sensor oscillator circuit using the MCP6541
comparator. This circuit provides a relatively simple
and inexpensive solution to interface a resistive sensor,
such as a RTD to a microcontroller. This circuit
topology requires a single comparator, a capacitor and
a few resistors. The oscillator outputs a square wave
with a frequency proportional to the change in the
sensor resistance.
The analysis of this circuit begins by assuming that
during power-up, the comparator output voltage is
railed to the positive supply voltage (V
DD). Based on
the values of R2, R3 and R4, the voltage at VIN+ of the
comparator can be determined. This voltage becomes
a switching or trip voltage to toggle the output to V
SS as
the voltage across the capacitor C
1 charges.
The comparator sources current to charge the
capacitor through the feedback resistor (R
1). When the
voltage across the capacitor rises above the voltage at
VIN+, the comparator drives the output down to the
negative rail (VSS). However, when the output voltage
swings to VSS, the trip voltage at VIN+ also changes.
Now the comparator output stays at VSS until the
voltage across the capacitor discharges through R
1.
When the capacitor voltage falls below the voltage at
VIN+, the comparator drives the output up to the posi-
tive rail (VDD). Therefore, the comparator swings the
output voltage to the rails (V
DD and VSS), every time the
capacitor voltage passes the trip voltage. As a result,
the comparator output generates a square wave
oscillation.
Design Procedure
A simplified design procedure for selecting the resistors
and capacitor C1
is provided below. The relaxation
oscillator design equations can be simplified by select-
ing the trip point voltages of the comparator circuit to be
equal to 1/3 VDD and 2/3 VDD by using equal value
resistors for R2, R
3 and R4. A detailed derivation of the
oscillation equations and error terms is provided in
Appendix B: Derivation of Oscillation Equations”.
Relaxation Oscillator Test Results
The oscillation frequency was calculated using fixed
discrete resistors to simulate the RTD resistance, R1
and the component values shown in Figure 5. A
0.68 µF tantalum capacitor was chosen for C
1. The
circuit uses the MCP6541 comparator.
FIGURE 5: Relaxation Oscillator
Component Values.
Simplified Equations:
Assume:
1. R1 = RTD sensor
2. R2 = R3 = R4 = R
3. R 10 x R
o
where: Ro = RTD resistance at 0°C
Design Procedure:
1. Select a desired nominal oscillation frequency
for the RTD oscillator. Guidelines for selecting
the oscillation frequency are provided in the
“System Integration” of this document.
2. C1 = 1 / (1.386 Ro fo).
3. Select a comparator with an Output Short
Circuit Current (ISC) which is at least five times
greater than the maximum output current to
ensure start-up at cold and relatively good
accuracy.
IOUT_MAX = V
DD / R1_MIN
ISC = IOUT_MAX / 5
where: R1_MIN = RTD resistance at coldest
sensing temperature and VDD is equal to the
supply voltage.
VOUT
0.68 µF VDD
R1 = RTD
VDD
10 k
10 k10 k
R3
R4
R2
C1
MCP6541
VIN+
VIN-
(1 k @ 0°C)
2004 Microchip Technology Inc. DS00895A-page 9
AN895
TABLE 5: RELAXATION OSCILLATOR TEST RESULTS
Table 5 shows a summary of the test results, while
Figure 6 provides a picture of the oscillation frequency
from the oscilloscope.
FIGURE 6: Measured Relaxation
Oscillator Output.
A major error source in the relaxation oscillator is the
comparator’s output drive capability. When the output
of the comparator toggles to V
DD or VSS, the
comparator has to source and sink the charge and
discharge current. If the comparator output is current
limited, it takes a longer period of time to charge and
discharge the capacitor C1, which ultimately affects the
oscillation frequency. The oscillation frequency needs
to be properly selected so that the comparator’s output
limits introduce a relatively small error over the oscilla-
tion frequency range. This error source is described in
Appendix D: “Error Analysis of the Relaxation
Oscillator’s Comparator”.
If a larger resistance RTD sensor is used, the
comparator’s output current is reduced and the
accuracy of the circuit increases. RTD sensors are
available in a number of nominal resistances, including
2000 and 5000. The test results of Table 5 show
that the relaxation oscillator’s accuracy is greater at the
larger resistances than at the smaller resistances. The
1000 RTD resistance was chosen because it is
readily available in both wire wound and thin film
configurations. The growing popularity of the thin film
technology has resulted in larger resistance RTDs at a
reasonable cost.
Another factor that limits the accuracy of the relaxation
oscillator is the relatively poor performance
characteristics of the 0.68 µF capacitor. Recommenda-
tions on the selection of capacitor C
1 to maximize the
accuracy of the oscillation frequency are provided in
the section titled, Oscillator Component Selection
Guidelines”.
Error Analysis
Table 6 provides a RSS estimation of the error of the
resistors and capacitor on the output frequency of the
relaxation oscillator. The test results from the previous
section show that the comparator output drive
capability limits the circuit accuracy. To minimize this
affect, a smaller capacitor and larger RTD resistance
can be used (see Appendix D: “Error Analysis of the
Relaxation Oscillator’s Comparator”).
The sensitivity equations for the relaxation oscillator
are listed below. The sensitivity values of resistors R3
and R4 will be determined from the design equations
provided in Appendix B: “Derivation of Oscillation
Equations. Note that R2 does not have a sensitivity
term because a change in the resistance changes the
upper and lower trip voltages an equal amount at the
inverting terminal and the voltage level difference
between the trip voltages will remain constant.
Although resistor R2 does not play a critical role in
determining the oscillation frequency, it is
recommended that the circuit use a high-quality
resistor equal to R3 and R4.
The RSS analysis shows that the resistors, capacitors
and RTD errors limit the accuracy of the oscillator to
approximately 1.2% at room temperature and 1.5% at
+125°C, which corresponds to a temperature
Simulated Temperature
(°C)
RTD
( )
Calculated Frequency
(Hz)
Measured Frequency
(Hz)
Error
(%)
Error
(°C)
-51.7 801 1322.4 1303 -1.47 3.9
-18.2 930 1139.0 1124 -1.31 3.5
12.5 1048 1010.7 1000 -1.06 2.8
25.5 1098 964.7 955 -1.01 2.7
54.0 1208 876.9 867 -1.12 2.9
76.4 1294 818.6 811 -0.93 2.4
95.3 1367 774.9 769 -0.76 2.0
120.8 1465 723.0 717 -0.83 2.2
fo
1
1.386( ) R1C1
( )
------------------------------------
=
SR1
f
oSC1
fo1= = SR3
foSR4
fo0.716= =
AN895
DS00895A-page 10 2004 Microchip Technology Inc.
resolution of ± °3.3 C and ± °3.9 C, respectively. The
equations correlating the oscillator’s frequency to the
temperature are provided in the “System Integration”
section of this document.
The major error term of the relaxation oscillator is due
to the tolerance of the capacitor. Thus, a calibration of
the capacitors nominal value can improve the
accuracy of the temperature measurement. Options for
providing temperature compensation to improve the
accuracy of the circuit are discussed in the “Oscillator
Component Selection Guidelines section of this
document.
TABLE 6: ERROR ANALYSIS OF RELAXATION RESISTORS, CAPACITORS AND RTD (NOTE 4)
Error Term Item
Sensitivity
(Notes 1,
2 and 5)
Error @ +25°C Error @ +125°C Comments
Resistor Tolerance R3, R4-0.716,
+0.716
1000 ppm 1000 ppm Tolerance = 0.1%,
RN55 metal film
Resistor TC R3, R4-0.716,
+0.716
0 ppm 5000 ppm TC = 50 ppm/°C
Resistor Aging R3, R4-0.716,
+0.716
5000 ppm 5000 ppm R at 2000 hours, 0.3W
and +125°C
Capacitor Tolerance C1 -1 10000 ppm 10000 ppm Tolerance = 1%,
NPO multi-layer ceramic
(Presidio Components Inc. ®)
Capacitor TC C1 -1 0 ppm 3000 ppm TC = 30 ppm/°C
Capacitor Aging C1 -1 0 ppm
(zero aging effect)
0 ppm
(zero aging effect)
C at 2000 hours, 200%
WVDC and +125°C
Capacitor Retrace C1 -1 200 ppm 200 ppm C temperature hysteresis
RTD Accuracy R1, -1 643 ppm 1340 ppm Class B RTD
Worst-Case Error Note 3
freq. (f) 19435 ppm/1.94% 30292 ppm/3.03%
± ° ± °temp. ( t) t = 5.2 C t = 8.1 C
RSS Error Note 3
freq. (f) 12400 ppm/1.24% 14677 ppm/1.47%
± ° ± °temp. ( t) t = 3.3 C t = 3.9 C
Note 1: The sensitivity of the resistors is defined as the relative change in the oscillation frequency per the relative
change in resistance ((fo/fo)/(R/R)).
2: The sensitivity of the capacitors is defined as the relative change in the oscillation frequency per the
relative change in capacitance ((fo/fo)/(C/C)).
3: The temperature accuracy error (t) was calculated using the equations provided in Table 7.
4: ppm is defined as parts-per-million (i.e., 200 ppm = 0.02%).
5: The sensitivity equations are defined in Appendix C: “Error Analysis”.
2004 Microchip Technology Inc. DS00895A-page 11
AN895
OSCILLATOR COMPONENT
SELECTION GUIDELINES
Calibration and Burn-In
An oscillator used in sensor applications must have a
tight tolerance, a small temperature coefficient and a
low drift rate. The op amps, resistors and capacitors
must be chosen carefully so that the change in the
oscillation frequency results primarily from the change
in the resistance of the RTD sensor and not from
changes in the values of the other components.
An application that requires an oscillator accuracy of
better than approximately ±1°C may require a
temperature calibration and/or burn-in procedure to
achieve the desired accuracy. A temperature
compensation algorithm can be easily implemented
using the EEPROM non-volatile memory of a
PICmicro® microcontroller to store temperature correc-
tion data in a look-up table. The temperature coeffi-
cients are obtained by calibrating the circuit over the
operating temperature range and comparing the mea-
sured temperature against the actual temperature. A
polynomial curve-fitting equation of the frequency
versus temperature data can also be used to improve
the accuracy of the oscillator. Since the compensation
coefficients will be unique for each PCB, the cost of
manufacturing will increase.
The drift error of the resistors and capacitors can be
significantly reduced by using a burn-in or temperature-
cycling procedure. The long-term stability of resistors
and capacitors is typically specified by a life test of
2000 hours at the maximum rated power and ambient
temperature. Burn-in procedures are successful in
stabilizing the drift error because the majority of the
change in magnitude of resistors and capacitors
typically occurs in the first 500 hours and the
component drift is relatively small for the remainder of
the test. A temperature-cycling procedure that exposes
the components to fast temperature transients from
cold-to-hot and hot-to-cold can be used to reduce the
mechanical stresses inherent in the devices and
improve the long-term stability of the oscillator.
Op Amp Selection
The appropriate op amp to use for the state variable
oscillator can be determined with a couple of general
design guides. First, the Gain Bandwidth Product
(GBWP) should be a factor of approximately 100 times
higher than the maximum oscillation frequency. Next,
the Full Power Bandwidth (fP) should be at least 2 times
greater than the maximum oscillation frequency. The
MCP6001 amplifier has a GBWP = 1 MHz (typ.) and a
fP of approximately 30 kHz, with VDD = 5V. An oscillator
with a frequency of approximately 10 kHz can be
implemented with the MCP6001 with enough design
margin that the op amp errors can be neglected.
Comparator Selection
The accuracy of the relaxation oscillator can be
improved by using a comparator rather than an op amp
for the amplifier. A comparator offers several
advantages over an op amp in a non-linear switching
circuit, such as a square wave oscillator. An op amp is
intended to operate as a linear amplifier, while the
comparator is designed to function as a fast switch.
The switching specifications, such as propagation
delay and rise/fall time of a comparator, are typically
much better than an op amp’s specifications. Also, the
switching characteristics of an op amp typically only
consist of a slew rate specification.
The non-ideal characteristics of a comparator will
produce an error in the expected oscillation frequency.
The offset voltage (VOS), input bias current (IB),
propagation delay, rise/fall time and output current limit
have an effect on the oscillation frequency. The non-
ideal characteristics of the MCP6541 comparator are
analyzed in Appendix D: “Error Analysis of the
Relaxation Oscillator’s Comparator” and the result-
ing frequency error of the relaxation oscillation is
estimated. The test results of the relaxation oscillator
show that an accuracy of approximately ±3°C can be
achieved using the MCP6541 using a 1000 RTD. The
accuracy of the relaxation oscillator can be improved
by using a higher-resistance RTD and a higher
performance comparator. However, the trade-off will be
that the comparator’s current consumption will be much
higher.
Resistor Selection
The errors of the resistors can be minimized by
selecting precision components and will be much less
than the error from the capacitors. Metal film and foil
resistors are two types of precision resistors that can
be used in an oscillator. Metal film resistors are
available with a tolerance of 0.01%, TC of ±10 to
±25 ppm/°C and a drift specification of approximately
0.1 to 0.5%. RNC90 metal foil resistors are available
with a tolerance of 0.01%, temperature coefficient of
±2 ppm/°C and a drift specification of less than 50 ppm.
Vendors, such as Vishay
® Intertechnology, Inc., offer a
number of precision resistors that have much better
specifications than the RNC90. These devices,
however, are relatively expensive.
The operating environment of a resistor also can
induce a change in resistance. Though the change of
the ambient temperature is usually unavoidable; how-
ever, the power rating of a resistor can be chosen to
minimize any self-heating from the I2R drop of the
device. Other factors, such as humidity, voltage coeffi-
cient (R versus voltage) and thermal EMF (due to the
temperature difference between the leads and self-
heating) are small and can be neglected by using
quality components and standard low noise analog
PCB layout procedures.
AN895
DS00895A-page 12 2004 Microchip Technology Inc.
Capacitor Selection
Capacitors have relatively poor performance when
compared with resistors and are usually the component
that limits the accuracy of an oscillator. Furthermore,
precision capacitors are available in only relatively
small capacitances. The state variable circuit reference
design requires two 100 nF capacitors, while the relax-
ation oscillator needs a 0.68 µF capacitor in order for
both circuits to have a nominal frequency of approxi-
mately 1 kHz, with a 1 kHz RTD. A capacitor with a tight
tolerance, low temperature coefficient and small drift
rate is available only in a maximum capacitance of
approximately 100 nF. The relatively poor specifica-
tions of a microfarad-range capacitor limits the
accuracy of the relaxation oscillator to approximately
3°C, unless temperature compensation is provided.
The major environmental error term of a capacitor is
due to temperature hysteresis and is specified as the
retrace error. Precision sensors can use temperature
compensation to correct for a change of capacitance
with temperature. However, it is difficult to correct for
hysteresis errors. The retrace error of the American
Technical Ceramic’s ATC700 capacitors recommended
for the state variable oscillator is specified at ± 0.02%.
Other capacitor environmental errors result from the
piezoelectric effect (C versus voltage and pressure),
the quality factor (Q) and resistance of the terminals.
These errors are relatively small and can be neglected.
In a sensor application, the oscillation frequency is well
below the capacitor’s maximum rated frequency and
the amplitude of the voltage is small compared to the
maximum Working Voltage DC (WVDC) rating of the
capacitor.
RF and microwave capacitors are a good source of
precision capacitors for the state variable oscillator.
The ATC700 series NPO porcelain and ceramic
capacitors have a tolerance of 0.1 pF, a temperature
coefficient of 0 ±30 ppm/°C and a drift rating of 0.00%.
Note that the vendor’s data sheet states that the NPO
dielectric has no change in capacitance with aging.
However, the military standard for the device specifies
the aging error as less than 0.02%. The trade-off with
the high-frequency ATC700 NPO capacitors is that
they are relatively small in magnitude and are only
available in a maximum capacitance of 5100 pF.
A multi-layer or stacked NPO ceramic is the
recommended capacitor for the relaxation oscillator.
Vendors (such as Presidio, etc.) offer multi-layer NPO
capacitors in values that include microfarads. Multi-
layer capacitors are available with a tolerance of 1%, a
temperature coefficient of 0 ±30 ppm/°C and a zero
drift rating. Other types of capacitors available in a
range of approximately 1 µF include tantalum and
metallized polypropylene film. Tantalum capacitors are
available with a tolerance of 1%, a temperature coeffi-
cient of 0 ±1000 ppm/°C and a drift rating of ±1%.
Polypropylene capacitors are available with a tolerance
of 1%, a temperature coefficient of 0 ±250 ppm/°C and
a drift rating of 0.5%. One additional problem with the
polypropylene capacitors is that their maximum
temperature is typically specified at +85 to +105°C and
some of the devices will not withstand the heat of an
automated PCB soldering system.
SYSTEM INTEGRATION
Oscillator to PICmicro® Microcontroller
Interface
The op amp oscillator can be easily integrated with a
PICmicro microcontroller to determine the frequency of
the oscillation or temperature. The oscillator can be
connected to the PICmicro microcontroller with a
standard digital input pin. However, a Schmitt-triggered
input is recommended to provide additional noise
immunity. A critical component in the frequency
measurement system is the microcontroller’s clock
signal. The accuracy of the frequency measurement is
directly related to the accuracy of the clock signal.
FIGURE 7: Typical RC Op Amp
Oscillator Sensor System.
RC
Oscillator PICmicro®
Microcontroller
RRTD
Clock
2004 Microchip Technology Inc. DS00895A-page 13
AN895
Microcontroller Clock
Typical microcontroller clock sources include crystal
oscillators, crystals, crystal resonators, RC oscillators
and internal microcontroller RC oscillators. Crystal
oscillators are available with a temperature
compensated accuracy better than 0.02%. They are
also relatively expensive. Crystals with an accuracy of
0.1% are available at a moderate cost. Resonators
typically have an accuracy of 0.5% and are relatively
low in cost. The internal PICmicro microcontroller RC
oscillators vary significantly (1%-50%) in accuracy and
are not recommend for a frequency measurement
application.
PICmicro Microcontroller Frequency
Measurement Options
There are two different options available to measure
oscillation frequency using a PICmicro microcontroller.
One approach is to count the number of pulses in a
fixed period of time, while the other is to count time
between a fixed number of edges. Either one of these
methods can be implemented for this application. It is
important to note, however, the advantages and
disadvantages of each solution.
The required resources for determining the frequency
varies depending upon the processor bandwidth,
available peripherals, and the resolution or accuracy
desired. The fixed-time method could utilize a firmware
delay or a hardware delay routine. While the firmware
can poll for input edges, this consumes processor
bandwidth. A more common implementation uses a
hardware timer/counter to count the input cycles during
a firmware delay. If a second timer is available, the
delay can be generated using this timer, thus requiring
minimal processor bandwidth. The fixed cycle method
could utilize firmware to measure both time and poll
input edges. However, this is processor-intensive and
has accuracy limitations. A more common implementa-
tion is to utilize the Capture/Compare/PWM (CCP)
module configured in Capture mode. This hardware
uses the 16-bit TMR1 peripheral and has excellent
accuracy and range.
FIXED TIME METHOD
The fixed time method consists of counting the number
of pulses within a specific time window, such as
100 ms. The frequency is calculated by multiplying the
count by the integer required to correlate the number of
pulses in one second or the set time window.
When using a fixed time measurement approach,
accuracy is relative to the input frequency versus
measurement time. The measurement time is chosen
by the designer based on the desired accuracy, input
frequency and desired measurement rate. A faster
measurement rate requires a shorter measurement
window, thus reducing the resolution. A slower
measurement rate allows a longer measurement
window and, therefore, increasing the resolution. For
example, in this op amp oscillator application, the oscil-
lator frequency is approximately 1 kHz at C. If the
measurement time is chosen to be 100 ms, there will
be approximately 100 cycles within the fixed window.
This provides an accuracy of approximately ±0.5%.
This measurement approach inherently minimizes the
effect of error sources, such as the op amp oscillator’s
jitter, by simply averaging multiple edges prior to
calculating the frequency.
FIGURE 8: Fixed Time Method.
FIXED CYCLE METHOD
The fixed cycle approach is similar in concept to the
fixed time approach. In the fixed cycle method, the
number of cycles measured is fixed and the
measurement time is variable. The concept is to
measure the elapsed time for a fixed number of cycles.
The number of cycles is chosen arbitrarily by the
designer based on the desired accuracy, input
frequency, desired measurement rate and PICmicro
microcontroller clock frequency (FOSC). The FOSC
determines the minimum time an edge can be
resolved. The measurement error will be proportional
to the total amount of time versus FOSC. Increasing the
number of cycles measured increases the total
measurement time, thus reducing the error. Increasing
FOSC decreases the minimum time to resolve an edge,
thus reducing the error. If the oscillator’s nominal
frequency is equal to 1 kHz and F
OSC is equal to
4 MHz, then the edge resolution is 1 µs due to the
microcontroller program counter incrementing once
every four clock cycles (FOSC/4). For an input
frequency of 1 kHz, the measurement error becomes
1000 ±1 µs, or 0.1%. The error due to input signal jitter
is significant only if few oscillation cycles are
measured. Measuring more oscillation cycles
inherently averages the input jitter at the expense of
increasing the measurement time.
Algorithm:
Count the number of clock pulses in a time window.
Oscillator
Signal
Time Window
Example: Measure the number of oscillation pulses in a
100 ms window and multiply by 10 to
determine the frequency.
AN895
DS00895A-page 14 2004 Microchip Technology Inc.
FIGURE 9: Fixed Cycle Method.
Oscillation Frequency versus
Temperature
RTD oscillators provide a frequency output that is
proportional to temperature. In this section, equations
are provided that show the relationship between
frequency and temperature. It should be noted that
while resolution and accuracy are closely related, they
are not identical. The accuracy of the RTD sensor,
oscillator circuit and the PICmicro microcontroller
frequency measurement system has to be analyzed to
determine the accuracy of the temperature
measurement system.
RTDs have the characteristics that the change in
resistance per temperature is very repeatable. If
temperature correction is used with the RTD, the
measurement accuracy of the system is limited only by
the minimum resolution step size.
To illustrate the frequency-to-temperature relationship,
let’s assume that the state variable and relaxation
oscillators are required to provide a temperature
resolution of 0.25°C. The equations are developed
using the resistance of the RTD at 0°C for convenience
because Ro is the standard value of resistance used to
define a RTD. In addition, it is assumed that the change
in the RTD’s resistance is linear over the operating
temperature range. A temperature change of 0.25°C
will increase the resistance of the RTD by 0.9625,
which corresponds to a change of 0.096% in the oscil-
lation frequency of both oscillators. The frequency-to-
temperature relationship for the oscillators is shown in
Table 7.
TABLE 7: FREQUENCY VERSUS TEMPERATURE FOR t = 0.25°C
Algorithm:
Determine the time between a fixed number of oscillation
Oscillator
Signal
Time
Example: Measure time between four rising edges of the
oscillation signal.
pulses.
Term Equation
State Variable Oscillator
R Ro[1+α ∆( t)]-Ro1000 [1+(0.00385°C
-1)(0.25°C)] - 1000
0.9625
fo @ to[1 / (2πRoC)] =1/(2 π(1000)(100 nF))
= 1591.55 Hz (P = 628.3 µs)
fo @ (to+t) [1/(2π(Ro+R)C)] = [1/(2π(1000 + 0.9625)(100 nF))]
= 1590.02 Hz (P = 628.9 µs)
f fo(to)-fo(to+t) = 1.53 Hz (0.096%)
Period
(P)
Po(to+t)-Po(to) = 628.9 - 628.3 µs
= 600 ns
Relaxation Oscillator
R Ro[1+α ∆( t)]-Ro 1000 [1+(0.00385°C
-1)(0.25°C)] - 1000
0.9625
fo @ to[1/(2 π RoC)] = 1/[(1.386)(1000)(0.68 µF)]
= 1061.8 Hz (P = 941.8 µs)
fo @ (to+t) [1 / (2 π(Ro+R)C)] = 1/[(1.386)(1000+0.9625)(0.68 µF)]
= 1060.7 Hz (P = 942.7 µs)
f fo @to - fo @ (t o+t) = 1.021 Hz (0.096%)
Period
(P)
Po @ (t
o+t) - Po @ to = 942.7 - 941.8 µs
= 900 ns
Legend: t = t - t o
Ro = RTD resistance at 0°C
R = change in resistance per t
C = capacitance of C
1 and C2
fo @ to = oscillation frequency at 0°C
f = change in oscillator frequency per R
P = change in oscillator period per R (P = 1/f)
2004 Microchip Technology Inc. DS00895A-page 15
AN895
Required Accuracy of the PICmicro
Microcontroller Frequency Measurement
The accuracy of the PICmicro microcontroller time
measurement method required to achieve a desired
temperature resolution must also be analyzed. The
accuracy of a microcontroller frequency measurement
is directly related to the accuracy of the clock source. It
is recommended that the PICmicro microcontroller’s
clock signal have an accuracy equal to, or 10 times
better than, the accuracy of the oscillator. For a system
that requires a resolution of 0.25°C (f 0.1% or
1000 ppm), a PICmicro microcontroller clock signal
with an accuracy of 10 to 100 ppm is required.
High accuracy oscillators are available; however, they
are relatively expensive. The high accuracy oscillators
usually include temperature compensation, with some
devices having a micro-heater inside the oscillator that
maintains a stable temperature for the crystal. An alter-
native to purchasing an expensive, high-accuracy
clock signal is to use a software routine to implement
temperature compensation. If the PICmicro microcon-
troller and oscillator are calibrated using a method such
as a look-up table with correction coefficients, the toler-
ance and temperature coefficient of the clock signal
can be corrected. Providing clock compensation will
require individual calibration at the PCB that will be
provided by forming a clock count versus temperature
relationship.
The clock signal also has an error similar to the retrace
error of a capacitor. This temperature hysteresis error
can not be easily calibrated because the magnitude of
the error is typically not repeatable and depends on the
temperature history. Other oscillator errors such as the
long term drift can be reduced with a burn-in or
temperature cycling procedure.
Conclusion
RTD sensors have a very accurate resistance-to-tem-
perature characteristic and are the standard
temperature sensor for precision measurements. The
main disadvantage of RTD sensors is that they are
relatively expensive compared to other temperature
sensors. The availability of thin film RTDs has lowered
the price of these sensors, making RTDs economically
feasible for many new applications. Another advantage
of RTD sensors is that their thermal response time is
very fast compared to other temperature sensors. For
example, RTDs with a response time of a few
milliseconds are used in hot wire anemometers to
measure fluid flow.
Precision sensing oscillators can be created using
CMOS op amps and comparators. CMOS ICs offer the
advantages of a good bandwidth, low supply voltage
and power consumption. However, their DC
specifications are relatively modest compared to
bipolar devices. Oscillators are relatively immune to DC
specifications like input offset voltage (VOS), making
the MCP6001 and the MCP6541 CMOS op amp and
comparator a good design choice for these precision
sensing circuits.
The inexpensive MCP6001 op amp can be used to
create an oscillator that can be used to accurately
measure temperature. The state variable oscillator is a
good circuit for precision applications, especially dual-
element RTD sensors. The state variable oscillator and
a class B dual element RTD can be used to provide a
temperature measurement equal to ±0.67°C at room
temperature and ± °1.07 C at 125°C. Note that the
accuracy of the measurement can be greatly improved
by implementing one of the temperature compensation
methods described in this document.
The relaxation oscillator offers a single comparator
solution for cost-sensitive applications. It is a simple
solution for an application that needs the fast thermal
response time of RTD, with a temperature
measurement accuracy approximately equal to ± °3 C.
Low cost and a simple interface circuit are terms that
traditionally have not been associated with RTDs.
Precision sensing oscillators can be created using
Microchip’s low-cost MCP6001 op amp and MCP6541
comparator. The main advantage of the oscillator
circuits is that they do not require an ADC.
AN895
DS00895A-page 16 2004 Microchip Technology Inc.
Acknowledgments
The authors appreciate the assistance of Jim Simons in
creating the “System Integration” section.
References
[1]. AN687, “Precision Temperature Sensing with
RTD Circuits”, Baker, B., Microchip Technology
Inc., 1999.
[2]. “Time to Learn Your RTDs”, Gauthier, R.,
Sensors, May 2003.
[3]. International Electrotechnical Commission
(IEC), “Specification IEC 60751, Industrial
Platinum Resistance Thermometer Sensors”,
1995 (amendment 2).
[4]. “Resistance Temperature Detectors: Theory
and Standards”, King, D., Sensors, October
1995.
[5]. AN866, “Designing Operational Amplifier
Oscillator Circuits for Sensor Applications”,
Lepkowski, J., Microchip Technology Inc., 2003.
[6]. “The ABCs of RTDs”, McGovern, Bill, Sensors,
November 2003.
[7]. “Introductory Systems Engineering”, Truxal, J.,
McGraw–Hill, N.Y., 1972.
[8]. “Analog Filter Design”, Ch. 19, Op Amp Oscilla-
tors, Van Valkenburg, M., Saunders College
Publishing, Fort Worth, 1992.
AN895
DS00895A-page 18 2004 Microchip Technology Inc.
Resistance versus Temperature
The International Electrotechnical Commission (IEC)
has established the IEC-60751 standard for the
resistance-to-temperature specifications of a RTD
(Reference [3]). This standard produces a sensor that
is interchangeable because the resistance to
temperature relationship is identical for a class A or B
sensor produced by any manufacturer.
A first order linear equation can be used to describe the
RTD’s resistance for a temperature between 0°C and
100°C. This equation is modeled by the temperature
coefficient or alpha ( ), which defines the averageα
change in resistance per unit temperature change from
the freezing point (0°C) to the boiling point of water
(100°C). Note that the alpha standard is specific to a
100 RTD at 0°C. However, this alpha is widely
accepted as the standard temperature coefficient of
commercially available RTDs that range from a
nominal resistance at 0°C of 100 to 10,000.
The linear first order equation is shown below:
If the sensed temperature is less than 0°C or greater
than 100°C, the RTD’s resistance should be calculated
using the Callendar-Van Dusen equation. The third
order Callendar-Van Dusen equation is required to
compensate for the slight non-linearity of the RTD over
a wide temperature range. The operating range of a
class B RTD is specified from -200°C to +850°C based
on the IEC 751 specification.
The Callendar-Van Dusen equation is listed below:
Comparisons of the RTD’s resistance calculated using
the first order and third order equations are shown in
Figure 11 and Figure 12. The variance between the two
equations is less than 0.1% (or approximately 0.2°C)
for temperatures between -15°C and +120°C. The
simpler linear first order equation can be used to calcu-
late the resistance. However, the second order
Callender-Van Dusen equation should be used if the
RTD is used to measure temperatures over a wider
temperature range.
FIGURE 11: Percentage Variance
between the First Order Linear and Third Order
Polynomial Resistance vs. Temperature
Characteristics for -55 t +125°C.
FIGURE 12: Resistance Variance
between the First Order Linear and Third Order
Polynomial Resistance versus Temperature
Characteristics for -200 t +600°C.
Rt = Ro [1 + α(t-to)] for 0°C t 100°C
Where:
Rt = resistance at temperature t
Ro = resistance at calibration temperature t
o
(to typically is equal to 0°C)
t = temperature (°C)
α = temperature coefficient of resistance (°C-1)
= 0.00385°C-1
R
t = Ro [1 + At + Bt2] for -200°C t < 0°C
Rt = Ro [1 + At + Bt2 + C(t-100)t3]
for 0°C t 850°C
Where:
A = 3.90830 x 10-3 (°C-1)
B = -5.77500 x 10-7 (°C-2 )
C = -4.18301 x 10-12 (°C-4 )
-0.200
-0.100
0.000
0.100
0.200
0.300
0.400
0.500
0.600
0.700
-55 -35 -15 5 25 45 65 85 105 125
Ambient Temperature (°C)
Variance (%)
0
500
1000
1500
2000
2500
3000
3500
-200 -100 0 100 200 300 400 500 600
Ambient Temperature (°C)
Resistance (
)
3rd Order Polynomial
(Callendar Van-Dusen Equation)
1st Order Polynomial
(Linear Equation)
2004 Microchip Technology Inc. DS00895A-page 19
AN895
APPENDIX B: DERIVATION OF
OSCILLATION
EQUATIONS
OSCILLATOR THEORY
An oscillator is a positive feedback control system that
generates a self-sustained output without requiring an
input signal. Figure 13 provides a block diagram of an
oscillator and the definition of the oscillation terms.
Additional details on op amp oscillators are provided in
references [7] and [8]. A procedure for deriving the
oscillation design equations is provided in reference
[5].
The oscillation frequency of an oscillator formed with
multiple op amps (such as the state variable circuit) can
be analyzed by finding the poles of the denominator of
the transfer equation T(s). Or equivalent to the zeroes
of the numerator N(s) of the characteristic equation
(s) as shown in Figure 13.
In contrast, the design equations for the single compar-
ator relaxation oscillator will be determined by analyz-
ing the circuit as a comparator. The equations formed
at the inverting and non-inverting terminals show that
the output of the amplifier will swing from the V
DD to the
VSS power supply rails at a rate proportional to the
charge and discharge time of the capacitor.
FIGURE 13: Oscillator Block Diagram.
STATE VARIABLE OSCILLATION
EQUATIONS
FIGURE 14: State Variable Oscillator.
STEP 1: FIND LG AND S
The oscillation frequency is determined by finding the
poles of the denominator of the transfer equation T(s).
Or equivalent to the zeroes of the numerator N(s) of the
characteristic equation (s). Figure 14 provides a
simplified schematic of the state variable oscillator. The
first step in the procedure is to find the s equation by
breaking the feedback loop and obtaining the gain
equation at each op amp in order to calculate the loop
gain (LG).
The loop gain is found by breaking the oscillator loop,
as shown below:
A Amplifier Gain
β ≡ Feedback Factor
+
VIN VOUT
+
T s( )
VOUT
VIN
------------- A
1 Aβ
---------------- A
1 LG
----------------- A
s
------ A
N s( )
D s( )
-----------
------------
= = = = =
where: A x β = LG loop gain
s characteristic equation
If VIN = 0, then T(s) = ∞ ∆ when s = 0
A1
C1
VDD/2
R1
A2
C2
VDD/2
R2
A3
R4
VDD/2
R3
V1V2V3
C4
Integrator Integrator Inverter
A1A2A3
T s( ) A
1 LG
----------------- A
s
------ A
N s( )
D s( )
-----------
------------
= = =
A11sR1C1
( )=
A3Z4
Z3
=
A21sR2C2
( )=
R4C4
||
( )R
3
=
R4R3
( ) 1 sR4C41+( )( )[ ]=
LG A 1A2
×A3
×=
1 s R 1C1
( )[ ] 1sR2C
2
( )[ ] R4R3
( ) 1 s R 4C41+( )( )[ ]=
R4s3R1R
2R3R4C
1C
2C
3C
4s2R1R2R3C1C2
+
 
 
=
sN s( ) D s( )1 L G= =
1 R4
s3R1R2R3R4C1C2C4s2R1R2
R3C1C2
+( )[ ]=
s3R1R
2R3R4
C1C2C4s2R1
R2R3C1C2R4
+ +[ ]
s3R1R2R3
R4C1C2C4s2R1R2
R3C1C
2
+[ ]
------------------------------------------------------------------------------------------------------------------
=
N s( ) s
3R1R2R3R4C1C2C
4s2
R1R2R3C1C2R4
+ +=
V1V3
V2
A1A3
A2
AN895
DS00895A-page 20 2004 Microchip Technology Inc.
STEP 2: SOLVE N(s) = 0 AND FIND O
An equation for the oscillation frequency ω
o can be
established by dividing the N(s) term by s
2 + ωo2 and
solving the remainder to be equal to zero. Though this
method is easy to use with third order systems, the
algebra can be tedious with higher order systems. The
division method is described in reference [7] and is
based on factoring the characteristic equation to have
an s2 + ωo2 term. The third order pole locations are at
s = ± jωo and s = -b when the equation is factored in the
form of (s + b)(s2 + ωo2).
Routh’s stability criterion provides an alternative
method to analyze the N(s) equation without the
necessity of factoring the equation. References [5], [7]
and [8] provide further information on the Routh
method.
Note that C4 does not appear in the oscillation
equation. The gain of amplifier A3 will not be a function
of C4 if the oscillation frequency is less than the cut-off
frequency of the low pass filter formed by C
4 and R4.
STEP 3: SUB-CIRCUIT DESIGN EQUATIONS
The third step analyzes the gain equation at each
amplifier. Note that the gain of integrator stages will
always be equal to one. As the RTD changes in
resistance, the frequency will change in a proportional
manner to maintain the gain of one.
STEP 4: VERIFY LG 1
The final step in the procedure verifies that the loop
gain is equal to or greater than one, after the R and C
component values have been chosen.
If:
1. R1 = R2
= R
2. C1 = C2 = C
3. R3 = R4
Then
ω = (1/RC), period (P) = 2πRC
and f = 1 / 2πRC
Step 2:
N(s) = s3R1R2R3R4C1C2C4 + s2R1R2R3C1C2 + R4
s2 + ωo2
sR1R2R3R4C1C2C4 + R1R2R
3C1C2
s3R1R2R3R4C1C2C4 + s2R1R2R
3C1C2
-s3R1R2R3R4C1C2C4 +
s2R1R2R3C1C2 + -sωo2
R1R2R3R4C1C2C4
-sωo2R1R2R3R4C1C2C4
+ R4
+ R4
-s2R1R2R3C1C2 + -ωo2
R1R2R3C1C2
-sωo
2R1
R2R3R4C1C2C4+ R4- ωo2R1R2R3C1C2
Set the s0 remainder term equal to zero and solve for ω
o2.
R4 - ωο2R1R2R3C1C2
= 0
ωo = R4
R1
R2
R3C1C2
Integrator A1Gain A
112πfR1C1
( )=
Gain A
212πfR2C2
( )=
Integrator A2
Gain R4R3
( ) 1 sR 4C41+( )( )[ ]=
Inverter A3
A1A2A3
=1= =
LG A1A2
×A3
×1= =
Assume:
1. R1 = R2 = R
2. C1 = C2 = C
3. R3 = R4
2004 Microchip Technology Inc. DS00895A-page 21
AN895
Relaxation Oscillator Design Equations
In this section, the equations that describe the circuit
oscillation are derived. From these equations, the
relationship of the oscillation frequency to the ambient
temperature is quantified. Also, equations are
developed for the error sources of the circuit.
The trip voltages at VIN+ can be determined using R
2,
R3 and R4 with respect to VDD and VOUT
. The resistor
network shown in Figure 2 can be simplified to the
Thevenin Equivalent circuit for ease of calculation as
shown in Figure 15. Initially, the Input Offset Voltage
(VOS) and the Input Bias Current (IB) terms of the
comparator will be ignored for simplification.
FIGURE 15: Thevenin Equivalent Circuit.
Realistically, the output stage of any push-pull output
comparator does not exactly reach the supply rails,
VDD and VSS. It approaches the rails to a point where
the difference can be negligible. This is specified in the
data sheet as high (VOH) and low (V
OL ) level output
voltage. The MCP6541 comparator output voltage will
be within 200 mV from the supply rails at 2 mA of
source current. VOH and VOL increase as the compar-
ator source or sink current increases (see Figure 17).
Therefore, the capacitor C1 and the trip voltages at the
non-inverting input are driven by the VOH and VOL
instead of VDD and VSS.
The trip voltage at VIN+, which triggers the output to
swing from VOH to VOL or from V
OL to VOH, are referred
to as VTHL and VTLH, respectively. These trip voltages
can be determined as follows using the Superposition
Principle of circuit analysis.
Using the equations below, the desired V
THL and VTLH
voltages can be set by properly selecting the
corresponding resistors.
For example, if R2 = R3 = R4 = 10 k and assuming
that VOH = VDD and VOL = VSS, then by substituting
these values in the above equations, the trip voltages
can be determined to be:
Assuming that the sensor resistance is given at the test
condition (for example, RTD resistance 1000 at 0°C),
the oscillation frequency depends on the value of the
capacitor C1. This frequency relates to the time that the
capacitor charges and discharges through V
OH and
VOL.
The voltage across a capacitor changes exponentially,
as shown below:
This equation describes the change in voltage across
the capacitor with respect to time. This relationship can
be used to calculate the oscillation frequency. Note that
the capacitor charges and discharges up to the trip
voltages VTHL and VTLH , which are set by R
2, R3 and
R4.
The following equation substitutes the variables in the
above capacitor equation to solve for t and calculate
the charging and discharging times.
When C1
is charged through VOH:
Solving for t:
VOUT
MCP6541
C1VDD
R1 (RTD)
R4
R23
V23
VIN+
VIN-
where: R23 = (R2 x R3) / (R2 + R3)
V23 = VDD x [R3/ (R2+R 3)]
VTHL VOH
R23
R23 R3
+
---------------------
 
V23
R4
R23 R4
+
---------------------
 
 
+=
VTLH VOL
R23
R23 R3
+
---------------------
 
V23
R4
R23 R4
+
---------------------
 
 
+=
VCAP = Vnal + (Vinitial -Vnal) e-(t/τ), t > 0
Where:
τ = time constant defined by R1 X C1
t = time
VCAP = capacitor voltage at a given time t
Vinitial
= capacitor voltage at t = 0.
Vnal = capacitor voltage t =
VTHL = VOH + (VTLH - VOH) e -tcharge/t
VTHL 2/3VDD
=
VTLH 1/3VDD
=
tch earg τVTHL VOH
VTLH VOH
------------------------------
 
 
ln=
Where:
tcharge
= time for the capacitor to charge from
VTLH to V
THL.
AN895
DS00895A-page 22 2004 Microchip Technology Inc.
When C1 is discharged through VOL:
Solving for t:
If VOH = VDD and VOL = VSS, then VTHL = 2/3 VDD and
VTLH = 1/3 VDD as shown in the above example. Then
tcharge and tdischarge are as follows:
Therefore, the oscillation frequency for this example
is:
Figure 16 shows the voltage waveforms of the
oscillator inputs and output.
FIGURE 16: Graphical representation of
the oscillator circuit voltage.
From this example, it can be shown that if R
2, R3 and
R4 have equal values, then the charge and discharge
time will be the same. However, if the values of R
3 and
R4 change, then the oscillator duty cycle and frequency
will change. A ±1% change in R2 offsets the trip volt-
ages with equal magnitude, but it does not affect the
oscillation frequency.
VTLH VOL VTHL VOL
( )etdi s ch earg τ
+=
td isch earg τVTLH VOL
VTHL VOL
-----------------------------
 
 
ln=
Where:
tdischarge = time for the capacitor to discharge
from V
THL to V
TLH.
tch earg 0.693 R1C1
=
tdisch earg 0.693 R1C1
=
frequency 1
1.386 R1C1
---------------------------- 1
tc h earg tdisc h earg
+
---------------------------------------------
= =
VOH
V
OL
VTHL
VTLH
VOUT
VIN+
VIN-
VOL
VOH
tdischarge tcharge time
Voltage
VIN- and VIN+
2004 Microchip Technology Inc. DS00895A-page 23
AN895
APPENDIX C: ERROR ANALYSIS
Error analysis is useful when predicting the
manufacturing variability, temperature stability and the
drift in accuracy over time. An error analysis is not a
replacement for development or verification tests. The
oscillator’s performance should always be verified by
building and testing the circuit. An error analysis is a
useful tool to estimate the accuracy of an oscillator and
to provide a comparison on the performance of
different circuits, such as the state variable and
relaxation oscillator.
The first step in performing an error analysis is to
calculate the shift of the oscillation frequency or
sensitivity from factors such as tolerance, temperature
coefficient and drift of the resistors and capacitors.
Sensitivity is a measure of the change in the output
(Y) per change in the input (X). The sensitivity of the
components are calculated from the oscillation
equation, derived in Appendix B: Derivation of
Oscillation Equations”. A sensitivity of -1/2 means
that a 1% increase in the component resistance or
capacitance will decrease the oscillation frequency by
0.5%. The sensitivity equations for the state variable
oscillator are listed below:
An error analysis of the oscillator can be performed by
either a Monte Carlo or a root-square-sum (RSS)
analysis. The Monte Carlo analysis can be performed
using a SPICE model or MathCad®, a mathematical
analysis program. The Monte Carlo analysis uses a
statistical model of each circuit component and
simulates the circuit’s performance by randomly
varying each component. A large number of simulated
circuits can be easily evaluated and the variance of the
frequency output can be analyzed.
The RSS error is easy to evaluate and will be used to
predict and compare the expected performance of the
state variable and relaxation oscillators. The RSS
analysis consists of listing the magnitude of all the error
terms and then multiplying the terms by the component
sensitivity factor. Next, the sum of the square of each
error is calculated. Finally, the RSS value is found by
calculating the square root of the sum of the squared
error terms. Listed below is the RSS error equation.
One limitation of the RSS method is that the error terms
are usually determined using the worst-case
specification or the maximum or minimum value listed
on the component’s data sheet. If worst-case
specifications are used in the RSS analysis, the
estimate of the error will usually be more pessimistic
than the error measured with the hardware. Also, the
RSS method assumes that the error terms are
independent and can be modeled by a standard
distribution curve.
The worst-case analysis consists of calculating the
sum all of the error terms multiplied by the sensitivity
weighting factor. This provides an estimation of the
theoretical minimum or maximum value of the output.
The insight given by worst-case analysis is limited
because the probability that each component is at a
value that maximizes the error is statistically unlikely,
especially as the circuit component count increases.
SX
Y
Y
Y
-------
 
 
X
X
-------
 
 
------------- d In(Y)
d In (X)
------------------
= =
ωo
R4
R1R2R3C1C2
---------------------------------
 
1/2
=ωo2 fπ=( )
SR1
ω0SR2
ω0SR3
ω0SR4
ω0SC1
ω0SC2
ω01/2= = == = =
Worst Case
n
Σ
k 1=
Sεk
Oεk
=
RSS
n
Σ
k 1=
Sεk
Oεk
( ) 2
=
Where:
S0
ε
1 = sensitivity factor
ε
n = error terms

Produktspecifikationer

Varumärke: Microchip
Kategori: Inte kategoriserad
Modell: TC1025

Behöver du hjälp?

Om du behöver hjälp med Microchip TC1025 ställ en fråga nedan och andra användare kommer att svara dig