Since inverted pendulum systems (IPSs) are under-actuated systems, controlling these systems has become an important problem. Because of their irregular movements and being structurally unstable, the balancing of these systems poses a major problem. In this study, the dynamic model of a linear IPS has been obtained by using the Newton–Euler method and also conventional proportional–integral–derivative (PID), fuzzy logic (FLC), and self-adaptive fuzzy-proportional–integral–derivative (SAF-PID) control algorithms have been designed for the control of the system. The purpose of these designed controllers is to keep the arms of the IPS on the moving cart in a vertical position and bring the cart to the specified equilibrium position. In conventional control methods, unwanted oscillations have occurred during the movement of the cart. By using two-loop control methods, it is aimed to reduce these oscillations and to design a robust system. The results have been obtained using the conventional PID, FLC, and SAF-PID controllers. To increase the performance of the SAF-PID control type, the optimum value of the coefficients of the points where the legs of the membership functions touch were calculated using the firefly optimization algorithm. To conclude, the designed controllers were performed on computer simulation. The results are given graphically and numerically. Mean absolute error (MAE), mean squared error, integral absolute error IAE, and integral squared error have been compared and examined with each other and with the studies in the literature using performance criteria. As a result, the proposed control method was at least 26.31% more successful in the angular control of the pendulum and at least 9.26% better in the position control of the cart than the studies in the literature.