12 — Diagnostics

A system that checks itself.

+ The questionHow does a system find its own failures, and what is diagnostic coverage worth?

A reading no air could produce

An open-circuit thermistor reads as air far colder than any incubator could hold, and the controller can tell that it has measured nothing. No real air could produce that reading (Chapter 1). A controller can be built to look for such readings: it compares each reading with a band of values, set wider than the incubator's working range but narrower than the readings of a broken wire or a short. The controller takes a reading outside the band as a failure of the sensor or its wiring, not as a temperature. That test is a range check, the simplest of the checks that a system runs on itself, and it sees the open circuit and the short alike.

The same check does different work in the two channels of Chapter 4. As Chapter 1 showed, an unchecked open circuit in the control loop drives the heater at full power, so the sensor's failure itself starts the climb that the protective channel exists to stop. With the check, the controller can switch the heater off and announce the fault, and the failure never leads to a demand. In the protective channel, the unchecked open circuit is the dangerous undetected failure of Chapter 2, and with the check the same failure becomes dangerous detected. The check does not make the thermistor fail any less often. What it shortens is the time that the failure stays hidden, from the next test or demand to the next run of the check.

Detection is worth only what the system does with it. A protective channel that finds its own sensor failed can open the cutout and put the incubator in Chapter 4's safe state, at the cost of an infant who cools until the staff take over. The channel can instead raise an alarm and leave the heater under the controller, and the incubator then runs without its protection until the sensor is repaired. The first choice turns a detected failure into a trip without a demand. Chapter 13 weighs the trips that a design accepts against the failures it misses.

A reading that holds still

A range check sees only readings that no air could produce. A drift leaves the reading inside the band, and so does the fourth failure mode of Chapter 1, a sensor stuck while the quantity it measures moves on. Seeing either takes a check that uses information the reading alone does not carry. A plausibility check asks whether a reading fits what the process can do: whether the air in a closed incubator can change as fast as the reading says, or whether a level can stand still while liquid flows into a tank. A cross-check sets the reading against a second measurement of the same quantity, so that a difference larger than two healthy sensors would show reveals that one of them has failed.

In the opening, the gauge on Tank 912 stuck at a level inside the tank's range. Each value it gave was one that a working gauge could also give, so no check on the size of a reading could tell the stuck gauge from a tank at rest. A stuck reading differs from a steady one only when it is set against the process. During a fill, a level that holds still contradicts the inflow, and a second, independent measurement of the level would disagree with it. Chapter 20 follows the sticking of the gauge itself.

The incubator already has two sensors in the same air, the controller's thermistor and the protective channel's (Chapter 4). Cross-checking them needs no new part. Neither range check can see a drift in either sensor, but the cross-check shows the drift as a difference between the two readings. The two thermistors sit at different places in the air stream, so the cross-check's tolerance must allow for some difference even when both work, and a drift smaller than that tolerance passes. The cross-check shows only that one sensor has failed, not which, and a third reading and a vote decide that (Chapter 13). The cross-check also joins the protective channel to the control loop, one more of the links that Chapter 14 examines.

Checks on the output and on the program

A check on the sensor sees nothing of a failure in the path that drives the heater. Chapter 5's records hold such a failure: in 2008 one maker recalled incubators whose heater power board might not regulate the temperature properly. A check on the output compares what the logic commanded with what the output does. A controller that has switched the heater off can measure whether current still flows to it, and a mismatch is a failure in the output path. Such a check is called readback, and it works only on an output that changes. The protective channel's cutout stays closed in normal operation, so reading back its contacts shows only that they are closed, as welded contacts are too (Chapter 2). A weld shows when the cutout is commanded to open, at a trip or a test. Until then the weld is one of the failures left to the proof test of Chapter 11.

