Research on digital twin modeling and monitoring technology for smoke alarm calibration system

Aiming at the problems of backward calibration method of smoke alarm, low production efficiency and difficult real-time monitoring, a digital twin system modeling and monitoring method of smoke alarm calibration is proposed. First, through the analysis of smoke alarm calibration requirements, the overall framework design of the digital twin calibration system for smoke alarm is proposed, and then the twin model of smoke box is constructed by running the digital twin five-dimensional model. The physical smoke box, geometric model, physical model, rule model and behavior model are introduced in detail; Then the communication system architecture, data acquisition and data mapping are used to construct the twin data model; Finally, the feasibility was verified by the calibration system of an enterprise. Through the system, the qualified rate of smoke alarm calibration was increased from 98 to 99.6%, and the repair rate of defective products was reduced by 1.6%.

www.nature.com/scientificreports/ generation engines and their subsystems associated with models of machine learning for predictive maintenance, allowing the classification of failures in the generating units of the plant.The models represent the mechanical, thermal, and electrical conditions and parameters of each piece of equipment under normal operating conditions, and the tool generates alerts when deviations from the base model occur 9 ; Kosova et al. proposed a novel digital twin-based health monitoring system for aircraft hydraulic systems to enable diagnostics of system failures early in the design cycle using machine learning (ML) methods 10 ; Leung et al.Proposed a digital twin-based inbound synchronization framework to streamline the operations of a PI-hub in a hyperconnected city logistics system 11 ; Lal et al.To develop and verify a digital twin model of critically ill patient using the causal artificial intelligence approach to predict the response to specific treatment during the first 24 h of sepsis 12 ; Zhang et al. proposed a digital twin-driven carbon emission prediction and low-carbon control of intelligent manufacturing job-shop ,realize the carbon emission reduction in intelligent manufacturing workshop 13 ; Zhongjun et al. create digital twins for historical buildings, to monitor historical buildings, predict energy consumption, and independently control energy consumption equipment, in order to achieve a balance between energy efficiency, building energy efficiency and human comfort 14 .
As for the research on the calibration of smoke alarm, only two literatures were retrieved with the keywords of "smoke alarm calibration", "smoke sensor calibration" and "smoke detector calibration", and the literature research was the elaboration of the calibration method of centralized alarm; There are only two literatures with the keyword of "alarm smoke box", which are about the performance research of smoke box; However, there is no relevant research on the digital twin of smoke alarm calibration.This paper studies the modeling method of smoke alarm calibrated smoke box by taking the digital twin modeling of smoke alarm calibrated smoke box as the breakthrough point.

Structural composition of smoke box system
The threshold calibration of smoke alarm shall be carried out in the smoke box.The structure of the smoke box system mainly includes: measurement work area, measurement platform, temperature and humidity sensor, flow rate sensor, rectifier grid, control and equipment connection, smoke box control and indication equipment connection, smoke generator, ion concentration meter, ion concentration exhaust device connection, optical densitometer, etc. Figure 1 shows the schematic diagram of smoke alarm, smoke box and calibration measurement area.

Mathematical model of response threshold measured by optical method
The response threshold value of the smoke alarm, that is, the smoke concentration when the smoke alarm alarms is represented by the dimming coefficient m value, is measured by the optical densitometer, which measures the smoke density based on the principle that the light radiation energy attenuates exponentially after the beam is affected by the smoke particles 15 .The dimming coefficient model is expressed in digital language as (1): where: m is the dimming system, dBm −1 ; d is the optical measurement length of the experimental smoke, m; P 0 is radiation power received when smokeless, W; P is radiation power received with smoke, W.

Demand analysis
Smoke box modeling and monitoring requirements are divided into virtual model, simulation model, data model, service model and database application interface.As shown in Fig. 2.
Virtual model: build a virtual model that can be exchanged with physical entities.The virtual model is consistent with the production of physical equipment through mapping, including shape, position, action and mutual relationship.At the same time, the virtual model can also realize the monitoring, analysis and diagnosis of the production process.
Simulation model: mainly used to realize the simulation of cigarette box production and operation.By setting the parameters such as wind speed, temperature and humidity, and shielding rate of the smoke box, combined with the virtual model, the calibration motion simulation of the smoke box can be realized; The virtual control panel is established based on the physical smoke box.The user can debug the motion simulation of the virtual smoke box and send instructions to the physical smoke box for real-time remote control, so as to improve the practicability, interactivity and efficiency of the monitoring scheme.
Data model: collect the data during the operation of the smoke box in real time, integrate and clean the data, and store the effective data in the database.It can also run the collected real-time data to control the virtual model motion simulation.
Service model: realize virtual simulation, virtual real synchronous simulation, production status monitoring, remote control and other application services based on the model.
Database application interface: it is mainly used to connect the database of localized storage data.The data collected by the upper computer is localized and stored in the database through the interface module.

