Cover
Vol. 21 No. 2 (2025)

Published: December 16, 2025

Pages: 99-107

Original Article

Utilizing Raspberry-Pi 3 to Implement Fuzzy Logic Controller Optimized by Genetic Algorithm

Abstract

The development of Fuzzy Logic Controllers (FLC) with low error rates and cost effectiveness has been the subject of numerous studies. This paper study goals to the investigation and then implementation an FLC using the readily accessible and reasonably priced Raspberry Pi technology. The FLC used in this work has two inputs, one output, and five Membership Functions (MFs) for each input and output. The FLC goes through two processes, tweaking the MF parameters and tuning input/ output Scaling Factors. The tuning technique makes use of the Genetic Algorithm (GA). The whole set of the FLC probabilities is taken into account as the tuned FLC controller, and then transformed into a lookup table. The Center of Gravity (COG) approach is used to determine the output for the tuned FLC controller. The resulting table is converted into values of digital binary using a specific type of encoder, and then extraction of the set of Boolean functions to apply this tuned circuit. Finally, the Python 3 programming language is used to define the resultant Boolean functions on the Raspberry Pi platform, and then a decoder extracted the appropriate control action from the output. The Benefit of this method is the use of a digital numbering system to define the FLC, which is implemented on Raspberry Pi technology and allows for fuzzified high processing speed output per second. The controller speed has not been unaffected by the quantity for these fuzzy rules.

References

  1. O. Cord´on, F. Herrera, F. Gomide, F. Hoffmann, and L. Magdalena, “Ten years of genetic fuzzy systems: current framework and new trends,” in Proceedings joint 9th IFSA world congress and 20th NAFIPS international conference (Cat. No. 01TH8569), vol. 3, pp. 1241–1246, IEEE, 2001.
  2. A. BASTIAN and I. HAYASHI, “An anticipating hybrid genetic algorithm for fuzzy modeling,” Journal of Japan Society for Fuzzy Theory and Systems, vol. 7, no. 5, pp. 997–1006, 1995.
  3. O. Cord et al., Genetic fuzzy systems: evolutionary tuning and learning of fuzzy knowledge bases, vol. 19. World Scientific, 2001.
  4. V. Ojha, A. Abraham, and V. Sn´aˇsel, “Heuristic design of fuzzy inference systems: A review of three decades of research,” Engineering Applications of Artificial Intelligence, vol. 85, pp. 845–864, 2019.
  5. G. Warner, S. Wijesinghe, U. Marques, O. Badar, J. Rosen, E. Hemberg, and U.-M. O’Reilly, “Modeling tax evasion with genetic algorithms,” Economics of Governance, vol. 16, pp. 165–178, 2015.
  6. S. Katoch, S. S. Chauhan, and V. Kumar, “A review on genetic algorithm: past, present, and future,” Multimedia tools and applications, vol. 80, pp. 8091–8126, 2021.
  7. P. V. de Campos Souza, “Fuzzy neural networks and neuro-fuzzy networks: A review the main techniques and applications used in the literature,” Applied soft computing, vol. 92, p. 106275, 2020.
  8. M. Mowbray, T. Savage, C. Wu, Z. Song, B. A. Cho, E. A. Del Rio-Chanona, and D. Zhang, “Machine learning for biochemical engineering: A review,” Biochemical Engineering Journal, vol. 172, p. 108054, 2021.
  9. S. Das, D. Chakraborty, and L. T. K´oczy, “Linear fuzzy rule base interpolation using fuzzy geometry,” International Journal of Approximate Reasoning, vol. 112, pp. 105–118, 2019.
  10. M. Vamsi and K. Soman, “In-vehicle occupancy detection and classification using machine learning,” in 2020 11th International Conference on Computing, Communication and Networking Technologies (ICCCNT), pp. 1–6, IEEE, 2020.
  11. S. Hodges, S. Sentance, J. Finney, and T. Ball, “Physical computing: A key element of modern computer science education,” Computer, vol. 53, no. 4, pp. 20–30, 2020.
  12. T. S. Roy, S. Ghosh, R. Datta, and A. Santra, “Iot based home automation using raspberry pi,” International Journal of Computer Engineering and Technology, vol. 10, no. 3, pp. 70–74, 2019.
  13. L. Zhu, P. Spachos, E. Pensini, and K. N. Plataniotis, “Deep learning and machine vision for food processing: A survey,” Current Research in Food Science, vol. 4, pp. 233–249, 2021.
  14. G. Yan, J. Zeng, H. Sang, Y. Lin, J. Lin, and Q. Li, “New customizable smart home system design based on raspberry pi,” in International Workshop of Advanced Manufacturing and Automation, pp. 91–99, Springer, 2022.
  15. M. Nykyri, M. Kuisma, T. J. K¨arkk¨ainen, J. Hallikas, J. J¨appinen, K. Korpinen, and P. Silventoinen, “Iot demonstration platform for education and research,” in 2019 IEEE 17th International Conference on Industrial Informatics (INDIN), vol. 1, pp. 1155–1162, IEEE, 2019.
  16. J. R. Strickland, “Raspberry pi for arduino users,” Raspberry Pi for Arduino Users, 2018.
  17. G. Flurry and G. Flurry, “Raspberry pi 3 model b+ setup,” Java on the Raspberry Pi: Develop Java Programs to Control Devices for Robotics, IoT, and Beyond, pp. 21– 48, 2021.
  18. R. Hosseini, K. Akhuseyinoglu, P. Brusilovsky, L. Malmi, K. Pollari-Malmi, C. Schunn, and T. Sirki¨a, “Improving engagement in program construction examples for learning python programming,” International Journal of Artificial Intelligence in Education, vol. 30, no. 2, pp. 299–336, 2020.
  19. B. A. Malloy and J. F. Power, “Quantifying the transition from python 2 to 3: An empirical study of python applications,” in 2017 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM), pp. 314–323, IEEE, 2017.
  20. B. P. Ganthia, S. K. Barik, and B. Nayak, “Genetic algorithm optimized and type-i fuzzy logic controlled power smoothing of mathematical modeled type-iii dfig based wind turbine system,” Materials Today: Proceedings, vol. 56, pp. 3355–3365, 2022.
  21. M. Dirik, “Prediction of nox emissions from gas turbines of a combined cycle power plant using an anfis model optimized by ga,” Fuel, vol. 321, p. 124037, 2022.
  22. Y.-T. Hsiao and C.-Y. Chien, “Enhancement of restoration service in distribution systems using a combination fuzzy-ga method,” IEEE Transactions on Power Systems, vol. 15, no. 4, pp. 1394–1400, 2000.
  23. Y. Li, J. Zhang, W. Liu, and S. Tong, “Observer-based adaptive optimized control for stochastic nonlinear systems with input and state constraints,” IEEE transactions on neural networks and learning systems, vol. 33, no. 12, pp. 7791–7805, 2021.