Logic that runs as a program can also stop. A watchdog is a timer that runs apart from the program, and the program must restart it, or service it, within a set time. A program hung in an endless loop stops servicing the watchdog, and the watchdog then resets or interrupts the processor. A windowed watchdog also treats servicing that comes too soon as a fault, so it catches a program running too fast. A 2002 application note by the chip maker Maxim, on its own watchdog supervisors, gives an example: an interrupt routine that runs more often than intended. Software design keeps the part of a program that can cause harm small and separate from the rest, with watchdogs among its guards. Chapter 5 of the Academy guide The next patient, the next update explains how.

Coverage is a share of the dangerous failures

Each check finds some failures and misses others, and the share it finds can be counted. The diagnostic coverage of a channel, or DC, is the ratio of the dangerous failures that its own checks detect to all its dangerous failures. As rates, DC = λDD/λD, where λD = λDD + λDU, the rates of Chapter 2's two dangerous classes. Diagnostic coverage does not count the failures that a proof test finds. The two coverages apply one after the other: diagnostic coverage to all the dangerous failures, and the proof-test coverage of Chapter 11 to those that the diagnostics miss.

Numbers for the ratio come from the PR5337 temperature transmitter of Chapter 10. The assessor exida analyzed the transmitter for its maker, PR electronics, in 2016. For a resistance-thermometer input, that analysis gives 203 FIT of dangerous detected failures, 71 FIT of dangerous undetected failures and no safe failures. A failure counted as detected reaches the logic solver as a current outside the normal range, much as the thermistor's open circuit reaches the controller as an impossible reading. The failure counts as detected only where the logic solver is set to recognize such currents, as NAMUR NE43 describes (Chapter 10).

26 — Diagnostic coverage as a share of the dangerous failures
DANGEROUS FAILURES, 274 FIT DETECTED 203 FIT UNDETECTED 71 FIT DIAGNOSTIC COVERAGE 203 / 274 = 74 % FOUND BY THE TRANSMITTER'S CHECKS, WITHIN 5 MINUTES AT WORST LEFT TO THE PROOF TEST detected only if the logic solver reads out-of-range currents (NAMUR NE43) ALL FAILURES, 274 FIT SAFE FAILURES: NONE IN THIS ANALYSIS SAFE FAILURE FRACTION (0 + 203) / (0 + 274) = 74 % 0 50 100 150 200 250 274 FIT, FAILURES IN 10⁹ HOURS One transmitter's FMEDA, made by an assessor for the maker. Rates at an average of 40 °C.
Dangerous failureSafe stateDiagnosticsFocal detail
Plate 26 — Of the transmitter's 274 FIT of dangerous failures, its own checks detect 203, a diagnostic coverage of 74 %, and with no safe failures in the analysis the safe failure fraction is also 74 %. The 203 count as detected only with a logic solver set to read out-of-range currents, and the 71 that the checks miss are left to the proof test.

A second ratio counts the safe failures as well. The safe failure fraction, or SFF, is the share of all failures that are either safe or dangerous detected: SFF = (λS + λDD)/(λS + λD), where λS is the rate of safe failures. The SFF measures how much of what can go wrong pushes the channel toward its safe state or announces itself. IEC 61508's architectural constraints set the least redundancy that a subsystem must have, by one of two routes. On the first route, that redundancy follows from the SFF, the integrity level sought and whether the element is of type A or type B (Chapter 13). The second route rests on failure data from the field and leaves the SFF out. Whichever route is taken, the constraints apply alongside the target for the average probability of failure on demand, and Chapter 13 takes up both routes with hardware fault tolerance.

Solved example: what the transmitter's checks are worth

