CAN Bus Technology

Source: Internet
Author: User

1. the generation and development of CAN Bus Controller Local Network (CAN-Controller Area Network) is a multi-host Local Network launched by Bosch for modern automobile applications, its outstanding performance has been widely used in industrial automation, a variety of control equipment, transportation tools, medical instruments, construction, environmental control and many other departments. The local network of controllers will be popularized in China. With the rapid development of computer hardware, software technology and integrated circuit technology, industrial control systems have become the most dynamic branch in the field of computer technology application, and have made great progress. Due to high requirements on system reliability and flexibility, the development of industrial control systems is mainly manifested in: control oriented to diversification, System Oriented to decentralization, that is, load dispersion, function dispersion, danger dispersion and regional dispersion. Distributed Industrial control systems are developed to adapt to such needs. This type of system is based on a microcomputer and uses 5C technology-computer technology, control technology, communication technology, and CRT technology) A product that closely integrates with change. It has obvious superiority in terms of applicability, scalability, maintainability, and fault resistance compared with the decentralized Instrument Control System and the centralized computer control system. A typical distributed control system consists of field devices, interfaces and computing devices, and communication devices. The field bus can meet the needs of process control and manufacturing automation at the same time. Therefore, the Field Bus has become the most active field in the field of industrial data bus. The Research and Application of fieldbus has become a hotspot in the field of industrial data bus. Although the current research on the field bus has not yet put forward a perfect standard, the high performance and price ratio of the field bus will attract many industrial control systems to adopt. At the same time, because the standards of the Field Bus have not yet been unified, the application of the field bus can be put into full play, and will provide a richer basis for the improvement of the field bus. The controller can (Controller aeranetwork) came into being in this context. As can is widely used and promoted in more and more different fields, the standardization of communication packets in various application fields is required. Therefore, in September 1991, PHILIPS semiconductors formulated and released the can technical specifications (Version 2.0 ). This technical specification consists of two parts: a and B. 2.0a provides the CAN message format defined in the can Technical Specification Version 1.2, while 2.0b provides two standard and extended message formats. Since then, in November 1993, ISO officially promulgated the international standard for Local Network (CAN) of high-speed communication controllers (iso11898 ), this paved the way for the standardization and promotion of local network controllers.

2. CAN bus features CAN bus is a serial data communication protocol developed by Bosch in Germany since the beginning of 1980s to solve the data exchange between numerous control and test instruments in modern cars, it is a multi-bus, and the communication medium can be twisted pair wires, coaxial cables, or optical fiber. The communication speed can reach 1 Mbps. The CAN bus communication interface integrates the physical layer and data link layer functions of the CAN protocol to complete frame processing of communication data, including bit filling, data block encoding, cyclic redundancy test, priority discrimination, and so on. One of the biggest features of the CAN protocol is the abolition of the traditional station address encoding, instead of coding the communication data block. By using this method, the number of nodes in the network is not limited theoretically. The ID code of the data block can be composed of 11 or 29 binary numbers, therefore, you can define 211 or 229 different data blocks. This data block encoding method allows different nodes to receive the same data at the same time, this is very useful in distributed control systems. The Data Segment can contain a maximum of 8 bytes, meeting the general requirements for controlling commands, operating states, and test data in the industrial field. At the same time, 8 bytes do not occupy the bus for too long, thus ensuring the real-time communication. The CAN protocol adopts CRC Check and provides corresponding error handling functions to ensure the reliability of data communication. Can features superior, high reliability and unique design, especially suitable for the interconnection of industrial process monitoring equipment, therefore, more and more attention from the industry, and has been recognized as one of the most promising field bus. In addition, the CAN bus adopts a multi-master competitive bus structure, which has the characteristics of Multi-master station operation, decentralized arbitration serial bus, and broadcast communication. Any node on the CAN bus can actively send information to other nodes on the network at any time, regardless of the primary and secondary nodes. Therefore, it can implement free communication between nodes. The CAN bus protocol has been certified by the International Standardization Organization. It is a mature technology, and the control chip has been commercialized and cost-effective. It is particularly suitable for the data communication between distributed measurement and control systems. The CAN Bus plug-in card can be inserted on a PC at XT compatible machine to form a distributed monitoring system.

