3.1. Architecture of the Proposed System
In order to enable advanced process management, the proposed control architecture integrates three complementary methods: an On/Off regulator for direct actuation, a PID controller that ensures high steady-state accuracy, and a Fuzzy logic module capable of providing dynamic adaptability under disturbances. To simultaneously achieve thermal comfort and energy efficiency in the laboratory space, the central algorithm processes multiple environmental factors and operates based on three essential sets of constraints.
This approach targets the concurrent optimization of operating conditions and energy-related costs, in a context where energy resources are limited and sustainability requirements are increasingly relevant.
The first constraint category is associated with the level of comfort perceived by the occupants of the analyzed room. The system collects direct user feedback through a voting mechanism in which occupants evaluate their thermal comfort state based on two types of parameters: indoor parameters (temperature and humidity) and personal perception parameters (activity level, clothing insulation, and skin temperature). The data are stored and processed in real time, and the algorithm uses the average vote to estimate overall satisfaction. By integrating human perception into the control loop, the proposed system overcomes the limitations of traditional approaches that rely exclusively on a fixed temperature setpoint, enabling dynamic setpoint adjustment according to the current user profile and the specific variations in the occupied indoor environment.
Integrating user feedback into the control strategy is a key component of the proposed system; however, the use of subjective perceptions requires appropriate methodological validation. In this work, the thermal comfort data are collected from a sample of 15 to 20 users, depending on the students present in the laboratory room. User presence in the analyzed space is detected and logged during active hours using a human presence sensor installed at the laboratory entrance.
The second constraint category refers to the energy consumption of the equipment installed in the room, considering both the distribution of consumption across device types the HVAC system, lighting system, IT equipment (desktop computers and laptops), the 3D printer, and the KUKA robotic arm and the time varying electricity tariffs depending on the time interval. The algorithm implements a load management strategy by identifying periods characterized by high energy costs and adjusting equipment operation to limit consumption during those intervals.
The third constraint category is associated with the availability of renewable energy provided by the photovoltaic panels installed on the faculty buildings. The system monitors instantaneous PV generation in real time and integrates this information into the decision-making process. When solar energy is abundant, the system prioritizes the use of this renewable resource to supply laboratory equipment, thereby reducing dependence on the external power grid. During periods of reduced or absent generation—such as nighttime intervals or unfavorable weather conditions—the algorithm compensates for the deficit by shifting supply to the conventional grid.
The adopted ±3 comfort scale is conceptually aligned with the Predicted Mean Vote (PMV) framework defined in ASHRAE Standard 55, which quantifies thermal sensation on a seven-point scale ranging from cold (–3) to hot (+3). The PMV model, originally introduced by Fanger, evaluates thermal comfort as a function of air temperature, mean radiant temperature (MRT), humidity, air velocity, metabolic rate, and clothing insulation. In this paper, thermal comfort is predominantly assessed based on indoor air temperature, but this approach has certain limitations. According to ASHRAE Standard 55, thermal comfort is more rigorously described by the operative temperature, which integrates both air temperature and mean radiant temperature (MRT), the latter having an essential role in the thermal perception of occupants. Therefore, the exclusive use of air temperature may lead to an approximation of the real comfort conditions, which must be recognized as a limitation of the proposed study [
23,
24].
Although the present study does not perform full PMV/PPD calculations, the subjective voting mechanism implemented in the Power Apps interface follows the same conceptual structure, enabling a simplified but consistent representation of thermal perception within a real-time control context.
The indicator is determined by computing the arithmetic mean of the responses provided by students and teaching staff through a digital form implemented as an intuitive graphical user interface (
Figure 4) developed in the Power Apps platform. This mechanism enables fast and standardized collection of thermal comfort perceptions, facilitating their integration into the system’s decision-making process.
In the
Figure 5 illustrates the graphical interface of the data collection application, where temperature, lighting, and ventilation statistics are presented as percentage values. The symbol ‘*’ is used to indicate that each percentage value corresponds to the associated parameter (temperature, lighting, or ventilation). The form integrates a set of questions designed to enable the storage and processing of information relevant to the assessment of thermal and environmental comfort conditions. Users are asked to evaluate the perceived indoor temperature, lighting level, and skin temperature a parameter correlated with variations in physiological state. Skin temperature was self-reported qualitatively through predefined categories within the Power Apps interface. In addition, data regarding physical activity level and clothing insulation are collected, two variables widely recognized in the literature as having a direct influence on human thermal perception.
The questions are selected to directly reflect the input variables of the fuzzy system implemented in the Simulink environment, as detailed in previous studies [
25]. Through this well-defined correspondence between the subjective parameters reported by users and the linguistic variables of the fuzzy model, the form functions not only as a data collection instrument but also as an integrated component of the control loop. After responses are collected from a sufficient number of participants, the application computes the arithmetic mean of the values, generating an average comfort level for the entire group of occupants.
The computed average comfort level is subsequently transmitted to the control algorithm and used as a primary constraint in the optimization process of the laboratory equipment operating parameters. By integrating subjective user perceptions and transforming them into objectively computed indicators, a decision-making model is obtained that effectively combines human feedback with mathematical analysis. This approach contributes to intelligent and adaptive indoor environment management, enabling equipment operation to be aligned with the actual needs of occupants.
Furthermore, in order to objectively evaluate the effectiveness of the fuzzy method, a comparative analysis is conducted against three classical control strategies commonly used in HVAC systems: ON/OFF control, PID control and fuzzy-rule-based control, which are widely adopted in conventional HVAC applications. The comparison is performed using standardized performance indicators such as settling time, steady-state error, mean absolute deviation from the setpoint, overshoot, and energy consumption. The results show that, under conditions of high variability in user preferences and in the presence of measurement noise, fuzzy control maintains a mean error below ±0.2 °C, reduces oscillations compared to PID control, and avoids the abrupt switching behavior characteristic of ON/OFF control.
In addition, the system is evaluated in terms of dynamic performance, including its responsiveness to rapid changes in user feedback and the resulting impact on energy consumption. The integration of these metrics validates the contribution of the fuzzy approach not only to comfort stabilization but also to peak load reduction and optimized energy utilization. Through these elements, the section provides a solid scientific foundation for the proposed approach and addresses methodological validation requirements, comparative assessment, and controller performance analysis.
3.2. Scenario Description Based on the Consumption Profile
The scenario used for system testing is configured within a laboratory room of the Faculty of Hydrotechnics, a space representative of modern educational environments. The laboratory is equipped with seven desktop computers, seven laptops, an air-conditioning system, a KUKA Ready2Educate robotic arm, and a FlashForge Creator 3 Pro 3D printer. All these devices are powered by energy supplied both from the photovoltaic system installed at the faculty level and from the national electrical grid, depending on source availability. Their operation is monitored both individually and in an integrated manner from an energy consumption perspective. The collected information plays a key role in evaluating the performance of the proposed algorithm.
The physical layout of the room, together with sensor placement and equipment distribution, is presented in
Figure 6. The laboratory floor plan highlights how measurement points were positioned to achieve uniform coverage and to minimize local influences on the recorded values, thereby ensuring an accurate and representative assessment of the indoor environment.
Figure 6 illustrates the configuration of a modern teaching laboratory designed for activities carried out together with faculty students. The space is organized to support both individual work at dedicated workstations and practical experiments in a central area reserved for educational robotic manipulation. The workstations are arranged along the perimeter and are equipped with computing stations, a layout that facilitates overall laboratory supervision and efficient coordination of activities.
Although two robotic arms are depicted in the figure, only one robotic arm is operational and monitored. On the left side of the room, a rapid prototyping area is installed, which includes a 3D printer. This section supports the development of functional prototypes and their integration into automation-related projects.
On the right side of the laboratory, the digital system for monitoring and storing data collected from the sensors installed in the room is located, managed through an application developed using Power Apps. This area also includes an automation panel integrating various hardware modules, such as presence, light, and temperature sensors, a control module, as well as cloud and wireless connectivity components. These elements enable continuous monitoring of environmental parameters and the implementation of intelligent control scenarios within the laboratory.
The figure also presents the heating, ventilation, and air conditioning (HVAC) system, which ensures control of ambient parameters and communicates with the integrated automation infrastructure. Together, these components reflect the configuration of a modern laboratory fully equipped for education, robot programming, and the exploration of automation technologies.
For the experimental evaluation, multiple monitoring scenarios were selected. Two scenarios were defined: system monitoring and management over a single day, and monitoring over a five-day period (Monday–Friday). The first scenario was conducted for a representative day in October, namely 15 October 2025, for which a complete dataset required for analysis was collected. The second scenario was carried out in November, specifically from 3–7 November 2025. Outdoor environmental conditions were recorded using a Sencor SWS 12500 weather station, which provides measurements of temperature, humidity, and other relevant atmospheric parameters.
Figure 7 presents the weather station installed on the Faculty of Hydrotechnics building, above the monitored laboratory, for the collection of external environmental parameters.
Indoor environmental conditions, particularly temperature and humidity, are acquired from sensors strategically placed at various locations within the room in order to capture local variations and ensure data consistency with occupants perceived comfort, as illustrated in the following
Figure 8.
The energy consumption of the equipment is monitored using smart outlets in conjunction with a smart relay installed in the laboratory’s electrical automation panel, which enables the measurement of individual devices and, implicitly, the identification of both base consumption and variations associated with the activities carried out in the laboratory. Subsequently, the individual values are aggregated to determine the total energy consumption of the room, which is required in the analysis stages and for evaluating the impact of the algorithm on overall energy efficiency. The temporal evolution of electrical consumption is illustrated in
Figure 9. The level of comfort perceived by users is obtained through an application developed in Power Apps, through which students and teaching staff periodically provide feedback regarding microclimate parameters. The collected subjective data are subsequently correlated with the objective measurements performed in the laboratory, thereby ensuring a comprehensive and coherent evaluation of indoor conditions.
Figure 9 presents the comparative evolution of energy consumption for all monitored equipment in the laboratory laptops, desktops, the robotic arm, the air-conditioning (HVAC) system, and the 3D printer over the 08:00–20:00 time interval. The graph provides an overall view of the energy consumption distribution and enables the identification of each device’s contribution to the total daily consumption.
Visual analysis highlights that the HVAC system is the primary energy consumer, with frequent peaks ranging between 11 and 18 kWh, significantly exceeding the values recorded for the other equipment. These periodic increases reflect the cyclic operation typical of HVAC systems, required to maintain a stable microclimate within the laboratory. In the case of the robotic arm, energy consumption generally ranges between 2 and 5 kWh, remaining consistently above that of IT equipment. The relatively high level and variability of consumption confirm the electromechanical nature of the equipment and the energy demands associated with repetitive motions, load handling, and the execution of programmed sequences.
The 3D printer occupies the next position in the energy consumption hierarchy, exhibiting peaks generally between 3 and 5.5 kWh, particularly during periods dedicated to large-scale prints or continuous extrusion and heating phases. Although lower than the consumption of the robotic arm or the HVAC system, the energy contribution of the 3D printer remains significant and adds to the laboratory’s overall load.
Desktop computers exhibit moderate consumption, generally below 2–3 kWh, but remain relatively constant throughout the day, indicating their role as continuous consumers influenced by high-power hardware components (CPU, GPU, power supply). In contrast, laptops show the lowest consumption among the analyzed devices, with values rarely exceeding 1 kWh, confirming the superior energy efficiency characteristic of this type of equipment.
A comparative analysis of the energy consumption profiles of all monitored equipment reveals several aspects that are relevant for understanding the laboratory’s overall energy behavior. The total energy demand is primarily driven by large technical systems, particularly the HVAC installation and the robotic arm, which consistently record the highest consumption levels. These devices largely determine the amplitude of daily consumption peaks.
By contrast, IT equipment contributes more moderately to the overall demand, but its consumption remains relatively constant throughout the day, reflecting continuous operation during laboratory activities. The 3D printer occupies an intermediate position in the energy hierarchy: its consumption is noticeably higher than that of laptops, yet remains below the levels associated with the robotic arm and the HVAC system.
An important observation concerns the complementary nature of these consumption patterns. While IT equipment produces a relatively uniform load profile, mechanical systems and climate control generate pronounced peaks. This interaction between steady background consumption and intermittent high-demand loads may lead to temporary stress on the electrical infrastructure during specific time intervals.
Figure 10 illustrates the hourly evolution of electrical energy consumption (Wh) for the monitored equipment over five consecutive working days (Monday–Friday, 3–7 November 2025). The figure reveals a well-defined daily energy consumption profile, characterized by low values during nighttime periods and significant increases throughout the daytime. Energy consumption begins to rise steadily in the 08:00–09:00 time interval, reaching peak values approximately between 10:00 and 18:00, which corresponds to periods of intensive equipment usage. This pattern is relatively consistent across all analyzed days, indicating a regular operational regime. Among the monitored equipment, the HVAC system exhibits the highest energy consumption values and the greatest variability, dominating the daily energy profile. The robotic arm and the 3D printer register pronounced consumption peaks, suggesting intermittent operation with high energy demand. In contrast, laptops and desktop systems display lower and relatively constant consumption throughout active periods.
Additionally, the graph reveals differences between weekdays in terms of the amplitude and duration of consumption peaks, particularly for high-power equipment, indicating variations in usage intensity. Overall, the figure highlights the dominant contribution of high-load equipment to total energy consumption, compared to office-type equipment, which has a more uniform and lower energy impact.
As shown in
Figure 11, the outdoor temperature graph highlights a slow and wide variation over time. Initially, the temperature gradually increases to approximately 17–20 °C, after which it begins to decrease steadily, reaching a minimum of around 10 °C at approximately 20:00. The curve exhibits smooth evolution without rapid oscillations, which is characteristic of natural outdoor variations driven by the daily thermal cycle.
The data processing stage includes filtering and temporal synchronization procedures applied to all information sources, with the objective of obtaining a coherent, homogeneous, and complete dataset suitable for use in simulations performed in MATLAB/Simulink (MathWorks, Natick, MA, USA, version R2020a). To ensure uniform input data resolution, all records are sampled at five-minute intervals, corresponding to the time window between 08:00 and 20:00, during which the laboratory room is intensively used for educational activities.
Throughout the entire 08:00–20:00 interval, the testing scenario is structured into two-hour segments corresponding to the organization of university schedules, where a lecture or laboratory session lasts 50 min and is followed by a 10 min break. This temporal structure enables the capture of natural variations in human activity, as breaks influence both room occupancy levels and the energy behavior of equipment. In this context, the energy consumption fluctuations observed in the collected data can be correlated with periods of intensified or reduced activity, as well as with the time intervals during which the main equipment, the robotic arm, and the 3D printer are actively used.
In the first interval, between 08:00 and 10:00, the predominant activity consists of observing and analyzing the operation of the robotic arm; during this period, most participants wear slightly heavy clothing, typical of early morning hours in October. In the 10:00–12:00 interval, laboratory activities become more dynamic, involving standing and moderate movement around the robotic arm. Clothing levels during this stage vary between “light” and “slightly heavy,” reflecting both adaptation to the indoor microclimate and the intensity of the performed activities.
Between 12:00 and 14:00, activity returns to a predominantly observational profile similar to the first segment, but in a context where participants’ clothing becomes mostly light due to the significant increase in outdoor temperature around midday. The 14:00–16:00 period introduces a mixed scenario, combining robotic arm analysis with activities dedicated to operating the 3D printer, which requires occasional movement within the room. During this stage, clothing levels revert to the “slightly heavy” category, reflecting variations in thermal comfort perceived by occupants throughout the afternoon.
A similar profile is maintained in the 16:00–18:00 interval, during which participants continue to operate both the robotic arm and the 3D printer, alternating between standing and short movements between work areas. Clothing levels remain constant during this period, still classified as “slightly heavy.” In the final interval of the schedule, from 18:00 to 20:00, laboratory activities preserve the same combined profile of observation and 3D printer operation; however, clothing gradually shifts toward the “moderately heavy” category, driven by the decrease in outdoor temperature toward the end of the day.
By integrating all these elements, the experimental scenario enables system testing within a realistic framework, where the interaction between occupant comfort levels, equipment energy consumption, and time-varying energy tariffs can be observed. In this manner, the algorithm evaluation is conducted in a complex and dynamic environment that reflects real usage conditions and provides a comprehensive perspective on its performance under the specific constraints of a modern university laboratory.
3.3. Case Study: Energy Management System in Buildings
To evaluate the operation of the proposed algorithm in a controlled and implementable context, a complete mathematical model is developed in the MATLAB/Simulink environment. The model is organized into functional subsystems so that each component of the real system is faithfully represented within the simulation. The overall structure of the model is illustrated in
Figure 12, where the main modules composing the simulation architecture are highlighted using color coding.
The subsystem highlighted in orange models the energy contribution from the photovoltaic panels, including the calculation logic related to the generated energy and its availability over the analyzed time interval. The purple-marked area integrates the energy cost calculation mechanism associated with monitored consumption, using a time-of-use tariff structure; within this subsystem, the Display block is used to show the total accumulated cost over the entire simulated day. The subsystem highlighted in green represents the switching algorithm responsible for generating the indoor temperature reference value, computed based on constraints imposed by occupant comfort, energy consumption, and photovoltaic resource availability. The red-marked area represents the types of control systems (ON/OFF, PID, and Fuzzy) that can be activated individually or jointly to obtain the results of the proposed system.
This modular organization enables a detailed analysis of the system’s operating behavior and facilitates the individual evaluation of each component within the energy control optimization process.
The modeling of the HVAC system and the room used in the simulation is carried out in accordance with the methodological framework presented in [
26], subsequently adjusted to reflect the geometric characteristics and specific conditions of the analyzed space.
The comparison of the three control strategies is based on the analysis of the results obtained following the implementation of each type of controller, configured as follows: the ON/OFF controller is defined by a maximum variation range from the reference value of ±0.5 °C; the PID controller has parameters given by an experimental method; and the fuzzy controller uses as input variables the indoor temperature, humidity, skin temperature, activity level and clothing level of the occupants, these representing data series recorded through the implemented sensors and the information collected through the developed application. This adaptation involves updating the physical parameters of the room such as volume, glazed surface area, thermo-energetic properties of the building envelope, and air flow configuration so that the model accurately reproduces the real thermal behavior of the laboratory. This approach ensures conceptual consistency with the reference model presented in the literature, while maintaining the level of accuracy required for simulating the specific operational conditions of the experimental environment in MATLAB/Simulink.
The mathematical modeling of the photovoltaic panels is implemented in Simulink using the dedicated PV Array block, which incorporates a detailed physical model of a photovoltaic generator based on specified electrical and construction parameters. This block employs the characteristic equations of a diode-based photovoltaic cell, including the effects of open-circuit voltage, short-circuit current, temperature coefficients, irradiance level, and cell temperature.
One of the most widely used models for photovoltaic cell simulation is that proposed by Bellia et al. [
27], which provides a detailed modeling and simulation approach applicable to any type of photovoltaic panel. In this model, the output variables are electrical current and power, while the input variables are temperature and solar irradiance.
The mathematical modeling of the photovoltaic cell can be expressed using differential equations, state-space equations, or transfer functions, depending on the desired level of analytical detail. Based on the model proposed by Bellia et al. [
27] and considering the requirements for constructing an adapted model for the photovoltaic cells analyzed in this work [
28], the following equations are obtained:
where:
I—current [A];
—light-generated current (photocurrent) [A];
—saturation current [A];
q—electron charge [C];
RS—series resistance [Ω];
k—Boltzmann constant [J/K];
—photovoltaic cell temperature [K];
G, —solar irradiance [W/m2];
μISC—temperature coefficient of short circuit current [A/K];
—semiconductor bandgap energy.
The model accurately reproduces the nonlinear behavior of the I–V and P–V curves under various irradiance and temperature conditions, enabling real-time simulation of the power variations generated by the photovoltaic panel. This capability to faithfully capture system dynamics confirms the usefulness of the model for energy performance analysis and for evaluating operating scenarios within the MATLAB/Simulink simulation environment.
Within the simulation, the model corresponding to the previously described real scenario is implemented so that the parameter evolution reflects the experimental conditions as closely as possible. The graph generated as a result of the simulation accurately reproduces the behavior observed in the real case, thereby confirming the validity of the mathematical model structure and the input data used. In particular, the photovoltaic energy production curve shown in
Figure 8 follows the typical evolution of a diurnal solar radiation cycle, highlighting both periods of maximum production and intervals characterized by reduced renewable energy availability. This agreement between simulated and real data supports the relevance of the analyzed scenario and provides the necessary basis for a reliable evaluation of the control algorithm’s performance.
Figure 13 presents the evolution of the energy produced by the photovoltaic system as a function of time over the 08:00–20:00 interval, with a temporal resolution of 5 min. Statistical analysis of the data indicates an average energy value of μ ≈ 5.97 Wh per interval and a standard deviation of σ ≈ 3.89 Wh, corresponding to a coefficient of variation of approximately 65%, highlighting the pronounced variability of the generation process. Individual energy values fall within the range [0, 12.11] Wh, with the maximum recorded around 12:40, near midday, when the instantaneous power reached approximately 145 W. From a statistical distribution perspective, the data exhibit slight skewness, with quartiles Q1 ≈ 2.29 Wh, median ≈ 5.76 Wh, and Q3 ≈ 9.73 Wh. This confirms that higher production levels are concentrated around the central part of the day, while lower values occur toward the extremes of the analyzed time window. Temporal integration of the data series results in a total daily energy production of approximately 0.87 kWh for the studied configuration.
The subsystem responsible for calculating the electrical energy cost is designed to integrate both the information related to the total energy consumption recorded over the analyzed day and the time-of-use tariff structure. First, the subsystem receives as input the total energy consumption curve, obtained by summing the individual values of the monitored equipment. In parallel, it receives the tariff schedule, which contains the electricity prices associated with each time interval of the analyzed day. These two datasets are subsequently combined through a multiplication block, where the instantaneous consumption is multiplied by the tariff corresponding to the respective time interval. The resulting product represents the energy cost at that moment, while temporal integration of these values yields the total cost of the energy consumed over the entire day. The final result is displayed via the Display block, enabling direct evaluation of the impact of energy consumption on costs in the analyzed scenario.
The SWITCH block represents the central decision-making component of the control model and is responsible for determining the final reference temperature used by the HVAC system, based on three input variables: the level of energy available from the photovoltaic panels (PV), the average comfort level reported by occupants (comfort), and the electricity cost associated with the current time interval (price). This block is implemented as a MATLAB Function subsystem, within which a set of multicriteria logical rules is defined to enable switching between different decision scenarios according to the simultaneous evolution of these parameters. The rules are designed to allow the algorithm to respond adaptively to variations in energy price by reducing consumption during high-cost periods, without significantly compromising occupant comfort.