The transmitter's diagnostic coverage is 203 ÷ (203 + 71) = 203 ÷ 274, about 74 %. Its safe failure fraction is (0 + 203) ÷ (0 + 274), also 74 %, because the analysis gives no safe failures. Tested once a year, the undetected failures give an average probability of failure on demand of 71 × 8,760 ÷ 10⁹ ÷ 2, about 3.1 in 10,000 (Chapter 11). The example takes the second reaction of the first section, an alarm, so a detected failure leaves the channel unable to act only until it is repaired. At a repair time of 24 hours, chosen for the example, the detected failures add 203 × 24 ÷ 10⁹, about 0.05 in 10,000, for a total near 3.2 in 10,000. With the same 274 FIT and no checks at all, every dangerous failure would hide until the yearly test. The channel would then average 274 × 8,760 ÷ 10⁹ ÷ 2, about 1.2 in 1,000, nearly four times as much. The checks bring the sensor channel's average from Chapter 8's SIL 2 band for low demand into its SIL 3 band. That holds for rates at an average of 40 °C, and only with a logic solver set as NE43 describes. The architectural constraints are a separate test (Chapter 13).

A safe failure fraction rises with every safe failure

A high SFF is easily read as few dangerous failures, but the ratio grows as much when safe failures are added as when dangerous ones are detected. If the transmitter had 726 FIT of safe failures besides its 274 FIT of dangerous ones, its SFF would rise from 74 % to (726 + 203) ÷ (726 + 274), about 93 %. The 726 FIT is a figure chosen for the example. The transmitter's 71 FIT of dangerous undetected failures and its diagnostic coverage of 74 % would stay the same, and each added safe failure would push the function toward a trip without a demand.

The coverage decides how much of the dangerous rate the proof test must carry. For the transmitter, the share left to the proof test is the 71 FIT that Chapter 11 tested once a year, and the proof-test coverage of Chapter 11 applies to that remainder alone.

A check has to keep up

A check finds a failure only when it runs. The time from one run of a check to the next is its diagnostic test interval, and a failure can wait unseen for up to that long. Where a check is what keeps a failure from becoming a hazard, the diagnostic test interval and the time taken to reach or keep the safe state must together be less than the process safety time of Chapter 4. IEC 61508 sets this rule, and an engineer at the chip maker Analog Devices quotes it in a 2021 blog post. In the incubator's control loop an open circuit drives the heater from the moment it occurs, so a check meant to stop the heating must run, and the heater must lose power, before the air can climb to harm.

Where demands arrive more often than once a year, a check that runs more than 100 times as often as they arrive is an alternative to that rule under IEC 61508:2010. For a dangerous condition that occurs once a week, or once in 168 hours, a diagnostic test interval below 1.68 hours makes the wait insignificant. The example comes from the summary page of a white paper by exida. The transmitter's analysis assumes that internal faults are detected within 5 minutes at worst (Chapter 10). A process that allows less than those 5 minutes plus the time to act therefore cannot rely on the transmitter's checks to reach the safe state in time.

Hardware that compares itself

A processor can fail in ways that no check on its inputs or outputs sees: a fault in its arithmetic turns a correct reading into a wrong decision, and the program still services its watchdog on time. Self-checking hardware adds a second copy of the processor and checks it against the first on every clock cycle. In lockstep, two processor cores run the same program on the same inputs, and a comparator checks their outputs, so that any difference reveals a fault in one of them. Texas Instruments' TMS570LS04x microcontrollers pair their main core with a checker core for "cycle by cycle checking of correct CPU operation", according to the maker's safety manual. The manual adds that a mismatch goes to the chip's error signaling module.

27 — A lockstep pair of processor cores
INPUTS MAIN CORE DELAY, 2 CYCLES CHECKER CORE OUTPUTS COMPARE, EVERY CYCLE MISMATCH ERROR SIGNALING MODULE ST'S DESIGN: FAULT COLLECTION AND CONTROL UNIT SAME PROGRAM IN BOTH: A FAULT IN THE PROGRAM GIVES THE SAME OUTPUT TWICE AND PASSES a difference in any cycle reveals a fault in one core ON THE CHIP, TI'S DESIGN AT LEAST 100 µm OWN CLOCK WIRING OWN POWER WIRING MAIN CHECKER, TURNED Schematic, after the makers' safety manuals: Texas Instruments TMS570LS04x (2015) and STMicroelectronics SPC574K72 (2014).
Dangerous failureDiagnosticsSafety functionFocal detail
Plate 27 — Two cores run the same program, the checker two cycles behind, and a comparator checks their outputs on every cycle, so a fault in either core that changes its outputs shows as a mismatch. A fault in the program itself runs on both cores and passes the comparator.

