A Study on Control System Design Based on ARM Sea Target Search System

1-3. The routine 1 is responsible for receiving data on the serial port 1, and decoding; the serial port 2 receives data in time 2-4, but causing losses of part of data (Byte1- Byte5) on the serial port 2 because data receiving time on the serial port 1 and 2 is overlapping. ABSTRACT: The infrared detector is used for sea target search, which can assist humans in searching suspi- cious objects at night and under poor visibility conditions, and improving search efficiency. This paper applies for interrupt and stack technology to solve problems of data losses that may be caused by one-to-many multi-byte protocol communication. Meanwhile, this paper implements hardware and software design of the system based on industrial-grade ARM control chip and uC / OS-II embedded operating system. The control system in the sea target search system is an information exchange and control center of the whole system, which solves the prob- lem of controlling over the shooting angle of the infrared detector in the process of target search. After testing, the control system operates stably and reliably, and realizes rotation and control functions of the pan/tilt platform during automatic search, manual search and track.


INTRODUCTION
With China's economic development, the sea transport is increasingly busy, and the marine traffic safety and emergency rescue tasks are arduous. Currently, the domestic search and rescue organization mainly depends on the search and rescue personnel to observe, search and rescue. However, the ship accidents mostly occur in bad weather or traffic-intensive conditions, which may bring great difficulties to search ships and persons in distress. Under a complex search and rescue environment, it is difficult for the search and rescue personnel to find targets in back light, at night and in a severe weather [1][2][3]. The target search system based on infrared detectors can be used for search and rescue, which can overcome these shortcomings and deficiencies [4]. Sea target search system includes an infrared detector, a pan/tilt platform, a target detecting board, a master control PC and an automatic search control system. The system structure is shown in Figure 1.
The control system is an information exchange and control center of the whole target search system. In the process of target search, the main control PC can control over each function of the system (including automatic detection and tracking of the target, manual detection and tracking, control of pan / tilt platform and vertical search range, set of detecting parameters, and control of the focusing and calibration of the infrared detector). This paper introduces the hardware structure and software component of the control system. The circuit board of the control system is designed and delivered for production in Altium Designer 8.0. ARM routine is complied, translated, debugged and downloaded in ADS 1.2. The communication of the control system and other systems adopts communication protocol (each protocol is 7 to 8 bytes) mode. If the way of traditional software waiting is adopted to receive the entire protocol data, there is a need to take up more CPU time, and it is likely to cause losses of data sent by other systems simultaneously. As shown in Figure 2, the serial port 1 receives data in time 1-3. The routine 1 is responsible for receiving data on the serial port 1, and decoding; the serial port 2 receives data in time 2-4, but causing losses of part of data (Byte1-Byte5) on the serial port 2 because data receiving time on the serial port 1 and 2 is overlapping.

A Study on Control System Design Based on ARM Sea Target Search System
Xinwei Lin*

School of Information Engineering, Shanghai Maritime University, Shanghai, China
ABSTRACT: The infrared detector is used for sea target search, which can assist humans in searching suspicious objects at night and under poor visibility conditions, and improving search efficiency. This paper applies for interrupt and stack technology to solve problems of data losses that may be caused by one-to-many multi-byte protocol communication. Meanwhile, this paper implements hardware and software design of the system based on industrial-grade ARM control chip and uC / OS-II embedded operating system. The control system in the sea target search system is an information exchange and control center of the whole system, which solves the problem of controlling over the shooting angle of the infrared detector in the process of target search. After testing, the control system operates stably and reliably, and realizes rotation and control functions of the pan/tilt platform during automatic search, manual search and track. Thus, this paper adopts interrupt function with a higher priority to receive data on the serial port and the stack way to timely save communication data, and then adopts the user routine with a lower priority to process these data in the time gap in the process of receiving protocol data, thereby avoiding data losses during one-to-many communication. After receiving data on the serial port (COM1 and COM2), the interrupt service routine (ISR 1 and ISR2) will timely stack data on the serial port, so as to avoid data losses. The routine scheduling process is shown in Figure 3. The control system needs to communicate with an infrared detector, a pan/tilt platform, a target detecting board and a master control PC. Because the infrared detector and the pan/tilt platform share a serial port, the system requires three serial ports. Meanwhile, in order to ensure that the system operates stably under severe sea environment, the system requires highly reliable control chip. Taking into account the design need of the system, this paper adopts PHILIPS industrial-grade 32-bit microcontroller LPC2132.
LPC2132 is a 32-bit ARM7TDMI-STM CPU that supports real-time simulation and tracking. On-chip Real Monitor Software and high-speed tracking execution code can be adopted for real time debugging, and to facilitate for designing, debugging and downloading routines [5]. LPC2132 can be up to 60 MHz of working frequency, with 16kB on-chip SRAM, which can meet the computing needs of control algorithm. The CPU is equipped with 64kB embedded high-speed Flash memory, which is enough to meet the needs of routine memory. LPC2132 has multiple serial interfaces, including two 16C550 industrial standard UART, two high-speed I2C interfaces (400 kbit/s), SPI TM and SSP. LPC2132 has a Power On Reset (POR) and Brown Out Detection (BOD) circuit, which can operate stably within a temperature range from -40 ° C to 85 ° C. These characteristics can guarantee that CPU operates stably and reliably under relatively severe sea environment.

