Design of CAN bus cable channel monitoring system based on ARM

Publisher:码字狂人Latest update time:2011-06-24 Keywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 Introduction
The land-to-ground ratio of urban high and low voltage transmission cables has become one of the symbols of urban management level. In recent years, urban power transmission and distribution cables are gradually changing from overhead lines to power cables. As the channel of cable lines, the construction speed of cable trenches is accelerating year by year, and the construction mileage is increasing year by year. In the future, it will be carried out on a large scale.
A cable trench detection system is developed, which uses modern equipment and means to transmit the cable trench environment and cable operation status in real time, monitor the whole process, display the status, critical alarm, predictive prompts, event analysis and statistics, etc. Through this equipment, the management of cable trenches is transformed from manual periodic inspection and post-event remediation to a management mode that combines full-time real-time monitoring, manual periodic maintenance and event emergency response processing. Eliminate potential accidents in the bud, prevent them before they happen, reduce the accident rate and personnel costs, improve power supply quality, and increase economic benefits. Based on the LPC2292 controller and CAN field bus technology, considering economic and practical factors, a distributed cable trench monitoring system with simple structure, high cost performance, flexible expansion and strong versatility is proposed and designed.

2 Overall system design
The design is a power cable trench monitoring system with a hierarchical (level) distributed multi-CPU structure. The monitoring system can be divided into three levels according to the structural function, namely: lower computer signal acquisition layer; upper computer data processing layer; network communication service layer. The system structure block diagram is shown in Figure 1.

(1) The control device of the lower computer signal acquisition layer is LPC2292, which has an embedded ARM7 microprocessor. The μC/OS-II operating system is transplanted on this device. The main responsibilities of this layer are: when a thief enters the channel, the lower computer generates an early warning signal to the upper computer, that is, the anti-theft function; and it has moisture-proof, explosion-proof, anti-virus and other functions, so this layer also has sensor equipment for collecting monitoring information, including: temperature sensor, anti-theft sensor, water level sensor, etc.
(2) Upper computer data processing layer The upper computer is the connection device between the CAN bus and the IP network, and the control device of this layer is also LPC2292. However, this layer does not connect sensors, but network connection modules, LCD interfaces, keyboards, and CAN communication modules. In addition to the functions related to CAN communication with the lower computer, the power channel information obtained from the lower computer is also displayed on the LCD, and the system parameters can be set through the keyboard. It is also necessary to organize the detection signals from all monitoring points on the CAN bus into IP packets in chronological order and send them to the central communication server when the IP link is unblocked.
(3) The network server layer is mainly composed of network communication servers and data servers. Cable channel information, sensor information, location information and alarm signals are sorted and stored, and combined with the data of the geographic information system (GIS) according to the business logic and required format, and then published to the authorized management system personnel and leaders of the power supply bureau at all levels in the form of WEB to complete the management and maintenance of the system, including database servers, GIS systems, application servers, management machines, etc.

3 System hardware design
The hardware composition of the lower computer system equipment is shown in Figure 2: control device LPC2292, CAN communication module, JTAG, Flash, SRAM memory, power module, current-to-voltage module, sensor and interface circuit. The hardware composition of the upper computer system equipment is similar to that of the lower computer.

