• In the CAN main line interconnection gateway’s design with realizes - en.51rd.net

    Abstract: This article has studied the CAN main line and the ethernet interconnection technical point systematically, first analyzes the interconnection technique to realize the difficulty - - protocol conversion which in the process meets. Then proposed one kind of CAN main line and the ethernet system interconnection design proposal, and elaborated in detail its system’s software and hardware realizes the method. In order to enhance system’s performance, uses high speed micro controller SX52 to design the embedded transparent gateway, introduced in detail with SX52 the method which realizes in the TCP/IP agreement stack, has guaranteed the overall system performance promotion by the SX52 strong network protocol handling ability.
    Key word: CAN, protocol conversion, gateway, SX52

    The gist of CAN bus and internet ethernet network technology are discussed in this paper. First, We analyse difficulty when the protocol was transformed. Second, we put forward a systemic design schema and implementation. In order to improve system performance, We select SX52 with high speed micro-controler to design embedded gateway.at the same time, we introduce how to use SX52 to realize TCP/IP protocol and improve the performance of network processor so that system can work well.

    Keyword: CAN FieldBus, Protocol conversion, Gateway, SX52

    1        Introduction

    Technical and society’s development, causes 20 century’s ends the globalization market competitions unprecedented intense. In the competition enterprise starts to implement the computer integration manufacture system gradually, uses the system integration, the information integration viewpoint to organize the industrial production. In this system, to realize between the scene intelligence equipment’s multi-spot digital communication, the computer observation technology and the computer network unifies closely in together, produced has been able in the industry scene environment movement, the perform reliably, the construction cost inexpensive field bus (FieldBus) technology.

    The field bus is uses in the manufacturing scene the lowest level communication network, it has realized between microcomputer’s site survey control instrument or equipment’s bidirectional serial multiple joint digital communication. The field bus technology’s key is causes the automatic control system and the field apparatus has the traffic capacity, connects the network system them, realizes the scene communication network and control system’s integration. As the network system, it has the opening unified communication protocol. The CAN main line is the field bus technology a mature technology standard which forms in the industrial application. Its agreement establishment above ISO/OSI model foundation, but has only used this model first floor physical level, the data link layer and the top layer application layer. In the Major industry automated system, the upper formation business management level and the production monitoring level uses is generally the ethernet and PC machine, but is uses the field bus and the monolithic integrated circuit observation equipment in the lower level workshop scene. The high and low two communications, usually use the industry cybertron to add the ether network card, in addition on the PC machine slot’s connection card or the parallel printing mouth’s EPP connection card realizes. This kind of connection mode cost is high, the development cycle is long. In view of this kind of situation, we design one kind of independent CAN ethernet gateway interconnected system, realizes the ethernet and the existing CAN bus network immediate data interconnection successfully.

    2        System system design

    The CAN main line is an equipment interconnection always the linear directed net. May hang on the CAN main line meets reaches 110 equipment nodes, between various equipment may independent correspond mutually, realizes the complex network control system. But the equipment information level is unable to arrive at the information management level directly, if wants the equipment information to enter the information management level to pass one kind of data gateway.

    Here we designed a SX52 gateway to use in the CAN main line and ethernet’s interconnection. The system overall divides into three parts: The scene observation network (the CAN network), the embedded transparent SX52 gateway, the ethernet information management terminal (for example monitors platform and network database and so on). The ethernet information management terminal and CAN on main line’s CAN node through the ETHERNET, SX52 gateway, CANBUS corresponds mutually, the SX52 gateway plays the core the heterogenous network interconnection role.

    The protocol conversion is the heterogenous network interconnection technical key and the difficulty, the protocol conversion may use the method which generally the lamination transforms, carries on from the low upward cascade. At present interlocks is mostly launches in the Internet level or the network level, thus must to interlock below the level each agreement cascade upward transformation, this kind of transformation method’s basis is the hierarchical layering of protocol basic principle: Namely underlying bed support high-level, high-level transfer underlying bed, after underlying bed separation connection, high-level connection also along with it separation, but the high-level separation connection will actually not affect the underlying bed. Looked from the network stratification structure, we design the interconnected system has the stratification structure which as shown in Figure one. On the ethernet moves the TCP/IP agreement, it has the application layer, the transmission level, the network level, the ethernet data link layer and the physical level; The CAN main line has the application layer, the data link layer and the physical level, the application layer defines by user, the data link layer and the physical level define by the CAN agreement; The SX52 data gateway has the physical level, the data link layer and the application layer, its application layer is also ETHERNET and the CAN message data exchange level, the SX52 micro controller explains and retransmits these two kind of different agreements mutually in the data.

    Figure one CAN main line and ethernet interconnection network stratification structure

    In this design, the SX52 gateway is designed a transparent data gateway, is also in the ethernet application layer construction and the analysis complete CAN agreement data packet, the CAN agreement data contract work is the TCP/IP network application layer data carries on the transmission, it the practical significance does not make any explanation specifically to the correspondence data. The reason that designs the data gateway transparent -like, is based on the following three aspect consideration: 1) the transparent -like gateway design relative not transparent gateway is simple, does not need on the hardware to expand the large capacity data-carrier storage to use in the buffer correspondence data; On the software does not use the consideration data the accumulation and distribution processing, reduced the programming order of complexity, to raise the correspondence speed and timeliness. 2) transparent -like gateway’s compatible, it may apply in the different project request, but not the transparent gateway must act according to the various requirement to make the different revision to the gateway procedure. 3), because the protocol conversion design is simple, does not have many complex processing, thus enhanced the correspondence reliability.

    The CAN main line network’s maximum correspondence speed is 1Mpbs, but the ethernet now is 10Mbps generally. Here must consider that between both’s speed match question, here may solve this problem from two aspects: First, uses big RAM on the gateway, uses for to take the correspondence data buffer, enhances the network transmission the efficiency. Second, limits the ethernet the data quantity which transmits to the CAN main line, causes it is smaller than the CAN main line’s correspondence speed.

    3        CAN protocol analysis

    CAN complies with the OSI model, according to the OSI datum model, the CAN structure division is two: Data link layer and physical level. According to IEEE802.2 and 802.3 standards, the data link layer also the division is:

    - - logic link control (LLC)

    - - media access control (MAC)

    The physical level also the division is:

    - - physical signaling (PLS)

    - - physical media supplementary installation (PMA)

    - - media related connection (MDI)

    The MAC sublayer movement with the aid of called it “breakdown limits entity (FCE)” the management entity carries on the monitoring. The breakdown limits are cause the distinction short disturbance and the permanent breakdown become the possible one self-checking mechanism. The physical level may draw support from the examination and the management physics media breakdown entity carries on the monitoring (e.g. main line to short-circuit or interrupt, main line fault management). LLC and the MAC two same level agreement entities (PDU-Protocol Data Unit) correspond mutually through exchange frame or the protocol data unit.

    The LLC sublayer provides the function includes: The frame receive filter, the overload circular and resume the management. And, the overload circular function is if the receiver internal condition request detention next LLC data frame or the LLC long-distance frame, start through the LLC sublayer to transmit the overload frame to be most may produce two overload frames, detention next data frame or long-distance frame.

    According to the network OSI seven models, the CAN main line network have completed the bottommost two agreement work, namely the physical level and the data link layer, they realized the level switch and the frame seal by the CAN controller’s hardware. In practical application, but also needs to establish own upper formation agreement. Here has designed one kind simply practical “an order data item” the structure, its complete data frame structure as shown in Figure two.

    Figure two application layer frame structure

    Considered in the industrial control the function are not generally many, therefore orders the length hypothesis is 1BYTE (may describe 256 kind of orders). Establishes the data length in the data item is considered the CAN main line is the short frame transmission (data frame, each data only then 8BYTE), some orders need the data parameter possibly is bigger than 7BYTE, simultaneously has the data which the possibility returns to be also big very much, therefore, here establishes a byte the data length item, may enable the user definition data frame length to amount to 256 bytes.

    4 SX52 TCP/IP agreement stack’s design

    The ARP agreement may realize the logical address to the physical address dynamic mapping. The ethernet connection supports only 48-bit the physical address. In SX52, the ARP agreement is through one “the IP address correspondence ethernet address” the list registration nucleus realizes. When the long-distance main engine needs to know when its physical address, the long-distance main engine will transmit ARP to request that by now it will respond this long-distance main engine’s request, told opposite party own physical address. When the application layer needs to transmit the IP data packet, SX52 the ARP agreement may also request the long-distance goal physical address.

    Must transmit the Internet data packet data wraps in the ethernet controller’s transmission buffer to construct, it uses the data packet goal ethernet address which recently received to take the transmission data packet the destination address. Certainly, this is not possibly the correct ethernet address, therefore, before actual transmission data packet, the ARP agreement will inspect in the transmission data packet the IP address whether to exist in the ARP nucleus, if in the transmission data packet’s IP address in this nucleus, will use in the ARP nucleus in the ethernet transmission buffer’s data packet the ethernet address to renew, if not, then the ARP agreement will transmit a ARP request package, then waits for a reply. Once this ARP reply receives, this ARP nucleus will use the goal ethernet address which just received to renew, then, waited for that the transmission the data packet will also use this ethernet address to renew, is transmitted. If transmits the ARP request package has not replied, causes the ARP timer overtime, this is waited for that the transmission the data packet will be abandoned, the normal agreement stack continues to move.

    The IP agreement is in the TCP/IP agreement race the most core agreement. All TCP, UDP, ICMP and IGMP data by IP data newspaper form transmission. IP provides not reliably, the connectionless data newspaper transmission service, cannot guarantee that the IP data newspaper arrives at the destination successfully. If has time some kind of mistake, if some router has used up the buffer temporarily, IP has a simple error processing algorithm: Discards this data newspaper, then transmits the ICMP Izvestia to give the source end. Any request’s reliability must provide by the upper formation. The connectionless meaning is IP does not maintain any about the more data newspaper status messages, each data newspaper’s processing is mutually independent. This also explained that the IP data newspaper may not according to the transmission order receive. In this design, the IP agreement is aims under the special application environment the reasonable simplification. The CAN main line’s directed net is one kind short frame, the real-time network, therefore, the IP data packet does not need the lamination (MF=DF=0), simultaneously, establishes the IP service type is the general type, its head length is 20 bytes, the first length field is 5, the life TTL establishment is 64.

    TCP provides one kind to the application layer face the connection, the reliable character to reduce expenses to serve. When faces in the industrial control the application, may make the reasonable simplification to the complex TCP agreement, because the CAN network transmission speed is quick, the data quantity is small, and the l0Mpbs ethernet transmission will not have blocking generally, on ethernet’s main engine will also have the enough ability stitch in time correspondence data. Therefore may fix the overtime and the re-transmit time is 5s, in addition on RTL8019AS has two 1500 byte receive buffers, and the CAN network is a control net, the information content is small, therefore may accept the window is 1400 bytes fixedly. In the design uses the general TCP service to be possible to satisfy the application, therefore may neglect the urgent indicator and the option and the packing field value. Through the above three simplifications, in fact greatly simplified TCP agreement realization, because the TCP overtime and the re-transmit time’s determination and window size’s control has the complex algorithm and realizes the mechanism.

    5 innovation summary

    This article innovation spot is aims at the tradition industrial control automation field bus connection mode cost to be high, the development cycle long deficiency, designs one kind of independent CAN ethernet gateway interconnected system, realizes the ethernet and the existing CAN bus network immediate data interconnection successfully. The field bus through with the Internet, the enterprise intranet is connected, causes the automatic control system and the field apparatus becomes the enterprise to synthesize the automated system and an information system’s constituent. The system in performance aspects and so on open, interoperability, field apparatus intellectualization, system structure, to scene adaptability to environment had the very big enhancement, the success has realized two different races network data communication.

    Reference:

    [1] Zou Yi kernel Ma Zengliang and so on, field bus control system’s design and development, 2003, Defense industry Publishing house

    [2] Zheng Wenbo directed net technology, 2001, Tsinghua University publishing house

    [3] Ed.Taylor, Zheng Yandeng insults translates, network interconnection technique guide, 2001, people’s posts and telecommunications publishing house

    [4] Li Ming embedded interconnecting network connection design and development, 2002, industrial control computer

    [5] Deng Zunyi, rather type, Liu Baoguo. Based on CAN main line’s distributional robot control system design. Micro computer information [J].2006 year 22 volumes 6-2 issues: The 254-256th page

    Share/Save/Bookmark

No comments yet.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

TOP
Copyright © 51 Research and Design, Electronic Engineers website - Embedded Systems, MCU, DSP, EDA, Test and Measurement, Components, Communications, Power, Microelectronics, Semiconductors
Powered by WordPress | Theme by mg12 | Valid XHTML 1.1 and CSS 3