To improve the controllability of an electro-hydraulic position servo control system while simultaneously enhancing the anti-jamming ability of a PID controller, a compound PID controller that combines the beetle antennae search algorithm with PID strategy was proposed, and used to drive the position servo control system of the electro-hydraulic servo system. A BAS-PID controller was designed, and the beetle antennae search algorithm was used to tune PID parameters so that the disturbance signal of the system was effectively restrained. Initially, the basic mathematical model of the electro-hydraulic position servo control system was established through theoretical analysis. The transfer function model was obtained by identifying system parameters. Then, the PID parameter-tuning problem was converted into a class of three-dimensional parameter optimization problem, and gains of PID controllers were adjusted using the beetle antennae search algorithm. Finally, by comparing the effectiveness of different algorithms, simulation and experimental results revealed that the BAS-PID controller can greatly enhance the performance of the electro-hydraulic position servo control system and inhibit external disturbances when different interference signals are used to test the system’s robustness.