3.1 Introduction to LPC2292
The core control device of the control system adopts LPC2292 microprocessor, which integrates 2 CAN controllers. Its main features are: 16/32-bit ARM7TDMI-STM CPU that supports real-time simulation and tracking; 16-bit Thumb mode can be used for applications with strict control of code size, which reduces the code size by more than 30% with little performance loss; LPC2290 has a 144-pin package, extremely low power consumption, multiple 32-bit timers, 8-way 10-bit A/D converter, 2-way CAN, PWM channels and up to 9 external interrupts. LPC2292 not only has the function of the main controller, but also serves as the node controller of CAN to realize data transmission and exchange with other nodes in the network.
3.2 CAN interface circuit
The CAN interface circuit is the key to CAN communication of the entire circuit. Its hardware circuit is shown in Figure 3, which consists of ARM microcontroller LPC2292, CAN bus transceiver TJA1050T, high-speed optocoupler 6N137 and power isolation module B0505S. Pin P0.23 RD2 and pin P0.24 TD2 are the transceiver pins of the CAN control module of LPC2292.
The two-way CAN controller integrated in LPC229 complies with the CAN specification CAN2.0B and ISO11898-1 standard. The bus data baud rate can reach 1 Mb/s, and 32-bit registers and RAM can be accessed.
The transceiver TJA1051T is the interface between the CAN protocol controller and the physical bus, which is fully compatible with the ISO11898 standard. CANH and CANL are ideally matched to reduce electromagnetic radiation to a minimum. CANH and CANL of LPC2292 are connected to RXD and TXD of TJA1050T respectively through high-speed optical coupler 6N137. The two power supplies used in the optical coupler circuit must be completely isolated. The complete isolation of the power supply uses a low-power power supply isolation module B0505S. Although the circuit is more complex, it improves the stability and safety of the node.

4 Analog sensor interface circuit design
Methane, carbon monoxide sensors, water level sensors, and temperature sensors are all analog sensors. The principles of analog sensors are similar. Only temperature sensors are introduced here. Common analog sensors are two-wire and three-wire. The difference is: in the three-wire system, two power lines are connected, one is connected to the positive power supply, one is grounded, and the other is the signal line to output current signals. In the two-wire system, one line is connected to the positive power supply, and the other is used as a signal output line to output current signals. The temperature sensor used in the system is a two-wire system. The basic principles of the two-wire system and the three-wire system are the same, but the connection methods are different.
The system analog sensors all use linear output, which makes it easy to calculate the voltage converted into the real value. Just select two test temperatures and measure the voltage value at the same time. The two points determine a straight line, and the relationship between the measured voltage and temperature can be listed. The use of other analog sensors such as water level and methane is the same. Its circuit connection is shown in Figure 4.

[page]

The CON8 socket is the connection socket for analog sensors. 24 V is used to power analog sensors, and the signal output pin is directly connected to the input pin of the op amp LF347. The temperature sensor outputs a 4-20 mA current signal that is linear with the measured temperature. Therefore, the system uses an emitter follower to first let the current flow through a 125 Ω resistor to the ground, and convert the 4-20 mA current signal into a corresponding 0.5-2.5 V voltage. The voltage input signal passes through the emitter follower, and the voltage signal output by the op amp remains unchanged, and is directly connected to the A/D pin of the LPC2292. In this way, the lower computer converts and collects various signals of digital and analog sensors through the A/D converter, and then packages them and uploads them directly to the upper computer through the CAN bus. The upper computer then converts the values ​​to obtain the true values ​​of various information in the channel. This current-to-voltage design is not only simple, but also has high precision and good stability.

5 CAN communication software design
The design uses μC/OS-II embedded real-time operating system to implement CAN communication. After successful transplantation on LPC2292, it can be used as the kernel to write the control software of the monitoring system.
5.1 Run μC/OS-II operating system
The CAN implementation of the project is mainly achieved by establishing two tasks, namely CAN sending task and CAN acquisition task. In the main function main, first use OSInit() to initialize the μC/OS-II operating system, establish a semaphore and clear the semaphore counter, then use OSTaskCreate() to create the first task Tasksend(), and then use OSStart() to start the multi-task scheduling mechanism of the operating system to start running the main application of the system. The main function code is as follows:


5.2 Data transmission
and reception Data can be received in query mode or interrupt mode. In order to improve efficiency, data reception adopts interrupt mode. Among the two tasks, the priority of task Tasksend() is set to the highest, and the priority of task Taskrev() is the second highest. Task Tasksend() is mainly responsible for initializing CAN, initializing timer 0, initializing VIC, establishing semaphores for task Taskadrev() to communicate with interrupts and establish a new task Taskrev(), and processing collected data. Task Taskadrev() is always in a waiting signal state. Once a signal is received from the interrupt, data is collected immediately, and the collected data pointer is sent to task Tasksend() through the mailbox.
The task flow chart of CAN receiving data and sending data based on μC/OS-II is shown in Figures 5 and 6.

