Development of a Fuzzy Logic Controller for Small-Scale Solar Organic Rankine Cycle Cogeneration Plants

Featured Application: Proper operation control of concentrated solar power plants is of paramount importance to increase their conversion efﬁciency. In this study, a fuzzy logic controller is developed and its capability investigated to increase the conversion efﬁciency of a micro-cogeneration plant based on concentrated solar technology to perform a thermal-load-following operation. Abstract: Solar energy is widely recognized as one of the most attractive renewable energy sources to support the transition toward a decarbonized society. Use of low- and medium-temperature concentrated solar technologies makes decentralized power production of combined heating and power (CHP) an alternative to conventional energy conversion systems. However, because of the changes in solar radiation and the inertia of the different subsystems, the operation control of concentrated solar power (CSP) plants is fundamental to increasing their overall conversion efﬁciency and improving reliability. Therefore, in this study, the operation control of a micro-scale CHP plant consisting of a linear Fresnel reﬂector solar ﬁeld, an organic Rankine cycle unit, and a phase change material thermal energy storage tank, as designed and built under the EU-funded Innova Microsolar project by a consortium of universities and companies, is investigated. In particular, a fuzzy logic control is developed in MATLAB/Simulink by the authors in order to (i) initially recognize the type of user according to the related energy consumption proﬁle by means of a neural network and (ii) optimize the thermal-load-following approach by introducing a set of fuzzy rules to switch among the different operation modes. Annual simulations are performed by combining the plant with different thermal load proﬁles. In general, the analysis shows that that the proposed fuzzy logic control increases the contribution of the TES unit in supplying the ORC unit, while reducing the number of switches between the different OMs. Furthermore, when connected with a residential user load proﬁle, the overall electrical and thermal energy production of the plant increases. Hence, the developed control logic proves to have good potential in increasing the energy efﬁciency of low- and medium-temperature concentrated solar ORC systems when integrated into the built environment. The plant under investigation consists of (i) a 146 m 2 solar ﬁeld based on an LFR producing heat at temperatures in the range of 250–280 ◦ C, (ii) a 2 kWe/18 kWth regenerative ORC unit, and (iii) a 3.8 ton latent heat thermal storage tank made of nitrate solar salt kNO 3 (40 wt%)/NaNO 3 (60 wt%) and equipped with heat pipes. In addition, a balance of the plant (BOP) with a total length of 49 m pipes connecting all the different subsystems is considered. Further details on the plant speciﬁcations can be found in [20]. plant under investigation. load proﬁles, namely residential, school, and ofﬁce, The load proﬁles are based on realistic data, all over the year, every 10 min. After generating the time series, the features in Section namely the day, hour, u ( t ), its mean value u ( t ) , its variance σ 2 u ( t ) , and the root mean square (RMS) value, are randomly divided into training (70%), test (15%), and validation (15%). The training is performed over 35 epochs, with a gradient method and a network made of 14 neurons in a hidden layer with a sigmoid activation function. in order to discriminate the target class, where class 1 represents the residential proﬁle, class 2 the school proﬁle, and class 3 the ofﬁce proﬁle. The confusion matrices for the training, validation, and test are depicted in Figure where the target classes are reported in the horizontal axis, the output (predicted) classes in the vertical axis, and each matrix element both in absolute and in percentual terms. As seen, classiﬁcation performances were high.


