CN-0300 [ADI]
Complete Closed-Loop Precision Analog Microcontroller Thermocouple; 完整的闭环精密模拟微控制器热电偶型号: | CN-0300 |
厂家: | ADI |
描述: | Complete Closed-Loop Precision Analog Microcontroller Thermocouple |
文件: | 总7页 (文件大小:375K) |
中文: | 中文翻译 | 下载: | 下载PDF数据表文档文件 |
Circuit Note
CN-0300
Devices Connected/Referenced
Circuits from the Lab™ reference circuits are engineered and
tested for quick and easysystem integration to help solve today’s
analog, mixed-signal, and RF design challenges. For more
information and/or support, visit www.analog.com/CN0300.
Cortex-M3 Based Microcontroller with
Dual 24-Bit Σ-Δ ADCs
ADuCM360
ADP1720-3.3 Low Dropout Linear Regulator
Complete Closed-Loop Precision Analog Microcontroller Thermocouple
Measurement System with 4 mA to 20 mA Output
a 12-bit digital-to-analog converter (DAC), anda 1.2V internal
reference, as well asan ARMCortex-M3 core, 126 kB flash, 8 kB
SRAM, and various digital peripheralssuch as UART, timers,
SPIs, and I2C interfaces.
EVALUATION ANDDESIGN SUPPORT
Circuit Evaluation Board
CN-0300 Evaluation Board (EVAL-CN0300-EB1Z) includes
Analog Devices J-Link OB emulator (USB-SWD/UART-
EMUZ)
Design and Integration Files
Schematics, Layout Files, Bill of Materials, source code for
ADuCM360
In the circuit, the ADuCM360 is connected to a Type T
thermocoupleand a 100 Ω platinum resistance temperature
detector(RTD). The RTD is usedfor cold junction compensation.
The low power Cortex-M3 core convertsthe ADC readings to a
real temperature value. The Type T temperature range supported is
−200°C to +350°C, and this temperature rangeis converted to
an output current rangeof 4 mA to 20 mA.
CIRCUIT FUNCTION AND BENEFITS
This circuit uses the ADuCM360 precision analogmicrocontroller
in an accurate thermocouple temperaturemonitoringapplication
and controls the 4 mA to 20 mAoutput current accordingly. The
ADuCM360 integrates dual 24-bit sigma-delta (Σ-Δ) analog-to-
The circuit provides a completesolution for thermocouple
measurementswith a minimum requirement for external
components, andit is loop poweredfor loop voltages up to 28 V.
digital converters(ADCs), dual programmablecurrent sources,
3.3V
ADP1720-3.3
VLOOP
1.6Ω
IN
OUT
10µF
10µF
GND
FERRITE BEAD
10µF
600Ω AT 100MHz
MURATA
BLM31AJ601SN1L
CURRENT
METER
0.1µF
0.1µF
INTERFACE
BOARD
CONNECTOR
VLOOP+
VLOOP–
AVDD
IOVDD
DAC
RESET
GND
RESET
SWDIO
SWCLK
IEXC
NPN
BC548
10Ω
SWDIO
SOUT
SWCLK
SIN
100Ω
PtRTD
ADC0
ADC1
VREF+
RLOOP
47Ω
0.01µF
10Ω
100kΩ
100kΩ
NC
AIN9
AIN8
0.01µF
ADuCM360
IOVDD
IOVDD
5.6kΩ
0.1%
R
REF
RESET
SD
VREF–
AIN2
RESET
10kΩ
P2.2/BM
10nF
10kΩ
AIN3
THERMOCOUPLE
JUNCTION
10nF
DVDD_REG
0.47µF
AIN7/VBIAS
AGND
Figure 1. ADuCM360 as a Temperature Monitor Controller with a Thermocouple Interface (Simplified Schematic, All Connections Not Shown)
Rev. A
Circuits from the Lab™ circuits from Analog Devices have been designed and built by Analog Devices
engineers. Standard engineering practices have been employed in the design and construction of
eachcircuit,andtheir functionand performancehave been testedandverified ina labenvironmentat
room temperature. However, you are solely respons ible fo r test in g the c irc u it and determ in in g its
suitabilityandapplicabilityfor your useandapplication. Accordingly, in no eventshall Analog Devices
be liable for direct, indirect, special, incidental, consequential or punitive damages due toany cause
whatsoever connected to the useof anyCircuits from the Labcircuits. (Continued on last page)
One Technology Way, P.O. Box 9106, Norwood, MA 02062-9106, U.S.A.
Tel: 781.329.4700 www.analog.com
Fax: 781.461.3113 ©2012–2013 Analog Devices, Inc. All rights reserved.
CN-0300
Circuit Note
CIRCUIT DESCRIPTION
•
•
The UART is usedasthe communication interface to the host
PC. This is usedtoprogramtheon-chipflash.It is also used as
a debug port and for calibrating the DAC and ADC.
Two externalswitches areused toforce the part intoitsflash
boot mode.By holding SDlow and toggling the RESET button,
the ADuCM360 entersboot mode insteadof normal user
mode. In boot mode, the internal flash can be reprogrammed
through the UART interface.
The J1 connector, an 8-pin dual-in-line connector, connectsto
the Analog DevicesJ-Link OB emulator that is providedwith
the CN0300support hardware. This allows programming
and debugging of this application board. See Figure 3.
The following features of the ADuCM360 areused in this
application:
•
The 12-bit DAC output with its flexible on-chip output
bufferis used to control an external NPN transistor, BC548.
By controlling the VBE voltage of this transistor, thecurrent
passing through a 47 Ω load resistor can be set to the
desired value. When NPN mode is selected,the buffered
on chip 1.2 V reference voltage is present on AIN8.
The DAC is 12-bit monotonic; however, the accuracy of
the DAC output is typically around 3 LSBs. In addition, the
bi-polar transistor introduces linearity errors. To improve
the accuracy of theDACoutput andto eliminateoffset and
gain end-point errors, ADC0 measures, on AIN9, a
feedbackvoltage reflecting the voltageacross the load
resistor (RLOAD). Based on this ADC0reading, the DAC
output is corrected by the source code. This provides
0.5°C accuracy on the 4 mA to 20 mA output.
•
•
Both the thermocouple and the RTD generate very small signals;
therefore, a programmable gain amplifier (PGA) is requiredto
amplify thosesignals.
The thermocouple usedin this application is a Type T (copper-
constantan) that has a temperature range of −200°C to +350°C.
Its sensitivity is approximately 40 µV/°C, which means that the
ADC in bipolar mode, with a PGA gain of 32, can cover the
entire temperaturerangeof the thermocouple.
•
•
The 24-bit Σ-Δ ADC with a PGA set for a gain of 32 in the
software for the thermocouple and the RTD. ADC1 switches
continuously between sampling the thermocouple and the
RTD voltages.
Programmableexcitation current sources force a controlled
current through the RTD. Thedualcurrent sourcesare
configurable in steps from 0 µA to 2mA. For this example,
a 200 µA setting is used to minimize the error introduced
by the RTD self-heating.
The RTD wasusedfor coldjunction compensation. The particular
one used in this circuit was a platinum 100 Ω RTD, Enercorp
PCS 1.1503.1. It is available in a 0805, surface-mount package.
This RTD has a temperaturevariation of 0.385 Ω/°C.
Note that the reference resistor, RREF, must be a precision 5.6 kΩ
( 0.1%).
•
•
An internal 1.2 V reference is provided for the ADC in the
ADuCM360. When measuring the thermocouple voltage,
the internalvoltage reference is used due to its precision.
An external voltage reference forthe ADC in the ADuCM360.
When measuring the RTD resistance, a ratiometricsetup
was used where an externalreferenceresistor (RREF) was
connected acrossthe external VREF+ and VREF−pins. The
on-chip reference input bufferis enabled because the reference
source in thiscircuitis high impedance.The on-chipreference
buffermeansno external buffer is requiredto minimize input
leakage effects.
Construct the circuit ona multilayer printed circuitboard (PCB)
with a large area groundplane. Use properlayout, grounding,
and decouplingtechniquesto achieve optimum performance (see
Tutorial MT-031, GroundingDataConvertersand Solvingthe
Mystery of "AGND" and "DGND," Tutorial MT-101, Decoupling
Techniques, and the ADuCM360TCZ Evaluation Board layout).
The PCB used for evaluating this circuit is shown in Figure 2.
•
•
A bias voltage generator (VBIAS). The VBIAS function is
used to set the thermocouple common-mode voltage to
AVDD_Reg/2 (900 mV). Again, this removes theneed for
externalresistors to set the thermocouple common-mode
voltage.
The ARM Cortex-M3 core. The powerful 32-bit ARM core
with integrated 126 kB flash and 8kB SRAM memory runs
the usercodethatconfiguresandcontrols theADCs and
converts the ADCconversions fromthe thermocouple and
RTD inputs to a finaltemperaturevalue. It also controls the
DAC output and continuously monitors this DAC output
using the closed-loop feedbackfrom the voltage levelon
AIN9. For extra debug purposes, it also controls the
communications over the UART/USB interface.
Figure 2. EVAL-CN0300-EB1Z Board Used for this Circuit
Rev. A | Page 2 of 7
Circuit Note
CN-0300
Figure 5. J2 Connector
Figure 3. EVAL-CN0300-EB1Z Board Connected to the Analog Devices J-Link
OB Emulator
For downloading and debugging, LK1, LK2, LK4, and LK6 must
be inserted. LK3and LK5are required to communicate via
UART. Requiredsoftwarefor the J-Link OB is included in the
software installation.
The Analog Devices J-Link OB emulator(USB-SWD/UART-
EMUZ) supports the following:
•
When plugged into a PC USB port, it can also be used
to connect to a COM port (virtualserialport)on the
PC. This is requiredfor runningthe calibration routines.
Provides SW (Serial Wire) debugging and
Note that the J-Link OB emulator replaces the J-Link Lite and
related interface boardspreviouslyshippedwiththe ADuCM360
development system.
•
•
•
For more details, see UG-457, ADuCM360 Development
Systems Getting StartedTutorial.
programming for the ADuCM360.
This USB port can be used to program the part using
the UART-based downloader. Code Description
Figure 4 shows a top view of the emulatorboard. J2
connector plugs into the EVA L -CN0300-EB1Z board.
The J2 connector pinout is shown in Figure 5
The source code used to test thecircuit can be downloadedasa
zip file from the ADuCM360 product page. The source code
uses the function libraries provided with the examplecode.
Figure 6 shows the list of source files used in the project when
viewed with the Keil µVision4tools.
Figure 6. Source Files Viewed in µVision4
Calibration Section of Code
The compiler #define values,calibrateADC1and calibrateDAC,
can be adjusted to enable ordisablecalibration routinesfor the
ADC and the DAC.
To calibrate eitherthe ADC or the DAC, the AnalogDevices J-Link
OB emulator(USB-SWD/UART-EMUZ) must be connected to J1
and to theUSBporton a PC. A COM port viewer program, such
as HyperTerminal, can be used to view the calibration menus
and step through the calibrationroutines.
Figure 4. Analog Devices J-Link OB Emulator Top View
When calibrating the ADC, the source code prompts the userto
connect zero-scaleand full-scalevoltages toAIN2and AIN3. Note
that AIN2is the positive input. On completion of the ca libration
routine, the newcalibration values forthe ADC1INTGN and
ADC1OF registers arestored to the internalflash.
Rev. A | Page 3 of 7
Circuit Note
CN-0300
When calibrating the DAC, connect the VLOOP+outputthrough
an accurate current meter.The first part of the DAC calibration
routine calibrates the DACto set a 4 mA output, and the second
part of the DAC calibration routinecalibrates the DAC to set a
20 mA output. The DAC code usedto set a 4 mA and 20 mA
output is stored to flash. Thevoltagemeasuredat AIN9for the
final 4 mA and 20 mA settings is also recorded and saved to flash.
Because the voltageat AIN9is linearly related to the current
flowing across RLOOP, these valuesareused to calculate the
adjustment factor for the DAC. This closed-loopschememeans
any linearity errors on the DAC and transistor based circuit are
fine-tuned out using the on-chip 24-bit Σ-Δ ADC.
For the thermocouple, temperatures for a fixed number of voltages
are stored in an array. Temperature valuesin between are calculated
using a linear interpolation between the adjacent points.
Figure 8shows the error obtained when using ADC1 onthe
ADuCM360 to measure 52 thermocouple voltagesover the full
thermocoupleoperating range. The overall worst-caseerror is
less than 1°C.
0.5
0.4
0.3
0.2
0.1
The UART is configured for a baud rateof 9600, 8 data bits, no
parity, and no flow control. If the circuit is connected directly to
a PC, a communication port viewing application, such as
HyperTerminal, can be used to view the results sent by the
program to the UART, as shown in Figure 7.
0
–0.1
–0.2
–0.3
–0.4
–0.5
To enter the charactersrequiredby the calibration routines,
type the required character in the viewing terminaland this
character willbe received by the ADuCM360 UART port.
–210
–140
–70
0
70
140
210
280
350
TEMPERATURE (°C)
Figure 8. Error when Using Piecewise Linear Approximation Using
52 Calibration Points Measured by ADuCM360/ADuCM361
The RTD temperatureis calculated using lookup tablesand is
implementedforthe RTD the same way asforthe thermocouple.
Note that the RTD has a different polynomial describing its
temperaturesas a function of resistance.
For details on linearization and maximizing the performance of
the RTD, refer to Application Note AN-0970, RTD Interf aci ng
and Linearization Usingan ADuC706x Microcontroller.
Temperature-to-Current Output Section of Code
Once the final temperature hasbeenmeasured, setthe DAC output
voltage to the appropriatevalue thatgives the requiredcurrent
across RLOOP. The inputtemperature range is expected to be −200°C
to +350°C. The code sets the outputcurrent to 4 mA for −200°C
and 20 mA for +350°C.The code implementsa closed-loop scheme,
as shown in Figure 9, where the feedbackvoltage on AIN9is
measuredby ADC0, and this value is used to compensate the
DAC output setting. The FineTuneDAC(void) function performs
this correction.
Figure 7. Output of HyperTerminal when Calibrating the DAC
Temperature Measurement Section of Code
To get a temperaturereading, measure the temperatureof the
thermocouple and the RTD. TheRTDtemperature is converted to
its equivalentthermocouple voltage via a look-up table (see the ISE,
Inc., ITS-90 Table for Type T Thermocouple). These two voltages
are added together to give the absolute value atthe thermocouple.
For best results, calibrate the DAC before beginning performance
testing of this circuit.
First, the voltage measured between the two wiresof the
thermocouple(V1). The RTD voltage is measured, converted to
a temperaturevia a look-up table, andthen, this temperatureis
converted to its equivalent thermocouplevoltage(V2). V1and
V2 are then added to give the overallthermocouplevoltage, and
this is then converted to the finaltemperaturemeasurement.
Rev. A | Page 4 of 7
Circuit Note
CN-0300
VLOOP+
circuit performance when the initial calibration is performed
and when using the closed-loop controlof the VDAC output
resultsin temperature valuesof0.5°C being reportedbythe DAC
output circuit. Nonlinearity errors from the DAC and the external
transistor circuit are adjustedout thanks to the 24-bit ADC.
Because temperatureis a slow changing input parameter,this
closed scheme is ideal for this application. Figure 11 shows the
ideal DAC output in blue and the real DAC output with no closed-
loop control(ADC0is not used tocompensatetheDACoutput).
The error can be >10°C without closed-loop control.
25
NPN
BC548
DAC
RLOOP
47Ω
VLOOP–
100kΩ
100kΩ
ADC0
AIN9
AIN8
(BUFFERED V
)
REF
Figure 9. Closed-Loop Control 4 mA to 20 mA DAC Output
20
For debug purposes, the following strings are sent to the UART
during normaloperation (see Figure 10).
15
ACTUAL CURRENT
10
IDEAL CURRENT
5
0
–200 –150 –100 –50
0
50
100 150 200 250 350
TEMPERATURE (°C)
Figure 11. Temperature in °C vs. Current Out in mA (Bl ue = Ideal Value, Open
Loop Operation: DAC Output Uncompensated)
Figure 12 shows the sameinformation when the closed-loop
controlis used as is recommended. The error is tiny, less than
0.5°C from the ideal value.
Figure 10. UART Strings Used for Debug
25
COMMONVARIATIONS
For a standard UART-to-RS-232interface,the FT232R transceiver
can be replaced with a device such as the ADM3202, which
requires a 3V power supply. For a wider temperaturerange, a
different thermocouple can be used, such asa TypeJ. To minimize
the cold junction compensationerror, a thermistor can be placed in
contact with the actualcold junction instead of on the PCB.
20
ACTUAL CURRENT
IDEAL CURRENT
15
10
5
Instead of using the RTD and externalreference resistor for
measuring the cold junction temperature, an external digital
temperature sensor canbe used. Forexample, the ADT7410can
connect to the ADuCM360 via the I2C interface.
0
For more details on cold junction compensation, referto Sensor
SignalConditioning, Analog Devices, Chapter 7, “Temperature
Sensors.”
–200
–100
0
100
200
300
400
TEMPERATURE (°C)
Figure 12.Temperature in °C vs. Current out in mA (Blue = Ideal Value,
Closed-Loop Operation: DAC Output Compensated by ADC0 Measurement
If isolation between the USB connector and this circuitis required,
the ADuM3160/ADuM4160 isolation devicesmustbe added.
Thermocouple Measurement Test
The basictest setup is shown in Figure 13. The thermocoupleis
connected to J2.
CIRCUIT EVALUATION AND TEST
Current Output Measurements
Two methodswere used to evaluate the performance of the circuit.
Initially, the circuit was tested with the thermocoupleattached
to the board,and it was used to measure the temperature of an ice
bucket. Then, it was used to measurethe temperature of boiling
water.
The DAC and external-voltage-to-current-convertor circuit
performance testswereallcompleted together.
A currentmeter was placed in serieswiththe VLOOP+ connection,
as shown in Figure 1. The meter used wasa HP 34401A. The
Rev. A | Page 5 of 7
Circuit Note
CN-0300
0
–0.01
–0.02
–0.03
–0.04
–0.05
–0.06
–0.07
–0.08
–0.09
–0.10
A Wavetek 4808 multifunction calibrator was used to fully evaluate
the error, asshown in Figure 13. In this mode, thethermocouple
was replacedwith thecalibratoras the voltage source. To evaluate
the entire range of a Type T thermocouple, the calibrator was
used to set the equivalent thermocouple voltage at 52points
between −200°C to +350°C for the negativeand positive ranges
of the T-type thermocouple (see the ISE, Inc., ITS-90 Table for
Type T Thermocouple). Figure 8shows thetest results.
When doing performance checks and using the CN0300 circuit
for normaloperation,pleaseensure theJ-Link OB emulator is
unplugged from the EVA L -CN0300-EB1Z board—only usethe
J-Link OB when programming, calibrating and debugging the
EVA L -CN0300-EB1Z board.
–25
–5
15
35
55
75
95
115
TEMPERATURE (°C)
Figure 15. Error in °C of RTD Measurement Using Piecewise Linearization
Code and ADC0 Measurements
EVAL-CN0300-EB1Z
J2
THERMOCOUPLE
JUNCTION
Current Measurement Tests
When operating normally, the entire circuit consumes2.25 mA
typically. When held in a reset state, the entirecircuit consumes
less than 600 µA.
AIN7/VBIAS
SEE TEXT
USB
CABLE
When doing performance checks and using the CN0300 circuit
for normaloperation,pleaseensure theJ-Link OB emulator is
unplugged from the EVA L -CN0300-EB1Z board—only usethe
J-Link OB when programming, calibrating and debugging the
EVA L -CN0300-EB1Z board.
WAVETEK 4808
MULTIFUNCTION
CALIBRATOR
PC
For more details on the current consumption figures for the
ADuCM360, see Application Note AN-1111.
Figure 13. Test Setup Used to Calibrate and Test the Circuit Over Full
Thermocouple Output Voltage Range
RTD Measurement Test
To evaluate the RTD circuit and linearization source code, the
RTD on the board was replaced with an accurate,adjustable
resistance source. The instrument used was the 1433-Z decade
resistor. The RTD values are from90 Ω to 140 Ω, which represents
an RTD temperature range of −25°C to +114°C.
The test setup circuit formeasuringthe RTD is shown in Figure 14,
and the error resultsfor the RTDtestsare shown in Figure 15.
AVDD
IOVDD
0.1µF
0.1µF
AVDD
IOVDD
1433-Z
DECADE
RESISTOR
AIN5/IEXC
10Ω
AIN0
0.01µF
AIN1
10Ω
ADuCM360
0.01µF
VREF+
VREF–
R
5.6kΩ
0.1%
REF
Figure 14. Test Setup for Measuring RTD Error
Rev. A | Page 6 of 7
Circuit Note
CN-0300
LEARNMORE
Data Sheets and Evaluation Boards
ADuCM360/ADuCM361 Data Sheet
CN0300 Design Support Package:
http://www.analog.com/CN0300-DesignSupport
ADuCM360/ADuCM361 Evaluation Kit
ADIsimPower Design Tool.
ADM3202 UART to RS232 Transceiver DataSheet
ADP1720 Data Sheet
Kester, Walt. 1999. Sensor SignalConditioning. Analog Devices.
Chapter 7, "TemperatureSensors."
REVISION HISTORY
Kester, Walt. 1999. Sensor SignalConditioning. Analog Devices.
5/13—Rev. 0 to Rev. A
Chapter 8, "ADCs for Signal Conditioning."
Changed USB-SWD/UART and SEGGER J-Link Lite Board to
J-Link OB Emulator.........................................................Universal
Changes to Circuit Description Section........................................2
Changes to Figure 3 and Calibration Section of Code Section;
Added Figure 4 and Figure 5, Renumbered Sequentially............3
Changes to Figure 9........................................................................4
Changes to Thermocouple Measurement Test Section and
Current Measurement Tests Section.............................................6
Change to Data Sheets and Evaluation Boards Section...............7
Looney, Mike. RTD Interfacingand LinearizationUsingan
ADuC706x Microcontroller. AN-0970 Application Note.
Analog Devices.
MT-022 Tutorial, ADC Architectures III: Sigma-Delta ADC
Basics. Analog Devices.
MT-023 Tutorial, ADCArchitecturesIV: Sigma-Delta ADC
Advanced Conceptsand Applications. Analog Devices.
MT-031 Tutorial, GroundingData Converters and Solvingthe
Mystery of "AGND" and "DGND." Analog Devices.
10/12—Revision0: Initial Version
MT-101 Tutorial, DecouplingTechniques. Analog Devices.
ITS-90 Table for Type T Thermocouple.
(Continued from first page) Circuits from the Labcircuitsare intendedonly for use withAnalogDevices productsandare the intellectualproperty ofAnalog Devices orits licensors.While you
may use the Circuits from the Lab circuits in the design of your product, no other license is granted by implication or otherwise under any patents or other intellectual property by
application or use ofthe Circuitsfrom the Lab circuits.Information furnished by Analog Devices isbelieved to be accurate and reliable. However, Circuits from the Lab circuitsare supplied
"as is" andwithout warranties ofany kind, express, implied, orstatutory including, but not limited to,any implied warranty ofmerchantability, noninfringement or fitnessfor a particular
purpose and noresponsibility isassumed by Analog Devicesfor their use, norfor any infringementsof patents or other rightsof third parties thatmay resultfrom their use.AnalogDevices
reserves the right to change any Circuits from the Lab circuits at any time without notice butis under no obligation to do so.
©2012–2013 Analog Devices, Inc. All rights reserved. Trademarks and
registered trademarks are the property of their respective owners.
CN10955-0-5/13(A)
Rev. A | Page 7 of 7
相关型号:
CN-0311
Broadband, Low Error Vector Magnitude (EVM) Direct Conversion Transmitter Using LO Divide-by-2 Modulator
ADI
©2020 ICPDF网 联系我们和版权申明