This paper takes the permanent magnet servo motor-driven hydraulic system as the research object. The hydraulic system power source uses servo motor instead of the original asynchronous motor, becoming a new energy-saving, fast response, and easy to realize closed-loop control hydraulic power systems. Aiming at variability of the load for the hydraulic system, immune algorithm is introduced to incremental PID controller and derive control law. Using fuzzy strategy approximating antibodies inhibit adjustment function to enhance the stability and robustness of the system, and designing fuzzy immune PID controller, parameters of controller are self-optimized by particle swarm (PSO) algorithm. This controller is applied to a hydraulic system, and achieved the precise control of the system flow in a variety of typical conditions. Simulation results show that: the controller can immune modulate automatically according to the dynamic changes of load of the hydraulic system, with fast tracking, small overshoot, and strong robustness advantages.