# Building Energy Savings by Developing Complex Smart Windows and Their Controllers
## 2 Materials and Methods
### Optimal Control Algorithm and Controller Development  
In this study, the function that controls the permeability of the smart skin over time was calculated using regression analysis. Consequently, a time function that optimizes the cooling load and lighting energy by controlling the smart skin is proposed.  
\[f(t)=0.0008t^{5}+0.1121t^{4}-2.8149t^{3}+19.36t^{2}-26.65t+71.82 \tag{1}\]  
Different results were obtained when the direction of the building was changed to east, west, south, or north. Using this result, the smart skin control algorithm (implemented to achieve the maximum reduction of cooling and lighting loads in a zero-energy building) can be derived, as shown in Figure 6. In the algorithm, the output level represents the temperature and irradiation amounts obtained from the sensor attached to the SPD. The SPD output is represented as a discrete value ranging from 0 to 1, with 1 indicating complete light blocking and 0 signifying transparent control allowing light transmission.  
Figure 5: Images of (**a**) a solar radiation blocking rate measuring device, (**b**) SPD production, and (**c**) a smart window.  
Figure 6: Control algorithm for load reduction.  
One disadvantage is that the effect of the change in insolation in real time cannot be fully considered through SPD and dimming control based solely on time. To address this limitation, precise, real-time control that considers the indoor environment is necessary. Therefore, a dependent logic considering the amount of insolation is proposed as follows:  
\[S(t)=-0.0185t^{2}+0.2804t-0.0935 \tag{2}\]  
where  
\[t=\left\{\begin{array}{l}08:00\;1\\ 09:00\;2\\ \ldots\\ 18:00\;10\\ \end{array}\right.\]  
\(|R-TR|>100\), \(X=(R-TR)/1000\)  
\(R:\)_Representative Insolation, \(TR:\) Hourly Insolation_  
\[S=S(t)-X(0\leq S\leq 1), \tag{3}\]  
In Equations (2) and (3), \(S(t)\) is a control value, and t is a variable representing time. \(R\) represents the representative solar radiation, and \(TR\) represents the hourly solar radiation. Equations (2) and (3) were used to supplement the control value in cases where the hourly insolation amount had a large error compared with the representative insolation amount. The following algorithm incorporates real-time insolation from the previous algorithm, resulting in a more accurate calculation of SPD values. Therefore, this algorithm allows for the calibration of SPD values, thereby improving the accuracy of SPD values for cloudy or rainy days. Finally, through algorithmic modeling, we were able to derive the optimal SPD transmittance and dimming values, and using these, we controlled the smart window. Figure 7 shows a control method that considers real-time insolation.  
The development of hardware (HW) and firmware (FW) to control a complex smart window system in an office utilizes a LoRa-based wireless communication method to collect wireless sensor data. This supports LGG, SPD, and LED controls. The detailed hardware configuration is illustrated in Figure 8.  
Figure 7: Control algorithm considering solar radiation for load reduction.