Mathematical modeling on application of wireless networks for industrial automation-factory automation

Since traditional automation relies on wires, the machines’ versatility will be restricted. Thus maintenance is required to prevent cable wear and breakage, which would be costly and highlighted the importance of wireless connectivity in overcoming some of the limitations of conventional factory automation. Moreover, two of the most critical considerations, reliability and latency, need to be fulfilled so that a factory automation system can perform flawlessly. However, in factory automation, 0ms is the perfect condition since many machines share the same network. Furthermore, it can only reduce latency to a certain extent but not to zero. This study focuses on wireless networks for Industrial Automation Factor Automation’s system architecture, including network devices and topology, and then demonstrates one of the wireless networks’ main technologies, retransmission. This paper develops a mathematical analysis based on Negative Acknowledgement (NACK)-based retransmission mode as default retransmission for field devices to send data frames to the gateway device periodically. The results demonstrate an automatic on-demand retransmission (AODR) scheme able to provide higher efficiency of retransmission rate.


Introduction
Factory automation uses control systems to independently operate and monitor a mechanized system for the operation of machinery and processes [1]. Wires are used to connect every machine and transfer information until recently; Fifth Generation (5G) is starting to be used to transfer information wirelessly. In addition, wireless communication technologies can improve the efficiency of process control systems.
Meanwhile, a wireless network for industrial automation-factory automation, or a shortened name for WIA-FA, works as a wireless network solution for factory automation. The WIA-FA contains a group of physical devices, including a host computer, gateway device, access device (AD), field device (FD), and handheld device. A redundant star topology, which is shown in Figure 1, basically defines how WIA-FA works. In its system management, WIA-FA uses a centralized management framework. FDs and AD perform management functions together.
Wireless factory automation requires a highly demanding set of a communication system [2]. According to Figure 1, frames of data are sent back and forth of AD and FDs. FDs consist of a few sensors and actuators to receive and send information and receive a command to carry out certain work, respectively. The connections between the devices are wireless to prevent the hassles of wired connection. The data phase shows three different colours of timeslots. Green colour represents the first transmission of data frames, red colour is the NACK frames generated by AD, and blue colour represents the retransmission of the failed FDs in the green colour. However, the default timeslot reservation schemes of WIA-FA networks are inefficient in retransmission. Hence, automatic on-demand retransmission (AODR) scheme is introduced in this thesis to improve the efficiency of the retransmissions. A couple of drawbacks of WIA-FA's default retransmission mode and how AODR works will be discussed later in the paper to overcome the problems.

Wireless Networks Application
In the fourth industrial revolution, the industrial cloud that organizes a group of geographically dispersed factories with the versatile adaptation of production capabilities and sharing resources and assets to enhance order fulfilment is one driving application scenario. A hybrid infrastructure covering both wired and wireless communication solutions would most likely be the next generation of workshop networks. By including wired or wireless field bus networks (WFNs) and wireless sensor networks (WSNs), which are normally fully independent of each other [3]. The industrial wireless sensor network (IWSN) is an emerging WSN category that provides industrial organizations with great benefits such as performance, productivity, and safety [4].

Industrial Wireless Sensor Networks (IWSN)
The concept of the Internet of Things (IoT) and Cyber-Physical System (CPS), which are introduced in the industrial application schemes, lead to the introduction of the Industry 4.0 idea [5]. Thus, creating a smart factory uses wireless communication where IWSN will change the industrial automation technology without question. IWSN sensors are autonomous and track environmental and physical conditions applicable in a variety of fields, including industrial automation and industrial equipment control. It is expected that the deployment of these networks will rise in the future at an exponential growth rate. The wireless channel is extreme for an IWSN deployed within a plant and impacted by major disturbances. We have to face noise and interference due to the resulting signals from heavy machines present in the area to design a stable network. Therefore, it is important to propose a functional architecture for an industrial environment in which signals emitted can be intercepted even in a harsh industrial environment [6].

5G Network
5G is the fifth-generation technology that is used in mobile networks. It has just started to work worldwide in 2019, but Malaysia still does not have the feature. Other countries around the globe had their social and economic development relying heavily on information and communication technologies. 3 5G become useful because it can provide high speed, rapid response, high reliability, and energy efficiency [7]. [8] explains the vast control processes that require different latency and reliability. A large number of connected devices are allowed to connect with higher bandwidths for a longer duration. Besides, it can save the environment by reducing energy usage by up to 90%. Reduced energy usage means a reduction in power consumption which is longer battery life [9]. The latency is significantly reduced, which is 10 times at around 1ms round trip latency. This significant improvement is achieved through the improvement in technology and architecture in the device and network.

