# Temperature Control Unit--Modeling and Implementation of a Particle Filter on a Microcontroller
## 5 Experiments Results
### Heating and Cooling Test  
In the second part of the experiments, the heating and cooling test was performed. We prepared a scenario in which the air in the case was heated to the desired temperature. After reaching the temperature, the air was immediately cooled down to the base temperature (19.875 \({}^{\circ}\)C). The information collected online was the indoor temperature and the estimated temperature. The quality of the estimation of the data models was tested and compared to the models given by Equations (10) and (12). The results obtained are shown in Figures 6-8 and are denoted as \(\hat{y}_{m1}\) and \(\hat{y}_{m2}\) for the systems (10) and (12), respectively. Figure 13 from Appendix A shows experiments obtained only with the use of the model (10) because these experiments were used to verify the operation of the estimation for various parameters of the particle filter--for different values of set temperatures and different noise variances. For better visibility of the range and approximations, some fragments of the charts are zoomed in on; they are marked with rectangles in the main picture. The \(u_{2}\) value is never set to zero as it is a signal related to the fan where the minimal PWM duty cycle is 30% due to below the value the fan is not working correctly. WMuch more importantly, we observed that the fan is very useful to mix up the air in the chamber. In cases when the fan is off, the hot air accumulates itself around the heater and above it. In other places of the chamber, the air stays colder. Further, when \(u_{2}\) was changed to 100% and \(u_{1}\) was changed to 0%, we observed air mixing at the beginning of the experiment. This resulted in a sudden increase in the air temperature around the thermometer. When the air became a semi-homogeneous mixture, the temperature drop was similar to the one described in the article. Using values below 30% for \(u_{2}\) would have had a negative impact on the quality of the experiments. Hence the nominal value of the \"off\" state of the fan was taken as 30%. \begin{table}
\begin{tabular}{c c c} \hline
**Platform** & **Processing Time (s)** & **Consumed Energy (Wh)** \\ \hline A & 0.249 & 0.0068 \\ B & 0.260 & 0.0030 \\ C & 1.767 & 0.0155 \\ D (O) & 3.110 & **0.0012** \\ D (S) & 91.750 & 0.0358 \\ \hline \end{tabular}
\end{table} 
Table 3: Comparison of the energy efficiency of the platform; the lowest value of Energy was marked by bold. Results obtained for various configurations of particle filter parameters were compared--for the noise variances, the number of particles, and for the different temperature values (see Appendix A, Tables A1 and A2). The results show that the estimates fit the measured values despite slight differences in the initial values. This is due to the use of measurement information in the filtration step. With correct PF settings (such as the number of particles, variances, etc. ), the initial errors are quickly compensated for, and the estimate begins to follow the measured temperature. When the assumed temperature was reached, the heater was turned off and the model parameters (10) were switched on in PF. Figure 6: Experimental results for 1000 particles; the measured value (red), estimated values from assumed models (blue and black), and outdoor measurement (gray); and the input signals. Figure 7: Experimental results for 500 particles; the measured value (red), estimated values from assumed models (blue and black), and outdoor measurement (gray); and the input signals. In the case of model (10), a sufficiently large number of particles is needed for a correct estimation. For Equation (12), the estimation also works correctly when the number of particles is reduced. This may be due to the estimation following a mathematical model, which did not keep the history of the previous sample, as was the case with the second one. The dynamics of the system and the impact of external controls can be treated here (in model (12)) as a disturbance in the estimation task.