Overall architecture design
The application framework of digital twin cigarette box includes physical layer, twin layer, data layer and service application layer.As shown in Fig. 3.
The physical layer includes two layers: physical resource and resource perception.The physical resource layer includes smoke box entity, smoke alarm, etc.; The resource sensing layer includes PLC, optical receiver, flow rate sensor, temperature and humidity sensor, etc.; The physical smoke box entity realizes the real-time perception of the real-time information and working status of the physical smoke box through the data acquisition technologies such as sensors and TCP communication protocol.At the same time, it can upload the real-time data of the (1) m = (10/d)log(P 0 /P) www.nature.com/scientificreports/physical smoke box collected by the sensors to the virtual smoke box system, and receive the monitoring tasks from the service system to realize the control of the virtual smoke box to the physical smoke box.The twin layer is the core of the system, and the twin model includes geometric model, physical model and production behavior model 16 .The geometric model is used to express the visualization effect of the physical smoke box mapping in the information space, and has the same shape, size, position parameters and assembly relationship with the physical smoke box; The physical model adds the physical attributes, constraints, characteristics and other information of the physical smoke box on the basis of the geometric model; The production behavior model maps the production operation logic in real time.
The data layer collects data through the acquisition program, and stores the data into the database, including equipment data, process data, operation data, status data, calibration data, etc.
The service application layer realizes virtual simulation, virtual real synchronous simulation, remote control and other functions by accurately mapping the twin layer and data layer.In the virtual simulation mode, the twin cigarette box sets the virtual simulation production process according to the parameters to provide feasibility verification for the actual production; In the virtual real synchronous simulation mode, the physical smoke box status and operation data are updated to its virtual model in real time based on the digital twin mapping mechanism for real-time visual monitoring; Remote control means that based on synchronous simulation and data analysis, the digital twin cigarette box sends instructions to the physical space and reversely controls the physical cigarette box for exception handling.

Construction of digital twin cigarette box model
Combined with the architecture of the digital twin five-dimensional model 17 and the data integration and system integration capabilities of the industrial Internet of things platform, according to the smoke alarm calibration production situation, a smoke alarm calibration smoke box system model based on the digital twin is constructed.The smoke alarm calibration smoke box system structure is shown in Fig. 4.
It includes physical cigarette box (PE), virtual cigarette box (VE), service (SS), twin data (DD) and connection (CN), and the digital twin five-dimensional model is shown in Eq. ( 2).

Physical smoke box
The physical smoke box entity is the foundation of this system.It can be divided into unit level, system level and complex system level by function.Unit level is the smallest manufacturing unit of smoke box, such as box, upper cover, fan, smoke exhaust outlet, air inlet, smoke generator, optical density meter, flow rate sensor, temperature   and humidity sensor, etc.The system level is formed by the integration and cooperation of multiple unit levels.The smoke box system level mainly includes mechanical system level, electrical system level, control system level, etc.The complex system level is based on the system level, through the information flow, energy flow and so on to achieve cross system interconnection, interoperability and mutual collaborative optimization.Figure 5 shows the physical smoke box.

Virtual smoke box
The virtual smoke box includes geometric model ( G v ), physical model ( P v ), behavior model ( B v ) and rule model ( R v ) 18 .The virtual model describes and depicts the physical entity from multiple time scales and spatial scales, and its mathematical expression is shown in (3).
When building the digital twin cigarette box model, we should first map the size, shape, assembly relationship and other attributes and laws of the physical cigarette box, so that the model can simulate the geometry,  constraints and physical attributes of the real physical cigarette box through known experience or physical laws.The second is to express the production behavior of the real cigarette box in the model, which mainly describes the multi-disciplinary, multi physical quantity and multi-scale data information related to the behavior activities, such as mechanical data, electrical data, control data, process data and state data.Finally, through the comparative analysis of the production data of the physical cigarette box and the virtual simulation data, the decision is made according to the relationship and rules between the parameters, and fed back to the real physical cigarette box to realize the monitoring of the production process of the physical cigarette box.