Latency
Latency is the transmission time for a packet of data which is a vital feature for factory automation. The time spent during the information transfer from a sensor to a control server is also considered the latency. If a certain factory cannot work with a low latency connection, the slightest delay can be problematic in critical situations. Factory automation relies on real-time control of machines and systems for constant and fast production lines with only a slight number of human involvement. If the operator's eyes perceive a slightly delayed movement compared to what is perceived by the sensor, this delay will lead to cybersickness. However, there is more than one line of production in a factory. Thus, this makes the wireless connection highly challenging in terms of latency and reliability [11]. Every network communication is divided into seven layers, each with different functions. Table 1 shows seven layers with their functions included and WIA-FA's layers. Based on the OSI reference model, the four layers at the bottom part are considered the lower layers that work by transferring data around the network. The top three layers are called the upper layers, and they contain the applicationlevel data. Every data must pass through each of the layers to ensure the layers can process the data properly before it is transmitted. In WIA-FA's OSI model, it is divided into three parts which are PHY, DLL and AL. We will focus on DLL only because that is where NACK-R mode runs.

Data Link Layer (DLL).
WIA-FA data link layer (DLL) guarantees real-time, reliable, and secure communication throughout the FDs and ADs. It has DLL Data Transport Functions and DLL Management Functions which is used to avoid the collisions between data during transmission, and define device joining, leaving, time synchronization and many more, respectively [12]. The system's gateway generates a superframe that has its length determined by the number of timeslots. There is a different combination of beacon timeslots, and uplink shared timeslots, and downlink timeslots. These timeslots are used to send frames to different devices based on their functions. Beacon timeslots broadcast beacon frames for FD. Uplink shared timeslots send frames to ADs. Downlink timeslots send frames to FDs, join response frames, leave request frames, and time synchronization response frames.

Superframe.
To prevent transmission collisions and ensure the reliability and real-time efficiency of transmission, WIA-FA uses time-division multiple access mechanism-based superframes. The superframe is a series of timeslots that repeats at a constant cyclically rate. The number of timeslots calculates a superframe's length. The default superframe consists of the beacon phase, management phase and data phase, as shown in Figure 2. Note that a beacon phase broadcast beacons to FDs by using access devices. The management phase sends packets from FDs to access devices via uplink shared timeslots and vice versa via downlink timeslots. NACK-R mode is used only in the data phase, so the discussion on the beacon and management phases is omitted from this paper.

Negative Acknowledgement-based Retransmission (NACK-R) Mode
There are two ways to confirm whether a packet has been successfully received. It can be known through acknowledgements (ACKs) or NACKs. For ACK-based protocols, the receiver informs the sender about all the successfully received packets. While for NACK-based protocols, the receiver informs the sender when a certainly received packet is unrecognized, non-sensical or corrupted [13]. The host computer controls the machines by receiving the packets of data. If the packet does not reach the receiver, the receiver will send feedback to the sender. This NACK response will command the sender to send the packet once again until positive feedback is received.  The white boxes represent the periodic data or management frames sent by FD to the gateway device. Then, the gateway device generates a NACK frame, for instance, a maximum of four times to give feedback on whether it receives frames from the FD. After that, in the retransmission timeslot, the FDs send the periodic data or management frames again in scheduled retransmission timeslots according to the feedback from NACK frames.  The AODR scheme will focus only on the data phase part of the superframe, as shown in Figure 4. The uplink timeslots send frames from the FDs to ADs, which is the NACK timeslots. If some of the frames are not sent successfully, the AD will retransmit in the next retransmission. So, there will be M ADs and N FDs. The frames that are not sent successfully are considered packet loss rate (PLR) of FDs [14].

Methodology
In WIA-FA, the FD uses an allocated timeslot to send periodic data to the gateway device. After receiving multiple periodic data or management frames, the gateway device generates a NACK frame in a certain order and transmits the NACK frame multiple times. The NACK frame contains the short addresses and relative timeslots number of failed FDs from which the gateway system, in scheduled timeslots does not receive periodic data or management frames. To ensure network reliability, NACK frames are sent multiple times. The NACK frames received are parsed by FDs. If the NACK frame's payload includes a FD's address, the FD will retransmit its periodic frame using the NACK payload's retransmission timeslot in the order indicated. If the scheduled retransmission timeslots are not appropriate for field system retransmission, the field system must wait in subsequent NACKs for future retransmission timeslots indicated. The steps are shown as a flowchart in Figure 5.

NACK-R Mode Timeslot Reservation
Several retransmission rounds timeslots will reserve to ensure efficient periodic exchange of data between FDs and gateway devices. These periodic data may be data frames or frames for the management. Let PLR and expected packet loss rate denoted by and , respectively, and used to determine the number of rounds and timeslots in each round. Hence, we can calculate minimum amount of retransmission, given by Let be the total number of periodic frames sent to gateway device during one super frame [15]. Thus, the number of timeslots, denoted by can be calculated as = . (2) Equation (2) is used to reserve the amount of timeslots needed when the gateway devices generate NACK frames and broadcast them to the FDs. If there is not enough value of (2) is generated, then the remaining failed FDs will have to wait for the next retransmission round. Then, (2) will be divided by to get reliability of NACK-R mode.  Figure 5. Flowchart of NACK-R mode.

