Abstract : Solar thermal systems are hybrid systems involving the interaction of continuous-variable dynamic systems and discrete-event dynamic systems. Based on a hierarchical structural model framework, the hybrid characteristics of a solar thermal control system are analyzed. A simulation model of a solar thermal system based on a generalized hybrid Petri net is established, building upon the traditional hybrid Petri net. Simulation analysis of the generalized hybrid Petri net model of the solar thermal system is then performed using Stateflow and Simulink in Matlab, laying the foundation for further optimization of the hybrid controller performance.
Keywords : solar thermal collector; hybrid Petri net; model; hybrid system
Research on solar collector system based on hybrid Petri net
MIAO Jing-fang 1 , JIANG Ping CHEN Feng, CHENG Shuang-shuang, XIAO Hong-sheng 2
(1. School of Electrical Engineering, Nantong University, Nantong 226019,China; 2. Jiangsu Sunshore Solar Energy Industry CO.,LTD, Nantong 226301,China)
Abstract : The solar collector system is a hybrid system consisting of continuous variables dynamic system and discrete events dynamic system. The hybrid features of solar collector system analyzed in the hierarchical structure modeling framework, The Solar collector simulation system is set up on the basis of the model of generalized hybrid Petri net. Simulation analysis of GHPN model of solar collector system is made by Stateflow and Simulink based on Matlab. It is the groundwork of the future research for founding optimzing hybrid controller.
Key words : solar collector system; hybrid Petri nets; modeling; hybrid system
0 Introduction
With the deepening of research in control theory and control engineering, practical engineering increasingly demands the handling of situations where discrete control and decision variables coexist with continuous parameters, such as process control systems. This is the currently widely studied problem of hybrid systems (HS). In recent years, Petri nets (PN) have gradually become a powerful tool for describing and analyzing discrete event dynamic systems with characteristics such as synchronization, concurrency, and conflict, and have been widely applied in fields such as flexible manufacturing systems, power systems, and urban transportation systems. However, there are no reports on the application of Petri nets in solar thermal collector system models.
Solar thermal systems are hybrid systems involving the interaction of continuous variable dynamic systems (DEDS) and discrete event dynamic systems (CVDS), exhibiting characteristics such as hybridity, time-varying nature, interactivity, and complexity. Because solar thermal systems involve two different types of variables and two different types of dynamic mechanisms, traditional hybrid petri nets (HPNs) fail to reflect the control of the continuous system by discrete events during simulation, or to capture the dynamic characteristics of the continuous system. Based on the hybrid and time-varying characteristics of solar thermal systems, a generalized hybrid Petri net (GHPN) is used to model the solar thermal system. Graphical modeling and simulation of the event-driven logic system using Matlab's Stateflow are employed to describe the interaction between CVDS and DEDS during the simulation of the GHPN model of the solar thermal system. The results can be used to further optimize the control algorithm of the solar thermal system.
1. Promote hybrid Petri nets
1.1 Hybrid Petri Net
Definition 1 HPN = {P, T, Pre, Post, H, J, M 0 }
1) P and T are finite non-empty sets of places and finite non-empty transition sets; H is the differential decision function; Pre and Post are the input association mapping and output association mapping, respectively; J is the time mapping function; M0 is the initial state identifier of the place node.
2) The condition for enabling a C transition Tj is:
(1) For each D library Pi in 0 T j , we have M(P i ) ≥ Pre (P i , T j );
(2) For each C library in 0 T j , P i , M(P i ) > 0.
The condition for enabling a D transition Tj is: for every place Pi in Tj , M( Pi ) ≥ Pre( Pi , Tj ).
1.2 Promoting Hybrid Petri Nets
Definition 2 GHPN={P, T, Pre, Post, H, J, M0 , E, S}, where
1) The meanings of P, T, Pre, Post, H, J, and M are given in Definition 1;
2) E is the event set, where events are defined as the fulfillment of a specific condition or the attainment of a specific state; S is the function of the Petri net's transition set T onto the event set E.
3) GHPN operation rules: The operation rules of the generalized hybrid Petri net are similar to those of the hybrid Petri net, and the superposition rule is satisfied. In each simulation step, when M(P i ) ≥ Pre (P i , T j ), T j has the right to occur. Only when the condition is satisfied and the event E j occurs will the enabled state T j be truly excited [8] .
2. Hybrid characteristics and framework of solar thermal collector systems
2.1 Hybrid Characteristics of Solar Thermal Collection Systems
A solar thermal system mainly comprises the heat collection process and the user heating process. The operation of the water tank essentially determines the water level through the inflow and outflow of water, which in turn causes changes in water temperature. However, the inflow is determined by the heat collection temperature and is an intermittent process. Users, on the other hand, have considerable autonomy in determining their water usage times and required flow rates, and these flow rate variations are unpredictable and uncontrollable by heating companies and heat sources. This means that numerous, dispersed users become active regulators, while heating companies and heat sources shift from being proactive to passively adapting. To adapt to this new change, control strategies must be improved to meet user needs.
The solar thermal collector system consists of a main control PLC and its peripheral components. By collecting parameters such as the temperature of the solar collector, the temperature of the water tank, and the water level in the water tank, it controls the start and stop of various peripheral devices such as the water inlet valve, the circulating pump, and the heating pipes according to the set program to ensure the water level in the water tank and ensure the stable, safe, and economical operation of the entire system. In addition, the control system also includes functions such as alarm, manual/automatic switching, and fault diagnosis, reflecting time-varying and complex processes, making it a typical process control hybrid system.
2.2 Framework of Solar Thermal Hybrid System
Figure 1. HS framework based on Petri net
Figure 1 HS framework base on
The solar thermal system employs a hierarchical model to describe the relative independence between its internal subsystems, using different tools for hierarchical modeling. When the discrete event system monitor is a Petri net, its HS control framework is shown in Figure 1. The Petri net monitor ( Gp , γ, μ) consists of a hybrid Petri net ( Gp ) and two interfaces (γ and μ), where γ: Ed → Bnd is the switching function, Ed is the set of monitored events, B = {0, 1}, and nd is the number of transitions in Gp ; μ: Ec → Bnc is the Gp transition enable function, nc is the number of transitions enabled in Gp , and the control switch: {0, 1} nc → Rl converts the decision commands generated by the Petri net monitor into piecewise continuous process inputs. The system model can be divided into three parts: (1) the water level in the tank, which is the controlled object and is a continuous dynamic part, described by differential equations. Its dynamic behavior changes according to the control commands output by the temperature controller; (2) the water level monitor, which is the discrete event part, described by GPEN in this paper; (3) the interface part, which mainly completes the information exchange between the water level controller and the water tank. This part consists of a generator and an actuator, namely the judgment of water level and temperature, which converts continuous variables into discrete variables, and the start/stop of pumps, valves and heating pipes, which converts discrete variables into input signals of the controlled object.
3 Petri net model of solar thermal collector system
3.1 Solar thermal collector system process flow and control rules
Figure 2. Process diagram of solar thermal collector system
Figure2 Solar collector system flow chart
The process diagram of the solar thermal collector system is shown in Figure 2. Assume the collector temperature is T1 , the water tank temperature is T2 , the return water temperature is T3 , the water tank level is h, the inlet valve is Y1 , the circulation pump is Y2 , the circulation valve is Y3 , the return water valve is Y4 , the supply pump is Y5 , and the heating element is Y6 . Valves, pumps, and heating elements are represented as 1 when open and 0 when closed. The assumed upper and lower limits of the liquid level, the upper and lower limits of the temperature or temperature difference, and the status of the on/off switches are shown in Table 1.
Table 1 Water Level Control Rules
Table 1 Level Control Rules
3.2 Liquid Level Control Model for Thermal Collector System
First, the modeling of pipes and valves. Pumps, valves and the like belong to discrete control devices. A valve or pump can be modeled using two places and two immediate transitions. These are the places corresponding to the open/closed state of the valve and the transitions corresponding to the open/closed valve events. The unique token exists in which place, depending on the state of the valve. Figure 3 shows the relationship between the basic elements of the model. The connecting arcs from the place to the transition form a loop. Two valves and two places form a single place that remains unchanged, i.e., M( P1 ) + M( P2 ) = 1. The valve can only be in one of the open or closed states [9] .
Solar thermal collector control mainly includes low water level protection, constant temperature water supply, collector temperature difference circulation, and user water supply circulation. Since water level and temperature are time-varying, solar thermal collectors are a time-varying, synchronous, and concurrent process. The water tank level control model is shown in Figure 4.
1) P = { p1 , p2 , p3 , p4 , p5 , p6 }, where p1 is the water level status of the water tank; p2 is the low water level protection; p3 is the constant temperature water discharge; p4 is the heat collector temperature difference circulation; p5 is the user water supply circulation; and p6 is the water tank water level output status.
2) T = { t1 , t2 , t3 , t4 , t5 , t6 }, where t1 , t2 , t3 , and t4 represent the water level changes for h < 60cm, 60 ≤ h < 200cm, h ≥ 200cm, and h ≥ 60cm, respectively; t5 represents the water level change; and t6 represents the water level adjustment process in the tank.
3) Initial identifier M0 = {h, 0, 0, 0, 0, 0}, where h represents the initial water level state.
4)
Figure 3. Petri net model of valve action
Figure3 Valve act Petri net model
Figure 4 Water tank level control model
Figure4 Water tank level control model
E = { E1 , E2 , E3 , E4 } is an event set, where E1 is the low water level protection event; E2 is the constant temperature water discharge event; E3 is the collector temperature difference circulation event; and E4 is the user water supply circulation event.
5) Define the S-function: t 1 → E 1 , t 2 → E 2 , t 3 → E 3 , t 4 → E 4 .
3.3 Thermal collector system model
The water tank level control mainly consists of four sub-models: P1 → t1 → P2 , P1 → t2 → P3 , P1 → t3 → P4 , and P1 → t4 → P5 .
The sub-models for low water level protection, constant temperature water discharge, collector temperature difference circulation, and user water supply circulation are shown in Figure 5. The overall Petri net model of the solar collector system's water tank level is shown in Figure 6.
1) P = { p7 , p8 , p9 , p10, p11 , p12 , p13, p14 , p15 , p16 , p17 , p18 , p19 , p20 , p21, p22, p23 , p24 , p25 , p26 , p27 }, where p10 , p15 , and p21 represent temperatures T1 , T2 , and T3 , respectively. The remaining states are shown in Table 1.
2)
Figure 5. Sub-model based on Petri net
Figure5 Sub-models base on Petri net
T = { t7 , t8 , t9 , t10 , t11, t12 , t13, t14 , t15 , t16 , t17 , t18 , t19 , t20 , t21 }, where t7 , t10 , t11 , t14 , t15 , t18 , t19 , and t20 represent valve operation processes; t9 , t13 , and t16 represent water level rise processes; t8 , t12 , and t21 represent temperature adjustment processes for T1 , T2 , and T3 , respectively; and t17 represents user water usage.
Figure 6. Petri net model for solar thermal collectors
Figure6 Solar collector system Petri net model
4. MATLAB Simulation Study of Petri Net Model
Figure 7 Simulation diagram of solar water collector water level control
Figure7 Solar collector lever control simulation diagram
Currently, there are many simulation tools available for Petri net models. This paper uses Matlab's Stateflow to simulate a PN model of a hybrid solar thermal collector system. Stateflows are interactive design tools used for modeling and simulating complex event-driven systems. Stateflows can be directly embedded into Simulink simulation models, with seamless integration. In the initial stage of simulation, Simulink converts the logic diagrams drawn by Stateflows into C language S-functions through a compiler, enabling visualized modeling and simulation of complex responsive systems based on finite state basis theory. Both flowcharts and state transition diagrams can be used simultaneously within the same Stateflow block diagram. Operations are performed based on defined events and transitions, and simulation is achieved by calling subsystems.
Figure 7 shows the water usage period during one night. The water level in the tank ranges from 60 to 200 mm. The peak heating period is from approximately 7:30 PM to 9:40 PM, with the heat collector circulating at a different temperature from 7:30 PM to 9:00 PM, followed by constant-temperature water discharge from 9:00 PM to 9:40 PM. Afterward, the water usage period is low. When the water level drops below 60 mm, the low-water-level protection automatically replenishes the water. It can be seen that under this control method, the water level meets the desired control targets.
5. Conclusion
This paper studies the characteristics of a hybrid solar thermal collector system, establishes its hierarchical structure model, and uses a generalized hybrid Petri net to establish a closed-loop hybrid object model. The hybrid solar thermal collector system is then modeled and simulated using Stateflow and Simulink in Matlab. This effectively solves the problems of concurrency, asynchrony, and conflict in the interaction between continuous variable systems and discrete event systems in solar thermal collector systems, laying a theoretical foundation for the establishment of its simulation model and the implementation of the simulation system, and facilitating the further development of solar thermal collector simulation systems.
References
[1] Cao Rui, Li Hongguang, Li Haoyang. Petri net modeling and simulation of mixed systems in sewage pumping stations [J]. Journal of Instrumentation, 2004, 25(4): 860-862.
[2] Li Ming, Ma Xiaoping, Bao Haiyong. Research on the application of Petri nets in mine conveyor belt control system [J]. Electrical Automation, 2005, 27(1): 121-123.
[3] Johansson K. Modeling of Hybrid Systems in Control Systems, Robotics, and Automation [J]. IEEE Control Magazine, 2004, 13(6):32~39.
[4] Liao Weizhi, Gu Tianlong, Li Wenjing, et al. Hybrid Petri net modeling and scheduling for fuzzy flexible manufacturing systems [J]. Computer Integrated Manufacturing Systems, 2008, 14(11): 2134-2141.
[5] Tong Qingyi, Yan Gangfeng. Hybrid systems and their applications in power systems [J]. Journal of Electric Power Systems and Automation, 2003, 15(2): 14-18.
[6] Zhang Junlong. Emergency Control of Power Systems Based on Hybrid Systems Theory [D]. Master's Thesis, Beijing University of Technology, 2003.
[7] DI FEBBRARO A, SACCO N. On modeling urban transportation networks via hybrid Petri nets [J]. Control Engineering Practice, 2004, 12 (10):1225-1239.
[8] Yang Hongzhi, Xu Jinliang. Highway simulation system model based on hybrid Petri net [J]. Journal of Chang'an University, 2006, 26(4): 40-44.
[9] Sun Yixin. Petri net modeling and analysis of start-up control tasks of distillation unit [D]. Master's thesis, Beijing University of Chemical Technology, 2008.