# Vision Based Dynamic Thermal Comfort Control Using Fuzzy Logic and Deep Learning
## 3 Methodology
### Fuzzy Method Based Thermal Control Systems  
The controller is composed of three interconnected parts, including computer vision model, sensors, and decision part. Figure 1 shows the control block diagram of fuzzy temperature control system.  
The fuzzy controller system consists of the data acquisition, PMV index computing, fuzzy inference mechanism, and output control (temperature change). Three environmental parameters, including temperature, relative humidity, and average radiant temperature, can be directly measured by the sensors and be sent into the controller. The PMV index can be obtained from Equation (2). It is employed as the current time value to the fuzzy controller. This value can be considered to be the main parameter to control the indoor temperature. It is compared with the previous value to produce PMV variation. The considered fuzzy sets for the input and output variables are included in Table 2, Figure 4a-c.  
Figure 3: (**a**) PMV thermal comfort index and (**b**) Temperature convergence for different actions based on Fuzzy temperature control started at 20 degrees.  
Figure 4: Membership functions of the (**a**) first input (PMV), (**b**) second input (APMV) and (**c**) output of the fuzzy temperature controller.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Variables** & **Terms** & **Sets** \\ \hline \multirow{8}{*}{**PMV**} & TC & \(-3\), \(-3\), \(-1.7\), \(-1.4\) \\  & C & \(-1.7\), \(-1.4\), \(-1\), \(-0.7\) \\  & SC & \(-1\), \(-0.7\), \(-0.3\), \(0\) \\  & N & \(-0.2\), \(0\), \(0\), \(0.2\) \\  & SW & \(0\), \(0.3\), \(0.7\), \(1\) \\  & W & \(0.7\), \(1\), \(1.4\), \(1.7\) \\  & TW & \(1.4\), \(1.7\), \(3\), \(3\) \\ \hline \multirow{8}{*}{**Change in Temp.**} & B\(-\)Negative & \(-3\), \(-3\), \(-0.6\), \(-0.4\) \\  & N & \(-0.6\), \(-0.4\), \(-0.3\), \(-0.1\) \\  & S\(-\)N & \(-0.3\), \(-0.2\), \(-0.1\), \(0\) \\ \cline{1-1}  & Z & \(-0.05\), \(-0.01\), \(0.01\), \(0.05\) \\ \cline{1-1}  & S\(-\)P & \(0\) \(0.1\), \(0.2\), \(0.3\) \\ \cline{1-1}  & P & \(0.1\), \(0.3\), \(0.4\), \(0.6\) \\ \cline{1-1}  & B\(-\)Positive & \(0.4\), \(0.6\), \(3\), \(3\) \\ \hline \multirow{8}{*}{**Change in Temp.**} & \(N_{4}\) & \(-0.25\), \(-0.2\), \(-0.15\) \\  & \(N_{3}\) & \(-0.2\), \(-0.15\), \(-0.1\) \\ \cline{1-1}  & \(N_{2}\) & \(-0.15\), \(-0.1\), \(-0.05\) \\ \cline{1-1}  & \(N_{1}\) & \(-0.1\), \(-0.05\), \(0\) \\ \cline{1-1}  & Z & \(-0.0005\), \(0\), \(0.0005\) \\ \cline{1-1}  & P\({}_{1}\) & \(0\), \(0.05\), \(0.1\) \\ \cline{1-1}  & P\({}_{2}\) & \(0.05\), \(0.1\), \(0.15\) \\ \cline{1-1}  & P\({}_{3}\) & \(0.1\), \(0.15\), \(0.2\) \\ \cline{1-1}  & P\({}_{4}\) & \(0.15\), \(0.2\), \(0.25\) \\ \hline \hline \end{tabular}
\end{table}
Table 2: Fuzzy sets of the fuzzy heating control in terms of input (PMV ranges from too cold to too warm, \(\Delta\) PMV ranges from Big\(-\)negative to Big positive) and output (Change in Temp. ranges from negative (\(N_{4}\)) to positive (\(P_{4}\))) variables.  
The current and variation values are then fed to the fuzzy controller as inputs to process the temperature based on pre-set rules, as can be seen in Table 3.  
If the PMV index is in a reasonable range, then the output of the controller will have an effect of no change. Otherwise, the controller will maintain the PMV index in the normal range by controlling the room temperature according to the thermal comfort of an occupant. This will be based on the person's actions in addition to other parameters. The fuzzy control used \(\pm\)0.25 degrees Celsius as maximum amount over which to change the temperature in order to achieve precise control of PMV index and thermal comfort. The actual value is set according to the occupant's preferences, affecting the amount of the system takes to adapt to the occupant's activities. This is considered next.