23.11.2012 Views

The FEE Server Control Engine of the ALICE-TRD - Westfälische ...

The FEE Server Control Engine of the ALICE-TRD - Westfälische ...

The FEE Server Control Engine of the ALICE-TRD - Westfälische ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5 <strong>The</strong> <strong>FEE</strong><strong>Server</strong> <strong>Control</strong> <strong>Engine</strong><br />

<strong>the</strong> ADC values UADC to a temperature is done with <strong>the</strong> formula<br />

temperature in°C =<br />

) − 11.6753<br />

°C − 273.15°C (5.2)<br />

−0.0394864<br />

ln( 3.3−UADC<br />

UADC<br />

<strong>The</strong> calibration values and most <strong>of</strong> <strong>the</strong> functions in <strong>the</strong> classes adc_device, voltage_sensor<br />

and temp_sensor were taken from existing C programs.<br />

<strong>The</strong> temperature sensor readout in <strong>the</strong> MCMs requires more elaborate readout functions.<br />

In principle, each MCM temperature sensor requires an individual calibration.<br />

Fur<strong>the</strong>rmore <strong>the</strong> sensors do not work reliably and <strong>the</strong>refore a runtime identification <strong>of</strong><br />

non-working sensors is required. In this section only <strong>the</strong> main functions used for <strong>the</strong><br />

temperature readout are described. A detailed description <strong>of</strong> <strong>the</strong> temperature sensors<br />

<strong>the</strong>mself is given in chapter 6.<br />

<strong>The</strong> class Temp<strong>Control</strong> (trdce) encapsulates <strong>the</strong> readout <strong>of</strong> <strong>the</strong> temperature sensors.<br />

Each time <strong>the</strong> function void Temp<strong>Control</strong>::measure(void) is called, <strong>the</strong> current temperature<br />

sensor value <strong>of</strong> all MCMs on <strong>the</strong> readout chamber is read out and printed to <strong>the</strong> logging<br />

system. An example <strong>of</strong> <strong>the</strong> output in case <strong>of</strong> printing absolute ADC values is given in<br />

listing 6.1 on page 79. <strong>The</strong> output format can be set via <strong>the</strong> extended SCSN command<br />

SCSN_CMD_MCMTEMP (see table B.2). To read out <strong>the</strong> sensors, first a write frame is<br />

send to all MCMs to trigger a measurement and afterwards <strong>the</strong> measured values are read<br />

out via SCSN read frames.<br />

Temp<strong>Control</strong> provides <strong>the</strong> function Temp<strong>Control</strong>::learnConfig(struct cfdat_temp_calib * ) to<br />

set calibration values for each MCM individually. However, it turned out that an individual<br />

calibration <strong>of</strong> <strong>the</strong> temperature sensors is not feasible (see chapter 6). <strong>The</strong>refore<br />

Temp<strong>Control</strong>::learnConfig(struct cfdat_temp_calib * ) is mainly kept for historical reasons.<br />

As a consequence, <strong>the</strong> function void Temp<strong>Control</strong>::measure(void) cannot print meaningful<br />

temperatures but prints out <strong>the</strong> raw ADC values <strong>of</strong> <strong>the</strong> temperature sensors or <strong>the</strong> difference<br />

between <strong>the</strong> first measured ADC value after switching on <strong>the</strong> MCMs and <strong>the</strong> current<br />

ADC value, depending on configuration.<br />

<strong>The</strong> identification <strong>of</strong> non-working temperature sensors is performed during <strong>the</strong> transition<br />

from STDBY to STDBY_INIT. <strong>The</strong> function CEStateMachine::triggerTransition() calls<br />

Temp<strong>Control</strong>::apply(void). This function reads out each MCM temperature sensor ten<br />

times and stores <strong>the</strong> results in <strong>the</strong> instances <strong>of</strong> MCMChip. For each MCM <strong>the</strong> class<br />

Temp<strong>Control</strong> contains one instance <strong>of</strong> class MCMChip which stores <strong>the</strong> last ten sensor readings<br />

and status information.<br />

Afterwards <strong>the</strong> function bool Temp<strong>Control</strong>::calcStatus(void) is called. This function calls<br />

bool MCMChip::calcStatus(void) for each instance. bool MCMChip::calcStatus(void) uses <strong>the</strong><br />

previously stored ten values to check if <strong>the</strong> temperature sensor does work or not and<br />

sets <strong>the</strong> corresponding status in class MCMChip. <strong>The</strong>n bool Temp<strong>Control</strong>::calcStatus(void)<br />

counts <strong>the</strong> number <strong>of</strong> non-working sensors. If this number is below a threshold which<br />

can be set via <strong>the</strong> extended SCSN command SCSN_CMD_MCMTEMP (see table B.2), <strong>the</strong><br />

MCMs are switched <strong>of</strong>f for a short time. It turned out that this procedure increases <strong>the</strong><br />

number <strong>of</strong> working sensors significantly (see chapter 6). After <strong>the</strong> MCMs were switched<br />

on again, <strong>the</strong> identification procedure is repeated.<br />

In <strong>the</strong> output <strong>of</strong> void Temp<strong>Control</strong>::measure(void) non-working sensors are represented<br />

by -1 in case <strong>of</strong> <strong>the</strong> absolute ADC values are printed since <strong>the</strong> possible range for real<br />

values is 0 to 1023, or by 999 in case <strong>of</strong> ADC differences are printed out.<br />

59

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!