6 Conclusion
The embedded system with ARM7TDMI core embedded microcontroller LPC2292 as the main controller and CAN bus as the data transmission mode has been widely used. At the same time, the excellent reliability of CAN communication has become the key to the performance of the system. Based on the successful transplantation of μC/OS-II, the CAN communication software design is studied with LPC2292 as the development platform. The experimental results show that the system design is feasible and meets the requirements of fast, accurate and high information volume.

Keywords:ARM Reference address:Design of CAN bus cable channel monitoring system based on ARM

Previous article:Implementation of multi-sensor data fusion fire alarm system based on ARM9
Next article:Design of LCD driver terminal based on ARM9 & Linux

Recommended ReadingLatest update time:2024-11-16 16:34

ARM architecture will be used in servers
ARM architecture has the advantage of low power consumption, so Taiwanese manufacturers expect ARM architecture to be applied to servers. According to Taiwanese industry insiders, Internet service providers in mainland China are interested in adopting ARM-based servers. Among server manufacturers, HP has starte
[Microcontroller]
ARM architecture will be used in servers
ARM9 startup analysis memory distinction and startup process analysis
I recently encountered a big problem. Actually, I have always had this problem before, but I never went into it! The main reason is that I want to do something new. I plan to use J-link to burn the ARM9 processor. If I can move the powerful debugging function of j-link to arm9, it will be a wonderful thing. With this q
[Microcontroller]
ARM9 startup analysis memory distinction and startup process analysis
ARM develops various burning file format descriptions (ELF, HEX, BIN)
1. ELF          Executable and linking format (ELF) files are a common object file format under x86 Linux systems. There are three main types:          (1) Relocatable files suitable for linking, which can be used with other object files to create executable files and shared object files.           (2) Executable f
[Microcontroller]
ARM develops various burning file format descriptions (ELF, HEX, BIN)
ARM exceptions and interrupts
1 SWI interrupt processing steps: 1) When entering an interrupt, pc- lr, cpsr- spsr, and cpsr_mode are set to privileged mode, all of which are completed by hardware. 2) Registering the interrupt vector table is done by software. You can use the B instruction or the ldr and dcd tables to place a jump instruction at th
[Microcontroller]
ARM exceptions and interrupts
Linux 2.6.32 porting to arm9 (s3c2440) platform 2 -- Kconfig and Makefile
I followed countless posts and documents on Ubuntu and spent a lot of time to set up the Qt environment and Eclipse, only to find in the end that these were irrelevant things. The first thing to do was to port Linux to the ARM core board. I fiddled with the porting for a long time and was confused by the complex tre
[Microcontroller]
Understanding #immed_8r in ARM data processing instructions
First of all , I would like to thank tekkamanninja for his blog post http://blog.chinaunix.net/space.php?uid=20543672&do=blog&id=94265&page=1#comment "Analysis and Understanding of "8-bit Bitmap" in ARM Processor" (read 8,000 times, spectacular, admiration), which brought me a refreshing feeling like lemonade dripping
[Microcontroller]
Design and implementation of interface between AD7656 analog-to-digital converter and LPC2210 ARM controller
introduction In the three-phase signal processing application of the power system, it is often necessary to collect and process the A, B, and C three-phase voltage and current signals at the same time. Such as three-phase power, electric energy measurement and harmonic analysis. The AD7656 of ADI Company of the Unit
[Microcontroller]
Design and implementation of interface between AD7656 analog-to-digital converter and LPC2210 ARM controller
Working status of ARM processor
In the ARM architecture, it can work in three different states: ARM state, Thumb state and Thumb-2 state, and debug state. 1. ARM state The arm processor works in the state of 32-bit instructions, and all instructions are 32-bit 2. Thumb status The state of arm executing 16-bit instructions, that is, 16-bit state
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号