Acta Polytechnica Hungarica Vol. 20, No. 6, 2023 – 61 – Optimal Fuzzy Controller, using a Genetic Algorithm for a Ball on Wheel System Péter Menich, József Kopják Kandó Kálmán Faculty of Electrical Engineering, Óbuda University, Bécsi út 96/b, H-1034 Budapest, Hungary email: peter.menich@pentasoft.hu, kopjak.jozsef@kvk.uni-obuda.hu Abstract: The process of building a fuzzy controller for the Ball on Wheel problem raised an issue with the optimization of the controller parameters. For non-linear systems the parameter values of the controller are based on a subjective estimate and a trial-and-error approach. This is a time-consuming human task, which could be automated. The information obtained from the visualized simulation results gave us the opportunity to increase the controllable area, using a genetic algorithm (GA), by tuning the parameters of the fuzzy membership methods. Keywords: unstable; fuzzy; genetic algorithm; microcontroller; BLDC; simulink 1 Introduction The control of an unstable non-linear system is always a challenging task. [1] Fuzzy controllers are well suited for such controlling applications [22] e.g., inverted pendulum [14] control of an unstable bioreactor [23]. Combining the fuzzy controller with various techniques opens up the possibility to increase the performance of the controller without significantly increasing the required computational power. A list of representative examples showing the huge scope for further development of controller design: predictive control [24], data-driven hybrid controller design [25], evolving fuzzy models [26], using lookup tables [29], cascade system structure [30]. Performance can also be improved by optimizing the controller. This can be achieved in several ways, of which the following are some examples: Multitasking genetic algorithm [27], using a Slime mold algorithm [28] Our goal was to build a very simple fuzzy controller for educational purposes for the “ball on the wheel" problem, where the task is to keep a free-rolling ball on the top of a rotating wheel. Since our goal was to make the controller as simple as possible, we discarded complex solutions and focused on optimizing the controller parameters, i.e., the points of the triangular membership functions.