| The purpose of the system is to control the ship in accordance with the planned route or course in navigation, and automatically turn at the scheduled way point. In order to improve system reliability, we use a triple-modular redundancy system, that is, the same three main controlling templates execute tasks in turn, vote in accordance with the principle of majority, at the same time have data backup and fault tolerance function.The system is divided into three modules, the main controlling module, human-computer interactive module and communication module. Human-computer Interactive module acquires the parameters of planned routes which operator set up and shows real-time ship's position information send by the main controlling module. Communication module acquires parameters in real-time ship's position information and transmits them to the main controlling module. In addition to the main controlling module calculates partial rudder angle according to algorithm and the collected parameters ,but also backups data and detects faults.This article focuses on four aspects: (1) solving the problem of triple-modular redundancy system's bus possession; (2) designing communication protocols between the templates; (3) realizing information transmission module of the main controlling template; (4) introducing a basic algorithm of track-controlling.The template has the same function in the triple-modular redundancy system, shares input and out channels, controls the peripheral devices. So the main problem is the bus possession among three templates and exchanging information. Token used to resolve the problem of triple-modular redundancy system bus possession. Every template has a fair right to the bus possession. It is not easy to have a bus confliction. This paper describes the establishment of a token, the transmission and processing after token lost.This paper designs communication protocols among the three machines and achieves information exchange in order to backup data through the serial interrupt or parallel port. The default mode of information transmission is the serial interrupt mode, parallel mode as a standby.This paper describes the debugging procession of communication between the main controlling template and simulation template, switch input template, vote and alarm input and out template, as well as tests whether the template communicates normally.This paper also introduces the track-controlling algorithm, describes in detail a algorithm of calculating the track offset and PID algorithm calculating partial rudder angle. |