# Temperature Control Unit--Modeling and Implementation of a Particle Filter on a Microcontroller
###### Abstract  
The paper discusses the possibilities of using particle filter estimation algorithms in embedded systems. For this purpose, the dedicated testing platform was built, which allowed for the determination of the estimation quality of a particle filter on a real system, and the microcontroller performance in that scenario. Tests were performed using the obsolete and not very efficient, although energy-saving, STM32F4 Discovery board--it has allowed for an in-depth analysis, and the results can be easily improved by switching to a modern platform. The quality of operations in open- and closed-loop systems was investigated based on the analysis of time simulations conducted for various mathematical models. These analyses made it possible to establish a correlation between the number of particles and the required calculation power. They have shown that it is possible to successfully implement and run a particle filter algorithm on an older and computationally limited device, as well as in real-time scenarios. particle filter; microcontroller; embedded system; implementation; heating process; system identification +
Footnote †: journal: Applied  
can be found in [12; 13; 14; 15]. A more complex algorithm, but also of better output quality for highly nonlinear objects, is the particle filter (PF), proposed in 1993 by [PERSON], [PERSON], and [PERSON] [4]. It is based on the randomization of particles and the calculation of their weights best matching the system's actual output. Over the years, various types of particle filters have been developed, such as an auxiliary particle filter (APF) [16] or a likelihood particle filter (LPF) [17]. The main differences involve selecting the transition function from which the particles are drawn. The particle filter is extremely useful in scenarios where enough processing power is available. In previous works, the authors proposed a modification relating to the parallelization of the basic particle filter, dividing it into smaller parts--the sub-filters. The code can be efficiently parallelized [18], resulting in a reduction of processing time without a negative impact on the output quality (except for the resampling step, which is very important in PF methods and, unfortunately, cannot be parallelized). Problems of applying the efficient use of microcontrollers and PF together have been analyzed in several works [19; 20; 21]. The researchers used a variety of platforms, ranging from hardware to software. The researchers used different types of platforms, which varied at the hardware and software levels. Some of them were built on commercial hardware platforms offered by, e.g., LEGO Mindstorms. The common parts of the above-mentioned platforms are a high-performance processor and a large amount of RAM memory. The platforms based on low-cost boards such as Nucleo and Discovery boards from ST, Arduino family boards, or just ESP8266 are rare. That was the motivation to test one of the mentioned platforms and check its performance. In our case, we decided to get an older platform--the results can be easily improved by simply replacing the board with its newer equivalent. The main subject of research in this publication is the state estimation in the temperature control system. The object was prepared as a dedicated platform for this research. In the literature, there are examples of the use of state estimation of thermal processes. For example, in [22], a particle filter was used to regulate the temperature, with the proposed adjustment of particle weights to improve the operation of the algorithm. The authors rely on a complex non-linear process model. In [23], the authors experimentally determined the parameters of the temperature control model, both in an open- and closed-loop system. However, the model was based only on measurement information--the development of the research may be the use of state estimation to improve this information. One can find many sources on the use of temperature estimation for various devices.