Application Scheme of Realizing Remote Data Acquisition System Using CAN Bus Communication Interface

The remote data acquisition system is mainly composed of two parts: the receiving and processing part on the shore and the underwater measuring device. In order to prolong the service time of the battery, the on-off of the battery power of the underwater measuring body is controlled from the shore. The data acquisition system uses a four-core longitudinally sealed seawater cable, two channels transmit data, and the other two channels control battery power.

Author: Ji Dou; Wang Xiangjun

1 Introduction

In the marine environment, because the measurement site is far from the shore and the environment is harsh, the measurement device must be separated from the computer system to form a remote data acquisition system. There are generally two ways of data transmission in the remote data acquisition system: frequency transmission and serial communication. The frequency measurement has strong anti-interference ability, which is convenient for long-distance transmission, but this kind of long-distance frequency measurement is generally only applicable to the lower frequency range below tens of hertz. In serial communication, the data transmission rate of RS-232 communication standard is slow (usually the asynchronous communication rate is limited below 19.2kbps), and the transmission distance is short (generally the cable length is 15m), so it is not suitable for use as a remote data acquisition system; RS-449 , RS-422 and RS-423 and other communication standards, the real-time performance is not strong; RS-485 can only form a master-slave structure system, and the communication method can only be carried out in the way of master station polling. It is poor; and when multiple nodes send data to the bus at the same time, the bus will be short-circuited, thereby damaging some nodes.

CAN (Controller Area Network) bus belongs to the category of field bus, it is a serial communication network that effectively supports distributed control or real-time control. The CAN bus communication interface integrates the physical layer and data link layer functions of the CAN protocol, which can complete the framing processing of the communication data. One of the biggest features of the CAN protocol is that the traditional station address encoding is abolished, and the communication data block is encoded instead. The advantage of using this method is that the number of nodes in the network is theoretically unlimited, and the identification code of the data block can be composed of 11-bit or 29-bit binary numbers, so 211 or 229 different data blocks can be defined. By means of data block coding, different nodes can also receive the same data at the same time. The length of the data segment is 8 bytes, which will not occupy the bus for too long, thus ensuring the real-time nature of communication. CAN protocol adopts CRC check and can provide corresponding error handling function, which ensures the reliability of data communication.

2 System Design

Remote data acquisition systems require sensors and measurement devices to be located at the measurement site, and computer systems to be onshore or on board. The distance between them is often hundreds of meters, and sometimes even several kilometers. Therefore, it is particularly important to have fewer connecting wires and lower maintenance costs. In this paper, the measurement system is aimed at the magnetic field (3 components), the electric field (3 components), and the inclination parameter (2 components), using CAN to build a remote underwater data acquisition system, using 3 measurement nodes to realize real-time detection of the above 8 sensor signals respectively. collection and transmission. The structural block diagram of the remote underwater data acquisition system is shown in Figure 1.

Application Scheme of Realizing Remote Data Acquisition System Using CAN Bus Communication Interface

The remote data acquisition system is mainly composed of two parts: the receiving and processing part on the shore and the underwater measuring device. In order to prolong the service time of the battery, the on-off of the battery power of the underwater measuring body is controlled from the shore. The data acquisition system uses a four-core longitudinally sealed seawater cable, two channels transmit data, and the other two channels control battery power.

2.1 Hardware circuit design

The sensor adopts a three-component measurement module of magnetic field, a three-component measurement module of electric field, and a two-component measurement module of inclination angle. In the signal processing circuit, each signal is amplified and filtered. The amplification adopts two LM148 four operational amplifiers. The filter is a cascade of two active low-pass filter second-order sections composed of operational amplifiers. The single-chip microcomputer system transmits the three-component electric field signal, the three-component magnetic field signal and the two attitude angle signals to a total of 8 signals in turn and sends them to A/D for conversion. The range is ±10V, and the output is 16-bit and 8-bit optional. Here, 16-bit parallel output is used. The control signal is generated by the port lines P1.0, P1.1 and P1.2 of the microcontroller. The structure diagram of the microcontroller system is shown in Figure 2. shown. The single-chip microcomputer adopts PHILIPS is the microcontroller P87C592 with the function of re-chip CAN, the crystal frequency is 16MHz, the P0 and P2 ports are used as data lines and address lines, and the P4 and P5 ports are used as the high 8 of the 16-bit analog-to-digital converter. bit and lower 8-bit parallel data lines. P1.6, P1.7 are used for CAN bus, P1.2, P1.3 and P1.4 control the channel of the eight-to-one multiplexer MAX308. PC82C250 is a CAN bus transceiver, which is the interface between the CAN controller and the physical bus. It provides the ability to drive and transmit the bus, the ability to transmit differentially to the CAN controller, and the ability to receive differentially to the CAN controller. It has a strong ability to resist instantaneous interference and protect the bus; there are 3 different working modes, namely high speed, slope control and standby. Power down of a node on the bus will not affect the bus, enabling high-speed applications up to 1 Mbps within 40 m. The host receiver uses PCL-841. PCL-841 can be directly inserted into the ISA expansion slot of the computer. The computer assigns a memory address to PCL-841 and uses it as a standard memory for reading and writing. The memory address can be set to C800H by jumper to any of the 40 base addresses in EF00H. It is a CAN bus communication card with built-in CAN controller. It provides bus arbitration and error detection and automatic retransmission function, thus avoiding data loss and ensuring the reliability of the system.