Introduction
The increasing energy demand worldwide, the catastrophic effects of climate changes, and the limited conventional energy sources are stressing increasingly the key role of renewable energy technologies for sustainable development. According to [1], the added net capacity of renewables around the world in 2018 was the same as in 2017 (about 180 GW) and further efforts are needed to fulfill the challenging commitments set out by the Paris Agreement in 2015.
Among the different renewable energy sources to support this energy transition, solar energy is considered one of the most promising. Indeed, solar energy is available worldwide and is abundant on Earth: about 1 × 10 5 TW reaches the surface of the Earth from the sun. Therefore, in the past decades, attention has been paid to solar technologies. In addition to traditional solar technologies such as solar thermal panels and photovoltaics (PV), innovative solar energy technologies such as concentrated solar power (CSP) systems have been developed. CSP plants are able to concentrate the incident radiation into a smaller area by means of lenses or mirrors. This energy is then collected by a solar receiver and converted into electricity or thermal power, depending on the need. In this way, it is possible to achieve higher overall conversion efficiencies compared to traditional solar technologies. Among the different methods of capturing solar thermal energy in CSP plants, linear Fresnel reflectors (LFRs) are considered a promising alternative to parabolic trough collectors in the medium-temperature range. Indeed, the former can overcome some techno-economic limits of the latter, thanks to a lighter structure and a fixed receiver. These characteristics make the LFR suitable for many applications such as those at the residential level.
To convert the medium-temperature solar energy into generated power, organic Rankine cycle (ORC) plants are adopted. Such plants work similarly to Rankine steam power plants, but they make use of organic working fluids, which have lower boiling points than water and, in addition, lead to above atmospheric pressures in the condenser. While medium-and large-scale ORC plants are already available in the market, on the small scale, several challenges need to be solved in order to increase their electric conversion efficiency and make them cost-competitive [2].
In general, use of solar energy in decentralized energy systems to simultaneously produce thermal and electrical energy (combined heat and power (CHP)) is considered a valuable alternative to substitute the thermal and electric power generation from fossil fuels. However, despite being abundant, solar energy is intermittent, and to ensure the proper operation of systems and reliable power supply, thermal energy storage (TES) technologies are usually combined with solar energy. In the low-temperature range, sensible heat TES is commonly adopted, but at the medium-high temperature level, latent heat TES is preferred [3]. Therefore, the design of multi-energy systems is becoming an important topic driven by the need for integrating distributed energy sources. Furthermore, the correct balance between energy supply and demand is considered a prominent subject of research. Hence, in the recent years, research in the field of energy system modeling and optimization has been carried out extensively [4]. In addition to general tools, including models of different technologies such as TRNSYS, Dymola, and Modelica, several commercial tools have been developed for the simulation of hybrid renewable energy systems, such as HOMER and RETSCREEN. For example, Bolognese et al. [5] carried out a modeling study of an industrial process integrating CSP technologies, and in particular, they focused on the use of parabolic trough collectors using the software Dymola in combination with MATLAB. Desideri et al. [6], instead, performed and validated the dynamic model of a parabolic trough collector in Thermocycle Modelica against the experimental results obtained at the Plataforma Solar de Almeria, finding good agreement both under steady-state and transient operating conditions. Manfrida et al. [7] mathematically investigated in TRNSYS latent heat TES for application to a solar power ORC system over a one-week period, obtaining a weekly average overall solar-to-electricity efficiency of 3.9%. Furthermore, the authors found that appropriate control logics are required to improve the performance of the system over a more extended period. Similarly, some of the authors of the present paper [8] numerically analyzed the performance of a novel solar ORC system based on an LFR, combined with an advanced latent heat TES unit, finding that the integrated plant had significant heat losses, which could be sensibly reduced by improving the control strategy of the plant. In subsequent work [9], the authors developed a hardware-in-the-loop simulator of the system to support the optimization of the control algorithms and to define the best control strategy to ensure proper operation of the ORC unit. Nevertheless, the work pointed out that further analyses were required to optimize the operation of the integrated system and maximize the energy production or the conversion efficiency.
Indeed, the operation of medium-temperature solar energy systems is sensitive to varying ambient conditions and users' needs. In addition, the thermal inertia of the different components has an important impact on the dynamics of these plants. Therefore, the development of an effective control logic is of paramount importance to maximize the conversion efficiencies of these systems. Among all the possible control approaches, a fuzzy logic controller is considered suitable for similar integrated systems.
Fuzzy logic, firstly introduced by Lofti Zadeh in [10], has been, indeed, applied with success in several engineering domains and has proved to be useful in renewable energy systems in general. Fuzzy logic is used for modeling purposes, such as in [11], where a household electric quantitative and qualitative representation was obtained in order to evaluate, ex ante, the economic benefit of energy management (EM). It is also used for design purposes, as in [12], to compare different heat transfer fluids (HTF) based on their benefits and costs in CSP applications. Most frequently, however, fuzzy logic is adopted for control design, as proposed by [13] for reducing the daily peak demands in limited-capacity, battery-based energy storage systems or by [14] to track the maximum power point of a PV array in a stand-alone photovoltaic system. Fuzzy logic controllers are preferred over model-based approaches whenever the mathematical model of the plant is not available or is highly uncertain [15]. This is especially true in complex solar power plants, where operative modes are identified according to the internal configuration of the plants and switching between modes is based on priority rules [16]. In this regard, yjr authors of [17] proposed a supervisory controller of an isolated hybrid AC/DC microgrid, where a state machine was used to govern the transitions between the different operating modes, while fuzzy logic was adopted to maintaining the desired state of charge (SOC) of the battery banks. In [18], a fuzzy logic controller was developed with the goal of minimizing the power profile fluctuations in a residential grid-connected microgrid, while keeping the SOC of the battery within secure limits. However, such approaches do not address the problem of discriminating between different load profiles in order to adjust the control logic accordingly. Furthermore, to the best of the authors' knowledge, there is no paper in the literature that considers the use of fuzzy logic to control small-scale concentrated solar ORC plants for the built environment. Therefore, in this paper, a concentrated solar ORC system, as designed and built under the EU-funded project Innova MicroSolar [19] by several universities and companies, is considered as a case study to investigate the potential of fuzzy logic control in optimizing the operation of small-scale solar ORC plants. More precisely, advanced models of the different subsystems are developed by the authors in MATLAB/Simulink in order to take into account the dynamics of the system under varying ambient and operating conditions. In addition, a fuzzy logic control strategy is included in the simulator, aimed at performing load following by dynamically adapting the plant operation to the user load profile.
Hence, the main contributions of the work rely on (i) the design of a fuzzy controller of a small-scale solar ORC plant for thermal load following and (ii) the use of the proposed control logic approach on complex solar energy systems by means of an advanced simulation tool developed by the authors.
Therefore, the paper is structured as follows: After this introduction, the methods used in the analysis and the developed models are presented in Section 2. Section 3 reports the impact of the proposed control logic on the operation and performance of the plant under investigation, while in Section 4, the main conclusions are discussed.

Methods and Models
In this section, the methodology of the work and the main characteristics of the models developed by the authors and implemented in MATLAB/Simulink are presented.

The Integrated Innova Microsolar Plant
The plant under investigation consists of (i) a 146 m 2 solar field based on an LFR producing heat at temperatures in the range of 250-280 • C, (ii) a 2 kWe/18 kWth regenerative ORC unit, and (iii) a 3.8 ton latent heat thermal storage tank made of nitrate solar salt kNO 3 (40 wt%)/NaNO 3 (60 wt%) and equipped with heat pipes. In addition, a balance of the plant (BOP) with a total length of 49 m pipes connecting all the different subsystems is considered. Further details on the plant specifications can be found in [20]. Figure 1 shows a scheme of the plant under investigation.