The two cores of such a pair are kept apart in time and in place. In TI's design the checker runs two cycles behind the main core, so the two never execute the same step at the same instant. The delay gives the pair what TI calls temporal diversity. STMicroelectronics' SPC574K72 delays its checker by the same two cycles, according to that maker's safety manual. TI's cores also sit at least 100 µm apart on the chip, one flipped and rotated against the other, each with its own wiring for the clock signal and for power. Chapter 14, on causes that strike two channels at once, returns to such differences.

Memory has a check of its own. An error-correcting code, or ECC, stores extra bits, the check bits, with each word of memory. The check bits are computed from the word's contents, so a bit that flips breaks the agreement between the word and its check bits. On ST's chip the flash memory carries a code that corrects any single-bit error and detects a double-bit one, so one flipped bit is repaired as the word is read and two are at least announced. TI's safety manual states that the flash and RAM of its device are fitted with ECC too.

Self-checking chips are the latest step in a longer history of control logic, from relays to programmable controllers, then safety controllers, then single chips. Modicon's first programmable logic controller was built in 1968 at the request of General Motors' automatic transmission division, as an electronic replacement for hard-wired relay systems. Schneider Electric's own history of the brand calls it the first such controller in the United States. Pilz describes its own PNOZ of 1987 as the first safety relay to ensure that machines stop reliably, and its PSS 3000 of 1995 as the world's first freely programmable safe control system. In 2008, as a trade journal reported, Texas Instruments launched automotive microcontrollers with two floating-point ARM Cortex-R4F cores in lockstep, designed for IEC 61508 SIL 3. The journal counted them among the first such parts built on that core.

Lockstep, ECC and the watchdog share one limit. Both cores of a lockstep pair run the same program, so a fault in the program itself gives the same wrong answer on both and passes the comparator. Chapter 3's limit written in the wrong unit is such a fault. ECC keeps the wrong limit intact, and the watchdog is serviced on time. The hardware checks find random failures of the hardware, and confidence in the program is earned in other ways (Chapter 16). As for the transmitter, whatever all the checks together miss is left to the proof test.

List what every credited check finds and does

For each diagnostic that a failure-rate calculation credits, write down what the check compares, which failure modes it detects, how often it runs and what the system does when it fires. Confirm that the interval and the reaction fit inside the process safety time. Confirm also that the installed logic is set as the analysis assumed, such as a logic solver set for out-of-range currents where an FMEDA's detected rate depends on that setting. For the incubator, give both thermistors a range check, decide whether a detected sensor failure opens the cutout or raises an alarm, and list the failures that no check sees, the cutout's welded contacts among them, for the proof test (Chapter 11).

+ What this chapter established
  • A check sees a failure only when the failed state looks different from the working state: a range check catches the thermistor's open circuit and short, while a drift or a stuck reading such as Tank 912's needs a cross-check or a plausibility check against the process.
  • Diagnostic coverage is the share of dangerous failures that a system's own checks detect. The PR5337 transmitter's 74 % holds only with a logic solver set as NAMUR NE43 describes, and with it, in the solved example, the yearly-tested channel's average is about a quarter of what it would be with no checks.
  • Where a check is what keeps a failure from becoming a hazard, its diagnostic test interval and the time to reach or keep the safe state must together be less than the process safety time. Where demands come more often than once a year, a check that runs more than 100 times as often as they arrive is an alternative.
  • Lockstep cores, error-correcting memory and watchdogs check the logic's hardware and timing, but a fault in the program itself passes them all, and what no check finds is left to the proof test.
Created with Claude (Anthropic).
Educational reference material, not engineering, regulatory or clinical advice. Product and company names referenced are the property of their respective owners.