Aiming at operating optimally minimizing error of tracking and designing control effort, this study presents a novel generalizable methodology of an optimal torque control for a 6-degree-of-freedom Stewart platform with rotary actuators. In the proposed approach, a linear quadratic integral regulator with the least sensitivity to controller parameter choices is designed, associated with an online artificial neural network gain tuning. The nonlinear system is implemented in ADAMS, and the controller is formulated in MATLAB to minimize the real-time tracking error robustly. To validate the controller performance, MATLAB and ADAMS are linked together and the performance of the controller on the simulated system is validated as real time. Practically, the Stewart robot is fabricated and the proposed controller is implemented. The method is assessed by simulation experiments, exhibiting the viability of the developed methodology and highlighting an improvement of 45% averagely, from the optimum and zero-error convergence points of view. Consequently, the experiment results allow demonstrating the robustness of the controller method, in the presence of the motor torque saturation, the uncertainties, and unknown disturbances such as intrinsic properties of the real test bed.