Geometric model
The geometric model is a three-dimensional model that describes the shape, size, position and assembly relationship of the physical entity, and has good temporal and spatial consistency with the physical entity.Figure 6 shows the geometric model of the smoke box.In order to achieve the movement effect of cigarette box calibration, each component must be established according to the assembly relationship.A complete smoke box is usually composed of the main body, moving parts, control system, electrical subsystem, heating device, smoke generation device, speed measuring device, pneumatic subsystem, smoke exhaust system and other ancillary structures.In order to improve the efficiency of computer graphics processing and simulation, the 3D model needs to be lightweight in modeling, and the key components, such as the main body of the smoke box, the working platform, the smoke generating device, the heating device, the alarm, etc., need to be retained; Simplify components that have no obvious relationship with simulation, such as air pressure device, control system, smoke exhaust device, etc., only need to show the complete overall dimensions and accurate motion form of the smoke box, without considering other auxiliary structures.The mathematical language expression for constructing the geometric model is (4): where: S g is geometric shape, D g is geometric dimension, P g is geometric position, AR g is assembly relationship, PR g is positional relationship.

Physical model
The physical model is to add the physical attributes, constraints, characteristics and other information of the physical smoke box and smoke alarm on the basis of the geometric model.www.nature.com/scientificreports/length(d), the radiation power received when smoking(P 0 ), the radiation power received when smoking(P), etc.Its mathematical language expression is (6): The physical properties of the alarm include the model (T y ), status (S y ), Working Voltage (V dc ), quiescent current(QC), alarm current (AC), alarm sound pressure(ASP), sensitivity (SS), etc.Its mathematical language expression is (7): Environmental parameters of smoke box include temperature (T ep ), humidity (H ep ), air pressure (p ep ), wind speed (W ep ), smoke concentration (D ep ), smoke inlet frequency (F ep ), shielding rate (C ep ), etc.Its mathematical language expression is (8):

Behavior model
Virtual simulation debugging depends on the model construction at the sensor and actuator level, and the behavior model is divided into sensor modeling and actuator modeling.The environmental parameters of the smoke box are set according to the requirements of the calibrated environmental parameters.The corresponding sensors of the smoke box (such as temperature and humidity sensor, flow rate sensor, smoke concentration sensor, etc.) are defined according to the working principle of the sensor.Through the sensor behavior modeling, the digital twin model of the smoke box is fed back to the control system based on the signals generated by the working conditions.In order to increase the accuracy of the trigger calibration time and avoid the error caused by the trigger calibration only by the calculation of the environmental parameters of the smoke box reaching the standard, position sensors are set at the inlet and outlet of each product.The calibration time of the smoke box is determined by calculating the environmental conditions of the smoke box, the trigger outlet sensors of the previous batch of calibrated products and the trigger inlet position sensors of the next batch of products, so as to improve the accuracy and success rate of calibration.
Based on the working principle of the driving smoke box, the motion control parameters of the corresponding actuator are defined, and their interaction signals with the control system are associated with the motion attributes of the digital model.With the help of actuator behavior modeling, the digital model can realize the movement of the actuator driven by the output signal of the control system.
The behavior model data includes process parameter (P ps ), process sequence (P ss ), smoke box operation data (R d ), alarm operation data (Y rd ), smoke box environment parameter (EP) and other information (Info), which are obtained and rendered to the model through the data interface set.Therefore, the mathematical language of cigarette box behavior model is expressed as formula (9):

Rule model
The rule model is designed after the behavior model is completed.In order to make the rule model meet the requirements of virtual simulation debugging, it needs to meet the control logic of the system.The calibration process of smoke alarm is shown in Fig. 7.After setting the environmental parameters of the smoke box, the data input sensor triggers to read the product information and write it into the PLC data block to calculate the pulse variable.When the pulse count value in the data block enters the window of the import pulse value, the PLC initiates a calibration request.After the calibration of the import position sensor is completed, the cylinder starts to move, the workbench acts, and the corresponding product starts calibration.After the product is successfully calibrated, the data of the corresponding element in the PLC data block is cleared.If the primary calibration of the product is unsuccessful, the secondary calibration will be carried out.If the calibration of the product is not successful after the secondary calibration, the product will be sent to the repair area.

