A Microcontroller Based Temperature Measurement Module
for the LEP2 SC RF Cavities
R. Brun and E. Ciapala, CERN, Geneva, Switzerlandand M. Pirotte, CPL Electronics, Gex, France
Abstract
For each of the 272 SC cavities of the LEP2 RF systema total of 24 temperatures at various points around thecavity and in the cryostat must be continuously monitored.
In the event of certain limit values being exceeded
appropriate actions must be taken to protect valuable
equipment. These temperature measurements are mostconveniently done within the G64 based equipment
controller (EC) that provides the interface and low level
control functions for the cavity. Since reliability and failsafe action is of utmost importance the tempera-turemeasurement and equipment protection functions must becompletely independent of the other EC tasks, althoughtemperature data and limits status must be available to theEC. A dedicated temperature measure-ment module has
been developed to meet these require-ments. The designis based on a general-purpose intelli-gent base acquisition
module with an on-board industrial microcontroller. A
mezzanine board provides the specific functions such astemperature measurement signal condi-tioning and digital
I/O for external control functions. A protected dual port
memory allows the main EC CPU access to all local
information without direct interaction with the local CPU.
The design can be easily adapted for other similar
applications, making use of the same base acquisitionboard but with different firmware and specific versions of
the mezzanine board.
1 Introduction
The RF system for LEP 1997 consists of a total of 240
super-conducting (SC) cavities together with 84 of theoriginal room temperature copper RF accelerating/storage
cavity assemblies. The SC system has routinely supplied acircumferal accelerating voltage of over 2300 MV during
the 1997, allowing an operating energy of 91.5GeV. A
further 32 SC cavities will be installed in 1998.
Four SC cavities in a common cryostat make up an RF
module, up to two modules being driven from a single
klystron. One or two klystrons are powered from a single
HV power converter, the HV converter, klystrons, cavity
modules and associated equipment making up an RF unit.
Within the RF unit the various pieces of equipment
associated with each major element of the RF unit aregrouped together and controlled by a G64 'Equipment
Controller' (EC) [1]. There is one EC for each cavity, toacquire data such as RF powers, cavity fields, tuningparameters, interlock states and temperatures.
Cavity temperatures (24 per cavity) are measured inside

the cryostat tank, on helium gas lines, magneto-strictive(MS) and thermal (TH) tuner bars and on critical components such as the main coupler. Measurements are used
for control of feedback loops such as cavity tuning and formonitoring and alarms. Most importantly, some are used
to protect equipment from overheating or the effects ofbeing too cold. When temperatures are outside pre-set
limits, RF power, MS, TH and helium bath heater power
supplies must be switched off via the interlock system.
Temperatures are measured using Pt100s connected inseries around the various points in the cavity and driven
by a 1mA current source. 2-wire measurement is used tominimise cryostat cabling and measurements are more
prone to noise than for conventional 3 or 4-wire connection. Many of the temperatures measured are well below
the linear range of the Pt100 sensors.
The fundamental requirement is no failure in the primary function to protect equipment. Much of the equipment
is inaccessible and difficult to repair. Failure of an RF
window would result in loss of vacuum and make itnecessary to remove the cavity module for repair and reprocessing.
An original temperature measurement interface wasbased on conventional logic. The temperature channels
were scanned, voltages digitised, stored in shift registers
then compared sequentially with upper and lower limit
values in EPROM. Standard TTL logic was used with alarge number of ICs. False out-of-limit detection occurred
due to noisy readings and internal logic glitches. As SC
cavity installation progressed these problems had increasingly detrimental effects on the operational reliability of
the RF system.
2 Microcontroller acquisition system
The new cavity temperature measurement system isbased on a standard intelligent acquisition base module
onto which is mounted a special I/O mezzanine. The basemodule has on-board microcontroller, memory, G64 interface and it provides the basic analog input channels anddigital I/O. Application specific input signal filtering andamplification, logic operations and buffering of digital
I/O are all done on the mezzanine board.
2.1 Intelligent acquisition module
The specifications of the base module are:• 32 analog input channels, i.e. 24 temperature input
channels with spares to cover other applications.
• 12-bit resolution.
• Control output lines for fault (interlock) states, each set

according to preset high/low limits on predeterminedsets of channels.
• Less than one second update time for all channels andcontrol outputs.
• Fail-safe protection, i.e. automatic setting of all faultstates in the event of acquisition failure.
• Readout of all values and states via the G64 bus.
• Complete independence of the local acquisition andcontrol processes from the EC software and G64 bus.
The design is based on an existing G64 module for themeasurement of liquid helium level in the cavity cryostats.
A microcontroller has been incorporated to allow on-board
acquisition and control. A prototype version verified thebasic principles of operation but some problems wereencountered with buffer memory control logic and microcontroller peripheral access logic.