Automatic on-demand Retransmission (AODR) Scheme
The data phase consists of first transmission of FDs, then NACK timeslots, retransmission timeslots and so on. The simpler form of data phase is shown in Figure 6.  Figure 6 shows that in the first transmission round, there is a number of FDs, N allocated. Let n represents the number of retransmissions and set to a random number. In any FDs failed in the first transmission round, the NACK timeslot will produce NACK frames to FDs. Then, the failed FDs will be retransmitted in the next round n-th denoted by . We assume that the length of the data phase, L is enough to support the max number of retransmission round, n. Hence, is the expected number of retransmissions of failed FDs and can be calculated as (3) Note that the range of is in the range of (0.1,0.3) to represent a good channel condition and (0.3,0.5) to represent a medium channel condition. From (3), if the value of each is below 1, then we can calculate the summation of all retransmissions, which is given by Using the summation in (4), we can conclude to the next formula (5) which is the number of available retransmission timeslots, , that can be expressed as Expression in (5) is used to identify whether all the FDs, ADs and retransmission timeslots are able to fit inside timeslots given by ≤ . To investigate if timeslots are enough to support all the transmission of FDs successfully. This investigation will be denoted as Case 1 [14].
Case 1: If n satisfies equation (3) and (5) simultaneously, timeslots will be enough for all FDs to be retransmitted successfully with no packet loss.
Finally, to validate the reliability of AODR and from (3), (4) and (5), the average of transmission failure, denoted by ̅ can be expressed as Note that the NACK-R mode has two main disadvantages. First, this model assumes that all FDs use the same value of PLR. As shown in (2), the timeslot is calculated by multiplying all frames sent to FDs with PLR, although the loss rate can be different in every data throughout the factory. Secondly, the state of the signals channelling in the physical industrial environment changes over time, affecting the value of PLR. Consequently, the number of timeslots allocated by (2) in each retransmission round may be insufficient regarding the number of FDs that have failed. Therefore, from (3), the AODR scheme is introduced to identify the correct number of timeslots that need to be produced by calculating the number of failed FDs.

Results
The calculations are made using MATLAB with the derivation given in Section 3. The simulation settings are shown in Table 2.  Figure 7 shows the cumulative distribution of which ranges from 0.1 to 0.3 and 0.3 to 0.5 respectively. The value of is randomly generated using MATLAB's function to simulate the real physical environment in a factory. The comparison of reliability between AODR and NACK-R mode is shown in Figure 8 and 9. The graph is calculated with the same number of retransmissions, n, which is 100 times. The only difference between both figures is the randomized value of between 0.3 to 0.5 and 0.5 to 0.7 for Figure 8 and Figure 9, respectively. Both figures show that even if the value of increases, the reliability of AODR is always higher compared to NACK-R mode. This means that AODR has a higher chance of successful retransmissions before the end of a super frame.  Figure 8. Reliability of AODR and NACK-R mode for = ( . , . ) Figure 9. Reliability of AODR and NACK-R mode = ( . , . ) Figure 10 and Figure 11 shows the difference in n with the reliability of AODR and NACK-R. AODR can achieve with far fewer retransmission timeslots compared to NACK-R mode. This is because AODR assigns retransmission timeslots in an on-demand manner to prevent a wasteful allocation of timeslots. The figures show that the lower the value of n, the fewer timeslots needed for higher reliability retransmission. Thus, the objective of achieving an efficient transmission performance of AODR in handling machine operation with WIA-FA networks is successful. Figure 10. Reliability of AODR and NACK-R mode for n=80 Figure 11. Reliability of AODR and NACK-R mode for n=60

Conclusion
A reliable 5G communication for WIA-FA networks has been investigated. The protocol architecture of WIA-FA is based on an OSI reference model where the DLL is where the default retransmission scheme does its work. NACK-R mode is enhanced with AODR to make sure efficient retransmission of timeslots in a super frame. An algorithm based on the AODR scheme in handling machine operation for the WIA-FA networks has been developed. Formulas for NACK-R mode and AODR scheme are developed for calculating the efficiency between both schemes. NACK-R mode has an assumption that it is theorybased, which will not be useful in real life. So, AODR is used to correct the mistake of NACK-R mode. The simulation results show that the timeslots retransmission performance of the developed algorithm. The graphs show that AODR is better than NACK-R mode for various packet loss rates and some retransmissions. This insight is due to the AODR allocates the retransmission timeslots in an on-demand