A Neural-Tuned Fuzzy Controller for DC Motor Speed Regulation: An Open-Source Educational Platform on Raspberry Pi
In this paper, I present an open-source educational platform for teaching closed-loop control of a DC motor to undergraduate students. The platform integrates a Raspberry Pi 4 with an L298N motor driver and an infrared reflective speed sensor, providing hands-on access to four controller types: Proportional-Integral (PI), Proportional-Integral-Derivative (PID), Mamdani fuzzy logic, and a neural-network-tuned Mamdani fuzzy controller. The neural-tuned controller uses three independently trained Keras neural networks to predict adaptive scaling factors for the fuzzy controller's error, change-in-error, and output signals at each control cycle. Ground-truth scaling factors for supervised training are generated using the Åström-Hägglund relay-feedback auto-tuning method across the motor's operating range. The system is exposed through a PyQt5 graphical interface with real-time plotting, controller switching, parameter tuning, and an integrated educational module containing topic explanations and an interactive tutorial. The complete source code is released under an MIT license. This paper documents the architecture, training pipeline, software design, and educational module. Preliminary observations from informal bench testing are reported, with quantitative comparative evaluation deferred to future work using preserved experimental datasets. The platform is intended as a teaching artifact for undergraduate control engineering courses and as a starting point for student projects exploring hybrid neuro-fuzzy control.
Authors
- Alex Odhiambo Haya (ORCID: https://orcid.org/0009-0002-0402-9313)
Publication Details
- Journal
- Open MIND
- Published
- 2026-05-11
- DOI
- https://doi.org/10.5281/zenodo.20124684
- Primary Topic
- Fuzzy Logic and Control Systems
- Type
- preprint