fault history is also stored in the DPM. G64 instructions
for the microcontroller, for example interlocks reset, arewritten as data in the DPM. General information such as
time-of-day for fault time-stamping is also written.
Some main features of the DPM implementation are:
• Data protection
Memory is divided into two parts. Either can be read byboth microcontroller and G64 interface but each can only
write to its own part.
• Two access protocols
Both polling (using handshake and status flags) andinterrupt driven mechanisms are available for DPM accessarbitration.
• Timeout handlingIf G64 access cannot be obtained within a fixed timeout period a fault indication is given. If themicrocontroller cannot gain access it assumes that the G64
process has failed and forces access.
Software running on the EC provides local display of
all temperature values, limit states, and fault history. Datais transmitted to control room applications on request.
The microcontroller′s internal UART and a local
monitor program allow in-situ control and debugging.
2.2 Temperature measurements mezzanine board
This connects external I/O (on the top connector of thebase module) and local I/O. It provides pre-treatment of
the Pt100 voltages and a number of logic functions.
Interlock lines are latched and can be reset locally orremotely. A watchdog provides fail-safe action, a countermust be reset every 10 seconds by the microcontroller. If
not, all the interlock lines are hardware activated.

Figure 1. Intelligent acquisition module
The block diagram of the CERN redesigned final
version is shown in Figure 1. Analog data from themezzanine is taken via two 16-channel multiplexers to adifferential amplifier and 12-bit ADC. One input of each
multiplexer is connected to remote ground allowing eachchannel to be measured with respect to that ground. An80C52 microcontroller controls the multiplexers andADC, collecting the data sequentially for each channel.
Voltage readings are converted to temperature values in
Kelvins, using a close fitting logarithmic approximation to
the standard Pt100 characteristic. The temperature
readings are compared with limit values stored in
microcontroller EPROM and the appropriate interlock is
set via the mezzanine board if an out-of-limit value isdetected. Automatic calibration is used. Spare measurement channels are used to read a fixed voltage reference
and ground periodically, giving gain and offset correction
factors for the conversion software.
All temperature readings and limit states are stored ina Dual Port Memory (DPM). The G64 bus has access via
the DPM only and has no direct action on the temperature
measurement and limit detection processes. Data such as

Figure 2. Temperature measurement mezzaninesimple interface uses level comparison. This is imprecise
due to the spread in values of the resistors. Since thesignal levels are low spurious fault indication due to noise
is sometimes encountered. A new version of this interface
uses the intelligent acquisition base module with aspecific HOM temperatures mezzanine module. The
mezzanine has the current sources for the Allen Bradley
resistors, the necessary input signal filtering andamplification and the control outputs. The microcontroller
program detects quench on the basis of a sudden increaseby a given amount from one cycle to the next, reconfirmed by a second reading. For this application there
are fewer channels but the measurements must be rapid.
A cycle time of less than 10mS is easily achieved withfour channels.
3 Present status

Figure 3 Temperature mezzanine and acquisition module.
The signals on each side of the Pt100 are filtered,amplified and the difference voltage produced by adifferential mplifier. The overall gain is 50, providing
5V for 100 ohms (273K). The variation in reading due tonoise in the LEP tunnel is less than plus or minus 2 bits,
allowing measurement repeatability within 0.3 Kelvin.
Remaining spare analog channels are used to measurelocal power supplies.
2.3 HOM coupler temperatures
Additional temperatures are measured separately on thehigher order mode power couplers and cooling circuits.
Here Allen Bradley 100 ohm carbon resistors are used tomeasure cryogenic temperatures. These have highresistance at cryogenic temperatures, varying in apronounced but non-linear way from 100 ohms at 4.5K to220 ohms at 20K. These temperatures are measured in a
separate ′HOM Temperature interface′ module in the EC.
The main purpose is to switch off RF in the event of aquench of the HOM coupler. A quench is indicated by arapid and sustained temperature rise. Detecting this withanalog circuitry is relatively complex and the present

At present over 100 microcontroller acquisition
modules with temperature measurement mezzanine havebeen installed. These have replaced the most fault-proneof the original temperature measurement modules,
resulting in a considerable improvement in the operationalreliability of the RF system.
During the 97/98 LEP shutdown all remaining cavities
will be equipped, which together with the 32 new cavities
will make a total of 272 installed modules andmezzanines.
The mezzanine module for the HOM temperature
measurements is in the prototype stage and installation isplanned for 1998.
A VME version of the base module and a stand-alone
version with a WorldFIP field bus connection are planned.
Acknowledgments
The success of this project is due in great part to thehigh level of competence and the dedicated efforts of P.
Fantini, both in the prototype development stage and in
the test of production material and its installation in LEP.
High quality printed circuit design work by W. Billereau
has greatly contributed to the excellent performance of thehardware. We are also grateful to him for complete
documentation. Thanks are also due to C. Stocklin who
provided basic microcontroller software routines.
References[1] G. Cavallari and E. Ciapala, "Digital Control of theSuperconducting Cavities for the LEP Energy
Upgrade," International Conference on Accelerator
and Large Experimental Physics Control Systems.
(1991)[2] R. Brun, "Temperature Measurement and Protectionof SC cavities by Microcontroller”, internal technicalreport. (1998)