Application Scheme of Realizing Remote Data Acquisition System Using CAN Bus Communication Interface

2.2 System software design

To achieve effective, real-time communication, software design is the key and difficult point. The software design of this system includes two parts, namely the single-chip program and the host control and data processing program.

The single-chip microcomputer program mainly includes the node initialization program, the message sending program, the message receiving program, and the CAN bus error processing program. The flow chart of the main program of the single-chip microcomputer is shown in Figure 3, and the program is written in C51 language.

Application Scheme of Realizing Remote Data Acquisition System Using CAN Bus Communication Interface

The CAN controller appears to the CPU as a register-mapped peripheral device that ensures that both parties work independently. The exchange of status, control and commands between the microcontroller and the CPU is done by reading these registers in reset mode or working mode. written to complete. When initializing the CAN internal registers, pay attention to the bit rate of each node must be consistent, and the receiving and sending parties must be synchronized. Sending a frame of data adopts high-speed DMA, which allows a complete message (up to 10 bytes) to be transferred between the CAN controller and the main RAM within a maximum of 2 cycles. The great enhancement of CPU capabilities is due to the fact that high-speed transfers are done in the background. The DMA bit is reset after a successful DMA transfer. During a DMA transfer, the CPU can process the next instruction, however, access to data memory, CANADR, CANDAT, CANCON or CANSTA is not allowed. After the DMA bit is set, each interrupt is disabled until the transfer is complete. DMA transfers cannot be performed during the reset state (reset request bit is high). In order to improve the real-time performance of communication, the reception of the message adopts the interrupt reception method, which can also ensure that the data overflow phenomenon will not occur in the receiving buffer.

The host program includes measurement and control subroutines, communication subroutines, data processing subroutines, and so on. The data measurement and control subroutine is used to control the lower computer to measure, the communication subroutine sends control commands and receives measurement data according to the communication protocol, and the data processing subroutine realizes the preprocessing and storage of the data. The host program is written in C language. The flow of the host program is shown in Figure 4.

Application Scheme of Realizing Remote Data Acquisition System Using CAN Bus Communication Interface

3 Data acquisition experiment of underwater physical field

When collecting underwater physical field data, there are 3 types of 8 signals to be measured: three components of electric field, three components of magnetic field, and two components of the sensor’s inclination angle on the seabed. During the actual measurement, the entire measuring body (including sensors, signal conditioning circuits, watertight containers, etc.) is placed on the seabed (about 30 meters deep), and the measuring body is 120 meters away from the receiving host on the shore. Some other experimental parameters are set as follows: the transmission baud rate is 1Mbps, the sampling frequency of each node is 10KHz, each 4-channel signal is sampled to send data to the host once, and 4 groups of 8-byte data are sent each time, resolution: 0.0495μA/m ; Signal input range: -50mV~50mV; Signal frequency bandwidth: 500Hz~800Hz; Supply voltage: ±5V, 9V, ±15V. The measurement system starts to work at 9:00 in the morning under complex marine environmental conditions, and does not stop in the middle, and the measurement is completed at 5:00 in the afternoon. The measurement results are consistent with the theoretical calculation after analysis, indicating that the system is stable and reliable. In addition, the complete set of measurement system hardware equipment (including computers and sensors) cost less than 30,000 yuan.

4 Conclusion

CAN bus has been recognized as one of the most promising field buses, and has been widely used in some high-end automotive vehicle systems. of R&D personnel. The innovation of this paper is to propose a method of remote data acquisition system based on CAN bus structure, apply CAN bus technology to industrial field control, design hardware circuit and software, and get practical application. The system can realize real-time acquisition and transmission of 8-channel sensor signals in complex oceans. Experiments show that the system has the advantages of simple structure, reliable performance, long transmission distance and low price. The system design method can also be applied to other multi-node systems that require data collection.

The Links:   LC171W03-C4K2 MG75J6ES50 GETCOMPONENT

Bookmark the permalink.

Comments are closed.