Serial expansion circuit
Because the system requires three serial ports, but LPC2132 has only two serial ports, and there is a need to expand the serial port by the use of serial extension chip. This paper selects GM8142 expanded serial port. This chip can expand a standard SPI interface into four standard UARTs, which is equipped with two modes of operation: serial expansion mode and broadcast mode [6]. Serial expansion mode allows all serial ports to receive and send data by the established baud rate, frame length and verification mode, as well as SPI interface. SPI data is 16bit, of which high 8bit is the address of sub-serial port and additional command and status information, while low 8bit is data actually sent and received. The serial port expansion circuit is shown in Figure 4. This paper connects IRQ interface of GM8142 with EINT1 interface of LPC2132. When the serial port receives data, the main control chip can receive the interrupt notification and timely receive data on the serial port.

Serial level swithcing circuit
The infrared detector and the pan/tilt platform are placed in a higher position of the ship, relatively distant from the control system, so this paper adopts RS-422 level standard with a relatively distant transmission distance and relatively high reliability to realize communication between the control system and the infrared detector and pan/tilt platform. The level switching circuit is shown in Figure 5 [7]. The communications between the control system and master control PC and target detecting board adopt RS-232 level standard. The circuit is shown in Figure 6 [8].

SYSTEM SOFTWARE DESIGN
In addition to completion of the communication tasks for the infrared detector, pan/tilt platform, target detecting board and master control PC, transfer tasks for each function parameter of the system, and control tasks for the focusing and calibration of the infrared detectors, the control system shall also complete control tasks for the position of pan/tilt platform under the automatic search and manual search mode. In order to complete more complex system function tasks, this paper adopts uC / OS-II embedded operating system to achieve scheduling of each task routine by turns [9].    The built-in serial port of LPC2132 adopts the interrupt service routine of serial port receiving to receive data, while the serial port expanded by GM8142 adopts external interrupt EINT1service routine to receive data. The process of interrupt service routine is shown in Figure 7.

Communication subroutine of target detecting board
The communication subroutine of target detecting board has completed information exchange of the control system and target detecting board, whose main task is to receive information related to target search, command tracking and target position of the target detecting board, which is used for realization of the target tracking and delivery of the information of target position to master control PC. The process of the communication subroutine of target detecting board is shown in Figure 8.

Communication subroutine of master control PC
Master control PC sends data to the control system by the serial port to control over the rotation of the pan/tilt platform, and adjust parameters of the infrared detector and target detecting board. The communication subroutine of the master control PC receives commands of master control PC and makes appropriate actions, including: control over the rotation direction and speed of the pan/tilt platform; set up target detection parameters; set up parameters of the infrared detector; set up the level and vertical rotation range of Web of Conferences MATEC 01008-p.4 the pan/tilt platform during automatic search of the target. The routine flow chart is shown in Figure 9.

Subroutines of target search and tracking
The control system makes appropriate control over the motion of the pan/tilt platform according to the location information sent from the pan/tilt platform and the command received from other systems. For example, when operating in an automatic target search mode, the control system controls over the pan/tilt platform to do reciprocating motion within the range set by the master control PC, so as to search targets possibly existing in the sea; when operating in a tracking mode, the control system controls over the pan/tilt platform to move based on the command of target detecting board, so as to track targets; when operating in the master control mode, the control sys-tem controls over the motion of the pan/tilt platform based on the command of master control PC, so as to manually search the target. The flow chart of the subroutines of target search and tracking is shown in Figure   system software, that is, to adopt serial debugging terminal routine and simulate each subsystem to send abnormal and massive protocol data, so as to test the routine; 4. Connect the control system to the online debugging system software in the target search system, and adopt the master control PC to test the function of system.
After a long period of test, the function of the system is normal.

System object and result
The object of the entire target search system is shown in Figure 11. In this paper, the control system has carried out a number of offshore ship tests, and the whole system has carried out performance tests during the day, afternoon and night, and other different environments. The test results are shown in Figures 12-13. During target tracking, the control system controls over the rotation of the pan/tilt platform, and makes the target located in the center of the screen. Figure 12 shows an infrared image collected by the system during automatic tracking; during target search, the control system controls over the pan/tilt platform to search suspicious targets on the sea. Figure 12 shows an infrared image collected during target search. After an overall test of the system, the function of the control system is basically realized, and the system performance is reliable and its operation is stable. This paper proposes a kind of hardware and software design method to avoid communication data losses during one-to-many protocol communication based on the features of ARM chip selected, and a kind of method to control over the pan/tilt platform during automatic target tracking and search, and finally successfully realizes a control system based on the sea target search system with ARM chip. Compared with the control system based on other platforms, the control system based on ARM shortens the development cycle, and gives full play to its high reliability, small size, flexible application and other characteristics.