The inverted pendulum (IP) system, is a highly coupled, complex, nonlinear system in which the performance of the system is adversely affected by parameter uncertainty and outside disturbances. Therefore, these complications must be managed by the controllers created for such systems. The primary objective of this work is to develop four control structures, including integer order proportional integral derivative neural network controllers for inverted pendulums that deal with trajectory tracking issues. Proportional-integral-derivative neural network structure1 (PIDNNS1), proportional-integral-derivative neural network structure2 (PIDNNS2), proportional-integral-derivative neural network structure3 (PIDNNS3), and proportional-integral-derivative neural network structure4 (PIDNNS4) are the controller structures for inverted pendulum (IP) system . The ant colony optimization (ACO) is a metaheuristic optimization method that is offered to optimize. the controllers' settings while minimizing the cost function. The proposed controllers' resilience to outside disturbances and parameter uncertainty is also tested. The results using MATLAB code demonstrate that the PIDNNS4 controller, which best has a reduced cost function equal to (1.177494), (1.273627), (1.209761) for trajectory tracking, parameters uncertainty, and disturbances rejection for the inverted pendulum (IP) system. and the best controller for stabilization with a low-cost function is the PIDNNS1 controller (1.280839).