3. Introduction to the CAN bus technology 3.1-BIT arbitration requires fast data transmission to process data in real time, which requires a high speed of the physical data transmission path. When several sites need to send data at the same time, the bus must be allocated quickly. Real-time processing of Urgent Data exchanged through the network is significantly different. A rapidly changing physical quantity, such as a car engine load, will transmit data more frequently and require a shorter latency than a relatively slow physical quantity, such as a car engine temperature. The CAN Bus transmits data in the unit of packets. The priority of packets is combined among 11-bit identifiers. The identifiers with the lowest binary number have the highest priority. This priority cannot be changed once it is established during system design. Conflicts in bus reading can be resolved through bitwise arbitration. As shown in figure 2, when several sites send messages at the same time, the message identifier of Site 1 is 011111, the message identifier of Site 2 is 0100110, and the message identifier of site 3 is 0100111. All identifiers have the same two 01 S. When the 3rd bits are compared, the message of Site 1 is discarded because its 3rd bits are high, the other two stations have low 3rd-bit packets. The 4, 5, and 6 bits of the station 2 and station 3 messages are the same. The messages of the Station 3 are lost only when the 7th bits are sent. Note: The signal in the bus keeps track of the packets of the station that finally obtains the read permission of the bus. In this example, the message of station 2 is tracked. The advantage of this non-destructive BIT arbitration method is that the starting part of the packet has been transmitted over the network before the network finally determines which station message is sent. All sites that do not obtain the read permission of the bus become receiving stations with the highest priority messages, and do not send packets before the bus is idle again. Can is highly efficient because the bus is only used by those pending sites of the Request bus. These requests are processed in order based on the importance of the packets in the entire system. This method has many advantages when the network load is heavy, because the priority of bus reading has been placed in each message in order, which can ensure a low individual hiding time in the real-time system. For the reliability of the master station, the CAN protocol implements non-centralized bus control, and all main communications, including bus read (license) control, are completed several times in the system. This is the only way to implement a communication system with high reliability.

3.2 comparison between can and other communication solutions in practice, there are two important bus distribution methods: distribution by schedule and distribution by demand. In the first method, no matter whether each node applies for a bus or not, each node is allocated according to the maximum period. Thus, the bus can be assigned to each station and is the only station, whether it is immediate bus access or bus access at a specific time. This will ensure that there is a clear bus distribution during bus access. In the second method, the bus is allocated to a station according to the basic requirements for data transmission, and the bus system is allocated according to the desired transmission (for example, Ethernet CSMA/CD ). Therefore, when multiple sites request bus access at the same time, the bus will terminate requests from all sites, and no station will receive bus distribution. In order to allocate a bus, more than one bus access is necessary. Bus distribution can be implemented to ensure that bus distribution is clearly implemented when different stations apply for bus access. This bitwise arbitration method can solve the collision problem when two sites send data at the same time. Different from message arbitration in the Ethernet network, the Can non-destructive solution solves the access conflict between bus and ensures that the bus is not occupied when no useful message is transmitted. Even when the bus is under heavy load, bus access with message content as the priority has been proved to be an effective system. Although the transmission capability of the bus is insufficient, all unresolved transmission requests are processed in order of importance. In a network such as CSMA/CD, Ethernet and the system often crash due to overload, which does not happen in CAN.

The 3.3 can packet format consists of seven parts, as shown in figure 3. The CAN protocol supports two message formats. The unique difference is that the length of the identifier (ID) is different. The standard format is 11 bits and the extended format is 29 BITs. In the standard format, the start position of a message is referred to as the frame start (SOF), followed by an arbitration site consisting of an 11-bit identifier and a remote sending request bit (RTR. The RTR bit indicates whether it is a data frame or a request frame. No data bytes exist in the request frame. The control field includes the identifier extended bit (IDE), indicating whether it is a standard format or an extended format. It also includes a reserved position (RO) for future extension. The last four bytes indicate the Data Length (DLC) in the data field ). The data field range is 0 ~ 8 bytes, followed by a cyclic redundancy check (CRC) that detects data errors ). The response field (ACK) includes the response bit and the response separator. The two messages sent by the sending site are recessive (logic 1). At this time, the receiving station that correctly receives the message sends the control level (logic 0) to overwrite it. In this way, the sending station can ensure that at least one station in the network can receive packets correctly. The end of the message is marked by the end of the frame. There is a short interval between two adjacent packets. If no bus access is performed on the station, the bus will be idle.

