# Optimization of Intelligent Maintenance System in Smart Factory Using State Space Search Algorithm
## 2 Materials and Methods  
### A New Design of an Intelligent Maintenance System (IMS)  
The evolution of industry necessitates the development of optimal industrial automation controllers, facilitating the transition of factories from semi-automated systems to fully automated or smart factories in the era of Industry 4.0 [1; 32]. The structure of step-level design begins with an automated pyramid hierarchical architecture that aligns with standard specifications. The ANSI/ISA-95 standard [33] comprises five distinct hierarchical levels, ranging from Level 0 to Level 4, as illustrated in Figure 13.  
In designing the new IMS, it is essential to gather comprehensive information from each production process. Key values can be derived from the levels of the automation pyramid within the automation systems present in smart factories. Beginning at Level 0, or the field level, this stage encompasses a multitude of machines and industrial instrumentation systems, including sensors. The data generated by these devices are transmitted to Level 1, the control level, which comprises programmable logic controllers (PLCs) [29]. These controllers are responsible for managing the operation of each step in the machinery, requiring expert programming of the input and output systems to align with the designed process steps. In the context of smart factories, there is an additional software layer that facilitates processing from Levels 2 to 4, beginning with supervisory control and data acquisition (SCADA) software [34]. This control system analyzes industrial equipment, assists in data collection, integrates multiple work sites, and enables the remote display  
Figure 12: Proposed framework. Figure 13: Automation pyramid according to ISA 95 model [8]. of results at the control room center. The subsequent level is the manufacturing execution system (MES) level, which serves as the core of Industry 4.0. It acts as the operational framework within the production process, facilitating the connection between the enterprise resource planning (ERP) system and the SCADA machine control level. The highest level, ERP, encompasses all the functions necessary for organizational operations, including warehousing, purchasing, sales, production, accounting, payroll, and document approval, thereby enabling real-time connectivity across all departments [29; 30]. Thus, it is evident that in a smart factory, various parameters of interest can be extracted from each level and transmitted to the database. This work is designed to fully address the aspects of Industry 4.0, including optimization, cost, time, and especially sustainability. To enhance competitiveness, reduce costs, and achieve better efficiency, a new intelligent maintenance system (IMS) has been designed to automatically extract necessary parameters from existing resources within the factory. Importantly, the FMEA risk standard has been integrated to support decision-making by the algorithm. Compared to similar recent research in maintenance, this work offers more comprehensive functions that better meet the needs of current industries. To inform the design decision-making process, a review of relevant research was conducted to evaluate the advantages and disadvantages of various maintenance approaches in comparison to their functional applications (Table 2). To enhance the efficiency of the IMS, this research presents a methodology for data collection at each stage, including the values recorded by sensors at various points of interest. The operational status of each machine, along with the working hours for every piece of equipment at each stage of the automation pyramid, is stored in a database for subsequent processing by the algorithm. The design is founded on the core principles of planned downtime management (PDM) integrated with CMMSs, resulting in a new design of the IMS, represented as PDM + CMMS = IMS, as illustrated in Figure 14.  
The most challenging aspect of designing a new Intelligent Maintenance System (IMS) presents several challenges, including:  
1.