The Stability of SG water level plays an important role in the safety of nuclear power plants, but tuned the parameter of water level PID controller is hard. Proposed a novel algorithm, KIPSO, which tuning PID controller parameters. Determine the cluster centre through K-means value cluster algorithm, and take the cluster territory as the characteristic value of vaccine set, enhance the vaccine multiplicity. Updated vaccine extraction by self-adaptive method, improved the convergence and adaptability. Analyzed the algorithm robustness in detail, and gave the rule which the immunity selection parameter. The simulation results shows: compares with the PID controller whose parameters are tuned by ZN method, KIPSO have a smaller overshoot, a better stability, and a shorter adjustment time. The simulation results show that the proposed method is effective for tuning PID parameters.