• Inventory
  • Products
  • Technical Information
  • Circuit Diagram
  • Data Sheet
Technical Information
Home > Technical Information > Embedded System/ARM Technology > Design of Distributed Monitoring System Based on CAN Bus

Design of Distributed Monitoring System Based on CAN Bus

Source:MLH203242
Category:Embedded System/ARM Technology
2023-05-19 11:08:07
16

Introduction

Boilers are important equipment to heat energy and power by burning heated working substances. At the same time, boilers are special equipment which is widely used in all walks of life because of pressure, fire, explosion danger. Therefore, it is very important to monitor the operation status of the boiler in real time and find out the accidents in the operation of the boiler timely and accurately. Traditional boiler monitoring system has a lot of defects in measurement means and sensors used. Taking temperature detection as an example, the early thermocouple bridge method has complicated testing process. The integrated semiconductor analog temperature sensor requires a large number of transmission cables, which is costly and difficult to maintain.

CAN bus is a multi-host control standard. It has the characteristics of protocol in physical layer and data link layer, multi-master node, lossless arbitration, high reliability and scalability. It can effectively support the serial communication network of distributed control system. On the one hand, its communication mode is flexible, it can work in a multi-master mode, and it can also send and receive many kinds of data, such as point-to-point, point-to-multipoint, etc. On the other hand, data communication at a higher bit rate can take place over a relatively large distance. This system is controlled and managed by the upper computer for several parallel pressure boiler monitoring units, which need fast data transmission between each monitoring unit. The CAN bus can meet the requirements of the system very well.

1 System Overall Structure

As shown in Figure 1, the system consists of an upper monitor, CAN node 0, and other CAN nodes. The upper monitor is a PC and the microcontrollers of each CAN node are STC89LE54RD+. STC89LE54RD + External CAN Controller SJA1000, the external equipment is mainly a linear digital thermometer DS1822 and pressure sensor.

The upper monitor (PC) uses an IBM-PC compatible computer, which is mainly responsible for receiving and managing monitoring data for each node of the system, sending control commands, and real-time display of dynamic parameters and device status of each control unit.

CAN Node 0 is a very important node, which has two main functions: one is as the interface between PC and CAN bus, completing the data conversion between CAN bus data and RS-232 interface, caching the data information transmitted by smart node, and warning the alarm signal to notify the maintenance personnel to process; Second, it is responsible for coordinating the communication between the upper computer and each CAN node to ensure that the monitoring data of each node can be quickly and accurately transmitted to the upper computer.

Monitoring CAN node is an intelligent monitoring module. With single-chip computer as its main responsibility, it monitors the environmental parameters and device status of the field, packages and processes the collected data, and sends the processed digital signal to the CAN bus through the CAN communication controller SJA1000. The pressure and temperature of each pressure boiler in the system are measured. Generally, the intelligent monitoring node stores the monitoring data, uploads it to the upper computer regularly, and accepts polling from the upper computer. If it is out of normal working range, warn and report the data to the upper computer in real time.

2 Design of hardware structure

As shown in Figure 2, the monitoring CAN node takes STC89LE54RD10 as its microcontroller, and the peripheral modules include CAN bus interface module, temperature acquisition module, pressure acquisition module, alarm module, etc. In order to make full use of the interface resources of STC89LE54RD+, all modules except CAN interface module use serial interface devices. This reduces the volume of the circuit and the hardware cost of the circuit.

STC89LE54RD+ is a new generation single-chip computer with high speed, low power consumption and compatibility with Philips 51MX core. The 12-clock/machine cycle and 6-clock/machine cycle can be set repeatedly, and the internal integration has MX810 dedicated reset circuit. The execution of instructions is 12 times faster than standard 8051, supporting ISP programming in the system and IAP programming in the application.

2.1 CAN bus interface module

In the Module shown in Figure 3, SJA1000 is chosen as the CAN controller and PCA82C250 as the CAN controller interface chip. The SJA1000 integrates the physical layer and data link layer functions of the CAN protocol for frame processing of communication data. PCA82C250 is the interface between CAN protocol controller and physical bus, which provides differential transmission capability for bus and differential reception capability for CAN controller. Increase the communication distance, improve the instantaneous anti-jamming ability of the system, protect the bus, reduce the radio frequency interference, and achieve thermal protection. Connecting STC89LE54RD+ ALE, RD, WR with SJA1000 ALE, RD, WR constitutes a minimum system node, accessing SJA1000 by reading and writing external data storage. The SJA1000 TX1 foot is suspended and the RX1 pin is grounded to form the level logic required by the CAN protocol.