Methods and Models
In this section, the methodology of the work and the main characteristic models developed by the authors and implemented in MATLAB/Simulink are pre

The Integrated Innova Microsolar Plant
The plant under investigation consists of (i) a 146 m 2 solar field based on producing heat at temperatures in the range of 250-280 °C, (ii) a 2 kWe/1 regenerative ORC unit, and (iii) a 3.8 ton latent heat thermal storage tank made o solar salt kNO3 (40 wt%)/NaNO3 (60 wt%) and equipped with heat pipes. In add balance of the plant (BOP) with a total length of 49 m pipes connecting all the d subsystems is considered. Further details on the plant specifications can be found Figure 1 shows a scheme of the plant under investigation. The considered phase change material (PCM) has a melting temperature in th of 216-223 °C [21], a high heat of fusion, but low thermal conductivity. As regard t unit, it operates under subcritical conditions using NOVEC 649 as a working fluid Based on the solar radiation and the state of charge of the TES, the plan according to different operation modes (OM), as summarized in Table 1 and schem represented in Figure 2. In particular, in OM1, the diathermic oil from the sol supplies directly the ORC unit at temperatures higher than 210 °C. When the c power from the solar field exceeds the nominal power input to the ORC (about 28 instead, the oil supplies both the TES and the ORC unit (OM4). In case the TES charged, instead, the LFR collector defocuses (OM−1). On the contrary, when the produced by the solar field is low or zero and the average TES temperature is clos of melting, the thermal energy of the TES can be used to run the ORC unit (TORC °C and TORC,off = 215 °C with hysteresis) and ensure its operation for a maximum with no sun. In particular, in OM5, only the TES supplies the ORC, while in OM the LFR solar field and the TES supply the ORC unit. The considered phase change material (PCM) has a melting temperature in the range of 216-223 • C [21], a high heat of fusion, but low thermal conductivity. As regard the ORC unit, it operates under subcritical conditions using NOVEC 649 as a working fluid.
Based on the solar radiation and the state of charge of the TES, the plant works according to different operation modes (OM), as summarized in Table 1 and schematically represented in Figure 2. In particular, in OM1, the diathermic oil from the solar field supplies directly the ORC unit at temperatures higher than 210 • C. When the collected power from the solar field exceeds the nominal power input to the ORC (about 28 kWth), instead, the oil supplies both the TES and the ORC unit (OM4). In case the TES is fully charged, instead, the LFR collector defocuses (OM−1). On the contrary, when the power produced by the solar field is low or zero and the average TES temperature is close to that of melting, the thermal energy of the TES can be used to run the ORC unit (T ORC,on = 217 • C and T ORC,off = 215 • C with hysteresis) and ensure its operation for a maximum of 4 h with no sun. In particular, in OM5, only the TES supplies the ORC, while in OM6, both the LFR solar field and the TES supply the ORC unit.

The Models of the Main Subsystems
The plant under analysis was modeled in MATLAB/Simulink [22] using MATLAB function blocks. The receiver tube of the LFR system, the TES unit, and the pipelines of

The Models of the Main Subsystems
The plant under analysis was modeled in MATLAB/Simulink [22] using MATLAB function blocks. The receiver tube of the LFR system, the TES unit, and the pipelines of the BOP were represented by dynamic models and the ORC unit by a quasi-steady state model since its thermal inertia is significantly lower compared to the other subsystems. Hence, the use of a quasi-steady state model for the ORC system can be considered acceptable since it does not affect the relaxation time of the overall plant, as further discussed in [9]. Therefore, in this way, it is possible to reproduce the transient operation of the real plant and to take into account the effect of the changing working conditions on its overall performance.
As regard the solar field, the thermal power output was calculated according to Equation (1): P LFR,out = A sf ·DNI·cos (θ)·η opt ·η rec (1) where A sf is the net area of the primary collectors; DNI the direct normal irradiance; θ the incident angle; η opt the optical efficiency of the LFR, which depends on the incident angle modifier (IAM); and η rec the receiver efficiency. As regard the optical efficiency, it was calculated as where α and σ are the solar elevation and azimuthal angles, respectively. The values of the maximum optical efficiency and the IAM were provided by the manufacturing company ELIANTO [23] based on a ray-tracing analysis. Eventually, with reference to the receiver efficiency, it is calculated by applying the well-known Forristal model [24] for the evacuated tubes. In particular, a one-dimensional longitudinal model was adopted, and the same numerical scheme used for the pipelines was applied. It is worth noting that in the case of the receiver tube, only the thermal inertia of the diathermic oil was considered while those of the metal parts and the glass tube were neglected. The TES unit was represented by means of a lumped model according to the guidelines of the IEA Task 32 report on advanced storage concepts [25]. For the scope of the analysis, the PCM was supposed to be isotropic and isothermal in each internal time step. The use of heat pipes was included into the model in terms of the maximum power exchanged with the oil (40 kW) and of a minimum temperature difference between the oil and the PCM (equal to 5 • C). Hence, the TES varied its temperature, as described in Equation (3): where ∆T TES(t) is the temperature difference between the diathermic oil and the PCM itself at time step t, while f depends on the convective Nusselt number of the PCM. To increase the accuracy of the model, an internal time step lower than that of the overall simulation is considered. As regard the thermal losses of the TES unit, they were equal to 0.4 W/m 2 ·K. The pipelines connecting all the different subsystems were modeled by means of a one-dimensional longitudinal model, as discussed in detail in [26]. In summary, the simplified advection Equation (4) was solved for each tube: where ρ, c p , T, and u are, respectively, the density, specific heat, temperature, and axial velocity of the oil; A is the internal cross-sectional area of the tube; and P exch is the exchanged power between the fluid and the environment (positive for losses, negative for gain). The equation was solved using the finite difference method with the explicit first-order upwind scheme. With reference to the ORC unit, its electric and thermal power outputs were calculated as in Equations (5) and (6): where . m f is the mass flow rate of the working fluid; ∆h e and ∆h p are the expander and pump enthalpy difference, respectively; and η m and η el the mechanical and electrical efficiencies assumed constant and equal to 0.95 and 0.9, respectively, for both the expander and the pump. In addition, . m c is the mass flow rate of the cooling water, c p,c its specific heat, and T in and T out the inlet and outlet temperatures, respectively, of the cooling water at the condenser.
The turbine isentropic efficiency varies with the operating conditions, and its values are based on the experimental data provided by the manufacturer ENOGIA [27]. In particular, under nominal operating conditions, the maximum isentropic efficiency is about 0.53, and it decreases with a pressure ratio, as better detailed in [28]. For the sake of the present analysis, a gear pump was considered to ensure the required refrigerant mass flow rate. Despite its related small size, the isentropic efficiency of this kind of pump can be assumed constant over all the considered operating range and equal to 0.7 according to [29].
The heat exchangers were modeled by means of the simplified ε-NTU method, according to which the overall heat transfer coefficient is considered constant. The thermodynamic state points and the organic fluid flow rate (design value of 0.20 kg/s) were obtained at each time step according to an iterative procedure to achieve a fixed overheating temperature difference at the evaporator. Table 2 reports the typical temperatures and pressures of the different state points (as indicated in Figure 3) with varying diathermic oil temperatures for a fixed inlet temperature of the cooling water at the condenser of 60 • C.
Appl. Sci. 2021, 11, 5491 7 thermodynamic state points and the organic fluid flow rate (design value of 0.20 k were obtained at each time step according to an iterative procedure to achieve a f overheating temperature difference at the evaporator. Table 2 reports the typ temperatures and pressures of the different state points (as indicated in Figure 3) varying diathermic oil temperatures for a fixed inlet temperature of the cooling wat the condenser of 60 °C.

The Fuzzy Logic Controller
The switch between the different OMs is decided according to the impleme control strategy. In this section, a control strategy based on fuzzy logic is proposed

The Fuzzy Logic Controller
The switch between the different OMs is decided according to the implemented control strategy. In this section, a control strategy based on fuzzy logic is proposed and described: it improved the performance of the system with respect to the baseline strategy, originally developed and described in [8], as will be later shown in Section 3. Please note that the proposed control strategy can be used for small-scale solar ORC plants integrating latent heat TES, as long as their OMs are defined, together with the rules for switching from one OM to another. This is common in complex plants, where operating modes and conditions are expressed according to the knowledge of the system engineers, which is often qualitative (experience based) and not quantitative (model based).

Baseline
The baseline control strategy is the initial control strategy developed to ensure reliable operation of the plant independent of the users' needs. It calculates the OM, starting from the available process variables, namely the collected thermal power from the solar field (i.e., P LFR,out ), the related temperature of the diathermic oil in the LFR solar field (i.e., T LFR ), and the average temperature of the TES unit (i.e., T TES,av ). Based on the values of these parameters, the appropriate OM is selected according to Table 3. As it can be seen, the baseline controller relies on a set of "if then . . . else . . . " rules, which makes the control logic difficult to modify and/or integrate with external system knowledge. the temperature difference between the outlet temperature of the diathermic oil from the solar field and the average temperature of the TES (T diff ), the period of the day when the load is expected to be higher than the rest of the day (Time), and the system information (System info ) about the overall performance of the plant, as further detailed in Section 2.3.2.1. Qualitatively speaking, the variable Time was introduced to account for loads that increase at specific times in a day (e.g., a school building, an office, etc.), while the variable System info provides feedback information about how well the thermal following is performing. These variables can belong to specific fuzzy sets via membership functions, where the choice of their shapes and values is made based on the knowledge of the system engineer and according to the experience derived from trial-and-error procedures. The trapezoidal membership functions shown in Figure 4 were considered. Please note that when the (thermal) load is distributed all over the day, then the Time variable can be neglected.
Appl. Sci. 2021, 11, 5491 9 of 22  The control policy was, instead, based on a Mamdani fuzzy inference system [30], which synthesizes a set of linguistic control rules. In Table 4, a set of 16 rules for a residential load model is reported, where the Time variable is neglected. In Table 5, a set of 21 rules for a school is reported, where the load is expected to be concentrated in the time period 7 a.m.-1 p.m. Finally, the fuzzy control action was defuzzied according to the center-of-area method, thus returning the OM to be selected. Table 4. Set of 16 linguistic rules at the base of the fuzzy load-following control strategy (residential load model). Membership functions are defined in Figure 4.  Table 5. Set of 21 linguistic rules at the base of the fuzzy load-following control strategy (school load model); when the rule number is not reported, the rule is identical to the one detailed in Table 4. Membership functions are defined in Figure 4.

Performance-Based Supervision
The System info variable contains information about the overall performance of the plant. This variable is one of the inputs to the fuzzy inference system and concurs to choose the best OM, following a performance-based supervision approach [31]. The System info variable is built according to the logic depicted in Figure 5. The input to the system is u(t) = E p (t) − E l (t), namely the difference between the produced thermal energy and that required by the user (load). This difference is fed to a high-pass filter, which accounts for high-frequency components, added to a term composed by a constant value, which accounts for low-frequency noise, and added again to a scaled version of the input itself. The resulting signal is low-pass-filtered to obtain a smoother signal and saturated over a custom range, here selected between −4 and +4. The variable is finally fuzzified according to the membership functions (Figure 4f). Negative values imply that the consumption is greater than the production, with a trend that can be decreasing (bad) or increasing (poor). Positive values imply, instead, that the production is greater than the consumption, with a trend that can be decreasing (ok) or increasing (good).

Neural Network
The load-following control strategy requires some knowledge of the load to follow in order to customize the set of rules to adopt within the fuzzy inference system (e.g., residential load, school load, etc.). This information is provided by an artificial neural network (ANN), whose task is to discriminate (runtime) the load type connected to the plant and switch to the most suitable set of rules. Hence, by using an ANN to classify the load connected to the plant, it is possible to employ the same load-following control strategy to different users, each one characterized by a custom set of fuzzy rules. The adopted neural network is of perceptron type and requires as input the day, hour, u(t) (defined in Section 2.3.2.1), its mean value ( ), its variance ( ), and the root mean square (RMS) value. The output of the neural network is a discrete variable that represents the load type. A graphical representation of the network is detailed in Figure 6. The network can be easily trained with time series obtained by using the simulator built upon the model in Section 2.2., considering different months and labeling each time series with the relevant load profile.

Results
In this section, the results obtained by means of the simulation model are presented. In particular, in Section 3.1, the capability of the neural network to recognize the kind of user based on the related thermal load is proven, while in Section 3.2, the comparison of the plant performances in the case of a baseline controller and a fuzzy logic controller is presented and discussed.

Neural Network
The load-following control strategy requires some knowledge of the load to follow in order to customize the set of rules to adopt within the fuzzy inference system (e.g., residential load, school load, etc.). This information is provided by an artificial neural network (ANN), whose task is to discriminate (runtime) the load type connected to the plant and switch to the most suitable set of rules. Hence, by using an ANN to classify the load connected to the plant, it is possible to employ the same load-following control strategy to different users, each one characterized by a custom set of fuzzy rules. The adopted neural network is of perceptron type and requires as input the day, hour, u(t) (defined in Section 2.3.2.1), its mean value u(t), its variance σ 2 u (t), and the root mean square (RMS) value. The output of the neural network is a discrete variable that represents the load type. A graphical representation of the network is detailed in Figure 6.

Neural Network
The load-following control strategy requires some knowledge of the load to follow in order to customize the set of rules to adopt within the fuzzy inference system (e.g residential load, school load, etc.). This information is provided by an artificial neura network (ANN), whose task is to discriminate (runtime) the load type connected to th plant and switch to the most suitable set of rules. Hence, by using an ANN to classify th load connected to the plant, it is possible to employ the same load-following contro strategy to different users, each one characterized by a custom set of fuzzy rules. Th adopted neural network is of perceptron type and requires as input the day, hour, u(t (defined in Section 2.3.2.1), its mean value ( ), its variance ( ), and the root mean square (RMS) value. The output of the neural network is a discrete variable that represent the load type. A graphical representation of the network is detailed in Figure 6. The network can be easily trained with time series obtained by using the simulato built upon the model in Section 2.2., considering different months and labeling each tim series with the relevant load profile.

Results
In this section, the results obtained by means of the simulation model are presented In particular, in Section 3.1, the capability of the neural network to recognize the kind o user based on the related thermal load is proven, while in Section 3.2, the comparison o the plant performances in the case of a baseline controller and a fuzzy logic controller i presented and discussed.

The Capability of the Neural Network
The perceptron-based ANN is trained by using time series generated by th simulator built upon the model described in Section 2, "Methods and Models," wher three different load profiles, namely residential, school, and office, are considered. Th load profiles are based on realistic data, all over the year, collected every 10 min. Afte The network can be easily trained with time series obtained by using the simulator built upon the model in Section 2.2, considering different months and labeling each time series with the relevant load profile.

Results
In this section, the results obtained by means of the simulation model are presented. In particular, in Section 3.1, the capability of the neural network to recognize the kind of user based on the related thermal load is proven, while in Section 3.2, the comparison of the plant performances in the case of a baseline controller and a fuzzy logic controller is presented and discussed.

The Capability of the Neural Network
The perceptron-based ANN is trained by using time series generated by the simulator built upon the model described in Section 2, "Methods and Models," where three different load profiles, namely residential, school, and office, are considered. The load profiles are based on realistic data, all over the year, collected every 10 min. After generating the time series, the features described in Section 2.3.2.2, namely the day, hour, u(t), its mean value u(t), its variance σ 2 u (t), and the root mean square (RMS) value, are randomly divided into training (70%), test (15%), and validation (15%). The training is performed over 35 epochs, with a gradient method and a network made of 14 neurons in a hidden layer with a sigmoid activation function.
The ANN is then tested in order to discriminate the target class, where class 1 represents the residential profile, class 2 the school profile, and class 3 the office profile. The confusion matrices for the training, validation, and test are depicted in Figure 7, where the target classes are reported in the horizontal axis, the output (predicted) classes in the vertical axis, and each matrix element both in absolute and in percentual terms. As seen, classification performances were high.
Appl. Sci. 2021, 11, 5491 generating the time series, the features described in Section 2.3.2.2, namely the da u(t), its mean value ( ), its variance ( ), and the root mean square (RMS) va randomly divided into training (70%), test (15%), and validation (15%). The tra performed over 35 epochs, with a gradient method and a network made of 14 ne a hidden layer with a sigmoid activation function. The ANN is then tested in order to discriminate the target class, where represents the residential profile, class 2 the school profile, and class 3 the office The confusion matrices for the training, validation, and test are depicted in F where the target classes are reported in the horizontal axis, the output (predicted in the vertical axis, and each matrix element both in absolute and in percentual te seen, classification performances were high.

The Micro-Solar CHP Plant Performance
The performance of the micro-solar ORC plant was investigated during a wh with a simulation time step of 10 min. Weather data (i.e., solar radiation and temperature) were taken from the Energy+ [32] database for the city of Lerida i which is close to the town of Almatret, where the Innova Microsolar prototype located. For the sake of the analysis, it was assumed, as often done in the literatu the system can work under the given reference conditions at the condense precisely, the return water temperature entering the condenser was assumed at 60 the temperature difference equal to 10 °C, with a fixed flow rate of 0.5 kg/s, he temperature level able to satisfy the thermal energy demands for space heating water of residential users.
As regard the load, two different profiles were considered: (i) a scale-down p a school building and (ii) a residential user profile related to four apartments wit area of 100 m 2 each. The thermal load of the school building was taken from [33

The Micro-Solar CHP Plant Performance
The performance of the micro-solar ORC plant was investigated during a whole year with a simulation time step of 10 min. Weather data (i.e., solar radiation and ambient temperature) were taken from the Energy+ [32] database for the city of Lerida in Spain, which is close to the town of Almatret, where the Innova Microsolar prototype plant is located. For the sake of the analysis, it was assumed, as often done in the literature, that the system can work under the given reference conditions at the condenser. More precisely, the return water temperature entering the condenser was assumed at 60 • C and the temperature difference equal to 10 • C, with a fixed flow rate of 0.5 kg/s, hence at a temperature level able to satisfy the thermal energy demands for space heating and hot water of residential users.
As regard the load, two different profiles were considered: (i) a scale-down profile of a school building and (ii) a residential user profile related to four apartments with a floor area of 100 m 2 each. The thermal load of the school building was taken from [33], while that of the residential user was calculated by means of TRNBuild [34], considering an indoor comfort temperature of 20 • C and according to the tap profile number 2, as reported in the European standard UNI EN 15316-3 [35] for space heating and domestic hot water, respectively. In addition, with reference to the residential user, an average electricity demand per apartment of 3600 kWh/year was considered based on the statistical data available in [36]. Anyhow, electrical load following was not considered in this work, and only a simplified coverage factor as the ratio between the electricity production from the plant and the overall demand was calculated for the residential user.
First, the performance of the CHP plant in the case of a baseline controller was assessed, as reported in Table 6. Table 6. Micro-solar ORC plant performance in the case of a baseline controller: collected thermal energy by the LFR (E th,LFR ), inlet thermal energy to the ORC unit (E th,ORCin ), electric energy output from the ORC (E el,ORC ), thermal energy output from the ORC (E th,ORCout ), electric efficiency (η el,ORC ), thermal efficiency (η th,ORC ), input thermal energy to the TES (E th,TESin ), and output thermal energy to the TES (E th,TESout ). Although the thermal energy collected by the solar field is about 110 MWh/year, the annual electrical and thermal energy production by the ORC unit corresponds to 6450 and 58,800 kWh, respectively. As expected, the performances of the proposed system were significantly affected by seasonality. Indeed, the ORC unit electrical and thermal energy productions were around eight times in July than in December. Furthermore, during the winter season, with the baseline controller, the operation of the TES unit was limited and even more its operating efficiency, which is defined as the ratio between the thermal energy output from the TES unit and the thermal energy input. This means that the thermal energy stored in the TES unit is dissipated into the ambient and not usefully recovered to satisfy the thermal energy demand of the users.

Month
To better understand the energy production of the proposed plant, we took into account the related number of hours of the different operation modes of the plant during the year as reported in Table 7. During the hot months, there is more solar radiation and the plant can store surplus energy in the PCM thermal storage, thus working for a consistent number of hours also in operation modes OM5 and OM6. Furthermore, the collected thermal energy is so high that the system is forced to defocus, thus operating also in OM−1.
Later, the performances of the plant were evaluated for both thermal load profiles using the case of a fuzzy logic controller aimed at satisfying the thermal energy demand of the users by means of the plant operation. Tables 8 and 9 report the plant performances when coupled with a school building load profile.   As expected, because of the thermal-load-following approach, the electrical and thermal energy production of the CHP plant was significantly affected by the load profile of the connected user. By comparing the results reported in Table 8 with those in Table 6, it can be noted that, overall, the electrical and thermal energy production of the CHP plant is lower (5214 kWhe and 48,023 kWth, respectively, in the case of a fuzzy logic controller), although the conversion efficiencies of the ORC unit are almost the same. On the contrary, during winter, the fuzzy logic controller is able to improve the integration with the TES unit time, thus supporting the ORC operation also in OM5 and OM6, as reported in Table 9. On an annual basis, in the case of a fuzzy logic controller, the operation of the plant in OM3 increases (about 844 h/year compared to 262 h/year in the case of a baseline controller), the operating hours of the ORC system reduce (about 3220 h/year in the case of a baseline controller and about 2830 h/year with a fuzzy logic controller) and the solar field is subjected to a longer period of defocusing (OM−1).
To better appreciate the peculiarities of the fuzzy logic controller in case the plant is coupled with a school building load profile, the daily trends of the most important performance parameters are reported in Figure 8a-d for a sunny winter day and a partially cloudy mid-season day by comparing the impact of both controllers. Independent from the controller, when the solar radiation is high, and, as a consequence, the collected thermal energy, the diathermic oil reaches a temperature level high enough to run the ORC under nominal operating conditions with almost constant electrical and thermal power outputs. On the contrary, when the TES also supplies energy to the ORC unit, the inlet temperature of the diathermic oil to the evaporator may reduce with time and the power outputs from the ORC as well. As can be clearly noted, the fuzzy logic controller is able to extend the operation of the ORC unit for a longer period when a thermal load is required, thus better exploiting the collected thermal energy by the solar field. This is obtained by reducing the number of switches between the different OMs when the thermal energy demand is absent or low (i.e., in the afternoon), while storing the collected thermal energy in the latent heat TES (on a typical winter day, the plant works in OM3 for a significantly longer period). The benefits of the fuzzy logic controller are even higher during the mid-season days, when the TES is also able to provide thermal energy to the ORC unit in the early morning, thus covering most of the energy demand while operating in OM5 and OM6. This is possible thanks to the higher temperatures reached by the TES unit in the case of a fuzzy logic controller, as reported in Figure 9a-d. Hence, during a typical winter day, the system can also prolong its operation when the collected thermal energy decreases by working in OM6, while during the mid-season days, the collected thermal energy by the solar field allows full melting of the PCM material and thus the operation of the plant also This is possible thanks to the higher temperatures reached by the TES unit in the case of a fuzzy logic controller, as reported in Figure 9a-d. Hence, during a typical winter day, the system can also prolong its operation when the collected thermal energy decreases by working in OM6, while during the mid-season days, the collected thermal energy by the solar field allows full melting of the PCM material and thus the operation of the plant also in OM5. Hence, it is evident that the fuzzy logic controller permits better usage of the TES unit, in accordance with the information embedded in the Time variable, which accounts for the periods of time when the load is expected to be higher.
(c) (d) Figure 8. Daily trend of plant performance coupled with a school building load profile: (a) sunny winter day in the case of a baseline controller, (b) sunny winter day in the case of a fuzzy logic controller, (c) partially cloudy mid-season day in the case of a baseline controller, and (d) partially cloudy mid-season day in the case of a fuzzy logic controller. This is possible thanks to the higher temperatures reached by the TES unit in the case of a fuzzy logic controller, as reported in Figure 9a-d. Hence, during a typical winter day, the system can also prolong its operation when the collected thermal energy decreases by working in OM6, while during the mid-season days, the collected thermal energy by the solar field allows full melting of the PCM material and thus the operation of the plant also in OM5. Hence, it is evident that the fuzzy logic controller permits better usage of the TES unit, in accordance with the information embedded in the Time variable, which accounts for the periods of time when the load is expected to be higher. In Tables 10 and 11, instead, the performances of the plant when integrated with a residential user load profile are reported in the case of a fuzzy logic controller. Table 10. Micro-solar ORC plant performance in the case of a fuzzy logic controller for a residential user load profile: collected thermal energy by the LFR (Eth,LFR), inlet thermal energy to the ORC unit (Eth,ORCin), electric energy output from the ORC (Eel,ORC), thermal energy output from the ORC (Eth,ORCout), electric efficiency (ηel,ORC), thermal efficiency (ηth,ORC), input thermal energy to the TES (Eth,TESin), and output thermal energy to the TES (Eth,TESout).

Month
Eth,LFR  In Tables 10 and 11, instead, the performances of the plant when integrated with a residential user load profile are reported in the case of a fuzzy logic controller.
In this case, as can be noted by comparing the results reported in Table 10 with those in Table 6, the overall electrical and thermal energy production of the CHP plant is higher (6450 kWhe and 58,800 kWth, respectively, in the case of a baseline controller and 6740 kWhe and 61,680 kWth, respectively, in the case of a fuzzy logic controller), although the conversion efficiencies of the ORC unit are almost the same. According to the detailed results of the operating hours reported in Table 8, with the fuzzy logic controller, the operating time of the ORC is about 3450 h/year, while with the baseline controller, it is 3220 h/year (increase of about 7%). In particular, the use of the TES unit is significantly extended. Indeed, in the case of a fuzzy logic controller, the solar field charges the TES 443 h/year in OM3 and about 1320 h/year in OM4, while with the baseline controller, the operating hours in these OMs are about 262 h/year and 1270 h/year, respectively. As a consequence, in the case of a fuzzy logic controller, the operational time of the plant in OM5 is higher: more precisely, it is about 914 h/year versus 723 h/year with the baseline controller. Hence, the fuzzy logic controller is able to improve the contribution of the TES in performing load following. Table 10. Micro-solar ORC plant performance in the case of a fuzzy logic controller for a residential user load profile: collected thermal energy by the LFR (E th,LFR ), inlet thermal energy to the ORC unit (E th,ORCin ), electric energy output from the ORC (E el,ORC ), thermal energy output from the ORC (E th,ORCout ), electric efficiency (η el,ORC ), thermal efficiency (η th,ORC ), input thermal energy to the TES (E th,TESin ), and output thermal energy to the TES (E th,TESout ).  Finally, Figure 10a,b and Figure 11a,b report the daily trends of the most important performance parameters of the plant and of the TES unit when connected with a residential user for a typical winter day. In addition, in this case, the use of the TES is extended, although the overall benefit is a bit lower than in the case of the school load profile. In any case, the fuzzy controller is able to reduce the number of switches between the different OMs (as can be seen by comparing Figure 10a,b) and to better follow the peak demands in the time range of 14:00-17:00. Nevertheless, perfect following cannot be achieved, especially in the early hours of the day, since the temperature of the latent heat TES unit is not high enough to run the ORC (OM5) and the collected thermal energy used to heat up the diathermic oil. In any case, the absence of an additional TES unit between the ORC system and the users to store the thermal energy output from the condenser of the ORC unit does limit the capability of the plant in satisfying the thermal energy demand when the solar radiation is low. Nevertheless, the potential of the proposed fuzzy logic controller in increasing the electrical and thermal energy production of the plant together while better satisfying the required thermal energy demand is also proven in the case of a residential user. demands in the time range of 14:00-17:00. Nevertheless, perfect following cannot be achieved, especially in the early hours of the day, since the temperature of the latent heat TES unit is not high enough to run the ORC (OM5) and the collected thermal energy used to heat up the diathermic oil. In any case, the absence of an additional TES unit between the ORC system and the users to store the thermal energy output from the condenser of the ORC unit does limit the capability of the plant in satisfying the thermal energy demand when the solar radiation is low. Nevertheless, the potential of the proposed fuzzy logic controller in increasing the electrical and thermal energy production of the plant together while better satisfying the required thermal energy demand is also proven in the case of a residential user.

Conclusions
In this work, a fuzzy logic controller performing the thermal load following of different user profiles was developed to improve the energy use and overall conversion efficiency of a micro-solar CHP plant based on an LFR solar field. First, an ANN was developed by the authors to recognize the kind of user based on the related thermal load, and then different sets of linguistic rules were included in the fuzzy logic controller to better adjust the plant operation with the request of the specific user.
Hence, the performances of the plant in the case of a fuzzy logic controller were assessed and compared with those in the case of a baseline controller. In general, the proposed fuzzy controller shows good capability in performing the load following by increasing the contribution of the TES unit in supplying the ORC unit and reducing the number of switches between the different OMs. When coupled with a school building load profile, the plant works in OM3 for a significantly longer period by storing the collected thermal energy from the solar field into the TES unit (when thermal demand is absent or low) and providing this amount of thermal energy to the ORC unit in the early morning after operating in OM5 and OM6. In this way, although the overall electrical and thermal production of the ORC unit is lower, the plant is able to cover more the thermal energy demand of the user. When coupled with a residential user load profile, instead, the electrical and thermal production of the plant even increases by means of a fuzzy logic controller but the absence of an additional TES unit between the ORC system and the user to store the thermal energy output from the condenser of the ORC unit limits the ability of the plant in satisfying the thermal energy demand all the time.
In any case, the analysis has proven the capability of the proposed fuzzy logic controller in performing thermal load following, and the proposed control strategy could

Conclusions
In this work, a fuzzy logic controller performing the thermal load following of different user profiles was developed to improve the energy use and overall conversion efficiency of a micro-solar CHP plant based on an LFR solar field. First, an ANN was developed by the authors to recognize the kind of user based on the related thermal load, and then different sets of linguistic rules were included in the fuzzy logic controller to better adjust the plant operation with the request of the specific user.
Hence, the performances of the plant in the case of a fuzzy logic controller were assessed and compared with those in the case of a baseline controller. In general, the proposed fuzzy controller shows good capability in performing the load following by increasing the contribution of the TES unit in supplying the ORC unit and reducing the number of switches between the different OMs. When coupled with a school building load profile, the plant works in OM3 for a significantly longer period by storing the collected thermal energy from the solar field into the TES unit (when thermal demand is absent or low) and providing this amount of thermal energy to the ORC unit in the early morning after operating in OM5 and OM6. In this way, although the overall electrical and thermal production of the ORC unit is lower, the plant is able to cover more the thermal energy demand of the user. When coupled with a residential user load profile, instead, the electrical and thermal production of the plant even increases by means of a fuzzy logic controller but the absence of an additional TES unit between the ORC system and the user to store the thermal energy output from the condenser of the ORC unit limits the ability of the plant in satisfying the thermal energy demand all the time.
In any case, the analysis has proven the capability of the proposed fuzzy logic controller in performing thermal load following, and the proposed control strategy could also be adopted in the case of other integrated systems based on CSP technologies and latent heat TES units.  organic Rankine cycle P exch exchanged power between the fluid and the environment (kW) P el electrical power output from the ORC unit (kWe) P th thermal power output from the ORC unit (kWth) P LFR,out outlet thermal power from the LFR (kWth) PCM phase change material P ORC,min minimum power threshold of the ORC unit (kWth) P ORC,max maximum power threshold of the ORC unit (kWth) SOC state of charge T temperature ( • C) T LFR,out outlet temperature of the diathermic oil from the LFR ( • C) T ORC,off switch-off temperature of the ORC ( • C) T ORC,on switch-on temperature of the ORC ( • C) T in inlet temperature of the cooling water at the condenser ( • C) T out outlet temperature of the cooling water at the condenser ( • C) T TES,av average temperature of the TES tank ( • C) T TES,max upper temperature threshold of the TES tank before defocus ( • C) TES thermal energy storage u velocity (m/s) ∆h e actual specific enthalpy difference across the expander (kJ/(kg K) ) ∆h p actual specific enthalpy difference across the pump (kJ/(kg K) ) ∆T TES temperature difference between the diathermic oil and the PCM ∆t int-timestep time interval of the internal time step (s) η el electric efficiency η m mechanical efficiency η opt optical efficiency η rec efficiency of the receiver θ solar incident angle ρ diathermic oil density (kg/m 3 )