1 Introduction
CAN (Controller Area Network), or controller area network, is one of the most widely used field buses. CAN bus can be applied to high-speed networks and low-cost line networks with its advantages of strong real-time performance, high reliability, simple structure, good interoperability, and low price. Here, a communication system of CAN bus isolator is proposed, which is applied to the communication network from an aircraft to the ground to achieve speed isolation between the aircraft and the ground, so that the aircraft and the ground can communicate stably and in real time. Based on the analysis of CAN bus 2.0B protocol, the system design adopts a structured method to independently design the communication protocol between the aircraft and the ground. The hardware design of the bottom module is based on the C8051F040 high-speed single-chip microcomputer, which integrates the CAN protocol controller internally. Therefore, only the addition of a CAN transceiver can realize the design of CAN intelligent nodes, which is simpler, more reliable, and easier to operate than the traditional CAN node composed of a single-chip microcomputer and a CAN protocol controller. The CAN bus application layer protocol is defined and written by the user, making it more in line with the system design requirements. At present, the whole system runs well, with stable performance and good communication redundancy, which meets the requirements of industrial field use.
2 Design of CAN intelligent node based on C8051F040
Figure 1 is a schematic diagram of the CAN bus hardware interface based on C8051F040. Through the CAN controller integrated inside the C8051F040, in order to enhance the anti-interference ability of the system, the optocoupler 6N137 is connected between the CAN controller and TJA1040, so as to realize the CAN communication between TJA1040 and the outside world. In fact, the integrated transceiver TJA1040 itself has instantaneous anti-interference ability, which can protect the bus and reduce radio frequency interference to achieve thermal protection function. Therefore, in the application occasions where the interference is not serious, there is no need to increase the optoelectronic isolation so that the system can reach the maximum communication rate or distance. If an optoelectronic isolator is used, a high-speed optoelectronic isolator should be used as much as possible to reduce the delay time of the effective loop signal transmission of the CAN bus. Since the CAN isolator needs to collect the data information of the input and output modules through the CAN bus, the interference is large. For the stability and reliability of the system, an optoelectronic isolator needs to be added. Through the connection communication test of CAN2.0B compatible with CAN2.0A protocol, the photocoupler 6N137 has a rise time of 30 ns (typical value), an isolation voltage of 3 000 V, and supports a maximum frequency value of more than 30 MHz.
In order to achieve the stability and reliability of the system, the system design adopts a redundant design, using the dual-channel optocoupler HCPL2631 to isolate and generate control signals to control two single-pole double-throw switches MAX4635, thereby realizing the switching of CAN intelligent nodes.
3 CAN bus isolator design
The CAN bus isolation designed in this system mainly consists of two parts: sending and receiving. Both the sending and receiving parts are composed of three units: data instruction configuration, data processing and data transmission, as shown in Figure 2. In the sending part: after the host computer instruction is configured, it is transmitted to the microcontroller through the FPGA. The microcontroller uses its own CAN bus, which reaches the bus driver after isolation processing, and then outputs data through the CAN bus. The receiving part is just the opposite. The system design sets the aircraft speed to 500 kHz and the ground speed to 50 km/s to better simulate the communication between the aircraft and the ground.
4 Communication protocol between the isolator transmitter and receiver
The bus isolator is divided into two parts: the aircraft high-speed interface and the ground low-speed interface. The isolator is required to pass all data from the ground to the aircraft. The CAN bus of this system adopts the master-slave mode. All bus data uniformly adopts data frames, without remote frames. The maximum data length is 8 bytes and the minimum is 0 bytes. According to the data link layer protocol, the arbitration field standard identifier is 11 bits (ID1O~ID0), and the system determines the priority of data transmission through the identifier. This protocol stipulates that in addition to indicating the priority, the ID is also the data receiving destination node, the data sending source node and the data type. Specifically explain the 11-bit ID: ID[1] (0-3 bits of ID) is the data receiving destination node; ID[2] (4-7 bits of ID) is the data sending source node; ID[3] (8-10 bits of ID) is the data type.
In this protocol, both the aircraft system and the ground system have three nodes, and the node numbers and ID numbers are shown in Table 1.
5 CAN isolator software design
5.1 CAN bus initialization
CAN bus initialization includes: I/O configuration, external crystal oscillator configuration, CAN bus opening and closing, sending and receiving initialization. The initialization procedure is as follows:
void initial_can(unsigned char MsgNum,unsignedl int id)
{SFRPAGE=CONFIG_PAGE;
5.2 Sending and receiving procedures
CAN message transmission is automatically completed by the CAN controller. The user only needs to transfer the corresponding data to the transmission buffer register according to the identifier of the received data frame, and then write the encoding of this message object into the command request register to start the transmission. The transmission is completed by hardware. Here, the data in the message object is updated regularly. The data transmission is automatically completed by the controller. When a data frame is received, the data frame with the same identifier can be sent out. The transmission program code is as follows:
The reception of CAN messages is the same as the transmission, which is automatically completed by the CAN controller. The receiving program only needs to read the received data from the receiving buffer and then process it accordingly. The method is basically the same as the sending program, so I will not repeat it here.
6 Key Technology Design Analysis
6.1 Redundancy Design
The conditions on industrial control sites are complex. The cable contact failure rate caused by external forces is much higher than the node failure rate. Once a cable fails, the bus will lose its communication capability and cause the system to crash, posing a threat to the robustness of the industrial control system. The simplest and most effective way to solve this problem is to design redundancy for physical media with a high failure rate. That is, use two bus cables and two CAN bus transceivers, but only one bus controller. The arbitration circuit automatically monitors the bus status and adaptively selects a normal cable to complete the communication task. When a cable failure occurs, the device automatically alarms to remind the staff to perform maintenance. During the maintenance process, the device continues to work using the spare cable. The cable redundancy design can achieve code-level compatibility with the usual CAN bus communication system. The arbitration circuit is set between the bus controller and the two bus transceivers to monitor the CAN bus cable status and achieve adaptive switching and alarm. When the device sends a message to other nodes, the bus controller sends the same message to the two buses at the same time; when receiving a message, the arbitration circuit always uses bus 1 (main bus) to receive the message when there is no cable failure. If bus 2 (slave bus) fails, the fault monitoring circuit will send an interrupt signal to the main control computer to report the fault, while bus 1 in normal state will still undertake normal communication tasks; if bus 1 fails, the fault monitoring circuit will automatically switch to bus 2 while sending an interrupt signal to the main control computer to ensure the normal operation of the equipment. The bus switching action will only occur when the cable in use fails, which can improve the stability of communication and reduce the probability of response failure.
6.2 Implementation of ID non-filtering when receiving data
In the receiving process of the CAN bus, the method of matching the sending ID and the receiving ID is generally implemented, that is, the receiving party needs to receive and filter the ID. However, this design implements any receiving method. As long as there is data, it starts receiving without filtering the ID number. This allows for better testing. For example, the ID number carried by a certain device does not match the ID received by the receiving party due to various reasons. In this way, it can be determined that the sending device may be interfered with, or there is a problem with the sending device itself. This method of not filtering the ID number is mainly implemented by setting the command request register, message mask register, arbitration register, message control register and command mask register of the receiving device. The implementation procedure is as follows:
7 Conclusion
This paper proposes a solution for implementing a CAN bus isolator. The C8051F series microcontroller with a CAN bus controller is used to implement a CAN intelligent node, increase the redundancy design of the CAN node, improve the stability of communication, and reduce the probability of response failure; the unfiltered CAN data reception can better test the reliability and monitoring function of the system. When a message is received that is not sent by a known device, the location of the device failure can be accurately located. The CAN bus isolator implemented by this solution has been successfully applied to a ground test bench for a certain type of aircraft. After testing and debugging, the system works stably and meets the design requirements. And because of the use of an embedded CAN bus controller, a lot of space can be reserved for future system upgrades.
Previous article:Oilfield power indicator parameter monitoring system based on ZigBee technology
Next article:Design of Power Quality Parameter Monitoring System for Electrified Railway
- Popular Resources
- Popular amplifiers
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Smart LED Octahedron
- [Lazy self-care fish tank control system] BLE_MESH fish tank light peripheral production
- Verilog001
- Inter-core Communication Method of TMS320C6678 Multi-core DSP
- Direct imaging digital exposure technology "prints" the innovative future
- RC π type filter resistor and capacitor value -------
- About the role of capacitors in suppressing differential mode interference and common mode interference
- [Raspberry Pi Pico Review] WS2812B full-color LED light strip/ring display driver
- How to determine the optimal size of a residential energy storage system?
- Hobbylord Bumblebee ST550 Foldable Carbon Fiber Quadcopter