FUNCTION BLOCKS EXECUTION SCHEDULING METHOD IN EPA INDUSTRIAL ETHERNET

Ning Liu, Chongquan Zhong, and Tonglong Xue

References

  1. [1] I. Draganjac and T. Petrovic, Highly-scalable traffic management of autonomous industrial transportation systems, Robotics and Computer-Integrated Manufacturing, 63(1), 2020, 169–182.
  2. [2] D. Aslan and Y. Altintas, Prediction of cutting forces in five-axis milling using feed drive current measurements, IEEE/ASME Transactions on Mechatronics, 23(2), 2018, 833–844.
  3. [3] S. Kayalvizhi and D.M. Vinod Kumar, Planning of autonomous microgrid with energy storage using grid-based multi-objective harmony search algorithm, International Journal of Power and Energy Systems, 37(1), 2017, 10–18. DOI: 10.2316/Journal.203.2017.1.203-6276.
  4. [4] IEC/TR 61158-1, Digital data communication for measurement and control – Fieldbus for use in industrial control systems – Part 1: Overview and guidance (Geneva, Switzerland: International Electrotechnical Commission, 2007).
  5. [6]–[14] Research on the application method of EPA system application in specific engineering field Equipment [15]–[19] Research on the development method of EPA equipment and development system based on specific software and hardware platform Performance [20], [21] Research on the performance of EPA and propose the improvement methods to improve the performance data through EPA communication, and the subsequent FB can be effectively executed only after receiving the data. Therefore, the execution of FBs must be synchronized with EPA communication to ensure the communication performance and operation efficiency of EPA system. However, EPA standard only defines EPA deterministic communication scheduling mechanism but does not define the FBS. In practical engineering application, it is found that the following problems exist in EPA industrial Ethernet system. According to EPA deterministic communication scheduling mechanism, the communication cycle of EPA system is the preconfigured communication macrocycle, but due to the lack of EPA-FBS mechanism, the actual execution cycles of FBs in engineering application are EPA devices’ scanning cycles. Therefore, a cycle synchronization problem arises. Because the scanning cycles of EPA devices are generally relatively small, an FB in an EPA device will be executed many times in one EPA communication macrocycle. Each time the FB is executed, a message carrying its output data is generated and put into the messages-sending queue of the device. However, when the communication time slice of the device does not arrive, these messages in the queue cannot be sent, and when the communication time slice of the device arrives, these messages will be sent to the subsequent FB in turn according to the first-in first-out principle. Because these messages arrive at the input of the same FB, the old data will be covered by the new data and cannot be processed. This problem increases the communication load of EPA system unnecessarily. According to the previous discussion, it is very necessary to propose an FBS method to realize the synchronization between the execution of FBs and data communication in EPA system. In [22], [23], the asynchronous problem between the execution scheduling of FBs and data communication in EPA industrial Ethernet was studied, and the synchronization methods were proposed. However, the methods change EPA deterministic communication scheduling mechanism that is defined in the EPA standard and has been widely used in the equipment of engineering field. Therefore, the equipment realizing the methods cannot interoperate with normal EPA equipment in practical engineering applications. In this article, EPA-FBS method is proposed that is based on EPA deterministic communication scheduling mechanism and realizes the synchronization between the execution scheduling of FBs and data communication to improve the real-time performance of EPA system. 2. Ethernet for Plant Automation-Function Blocks Execution Scheduling Method In EPA system, each device executes a function task and a communication task. The function task is the execution of all the FBs in the device. These FBs have different functions and belong to different control loops, but they are all executed in sequence with the programme of the device, which is a scheduling unit. The communication task is the transmission of periodic messages. It executes EPA deterministic scheduling mechanism and is also a scheduling unit. The control function of an EPA system is achieved by executing the two tasks distributed in many devices in EPA network. EPA-FBS method is to synchronize the two tasks in a device as follows. First, each device in the EPA network is configured with function time slice and communication time slice without interval alternation. Second, functional task and communication task in a device can only be executed in their own time slices. Third, function tasks can only be executed once in a function time slice. The schematic diagram of EPA-FBS method is shown as Fig. 1, in which the communication time slice is the periodic messages transferring time slice, and the rest of the macrocycle is the function time slice. As the function task is only executed once in its time slice, and the generated periodic message can only be sent when the communication time slice arrives, the execution of the function task has two characteristics as follows. First, a device executes Figure 1. Scheduling diagram of EPA-FBS method. 100 its function task and communication task alternately and circularly; moreover, it executes its function task and puts generated messages into the messages-sending queue before communication time slice arrives in each macrocycle. Second, the function task can only be executed once in each EPA macrocycle, so that the communication task and the function task achieve the cycle synchronization with the macrocycle. Therefore, EPA-FBS method can prevent the invalid execution of FBs. 3. Parameters of Ethernet for Plant AutomationFunction Blocks Execution Scheduling Method The parameters related to EPA-FBS method include function time slice F, communication time slice S, non-periodic messages sending time slice B and macrocycle T. The key to the success of the method is that the function time slice is enough to execute the function task. If the function time slices of device i is recorded as Fi and the function task execution time of device i is recorded as Ci, Fi should be bigger than or equal to Ci, as shown in the following equation: Fi ≥ Ci (1) According to EPA-FBS method, the relation between the communication time slice Si and the function time slice Fi of device i can be shown as follows: Fi = T − Si (2) According to EPA deterministic scheduling mechanism, the macrocycle T is the sum of the non-periodic messages sending time slice B and the communication time slices S of all the devices in the network, as shown in the following equation: T = n j=1 Sj + B (3) where n is the number of the devices in the EPA network, and Sj is the communication time slice of device j. Insert (3) into (2) and transform, Fi can be shown as follows: Fi = n j=1 Sj + B − Si (4) As shown in (4), Fi is equal to the sum of the communication time slice S of each device and the non-periodic messages transmission time slice B in the network minus the communication time slices S of device i. Insert (4) into (1) and transform, the following equation can be obtained: n j=1 Sj + B − Si ≥ Ci (5) However, in non-periodic messages sending time slice, function task and transmission of non-periodic messages are executed in parallel. To ensure the successful transmission of non-periodic messages, the priority of non-periodic messages’ transmission is higher than the function task in a device. Furthermore, the communication load of nonperiodic messages in control network is stochastic and difficult to determine in advance. When the communication load of non-periodic messages is very big, the function task will be frequently interrupted and cannot have effective and deterministic execution time. Thus, the setting of the time slices of EPA-FBS must meet the condition: Ri (function time slice Fi minus non-periodic messages sending time slice B) is no less than the function task execution time Ci of device i, as shown in the following equations: Ri ≥ Ci (6) Ri = n j=1 Sj − Si (7) Equations (6) and (7) are the setting conditions of the time slices of EPA-FBS method. 4. Realization The key problem of the realization of EPA-FBS method is the execution of function task. It has three requirements. First, a function task can only be executed in its function time slice and can only be executed once. Second, the function time slice of a device must be enough to execute its function task. Third, a function task must be executed immediately once function time slice arrives. The first requirement can be solved by setting scheduling tag. Scheduling tag is a logical variable. Each FB has one scheduling tag. When a device scans its FBs, scheduling tag is the basis whether it executes an FB or not. If the scheduling tag of the FB is true, the FB will be executed, otherwise, if it is false, the FB will not be executed. During communication time slice, a device sets the scheduling tags of all the FBs true. Then all the FBs will be executed when function time slice arrives. The execution of function task is shown as Fig. 2, m is the number of FBs in a device. Mj is the scheduling tag of FBi. When the program scans an FB, if its Mj is false, it skips to scan the next FB. If its Mj is true, it executes the FB and then sets its Mj to false. By this means, each FB can be executed only once in the task function time slice. But when the communication time slice arrives, the programme will set the scheduling tags of all the FBs to true so that the FBs can be executed when the next function time slice arrives. The second requirement can be solved by making devices monitor their time slices automatically and send out alarm messages. When the function task starts, the programme obtains current time Lt of the device. When the function task finishes, it obtains current time Lp. Then Ci = Lp − Lt. If Ci ≤ Ri, the time slice is enough to execute its function task. Otherwise, the time slice is not enough to execute its function task. So the device sends alarm messages to apply for resetting the time slices. 101 Figure 2. Execution of function. The third requirement can be solved using timer’s interrupt. The programme sets a timer that triggers an interrupt when communication time slice or function time slice arrives. EPA-FBS method is realized in the interrupt handler of the timer. The interrupt handler is shown as Fig. 3. When the interrupt is triggered, device i obtain current time Lt to determine whether current time is in the communication time slice or not according to the following equation: G = ⎧ ⎨ ⎩ Di ≤ MOD(Lt, T) ≺ Ds i = n Di ≤ MOD(Lt, T) ≺ Di+1 i = n (8) Therein, Di is the periodic-data-sending offsets of device i, and Di+1 is the periodic-data-sending offsets of device i+1. Ds is the non-periodic-data-sending offset of the network. G is a logical variable that indicates whether current time is in the communication time slice or not. If G is true, current time is in the communication time slice. The device calculates the start time of function time slice and updates the timer then sets scheduling tags of all the FBs in the device to true and then sends out periodic messages. If G is false, current time is in the function time slice. The device calculates the start time of communication time slice and updates the timer and then scans and executes FBs. In addition, to ensure the transmission of non-periodic message, a timer for the transmission of non-periodic messages is set. When the start time of the non-periodic messages time slice arrives, the timer triggers an interrupt and the interrupt handler calculates the start time of next non-periodic messages sending time slice and updates the timer and then sends out non-periodic messages. Figure 3. Flow chart of interrupt handler of function task timer. Figure 4. Experiment platform. 5. Experiment In this section, an experiment is conducted to verify the effect of EPA-FBS method. As shown in Fig. 4, the experimental platform is made up of a personal computer (PC), an EPA bridge and an EPA network, including a HUB, a TE (test equipment) and four DUTs (devices under test). The DUTs and TE are EPA control modules. EPAFBS method is realized in their protocol stack. The TE 102 Figure 5. Function diagram. Table 2 Configuration of Communication Time Slice and Adjustment Limit DUT Di Sa Sb Ds Ba Bb T (ms) (ms) (ms) (ms) (ms) (ms) (ms) 1 0 0.2 2 2 2 0.2 2 3 4 0.2 2 4 6 0.2 2 9 1 1 10 TE 8 0.5 0.5 Port 8.5 0.5 0.5 runs a specific programme for monitoring and analysing message transmission in the network. EPA-FBS method and EPA-timeslice self-adaptive adjustment (TSA) method proposed in [20] are realized in the communication protocol stack in the DUTs and TE. The EPA Bridge is used to forward the messages between the network and the PC. The PC runs a configuration and analysis software to configure the system and process experimental data. As shown in Fig. 5, 20 FBs distributed in the 4 DUTs are connected into 5 control loops. After application of EPA-FBS method, DUT1 sends two messages, DUT2 sends one message, DUT3 sends three messages and DUT4 sends one message in each macrocycle. The messages are EPA periodic messages whose sizes are 74 bytes. Before the application of EPA-FBS method, the execution times of function task in each macrocycle depend on the scanning cycle of each DUT and the number of messages that each DUT needs to send in each macrocycle depends on the scanning times. By comparing the communication time slice between before and after application of EPAFBS method, the effect of EPA-FBS method to reduce communication load and execution times of FBs can be obtained. The initial values of the periodic-data-sending offsets Di and the non-periodic-data-sending time slice Ds, the allowable extreme values Sa and Sb of communication time slice, the allowable extreme values Ba and Bb and the Figure 6. Time slices comparison before and after application of EPA-FBS method. Figure 7. Network delays comparison of control loops before and after application of EPA-FBS method. macrocycle T are shown in Table 2. The non-periodic messages sending time slice, the communication time slices of TE and testing port are locked so as to prevent the experimental results from being disturbed. The TE obtains the communication time slices of all the DUTs and the non-periodic messages sending time slice of the network in each macrocycle by means of receiving and processing the NDA (non-periodic data annunciation) messages. Then TE transmits the data to the configuration and analysis software in the PC through the EPA network. The configuration and analysis software running in the PC receives and processes the data and makes the average of the time slices from 100 macrocycles to display. In Fig. 6, the communication time slices Si and the non-periodic messages sending time slice B before and after application of EPA-FBS method are shown. Before the application of EPA-FBS, the communication time slices are very big. The communication time slices of the DUT1 and the DUT3 reach their maximum: 2 mm. While after the application of EPA-FBS, the communication time slices of DUT1–DUT4 reduce 67.6%, 61.2%, 61.8% and 65.4%, respectively, and the macrocycle reduces 48.8%. The more communication times a device need, the more obvious the effect of the reducing communication time slice is. The reduction of the communication time slices reflects the reduction of the communication load [20]. Combined with the previous content, the experimental results show that the execution times of FBs are reduced. The reduction of the execution times of FBs means the reduction of the calculation load of the EPA system so that the operation efficiency can be improved. Moreover, as shown in Fig. 7, after the application of EPA-FBS method, the network delays of control loop 103 1–control loop 5 reduce 46.2%, 44.9%, 43.1%, 43.1% and 67.5%, respectively. Thus, the experiment shows that EPA-FBS can improve the real-time performance of EPA system. 6. Conclusion In this article, a method to improve the real-time performance of EPA industrial Ethernet is proposed on the base of EPA deterministic scheduling mechanism. The method integrates all the FBs in a single-field device into a function task and sets the function time slice for the execution of the function task according to the principle of the cycle synchronization between the execution of FBs and the data communication in EPA system. On this basis, the method first realizes the single execution of each device’s function task in an EPA macrocycle by setting a scheduling tag in each FB and then realizes the quick trigger execution of the function task when its time slice arrives by using timer interrupt. By the previous means, the method realizes the synchronization between the execution scheduling of FBs and EPA deterministic communication so that it prevents the invalid executions of FBs in EPA system. The experiment proves that the method reduces the communication load and improves the real-time performance of EPA system. Acknowledgement The work reported in this article was funded jointly by two projects, which are the project of national science and technology supporting plan of China (No. 2015BAF20B02). References [1] I. Draganjac and T. Petrovic, Highly-scalable traffic management of autonomous industrial transportation systems, Robotics and Computer-Integrated Manufacturing, 63(1), 2020, 169–182. [2] D. Aslan and Y. Altintas, Prediction of cutting forces in five-axis milling using feed drive current measurements, IEEE/ASME Transactions on Mechatronics, 23(2), 2018, 833–844. [3] S. Kayalvizhi and D.M. Vinod Kumar, Planning of autonomous microgrid with energy storage using grid-based multi-objective harmony search algorithm, International Journal of Power and Energy Systems, 37(1), 2017, 10–18. DOI: 10.2316/Journal.203.2017.1.203-6276. [4] IEC/TR 61158-1, Digital data communication for measurement and control – Fieldbus for use in industrial control systems – Part 1: Overview and guidance (Geneva, Switzerland: International Electrotechnical Commission, 2007). [5] IEC61784-2, Industrial communication networks – Profiles – Part 2: Additional fieldbus profiles for real-time networks based on ISO/IEC 8802-3 (Geneva, Switzerland: International Electrotechnical Commission, 2007). [6] J. Wang, C. Xu, and W. Sun, Mine fully mechanized monitoring system of multiple fieldbus based on EPA standard, Coal Mine Machinery, 37(12), 2016, 177–182.
  6. [7] H. Wang, G. Wu, and P. Wang, Application of DRP in smart substation based on EPA, Automation of Electric Power Systems, 36(17), 2012, 77–81.
  7. [8] X. Zhu, Research on real-time Ethernet technique acceptable for digital substations, Guangdong Electric Power, 24(10), 2011, 48–52.
  8. [9] D. Mestriner and M. Invernizzi. Analysis of lightning effects on power plant connection, International Journal of Power and Energy Systems, 38(2), 2018, 40–49. DOI: 10.2316/ Journal.203.2018.2.203-0011.
  9. [10] W. Wang, B. Yang, and C. Shi, Development of EPA electric actuator based on small embedded RTOS, Instrument Technique and Sensor, 46(8), 2010, 22–29.
  10. [11] X. Wang, X. Hu, and Y. Zhang, Design and research of low-voltage DC Servo with EPA, Computer Engineering and Applications, 46(19), 2010, 58–66.
  11. [12] H. Li, H. Zhang, and D. Peng, Design and application of communication gateway of EPA and MODBUS on electric power system, Energy Procedia, 02(17), 2012, 286–292.
  12. [14] Research on the application method of EPA system application in specific engineering field Equipment
  13. [15]–[19] Research on the development method of EPA equipment and development system based on specific software and hardware platform Performance [20], [21] Research on the performance of EPA and propose the improvement methods to improve the performance data through EPA communication, and the subsequent FB can be effectively executed only after receiving the data. Therefore, the execution of FBs must be synchronized with EPA communication to ensure the communication performance and operation efficiency of EPA system. However, EPA standard only defines EPA deterministic communication scheduling mechanism but does not define the FBS. In practical engineering application, it is found that the following problems exist in EPA industrial Ethernet system. According to EPA deterministic communication scheduling mechanism, the communication cycle of EPA system is the preconfigured communication macrocycle, but due to the lack of EPA-FBS mechanism, the actual execution cycles of FBs in engineering application are EPA devices’ scanning cycles. Therefore, a cycle synchronization problem arises. Because the scanning cycles of EPA devices are generally relatively small, an FB in an EPA device will be executed many times in one EPA communication macrocycle. Each time the FB is executed, a message carrying its output data is generated and put into the messages-sending queue of the device. However, when the communication time slice of the device does not arrive, these messages in the queue cannot be sent, and when the communication time slice of the device arrives, these messages will be sent to the subsequent FB in turn according to the first-in first-out principle. Because these messages arrive at the input of the same FB, the old data will be covered by the new data and cannot be processed. This problem increases the communication load of EPA system unnecessarily. According to the previous discussion, it is very necessary to propose an FBS method to realize the synchronization between the execution of FBs and data communication in EPA system. In [22], [23], the asynchronous problem between the execution scheduling of FBs and data communication in EPA industrial Ethernet was studied, and the synchronization methods were proposed. However, the methods change EPA deterministic communication scheduling mechanism that is defined in the EPA standard and has been widely used in the equipment of engineering field. Therefore, the equipment realizing the methods cannot interoperate with normal EPA equipment in practical engineering applications. In this article, EPA-FBS method is proposed that is based on EPA deterministic communication scheduling mechanism and realizes the synchronization between the execution scheduling of FBs and data communication to improve the real-time performance of EPA system. 2. Ethernet for Plant Automation-Function Blocks Execution Scheduling Method In EPA system, each device executes a function task and a communication task. The function task is the execution of all the FBs in the device. These FBs have different functions and belong to different control loops, but they are all executed in sequence with the programme of the device, which is a scheduling unit. The communication task is the transmission of periodic messages. It executes EPA deterministic scheduling mechanism and is also a scheduling unit. The control function of an EPA system is achieved by executing the two tasks distributed in many devices in EPA network. EPA-FBS method is to synchronize the two tasks in a device as follows. First, each device in the EPA network is configured with function time slice and communication time slice without interval alternation. Second, functional task and communication task in a device can only be executed in their own time slices. Third, function tasks can only be executed once in a function time slice. The schematic diagram of EPA-FBS method is shown as Fig. 1, in which the communication time slice is the periodic messages transferring time slice, and the rest of the macrocycle is the function time slice. As the function task is only executed once in its time slice, and the generated periodic message can only be sent when the communication time slice arrives, the execution of the function task has two characteristics as follows. First, a device executes Figure 1. Scheduling diagram of EPA-FBS method. 100 its function task and communication task alternately and circularly; moreover, it executes its function task and puts generated messages into the messages-sending queue before communication time slice arrives in each macrocycle. Second, the function task can only be executed once in each EPA macrocycle, so that the communication task and the function task achieve the cycle synchronization with the macrocycle. Therefore, EPA-FBS method can prevent the invalid execution of FBs. 3. Parameters of Ethernet for Plant AutomationFunction Blocks Execution Scheduling Method The parameters related to EPA-FBS method include function time slice F, communication time slice S, non-periodic messages sending time slice B and macrocycle T. The key to the success of the method is that the function time slice is enough to execute the function task. If the function time slices of device i is recorded as Fi and the function task execution time of device i is recorded as Ci, Fi should be bigger than or equal to Ci, as shown in the following equation: Fi ≥ Ci (1) According to EPA-FBS method, the relation between the communication time slice Si and the function time slice Fi of device i can be shown as follows: Fi = T − Si (2) According to EPA deterministic scheduling mechanism, the macrocycle T is the sum of the non-periodic messages sending time slice B and the communication time slices S of all the devices in the network, as shown in the following equation: T = n j=1 Sj + B (3) where n is the number of the devices in the EPA network, and Sj is the communication time slice of device j. Insert (3) into (2) and transform, Fi can be shown as follows: Fi = n j=1 Sj + B − Si (4) As shown in (4), Fi is equal to the sum of the communication time slice S of each device and the non-periodic messages transmission time slice B in the network minus the communication time slices S of device i. Insert (4) into (1) and transform, the following equation can be obtained: n j=1 Sj + B − Si ≥ Ci (5) However, in non-periodic messages sending time slice, function task and transmission of non-periodic messages are executed in parallel. To ensure the successful transmission of non-periodic messages, the priority of non-periodic messages’ transmission is higher than the function task in a device. Furthermore, the communication load of nonperiodic messages in control network is stochastic and difficult to determine in advance. When the communication load of non-periodic messages is very big, the function task will be frequently interrupted and cannot have effective and deterministic execution time. Thus, the setting of the time slices of EPA-FBS must meet the condition: Ri (function time slice Fi minus non-periodic messages sending time slice B) is no less than the function task execution time Ci of device i, as shown in the following equations: Ri ≥ Ci (6) Ri = n j=1 Sj − Si (7) Equations (6) and (7) are the setting conditions of the time slices of EPA-FBS method. 4. Realization The key problem of the realization of EPA-FBS method is the execution of function task. It has three requirements. First, a function task can only be executed in its function time slice and can only be executed once. Second, the function time slice of a device must be enough to execute its function task. Third, a function task must be executed immediately once function time slice arrives. The first requirement can be solved by setting scheduling tag. Scheduling tag is a logical variable. Each FB has one scheduling tag. When a device scans its FBs, scheduling tag is the basis whether it executes an FB or not. If the scheduling tag of the FB is true, the FB will be executed, otherwise, if it is false, the FB will not be executed. During communication time slice, a device sets the scheduling tags of all the FBs true. Then all the FBs will be executed when function time slice arrives. The execution of function task is shown as Fig. 2, m is the number of FBs in a device. Mj is the scheduling tag of FBi. When the program scans an FB, if its Mj is false, it skips to scan the next FB. If its Mj is true, it executes the FB and then sets its Mj to false. By this means, each FB can be executed only once in the task function time slice. But when the communication time slice arrives, the programme will set the scheduling tags of all the FBs to true so that the FBs can be executed when the next function time slice arrives. The second requirement can be solved by making devices monitor their time slices automatically and send out alarm messages. When the function task starts, the programme obtains current time Lt of the device. When the function task finishes, it obtains current time Lp. Then Ci = Lp − Lt. If Ci ≤ Ri, the time slice is enough to execute its function task. Otherwise, the time slice is not enough to execute its function task. So the device sends alarm messages to apply for resetting the time slices. 101 Figure 2. Execution of function. The third requirement can be solved using timer’s interrupt. The programme sets a timer that triggers an interrupt when communication time slice or function time slice arrives. EPA-FBS method is realized in the interrupt handler of the timer. The interrupt handler is shown as Fig. 3. When the interrupt is triggered, device i obtain current time Lt to determine whether current time is in the communication time slice or not according to the following equation: G = ⎧ ⎨ ⎩ Di ≤ MOD(Lt, T) ≺ Ds i = n Di ≤ MOD(Lt, T) ≺ Di+1 i = n (8) Therein, Di is the periodic-data-sending offsets of device i, and Di+1 is the periodic-data-sending offsets of device i+1. Ds is the non-periodic-data-sending offset of the network. G is a logical variable that indicates whether current time is in the communication time slice or not. If G is true, current time is in the communication time slice. The device calculates the start time of function time slice and updates the timer then sets scheduling tags of all the FBs in the device to true and then sends out periodic messages. If G is false, current time is in the function time slice. The device calculates the start time of communication time slice and updates the timer and then scans and executes FBs. In addition, to ensure the transmission of non-periodic message, a timer for the transmission of non-periodic messages is set. When the start time of the non-periodic messages time slice arrives, the timer triggers an interrupt and the interrupt handler calculates the start time of next non-periodic messages sending time slice and updates the timer and then sends out non-periodic messages. Figure 3. Flow chart of interrupt handler of function task timer. Figure 4. Experiment platform. 5. Experiment In this section, an experiment is conducted to verify the effect of EPA-FBS method. As shown in Fig. 4, the experimental platform is made up of a personal computer (PC), an EPA bridge and an EPA network, including a HUB, a TE (test equipment) and four DUTs (devices under test). The DUTs and TE are EPA control modules. EPAFBS method is realized in their protocol stack. The TE 102 Figure 5. Function diagram. Table 2 Configuration of Communication Time Slice and Adjustment Limit DUT Di Sa Sb Ds Ba Bb T (ms) (ms) (ms) (ms) (ms) (ms) (ms) 1 0 0.2 2 2 2 0.2 2 3 4 0.2 2 4 6 0.2 2 9 1 1 10 TE 8 0.5 0.5 Port 8.5 0.5 0.5 runs a specific programme for monitoring and analysing message transmission in the network. EPA-FBS method and EPA-timeslice self-adaptive adjustment (TSA) method proposed in [20] are realized in the communication protocol stack in the DUTs and TE. The EPA Bridge is used to forward the messages between the network and the PC. The PC runs a configuration and analysis software to configure the system and process experimental data. As shown in Fig. 5, 20 FBs distributed in the 4 DUTs are connected into 5 control loops. After application of EPA-FBS method, DUT1 sends two messages, DUT2 sends one message, DUT3 sends three messages and DUT4 sends one message in each macrocycle. The messages are EPA periodic messages whose sizes are 74 bytes. Before the application of EPA-FBS method, the execution times of function task in each macrocycle depend on the scanning cycle of each DUT and the number of messages that each DUT needs to send in each macrocycle depends on the scanning times. By comparing the communication time slice between before and after application of EPAFBS method, the effect of EPA-FBS method to reduce communication load and execution times of FBs can be obtained. The initial values of the periodic-data-sending offsets Di and the non-periodic-data-sending time slice Ds, the allowable extreme values Sa and Sb of communication time slice, the allowable extreme values Ba and Bb and the Figure 6. Time slices comparison before and after application of EPA-FBS method. Figure 7. Network delays comparison of control loops before and after application of EPA-FBS method. macrocycle T are shown in Table 2. The non-periodic messages sending time slice, the communication time slices of TE and testing port are locked so as to prevent the experimental results from being disturbed. The TE obtains the communication time slices of all the DUTs and the non-periodic messages sending time slice of the network in each macrocycle by means of receiving and processing the NDA (non-periodic data annunciation) messages. Then TE transmits the data to the configuration and analysis software in the PC through the EPA network. The configuration and analysis software running in the PC receives and processes the data and makes the average of the time slices from 100 macrocycles to display. In Fig. 6, the communication time slices Si and the non-periodic messages sending time slice B before and after application of EPA-FBS method are shown. Before the application of EPA-FBS, the communication time slices are very big. The communication time slices of the DUT1 and the DUT3 reach their maximum: 2 mm. While after the application of EPA-FBS, the communication time slices of DUT1–DUT4 reduce 67.6%, 61.2%, 61.8% and 65.4%, respectively, and the macrocycle reduces 48.8%. The more communication times a device need, the more obvious the effect of the reducing communication time slice is. The reduction of the communication time slices reflects the reduction of the communication load [20]. Combined with the previous content, the experimental results show that the execution times of FBs are reduced. The reduction of the execution times of FBs means the reduction of the calculation load of the EPA system so that the operation efficiency can be improved. Moreover, as shown in Fig. 7, after the application of EPA-FBS method, the network delays of control loop 103 1–control loop 5 reduce 46.2%, 44.9%, 43.1%, 43.1% and 67.5%, respectively. Thus, the experiment shows that EPA-FBS can improve the real-time performance of EPA system. 6. Conclusion In this article, a method to improve the real-time performance of EPA industrial Ethernet is proposed on the base of EPA deterministic scheduling mechanism. The method integrates all the FBs in a single-field device into a function task and sets the function time slice for the execution of the function task according to the principle of the cycle synchronization between the execution of FBs and the data communication in EPA system. On this basis, the method first realizes the single execution of each device’s function task in an EPA macrocycle by setting a scheduling tag in each FB and then realizes the quick trigger execution of the function task when its time slice arrives by using timer interrupt. By the previous means, the method realizes the synchronization between the execution scheduling of FBs and EPA deterministic communication so that it prevents the invalid executions of FBs in EPA system. The experiment proves that the method reduces the communication load and improves the real-time performance of EPA system. Acknowledgement The work reported in this article was funded jointly by two projects, which are the project of national science and technology supporting plan of China (No. 2015BAF20B02). References [1] I. Draganjac and T. Petrovic, Highly-scalable traffic management of autonomous industrial transportation systems, Robotics and Computer-Integrated Manufacturing, 63(1), 2020, 169–182. [2] D. Aslan and Y. Altintas, Prediction of cutting forces in five-axis milling using feed drive current measurements, IEEE/ASME Transactions on Mechatronics, 23(2), 2018, 833–844. [3] S. Kayalvizhi and D.M. Vinod Kumar, Planning of autonomous microgrid with energy storage using grid-based multi-objective harmony search algorithm, International Journal of Power and Energy Systems, 37(1), 2017, 10–18. DOI: 10.2316/Journal.203.2017.1.203-6276. [4] IEC/TR 61158-1, Digital data communication for measurement and control – Fieldbus for use in industrial control systems – Part 1: Overview and guidance (Geneva, Switzerland: International Electrotechnical Commission, 2007). [5] IEC61784-2, Industrial communication networks – Profiles – Part 2: Additional fieldbus profiles for real-time networks based on ISO/IEC 8802-3 (Geneva, Switzerland: International Electrotechnical Commission, 2007). [6] J. Wang, C. Xu, and W. Sun, Mine fully mechanized monitoring system of multiple fieldbus based on EPA standard, Coal Mine Machinery, 37(12), 2016, 177–182. [7] H. Wang, G. Wu, and P. Wang, Application of DRP in smart substation based on EPA, Automation of Electric Power Systems, 36(17), 2012, 77–81. [8] X. Zhu, Research on real-time Ethernet technique acceptable for digital substations, Guangdong Electric Power, 24(10), 2011, 48–52. [9] D. Mestriner and M. Invernizzi. Analysis of lightning effects on power plant connection, International Journal of Power and Energy Systems, 38(2), 2018, 40–49. DOI: 10.2316/ Journal.203.2018.2.203-0011. [10] W. Wang, B. Yang, and C. Shi, Development of EPA electric actuator based on small embedded RTOS, Instrument Technique and Sensor, 46(8), 2010, 22–29. [11] X. Wang, X. Hu, and Y. Zhang, Design and research of low-voltage DC Servo with EPA, Computer Engineering and Applications, 46(19), 2010, 58–66. [12] H. Li, H. Zhang, and D. Peng, Design and application of communication gateway of EPA and MODBUS on electric power system, Energy Procedia, 02(17), 2012, 286–292. [13] Y. Cao, Y. Tong, and Y. Tang, Application of EPA real-time Ethernet technology in marine PLC control system, Instrument Standardization & Metrology, 36(1), 2019, 18–21. [14] S. Luo and J. Huang, Design of integrated control system for brake valve maintenance based on EPA protocol, Technology Innovation and Application, 12(5), 2018, 110–114. [15] Q. Tong and T. Wang, The EPA on-chip communication system with AMBA bus, China Instrumentation, 26(4), 2018, 65–70.
  14. [16] R. Shi, Research and implementation of PLC network communication function block technology (Dalian, China: Dalian University of Technology, 2016).
  15. [17] Y. He, D. Feng, and Y. Zhu, Deterministic transmission of multimedia data based on EPA network, Computer Engineering, 40(2), 2014, 26–30.
  16. [19] Research on the development method of EPA equipment and development system based on specific software and hardware platform Performance
  17. [20],
  18. [21] Research on the performance of EPA and propose the improvement methods to improve the performance data through EPA communication, and the subsequent FB can be effectively executed only after receiving the data. Therefore, the execution of FBs must be synchronized with EPA communication to ensure the communication performance and operation efficiency of EPA system. However, EPA standard only defines EPA deterministic communication scheduling mechanism but does not define the FBS. In practical engineering application, it is found that the following problems exist in EPA industrial Ethernet system. According to EPA deterministic communication scheduling mechanism, the communication cycle of EPA system is the preconfigured communication macrocycle, but due to the lack of EPA-FBS mechanism, the actual execution cycles of FBs in engineering application are EPA devices’ scanning cycles. Therefore, a cycle synchronization problem arises. Because the scanning cycles of EPA devices are generally relatively small, an FB in an EPA device will be executed many times in one EPA communication macrocycle. Each time the FB is executed, a message carrying its output data is generated and put into the messages-sending queue of the device. However, when the communication time slice of the device does not arrive, these messages in the queue cannot be sent, and when the communication time slice of the device arrives, these messages will be sent to the subsequent FB in turn according to the first-in first-out principle. Because these messages arrive at the input of the same FB, the old data will be covered by the new data and cannot be processed. This problem increases the communication load of EPA system unnecessarily. According to the previous discussion, it is very necessary to propose an FBS method to realize the synchronization between the execution of FBs and data communication in EPA system. In
  19. [22],
  20. [23], the asynchronous problem between the execution scheduling of FBs and data communication in EPA industrial Ethernet was studied, and the synchronization methods were proposed. However, the methods change EPA deterministic communication scheduling mechanism that is defined in the EPA standard and has been widely used in the equipment of engineering field. Therefore, the equipment realizing the methods cannot interoperate with normal EPA equipment in practical engineering applications. In this article, EPA-FBS method is proposed that is based on EPA deterministic communication scheduling mechanism and realizes the synchronization between the execution scheduling of FBs and data communication to improve the real-time performance of EPA system. 2. Ethernet for Plant Automation-Function Blocks Execution Scheduling Method In EPA system, each device executes a function task and a communication task. The function task is the execution of all the FBs in the device. These FBs have different functions and belong to different control loops, but they are all executed in sequence with the programme of the device, which is a scheduling unit. The communication task is the transmission of periodic messages. It executes EPA deterministic scheduling mechanism and is also a scheduling unit. The control function of an EPA system is achieved by executing the two tasks distributed in many devices in EPA network. EPA-FBS method is to synchronize the two tasks in a device as follows. First, each device in the EPA network is configured with function time slice and communication time slice without interval alternation. Second, functional task and communication task in a device can only be executed in their own time slices. Third, function tasks can only be executed once in a function time slice. The schematic diagram of EPA-FBS method is shown as Fig. 1, in which the communication time slice is the periodic messages transferring time slice, and the rest of the macrocycle is the function time slice. As the function task is only executed once in its time slice, and the generated periodic message can only be sent when the communication time slice arrives, the execution of the function task has two characteristics as follows. First, a device executes Figure 1. Scheduling diagram of EPA-FBS method. 100 its function task and communication task alternately and circularly; moreover, it executes its function task and puts generated messages into the messages-sending queue before communication time slice arrives in each macrocycle. Second, the function task can only be executed once in each EPA macrocycle, so that the communication task and the function task achieve the cycle synchronization with the macrocycle. Therefore, EPA-FBS method can prevent the invalid execution of FBs. 3. Parameters of Ethernet for Plant AutomationFunction Blocks Execution Scheduling Method The parameters related to EPA-FBS method include function time slice F, communication time slice S, non-periodic messages sending time slice B and macrocycle T. The key to the success of the method is that the function time slice is enough to execute the function task. If the function time slices of device i is recorded as Fi and the function task execution time of device i is recorded as Ci, Fi should be bigger than or equal to Ci, as shown in the following equation: Fi ≥ Ci (1) According to EPA-FBS method, the relation between the communication time slice Si and the function time slice Fi of device i can be shown as follows: Fi = T − Si (2) According to EPA deterministic scheduling mechanism, the macrocycle T is the sum of the non-periodic messages sending time slice B and the communication time slices S of all the devices in the network, as shown in the following equation: T = n j=1 Sj + B (3) where n is the number of the devices in the EPA network, and Sj is the communication time slice of device j. Insert (3) into (2) and transform, Fi can be shown as follows: Fi = n j=1 Sj + B − Si (4) As shown in (4), Fi is equal to the sum of the communication time slice S of each device and the non-periodic messages transmission time slice B in the network minus the communication time slices S of device i. Insert (4) into (1) and transform, the following equation can be obtained: n j=1 Sj + B − Si ≥ Ci (5) However, in non-periodic messages sending time slice, function task and transmission of non-periodic messages are executed in parallel. To ensure the successful transmission of non-periodic messages, the priority of non-periodic messages’ transmission is higher than the function task in a device. Furthermore, the communication load of nonperiodic messages in control network is stochastic and difficult to determine in advance. When the communication load of non-periodic messages is very big, the function task will be frequently interrupted and cannot have effective and deterministic execution time. Thus, the setting of the time slices of EPA-FBS must meet the condition: Ri (function time slice Fi minus non-periodic messages sending time slice B) is no less than the function task execution time Ci of device i, as shown in the following equations: Ri ≥ Ci (6) Ri = n j=1 Sj − Si (7) Equations (6) and (7) are the setting conditions of the time slices of EPA-FBS method. 4. Realization The key problem of the realization of EPA-FBS method is the execution of function task. It has three requirements. First, a function task can only be executed in its function time slice and can only be executed once. Second, the function time slice of a device must be enough to execute its function task. Third, a function task must be executed immediately once function time slice arrives. The first requirement can be solved by setting scheduling tag. Scheduling tag is a logical variable. Each FB has one scheduling tag. When a device scans its FBs, scheduling tag is the basis whether it executes an FB or not. If the scheduling tag of the FB is true, the FB will be executed, otherwise, if it is false, the FB will not be executed. During communication time slice, a device sets the scheduling tags of all the FBs true. Then all the FBs will be executed when function time slice arrives. The execution of function task is shown as Fig. 2, m is the number of FBs in a device. Mj is the scheduling tag of FBi. When the program scans an FB, if its Mj is false, it skips to scan the next FB. If its Mj is true, it executes the FB and then sets its Mj to false. By this means, each FB can be executed only once in the task function time slice. But when the communication time slice arrives, the programme will set the scheduling tags of all the FBs to true so that the FBs can be executed when the next function time slice arrives. The second requirement can be solved by making devices monitor their time slices automatically and send out alarm messages. When the function task starts, the programme obtains current time Lt of the device. When the function task finishes, it obtains current time Lp. Then Ci = Lp − Lt. If Ci ≤ Ri, the time slice is enough to execute its function task. Otherwise, the time slice is not enough to execute its function task. So the device sends alarm messages to apply for resetting the time slices. 101 Figure 2. Execution of function. The third requirement can be solved using timer’s interrupt. The programme sets a timer that triggers an interrupt when communication time slice or function time slice arrives. EPA-FBS method is realized in the interrupt handler of the timer. The interrupt handler is shown as Fig. 3. When the interrupt is triggered, device i obtain current time Lt to determine whether current time is in the communication time slice or not according to the following equation: G = ⎧ ⎨ ⎩ Di ≤ MOD(Lt, T) ≺ Ds i = n Di ≤ MOD(Lt, T) ≺ Di+1 i = n (8) Therein, Di is the periodic-data-sending offsets of device i, and Di+1 is the periodic-data-sending offsets of device i+1. Ds is the non-periodic-data-sending offset of the network. G is a logical variable that indicates whether current time is in the communication time slice or not. If G is true, current time is in the communication time slice. The device calculates the start time of function time slice and updates the timer then sets scheduling tags of all the FBs in the device to true and then sends out periodic messages. If G is false, current time is in the function time slice. The device calculates the start time of communication time slice and updates the timer and then scans and executes FBs. In addition, to ensure the transmission of non-periodic message, a timer for the transmission of non-periodic messages is set. When the start time of the non-periodic messages time slice arrives, the timer triggers an interrupt and the interrupt handler calculates the start time of next non-periodic messages sending time slice and updates the timer and then sends out non-periodic messages. Figure 3. Flow chart of interrupt handler of function task timer. Figure 4. Experiment platform. 5. Experiment In this section, an experiment is conducted to verify the effect of EPA-FBS method. As shown in Fig. 4, the experimental platform is made up of a personal computer (PC), an EPA bridge and an EPA network, including a HUB, a TE (test equipment) and four DUTs (devices under test). The DUTs and TE are EPA control modules. EPAFBS method is realized in their protocol stack. The TE 102 Figure 5. Function diagram. Table 2 Configuration of Communication Time Slice and Adjustment Limit DUT Di Sa Sb Ds Ba Bb T (ms) (ms) (ms) (ms) (ms) (ms) (ms) 1 0 0.2 2 2 2 0.2 2 3 4 0.2 2 4 6 0.2 2 9 1 1 10 TE 8 0.5 0.5 Port 8.5 0.5 0.5 runs a specific programme for monitoring and analysing message transmission in the network. EPA-FBS method and EPA-timeslice self-adaptive adjustment (TSA) method proposed in [20] are realized in the communication protocol stack in the DUTs and TE. The EPA Bridge is used to forward the messages between the network and the PC. The PC runs a configuration and analysis software to configure the system and process experimental data. As shown in Fig. 5, 20 FBs distributed in the 4 DUTs are connected into 5 control loops. After application of EPA-FBS method, DUT1 sends two messages, DUT2 sends one message, DUT3 sends three messages and DUT4 sends one message in each macrocycle. The messages are EPA periodic messages whose sizes are 74 bytes. Before the application of EPA-FBS method, the execution times of function task in each macrocycle depend on the scanning cycle of each DUT and the number of messages that each DUT needs to send in each macrocycle depends on the scanning times. By comparing the communication time slice between before and after application of EPAFBS method, the effect of EPA-FBS method to reduce communication load and execution times of FBs can be obtained. The initial values of the periodic-data-sending offsets Di and the non-periodic-data-sending time slice Ds, the allowable extreme values Sa and Sb of communication time slice, the allowable extreme values Ba and Bb and the Figure 6. Time slices comparison before and after application of EPA-FBS method. Figure 7. Network delays comparison of control loops before and after application of EPA-FBS method. macrocycle T are shown in Table 2. The non-periodic messages sending time slice, the communication time slices of TE and testing port are locked so as to prevent the experimental results from being disturbed. The TE obtains the communication time slices of all the DUTs and the non-periodic messages sending time slice of the network in each macrocycle by means of receiving and processing the NDA (non-periodic data annunciation) messages. Then TE transmits the data to the configuration and analysis software in the PC through the EPA network. The configuration and analysis software running in the PC receives and processes the data and makes the average of the time slices from 100 macrocycles to display. In Fig. 6, the communication time slices Si and the non-periodic messages sending time slice B before and after application of EPA-FBS method are shown. Before the application of EPA-FBS, the communication time slices are very big. The communication time slices of the DUT1 and the DUT3 reach their maximum: 2 mm. While after the application of EPA-FBS, the communication time slices of DUT1–DUT4 reduce 67.6%, 61.2%, 61.8% and 65.4%, respectively, and the macrocycle reduces 48.8%. The more communication times a device need, the more obvious the effect of the reducing communication time slice is. The reduction of the communication time slices reflects the reduction of the communication load [20]. Combined with the previous content, the experimental results show that the execution times of FBs are reduced. The reduction of the execution times of FBs means the reduction of the calculation load of the EPA system so that the operation efficiency can be improved. Moreover, as shown in Fig. 7, after the application of EPA-FBS method, the network delays of control loop 103 1–control loop 5 reduce 46.2%, 44.9%, 43.1%, 43.1% and 67.5%, respectively. Thus, the experiment shows that EPA-FBS can improve the real-time performance of EPA system. 6. Conclusion In this article, a method to improve the real-time performance of EPA industrial Ethernet is proposed on the base of EPA deterministic scheduling mechanism. The method integrates all the FBs in a single-field device into a function task and sets the function time slice for the execution of the function task according to the principle of the cycle synchronization between the execution of FBs and the data communication in EPA system. On this basis, the method first realizes the single execution of each device’s function task in an EPA macrocycle by setting a scheduling tag in each FB and then realizes the quick trigger execution of the function task when its time slice arrives by using timer interrupt. By the previous means, the method realizes the synchronization between the execution scheduling of FBs and EPA deterministic communication so that it prevents the invalid executions of FBs in EPA system. The experiment proves that the method reduces the communication load and improves the real-time performance of EPA system. Acknowledgement The work reported in this article was funded jointly by two projects, which are the project of national science and technology supporting plan of China (No. 2015BAF20B02). References [1] I. Draganjac and T. Petrovic, Highly-scalable traffic management of autonomous industrial transportation systems, Robotics and Computer-Integrated Manufacturing, 63(1), 2020, 169–182. [2] D. Aslan and Y. Altintas, Prediction of cutting forces in five-axis milling using feed drive current measurements, IEEE/ASME Transactions on Mechatronics, 23(2), 2018, 833–844. [3] S. Kayalvizhi and D.M. Vinod Kumar, Planning of autonomous microgrid with energy storage using grid-based multi-objective harmony search algorithm, International Journal of Power and Energy Systems, 37(1), 2017, 10–18. DOI: 10.2316/Journal.203.2017.1.203-6276. [4] IEC/TR 61158-1, Digital data communication for measurement and control – Fieldbus for use in industrial control systems – Part 1: Overview and guidance (Geneva, Switzerland: International Electrotechnical Commission, 2007). [5] IEC61784-2, Industrial communication networks – Profiles – Part 2: Additional fieldbus profiles for real-time networks based on ISO/IEC 8802-3 (Geneva, Switzerland: International Electrotechnical Commission, 2007). [6] J. Wang, C. Xu, and W. Sun, Mine fully mechanized monitoring system of multiple fieldbus based on EPA standard, Coal Mine Machinery, 37(12), 2016, 177–182. [7] H. Wang, G. Wu, and P. Wang, Application of DRP in smart substation based on EPA, Automation of Electric Power Systems, 36(17), 2012, 77–81. [8] X. Zhu, Research on real-time Ethernet technique acceptable for digital substations, Guangdong Electric Power, 24(10), 2011, 48–52. [9] D. Mestriner and M. Invernizzi. Analysis of lightning effects on power plant connection, International Journal of Power and Energy Systems, 38(2), 2018, 40–49. DOI: 10.2316/ Journal.203.2018.2.203-0011. [10] W. Wang, B. Yang, and C. Shi, Development of EPA electric actuator based on small embedded RTOS, Instrument Technique and Sensor, 46(8), 2010, 22–29. [11] X. Wang, X. Hu, and Y. Zhang, Design and research of low-voltage DC Servo with EPA, Computer Engineering and Applications, 46(19), 2010, 58–66. [12] H. Li, H. Zhang, and D. Peng, Design and application of communication gateway of EPA and MODBUS on electric power system, Energy Procedia, 02(17), 2012, 286–292. [13] Y. Cao, Y. Tong, and Y. Tang, Application of EPA real-time Ethernet technology in marine PLC control system, Instrument Standardization & Metrology, 36(1), 2019, 18–21. [14] S. Luo and J. Huang, Design of integrated control system for brake valve maintenance based on EPA protocol, Technology Innovation and Application, 12(5), 2018, 110–114. [15] Q. Tong and T. Wang, The EPA on-chip communication system with AMBA bus, China Instrumentation, 26(4), 2018, 65–70. [16] R. Shi, Research and implementation of PLC network communication function block technology (Dalian, China: Dalian University of Technology, 2016). [17] Y. He, D. Feng, and Y. Zhu, Deterministic transmission of multimedia data based on EPA network, Computer Engineering, 40(2), 2014, 26–30. [18] F. Cheng, D. Feng, and J. Chu, Industrial wireless network realtime and reliable routing algorithm based on EPA, Computer Engineering, 40(5), 2014, 73–80. [19] K. Tian, Research on security schemes under EPA standards for industrial control networks (Shenyang, China: Shenyang University of Chemical Technology, 2019). [20] N. Liu, C. Zhong, and H. Teng, Self-adaptive adjustment method of the data transmission time-slice in EPA system, Chinese Journal of Scientific Instrument, 30(11), 2009, 2298–2304. [21] X. Liu, Delay features analysis of EPA real-time industrial Ethernet based on µclinux, Information and Communications, 13(3), 2016, 24–29. [22] N. Liu, K. Lv, and T. Xue, Synchronization method between control and communication in the system based on EPA realtime Ethernet, Control Engineering of China, 26(7), 2019, 1391–1396. [23] N. Liu, C. Zhong, and T. Xue, A function blocks executing method in the control systems based on real-time Ethernet, Computer Engineering and Applications, 55(13), 2019, 112–118.

Important Links:

Go Back