To solve the course control problem of unmanned surface ships, a course controller based on prediction function is designed, considering the inherent steering constraints of unmanned surface ships and the disturbance of stroke, wave and current during navigation. Based on prediction function, the controller adopts the strategy of prediction before control to overcome the constraints and interference in course control. In the online optimal control calculation, the potential influence of steering constraints and external interference on course control is considered, and the timely compensation of navigation interference is realized. Finally, the course controller based on prediction function is verified by simulation experiment and compared with the traditional PID controller. Through observation and analysis of the test results, it is proved that the new controller is effective in solving the heading control problem.