Twin data model construction
Data as a bridge connects the physical smoke box and the virtual smoke box.In order to ensure the normal operation of the smoke box in the calibration process, it is necessary to collect data in real time.The virtual cigarette box model maps the physical cigarette box in real time.On the basis of completing the static modeling of the virtual model, the dynamic modeling between the virtual model and the physical entity is required.On the one hand, the physical entity can drive the digital twin model for real-time simulation through the communication system.On the other hand, the digital twin model can also send instructions to reverse control the operation of the physical entity, realizing the two-way mapping of "twins".

Communication system architecture
To enable the virtual cigarette box to smoothly map the real-time operation of the physical cigarette box, it is necessary to collect the status data, operation data and location data of the physical cigarette box.The type analysis and format of these data are not unified.The virtual model and external signal connection currently support the following protocols: OPC Da, SHM, OPC UA, TCP, plcsim adv, UDP, PROFINET.The system uses (6) E p = (T e , V e , O e , L e , d, P 0 , P...) (7)  Y p = T y , S y , V dc , QC,AC,ASP,SS.. OPC UA communication protocol to build a virtual real mapping platform.The whole environment is composed of three parts: PLC CPU, OPC server and digital twin model (MCD).The CPU is used to process the operation logic, obtain the machine status through the OPC server, and send the operation instructions to the equipment through the OPC server; MCD is used to display the virtual model and conduct simulation, obtain CPU instructions from OPC, and feed back the current equipment status through OPC server.Figure 8 shows the signal transmission path.

Data acquisition
Data is the foundation of digital twins, originating from physical entities, twin systems, sensors, etc.It covers twin model data, environmental data, physical entity geometric data, physical data, process data, production and operation data, and runs through the entire process of physical object operation.The realization of data acquisition and communication is shown in Fig. 9. Data acquisition mainly relies on the data acquisition module of the physical cigarette box.The cigarette box is equipped with an RFID reader to automatically read the position, rotation angle, residence time, etc. after the alarm enters the cigarette box; The sensor is used to obtain smoke box working condition data, alarm status data, smoke box environment data, etc.Data information such as position sensor, temperature and humidity sensor and concentration sensor are collected in the calibration system and then input to the master station.The main station stores the received data into real-time data and historical data www.nature.com/scientificreports/ in the database.Based on the collected information, the control system analyzes the actual situation of each station of the cigarette box, and controls the movement of the cylinder and workbench of each station through the slave station and master station.In addition, the industrial Ethernet communication protocol is used to establish communication between master and slave stations and between master station and host computer (PC), so as to realize the real-time data flow under the digital twin architecture.
The main station provides an interface to the twin model system to drive the operation of the model.All virtual variables generated during the model operation are stored in the database with the same data classification, and then the real workshop variables obtained from the server are traversed to establish a one-to-one connection with the virtual workshop variables, achieving the acquisition of data from the main by the model.

Data mapping and driving
Smoke alarm calibration twin system virtual real mapping and driving is to communicate and connect the equipment status data generated during the actual operation of the physical space of the smoke box with the digital space, and transmit the equipment status data to the digital space twin model to realize the synchronous operation of the physical space smoke box and the digital space twin virtual model.The physical space collects, transmits, analyzes, processes and stores data through software programs, and finally imports it into the database.The data stored in the database is connected to the digital space after unified processing.The data mapping of smoke alarm calibration includes smoke box, alarm, environment mapping, etc.As shown in Fig. 10.
1. Smoke box mapping.The smoke box is the main equipment for calibration production.It carries out realtime mapping of the behavior, position and state of each part of the smoke box in production.The mapping mainly includes the geometric parameters of the smoke box, the physical attribute of the smoke box(E p ), the process parameter (P ps ), the process flow (P ss ), and the smoke box operation data (R d ). 2. Alarm mapping.The production data drives the alarm throughout the calibration process, and the data of the alarm in the calibration process includes the geometric data, physical attribute data (Y p ), operation data (Y rd ), etc. 3. Environment mapping.The environmental mapping displays the environmental parameter information in the smoke box in real time during the calibration process, understands the impact of environmental parameter changes on the alarm threshold, and timely adjusts to ensure the accuracy of the threshold.Including: T ep , H ep , p ep , W ep , D ep , F ep , C ep , etc.
After getting the operation data of real equipment, we need to use some data to drive the equipment in the digital twin scene to achieve the dynamic consistency between the physical space and the virtual digital twin space.The process of real data driving virtual digital twin is introduced by taking the smoke box monitoring in digital twin system as an example.After receiving the trigger request of data query, the digital twin system for smoke box monitoring circularly reads data from the database at a certain time interval, and then continuously transmits the data to the drive function of the fan equipment.Through continuous real-time rendering and display, the dynamic consistency between the physical world equipment and the twin system equipment is realized.The flow chart is shown in Fig. 11.First, the user sends a data query request and generates SQL statements according to the corresponding trigger.The system connects the database and queries the corresponding data in the database according to the data request command.After querying the corresponding data, judge the data to determine whether the data in the database has been updated.If the data in the database has been updated, the read data will be written into the model driver function according to the data mapping relationship, and NX will render and display the results in real time.If the data in the database is not updated, end the data acquisition.By periodically cycling the above process, the purpose of real-time data driving is achieved.Complete the corresponding actions of the equipment driven by data.

