## 2 Proposed Smart Factory Methods and Methodology
### Risk Analysis Component  
The risk analysis component is used when designing and/or adapting an HRC application. The component supports a safety engineer during the hazard identification, risk evaluation, hazard elimination, and risk reduction, as illustrated in Figure 2. It does not automate the process of estimating risks or identifying hazards. Instead, it highlights which changes to an existing system have resulted in changes to the risk profile and need to be reviewed and enforces formal risk analysis and change management processes. The component allows the user to both import the process structure and insert additional data. The user is then guided through the process of estimating the risk and documenting hazards and risk reduction measures. When performing an update, changes that require the user's attention are automatically detected by making comparisons against the previous configuration. The change detection is based on comparing identifiers and searching for matches between the previous version and the updated one to find added, modified, and deleted elements. The component was designed to allow both manual data entry and to import data from a variety of sources, such as a digital twin, or from a factory MES. The focus of the risk analysis is on mechanical, HRC-related hazards (e.g., crushing, impact) listed in Annex A of ISO 10218-2 [53]. These can be chosen from a pull-down list. Figure 7: Sequence diagram of the workflow for performing a risk analysis using the proposed methods. Initially, the user defines the process via BPMN. Second, the BPMN is shared to the MES and RA to extract the **process definition** (PD). Third, the **process definition** is used by the user to assign **resources**. Fourth, the **process definition** and **resources** are sent to the RA for the risk analysis. Finally, the result is sent back to the MPMS and the MES, directing them to start execution, or not, depending on the result of the analysis. A novel feature of the risk analysis component is that the data are structured by task--e.g., a partial process, action, or operation performed by some actor in the assessed system, such that every hazard is always associated with a task. With this approach, the tasks are connected to resources (which correspond to a physical entity such as robotic equipment, a part of the environment, or a person) and actions (operations that are performed by one or more resources). A basic assumption of this model is that some action (e.g., motion of some dynamic parts--automated or mechanical equipment of the system, interaction with their environment as part of normal or abnormal operation, putting people or materials on site) is always required in order to introduce risks into a state which would otherwise be safe (e.g., when the equipment is standing still, the factory is empty, and no one is around). It is easy to imagine a counterexample case in which the mere presence of the equipment or materials might constitute a hazard (consider for instance the storage of explosives or corrosive chemicals). Such cases would not fit into the model used by the application; however, one could still consider defining \"storing dangerous chemical 1\" as a task that covers this specific case. This \"task-based modeling\" of an application fits well with a robot-centric view of an application. Risks that exist due to a robotic application are heavily dependent on specific information, such as the robot's speed during a defined movement. As such, the proposed level of granularity is considered sufficient for understanding what the robot is doing and allows the safety expert to identify associated hazards and risks. Although the component is also able to document the evaluation of the individual risks (risk assessment) by the safety expert, the main focus of the innovation is on the methods for asset and task definition, as well as hazard identification during the risk analysis phase.