# Architecting an Agent-Based Fault Diagnosis Engine for IEC 61499 Industrial Cyber-Physical Systems
## 2 Background
### Fault Identification and Diagnosis in ICPS  
ICPS demand sophisticated fault management if they are to operate for the maximum possible uptime without interruption [33; 34]. Self-managing fault diagnostic engines now ensure the reliability of interplanetary spacecraft and smart factories, often in situations where humans are not able to be present when things go wrong [35; 36]. A _fault_ is defined as any change in the operation of an ICPS that leads to unacceptable behavior or degraded performance [37]. Diagnostic strategies must enable fault-management software to be able to recognise what constitutes both normal and abnormal behavior by the devices that operate in the ICPS. If the cobot in the example above pauses because it cannot complete a task when an obstruction is blocking its path, that is not a fault. It is the ICPS adapting appropriately to a change in its environment. However, failing to halt is a fault, possibly caused by a damaged sensor or a programming error. Sophisticated smart sensors contain in-built electronics to pre-process readings and transmit them to the ICPS they are connected to. Faults in such sensors can include failures in electronic components, both intermittent and permanent, as well as calibration errors that cause them to return false readings. Actuators such as those that move aircraft flight control surfaces rely on feedback from multiple position sensors to determine if they are orientated correctly. Since many sensors and actuators have their own embedded processors, software faults can lead to operational failures. The recent failure of the airspeed and angle of attack sensors on the Boeing MAX 8 led to the incorrect operation of the on-board MCAS flight stability software, resulting in catastrophic behavior of the aircraft [38]. [PERSON] et al. [39] note how the number of sensors being monitored for faults affects both the design and worst-case performance of diagnostic approaches. [PERSON] et al. [40] comment that many ICPS devices are designed for low power consumption and have limited computational capabilities. Hence, external fault diagnostic systems rather than built-in fault-finding ensures that these ICPSs are not overloaded by fault management and diagnostic processes. Physics-Based Modeling of faults relies on models of behavior that can be used to recognise misbehavior. Model-invalidation techniques recognize deviations in the ICPS telemetry from the values predicted in the model [41; 42]. Noise discrimination is  
Figure 2: IEC 61499 Function Block that converts temperatures with its ECC. required since the differences may be small when the device is appearing to perform nominally [43; 44]. However, creating models is labor-intensive and they require careful calibration to enable them to determine when the ICPS has deviated from expected behaviors [41; 45]. In contrast, Model-Free approaches use Artificial Intelligence (AI) where the correct operation of the ICPS is learnt by observation during a training period. While the effort to create a pre-defined model is not required, fault engines that rely on AI techniques must be trained on a system that is able to demonstrate what nominal operation is. In the prior scoping survey [9], variations of Model-Based approaches in the aerospace sector were encountered in 85% of the studies while AI featured in 30% of the studies. Hybrid techniques that combine aspects of both approaches were found in 36% of these studies. This predominance of Model-Based techniques reflects a conservative approach typical of safety-critical environments. [PERSON] [15] proposed a model of fault diagnosis applicable to IEC 61499 that extends the Model-View-Controller (MVC) pattern to include diagnostics and fault recovery. The approach proposed an additional layer of custom FBs that monitored activities of the other blocks it is connected to in that region. [PERSON] et al. propose a Unit-Test framework for IEC 61499 using FBs that surround the block to be examined [46].