Application examples
According to the modeling and mapping method mentioned in this paper, the calibration font of a smoke alarm of a company in Ningbo, Zhejiang Province is used as the verification.According to the calibration process of smoke alarm and the digital twin modeling method proposed in this paper, the Siemens NX platform is used to build the digital twin model of the smoke box, and the OPC UA communication protocol is used to build the virtual real communication platform.Finally, the real-time mapping technology is used to realize the visualization of 3D model and virtual production.
When building the twin model of the cigarette box, Siemens NX was used to model the whole cigarette box in equal proportion, and the assembly was carried out according to the geometric position relationship and assembly relationship between the components of the cigarette box, and the physical properties such as material, mass, friction, mechanics, optics, and heat corresponding to the model and the physical cigarette box were given to complete the construction of the geometric model and the physical model, as shown in Fig. 12, which shows the comparison between the physical entity of the cigarette box and the twin model.By mapping the position and calibration behavior of the physical smoke box and the alarm, the visual detection of the smoke alarm calibration production process is realized, and the real-time production data is collected and saved in the database.Figure 13 shows the monitoring interface during cigarette box production.Figure 14 data acquisition interface.
In order to verify the reliability of the method proposed in the paper, the authors team compared the traditional calibration method with the calibration method proposed in this paper.The traditional calibration method for smoke alarms is to manually place the product into the calibration instrument, observe the calibration instrument data with the naked eye, and then manually collect the product.The operator does not record any calibration data during the calibration process.The traditional smoke alarm calibration method is shown in Fig. 15.The authors randomly selected 40 Rum alarms calibrated using traditional  calibration methods for sensitivity testing.Among them, 3 products had sensitivity thresholds that exceeded the standard range.These 40 alarms were recalibrated using the method described in this paper.After testing, the sensitivity of all products met the requirements of EN54-S/7:2000 testing criteria, as shown in Table 1.Through multiple inspections and verifications, compared with traditional calibration methods, the qualification rate of this design system has increased from 98 to 99.6%, and the repair rate of defective products has decreased by 1.6%.

Conclusion
This paper preliminarily explores the application of digital twin technology in the smoke alarm calibration workshop, expounds the working mechanism of the smoke alarm calibration system, designs the overall framework of the digital twin smoke alarm calibration and monitoring system, uses Siemens NX platform to build the digital twin five-dimensional model of the smoke box, and uses OPC UA communication protocol to build the virtual and real communication platform RFID and other technologies collect data from the physical smoke box and the twin smoke box, realize the real-time mapping between the physical smoke box and the twin smoke box, improve the efficiency and quality of smoke alarm calibration, and provide a new idea for the digital production of smoke alarm.

Figure 1 .
Figure 1.Schematic diagram of smoke alarm, smoke box and calibration measurement area.

Figure 3 .
Figure 3. Frame diagram of digital twins.

Figure 4 .
Figure 4. Five dimensional model of digital twin cigarette box.

Figure 6 .
Figure 6.Geometric model of smoke box.

Figure 12 .
Figure 12.Comparison of physical smoke box and twin smoke box.

Figure 13 .
Figure 13.Monitoring control interface during cigarette box production.

Figure 15 .
Figure 15.The calibration of traditional smoke alarm.
Mathematical twin smoke box modeling and monitoring requirements framework.