3.4 Data error detection is different from other bus, and the CAN protocol cannot use response information. In fact, it can signal any errors. The CAN protocol can use five methods to check errors. The first three methods are packet content-based checks. 3.4.1 The cyclic redundancy check (CRC) is added with a redundant checkpoint in a message to ensure that the packets are correct. The receiving station uses CRC to determine whether a message is faulty. 3.4.2 frame Check This method uses the bitfield check frame format and size to determine the correctness of the message. It is used to check format errors. 3.4.3. As described above, the received frame is confirmed by the receiving site through a clear response. If the sending site does not receive a response, it indicates that the receiving site has found an error in the frame, that is, the ACK field is damaged or the packets in the network are not received by the station. The CAN protocol can also detect errors through bit checks. 3.4.4 bus detection sometimes, one node in can monitor its own signal. Therefore, the station that sends the message can observe the bus level and detect the difference between the sending bit and the receiving bit. 3.4.5 each bit in a packet is represented by a non-zero code, which guarantees the maximum bit encoding efficiency. However, if there are too many bits of the same level in a frame, synchronization may be lost. To ensure synchronization, the synchronization follows the bit filling. Five students. After five consecutive equal bits, the sending Site Automatically inserts a complementary complement bit. When receiving, the fill bit is automatically lost. For example, after five consecutive low-level bits, can automatically inserts a high-level bits. Can uses this encoding rule to check for errors. If there are six identical bits in a frame message, the can will know that an error has occurred. If at least one site detects one or more errors through the above methods, it will send an error mark to terminate the current sending. This prevents other sites from receiving error messages and ensures the consistency of Network reports. When a large amount of data is sent, the sending Site Automatically resends the data. As a rule, send again within the 23-digit cycle after an error is detected. In special cases, the recovery time of the system is 31 single-digit periods. However, this method has a problem, that is, a site with an error will cause all data to be terminated, including correct data. Therefore, if no self-monitoring measures are taken, the bus system should adopt modular design. Therefore, the CAN protocol provides a way to distinguish accidental errors from permanent errors and local site failures. This method can be implemented by evaluating the statistics of error stations to identify the errors of a station and entering a running method that does not have adverse effects on other stations, that is, the station can disable itself to stop normal data from being mistakenly treated as incorrect data. 3.4.6 can reliability in order to prevent the vehicle from causing danger to the driver due to data exchange errors during the life cycle of use, the vehicle's safety system requires high data transmission security. If the reliability of data transmission is high enough or the residual data errors are low enough, it is not difficult to achieve this goal. From the perspective of bus system data, reliability can be understood as the ability to identify data errors generated during transmission. The probability of residual data errors can be obtained through statistical measurement of Data Transmission reliability. It describes the probability that the transmitted data is damaged and the damage cannot be detected. The error probability of residual data must be very small, so that it is hardly detected during the entire life cycle of the system by average statistics. To calculate the probability of residual errors, you must be able to classify data errors, and the data transmission path can be described by a model. To determine the residual error probability of can, we can regard the residual error probability as 80 ~ The 90-bit message transmission time-bit error probability function, and assume that the system has 5 ~ If there are 10 sites and the error rate is 1/1000, the maximum bit error probability is 10-13 orders of magnitude. For example, the data transmission rate of a CAN network is 1 Mbps. If the data transmission capability is only 50%, for a system with a service life of 4000 hours and an average packet length of 80 bits, the total amount of data transmitted is 9 × 1010. During the life cycle of the system, the average statistics of unmeasurable transmission errors are smaller than 10-2. In other words, if a system is 365 days a year, 8 hours a day, and the error rate per second is 0. 7, then an uncheckable error occurs on average every 1000. 4. application Example: A hospital has five 16 t/h German feisman gas boilers, providing 5 kg/cm2 of steam to the laundry room, preparation room, supply room, domestic water, heating and other facilities, the annual consumption of natural gas is 12 million, consuming 0.2 million tons of tap water. The hospital uses the power-based heating method to manage the heat network in a region and divide it into four Heating areas. The air usage of heating in winter is very high. Based on this, a distributed boiler steam Network Intelligent Monitoring System Based on CAN Field Bus is designed. Field application shows that the building automation system has the characteristics of strong anti-interference ability, easy field configuration, high degree of network, and friendly man-machine interface.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.