To further improve the anti-jamming ability of the system, a 6N137 photoelectric isolation chip is added between CAN controller SJA1000 and CAN controller interface PCA82C250, and a DC-DC converter is used to isolate the power supply. The reflection occurs when the communication signal is transmitted to the end of the traverse, which interferes with the transmission of the normal signal. Therefore, two 124W resistors at the bus 2 end (see Figure 1) play an important role in matching the bus impedance. Ignoring them will greatly reduce the anti-jamming and reliability of data communication, even make it impossible to communicate. The resistance RS between the 8th foot of PCA82C250 and the ground is called the "slope resistance", and its value determines whether the system works at a high speed or a slope control mode. Connect the pin directly to the ground and the system will work at a high speed. In this way, shielded cables are used as buses to avoid radio frequency interference. However, when the baud rate is low and the bus is short, the slope control method is generally used. The slope of rise and fall depends on the resistance value of RS. Normally, the ideal power range for RS is between 15 kW and 200 kw. In this way, parallel lines or twisted pairs are used as the bus.

2.2 Temperature measurement module

The temperature measurement module uses the digital thermometer chip DS1822 based on single bus technology, which is introduced by DalIas Company in the United States. It has a simple connection circuit and no external components, as shown in Figure 4. DS1822 uses a clock counting method that directly converts temperature to frequency. The clock counting is generated by an oscillator with a very low temperature coefficient and is therefore very stable. The counted gate cycle is determined by an oscillator with a high temperature coefficient (i.e., very temperature sensitive).

2.3 Pressure measurement module

The pressure measurement module uses a precision intelligent pressure sensor PPT-R. PPT-R is a high quality pressure sensor manufactured by Honeywell Company with stainless steel diaphragm for measuring high temperature and corrosive media.

PPT-R intelligent pressure sensor has good performance and flexible configuration. The PPT-R sensor integrates each pressure signal measured, and the integration time can be selected between 8 ms and 12 s. This can improve the adaptability and anti-jamming ability of the digital control system under different environment conditions. PPT sensor has excellent repeatability and stability, and its pressure signal can be set by single-chip computer to digital output mode or analog output mode. In this system, set it as digital output mode.

3 Design of software

The system software is designed in a modular way, which is mainly divided into PC program module, data collection and processing module, CAN communication module, and so on. This paper mainly introduces the design of PC software module and CAN communication module.

Design of 3.1 Upper Computer Software

The PC software takes C++ Builder6 introduced by Borland as its development platform, and has functions of system parameter setting, monitoring status setting, data sending and receiving, node status query, interrupt receiving data management, etc. The upper computer first initializes the CAN bus and itself, then sends commands to notify specific nodes to send data to the CAN bus, uploads it to the upper computer through the CAN bus, and then processes it by the upper computer. The upper computer sends commands to each node in a timed cycle and receives data by interruption.

First open the communication serial port with CreateFile (), the function reference format is:

CreateFile (1pFileName, dwDesiredAccess, dwShare-Mode, lpSecurityAttributes, dwCreationDistribution, dw-FlagsAndAttributes, hTemplateFile);

Then use BuildCommDCB() and SetCommState() functions to set serial communication parameters, such as baud rate, stop bit, data bit, check bit, etc., through the communication device control block DCB (Device Control Block).

When a communication event occurs, the serial buffer can be read and written directly using the functions ReadFile () and WriteFile (). The Citation Formats are:

WriteFile (hFile, lpBuffer, nNumberOfBytes ToWrite.lpNumberOfBytes Written, lpOverlapped);

ReadFile (hFile, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesRead, lpOverlapped).

Other functions of the upper computer software can be programmed by calling the properties of the corresponding components. The developed software interface is shown in Figure 5.

3.2 Design of CAN communication module

The CAN communication program sends the collected data to the CAN controller, which then sends the data to the CAN bus.

For receiving data, the system is implemented by interruption. Once an interrupt occurs, the data to be received is automatically loaded into the corresponding message register, and shielding filtering can also be used. A screening filter register is used to selectively compare the identifier of the received message with the identifier set in advance at the initialization of the receive buffer bit by bit. Only messages with matching identifiers can enter the receive buffer, and those that do not meet the requirements will be shielded from the receive buffer, thus alleviating the CPU's burden on processing messages. In addition, different data should be placed in different message registers, and the program flow is shown in Figure 6.

Conclusion

This system uses a secondary control system consisting of lBM-PC compatible machine, single-chip computer and SJA1000. It realizes the integrated operation and solves the long-standing difficulties in the monitoring of pressure boilers. The system is simple in structure, convenient in operation, safe and reliable, low in cost, stable and reliable in operation.



Reference:

[1].SJA1000 Datasheethttp://www.dzsc.com/datasheet/SJA1000_609075.html.
[2].DS1822 Datasheethttp://www.dzsc.com/datasheet/DS1822_1056058.html.
[3].RS-232 Datasheethttp://www.dzsc.com/datasheet/RS-232_584855.html.
[4].PCA82C250 Datasheethttp://www.dzsc.com/datasheet/PCA82C250_542618.html.
[5].6N137datasheethttp://www.dzsc.com/datasheet/6N137_91364.html.


Source:Xiang Xueqin