KR101748268B1 - Synchronization method of can communication and computer-readable medium storing program for executing the same - Google Patents
Synchronization method of can communication and computer-readable medium storing program for executing the same Download PDFInfo
- Publication number
- KR101748268B1 KR101748268B1 KR1020150156662A KR20150156662A KR101748268B1 KR 101748268 B1 KR101748268 B1 KR 101748268B1 KR 1020150156662 A KR1020150156662 A KR 1020150156662A KR 20150156662 A KR20150156662 A KR 20150156662A KR 101748268 B1 KR101748268 B1 KR 101748268B1
- Authority
- KR
- South Korea
- Prior art keywords
- controller
- local counter
- value
- synchronization
- period
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L7/00—Arrangements for synchronising receiver with transmitter
- H04L7/0016—Arrangements for synchronising receiver with transmitter correction of synchronization errors
- H04L7/0033—Correction by delay
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40006—Architecture of a communication node
- H04L12/40026—Details regarding a bus guardian
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
- H04L2012/40215—Controller Area Network CAN
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40267—Bus for use in transportation systems
- H04L2012/40273—Bus for use in transportation systems the transportation system being a vehicle
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
Abstract
A synchronization method of CAN communication capable of operating simultaneously in a controller that performs CAN communication, and a computer-readable medium having recorded thereon a program for executing the same.
To this end, the present embodiment provides a mechanism for establishing time synchronization through two control period time delays and time correction, and provides a mechanism for achieving operation synchronization based on time synchronization.
Description
The present invention relates to a synchronization method of CAN communication and a computer readable medium having recorded thereon a program for executing the same, and more particularly to a synchronization method of CAN communication capable of operating simultaneously in a controller for CAN communication, Readable medium having recorded thereon a program.
Recent automotive design trends tend to be designed to minimize harnesses. As a representative example, a control period synchronization design for CAN communication can be mentioned. Control period synchronization has been discussed in two respects.
That is, first, two controllers of the existing system need to connect hardwires in order to operate simultaneously. In order to operate the second controller on the same CAN communication at the same time, a high priority message or event message Two control periods were synchronized with each other.
However, the above-mentioned first is that the physical connection is increased due to the additional physical connection, and additional air traffic is required at the time of production, especially when a function requiring synchronization is added.
The second is that the high priority messages or event messages are limited in use, and when the functions of synchronization are increased, overload due to the bus load occurs.
It is an object of the present invention to provide a synchronization method of CAN communication capable of realizing synchronization of any two control period local counters that make CAN communication, and a computer readable medium having recorded thereon a program for executing the same.
It is another object of the present invention to provide a synchronization method of CAN communication capable of realizing synchronization of two control period operation signals for AN communication and a computer readable medium having recorded thereon a program for executing the same.
According to one embodiment, there is provided a method for synchronizing a local counter in a controller for at least one CAN communication having different local counters, comprising the steps of: providing a first local counter value (T1) Message to a second controller that is a synchronization reference of the local counter; And transmits a second local counter value (T2) generated at the reception time of the second controller and a third local counter value (T3) generated at the time of transmission to the first controller in a response message to the first controller step; A local counter synchronization (T3) of the second controller using the fourth local counter value (T4) generated at the time of receiving the third local counter value (T3) and the obtained first, second, Calculating a correction value required for the first controller; And synchronizing the first controller and the second control period local counter through the calculated correction value.
The synchronization method further includes calculating the delay value generated between the first controller and the second controller in the first controller using the first, second, third and fourth local counter values can do.
The delay value D can be calculated by the following equation (1).
D = [(T4 - T1) - (T3 - T2)
The correction value may be used to synchronize to the local counter of the second controller by adding an offset calculated by the following equation (2) to the local counter of the first controller.
offset = [(T2 - T1) + (T3 - T4)] /
The synchronizing step may include synchronizing the first local counter value T1 with the fourth local counter value T4 by one period X and when the period is maintained for N times, If the delay value is large, the delay value and the offset generated in each of the N times of the corresponding times can be excluded.
The synchronizing step may exclude a local counter value having a delay value of 1.5 times or more by calculating an average of the N delay values when the period is maintained for N times.
The first controller may be a slave controller, and the second controller may be a master controller.
According to one embodiment, the first controller transmits a first periodic message including an Oxff value to a second controller; Transmitting a second periodic message including a periodic synchronization value (S) to the second controller after transmitting the first periodic message; Operating the control object in the first controller according to a period set when the local counter value of the first controller and the Oxff is the second periodic message; And operating the control object in the second controller according to the period when the second periodic message received from the first controller is not Oxff and the local counter value & Oxff is a second periodic message Provides a synchronization method of CAN communication.
The period synchronization value S can be calculated by the following equation (3).
S = ((Local counter value% Oxff of the first controller) + (predetermined message period value * 1.5)) (3)
The predetermined message period value may be 100 ms.
The first periodic message and the second periodic message may be 8-bit messages.
The first controller may be a slave controller, and the second controller may be a master controller.
According to one embodiment, there is provided a method comprising: maintaining an event message including an Off value in a third controller; Transmitting the event message including an event variable (TxTime) having a local counter value of the third controller to the fourth controller when the event message is ON; Operating the control object according to a predetermined period in the first controller when the delay value (D) as the delay time of the third controller and the fourth control period + TxTime is the local counter value; And operating the control object according to the appointed period immediately after receiving the event message from the fourth controller.
The delay value D can be calculated by the following equation (4).
D = [(T4 - T1) - (T3 - T2)
Wherein T1 is a first local counter value of the third controller generated upon transmission from the third controller to the fourth controller and T2 is a second local counter value of the second controller of the fourth controller generated upon reception of the first local counter value, T3 is a third local counter value of the fourth controller generated at the time of transmitting to the third controller and T4 is a local counter value of the third controller generated at the time of receiving the third local counter value, May be a fourth local counter value.
The event message may be a 2-bit message.
The third controller may be a slave controller, and the fourth controller may be a master controller.
As described above, the present embodiment does not need to add and / or change hardware when any two control period time synchronization and / or operation synchronization are performed.
In addition, this embodiment enables high-precision time synchronization. For example, it is possible to synchronize clocks within the error range of several tens of milliseconds in the Internet environment.
In addition, the present embodiment can implement time synchronization without greatly modifying the structure of existing periodic messages.
In addition, this embodiment can reduce the cost of using hardwires for operation synchronization when the front / back distance is long, such as truck / bus.
The effects described above are not limited to the effects mentioned above, and other effects not mentioned can be clearly understood by those skilled in the art from the following description.
BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention. However, the technical features of the present embodiment are not limited to the specific drawings, and the features disclosed in the drawings may be combined with each other to constitute a new embodiment.
1 is a flowchart showing an example of a synchronization method of CAN communication according to the first embodiment.
FIG. 2 is a diagram illustrating a flow of a control period synchronization signal for performing the synchronization method of the CAN communication of FIG.
3 is a diagram illustrating an example of a synchronization method of CAN communication according to the second embodiment.
4 is a diagram illustrating a flow of a control period synchronization signal for performing the synchronization method of the CAN communication of FIG.
5 is a diagram illustrating an example of a synchronization method of CAN communication according to the third embodiment.
6 is a diagram illustrating a flow of a control period synchronization signal for performing the synchronization method of CAN communication of FIG.
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the like elements throughout.
It is to be understood that the terms used in the following examples are used only to illustrate specific embodiments, and are not intended to be limiting.
For example, although the terms including ordinals such as 'first' and 'second' described in the following embodiments can be used to describe various elements, the elements are not limited by the terms . The terms are used to distinguish one component from another.
It is also to be understood that the singular forms "a" and "an" used in the description of the various embodiments described and in the claims are intended to include the plural forms as well, unless the context clearly dictates otherwise.
It is also to be understood that the term " and / or " disclosed in the following embodiments includes any and all possible combinations of one or more of the listed related items.
Furthermore, terms such as " comprising "or" having ", such as those disclosed in the following embodiments, mean that a component can be implanted unless specifically stated otherwise, But should be understood to include additional elements.
Based on this, the local counters disclosed in the following embodiments refer to linearly increasing counters (having different initial values of different local counters) in each controller. For example, the Tick Timer or OsTimer of each controller need not be the same.
Hereinafter, the synchronization method of the CAN communication performed in the controller in the vehicle having the initial values of the different local counters will be described in detail.
≪ Embodiment 1 >
FIG. 1 is a flowchart illustrating an example of a synchronization method of a CAN communication according to the first embodiment, and FIG. 2 is a diagram illustrating a flow of a control period synchronization signal for performing the synchronization method of the CAN communication of FIG.
Fig. 2 will be referred to as supplementary when describing Fig.
Referring to FIG. 1, the method for synchronizing CAN communication according to the first embodiment may include
The controller may be configured as at least one
First, in
For example, as in FIG. 2, the
The
The
It is therefore aimed to adjust and synchronize the local counters of the slave controllers to the local counter of the master controller. That is, the
In
This
In
At this time, the
For example, as shown in FIG. 2, the MSG
Accordingly, the
Meanwhile, the third local counter value T3 generated in the
The memory may be a flash memory type, a hard disk type, a multimedia card micro type, a card type memory (e.g., SD or XD memory), a RAM Random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read- , And an optical disc.
However, it is not so limited, and for example, the memory may be a buffer or a virtual memory.
In addition, the above-described memory may be present in the
In
For example, as in FIG. 2, a fourth local counter value of 125 ms may be stored in the memory.
The
The correction value may mean a result obtained by adding the offset calculated by the following equation (1) to the value of the local counter of the
offset = [(T2 - T1) + (T3 - T4)] /
For example, as shown in Fig. 2, the offset may be a value of [(125 ms - 100 ms) + (353 ms - 125 ms)] = 239 ms.
Similarly, other
Accordingly, in
In
Here, the delay value D can be calculated by the following equation (2).
D = [(T4-T1) - (T3-T2)] (2)
For example, as shown in FIG. 2, the delay value D may be [(125 ms-100 ms) - (353 ms-350 ms) = 22 ms.
In this case, in
The reason for excluding the delay value and the offset is to prevent the local counter synchronization between the
Further, in
As such, the present embodiment can synchronize the local counter of the
For example, the time synchronization of the controllers can be applied to objects in the vehicle such as turn signal lamps, LED lamps.
However, although the object can be controlled through the time synchronization of the controllers described above, operation synchronization with respect to the object is not practically performed.
Therefore, in the following, operation synchronization based on some or all of the above-described time synchronization will be described in more detail.
≪ Embodiment 2 >
FIG. 3 is a diagram illustrating an example of a synchronization method of CAN communication according to the second embodiment, and FIG. 4 is a diagram illustrating a flow of a control period synchronization signal for performing the CAN communication synchronization method of FIG.
As shown in the figure, the CAN
The controller may be configured as at least one controller 400 in the vehicle that carries out CAN communication with each other as shown in FIG. It is assumed that at least one controller 400 is composed of one
First, in
The
Accordingly, it is an object of the present invention to provide an operation synchronization for a periodic message exchanged between slave controllers according to a local counter of a master controller. The
In
The period synchronization value S may be calculated by the following equation (3).
S = ((Local counter value% Oxff of the first controller) + (predetermined message period value * 1.5)) (3)
At this time, the predetermined message period value is preferably 100 ms.
The first
The memory may be a flash memory type, a hard disk type, a multimedia card micro type, a card type memory (e.g., SD or XD memory), a RAM Random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read- , And an optical disc.
However, it is not so limited, and for example, the memory may be a buffer or a virtual memory.
In addition, the above-described memory may be present in the
Accordingly, in
For example, when the [(local counter value) & Oxff) == C_Hazard, the
That is, when C_Hazard has a period of 100 ms, the
The local counter value of the
In
For example, when the C_Hazard is received from the
That is, when C_Hazard has a period of 100 ms, the
The local counter value of the
However, when the above-mentioned determination condition is not satisfied, it can be considered that the operation synchronization between the
As described above, in this embodiment, after the time synchronization between the
≪ Third Embodiment >
FIG. 5 is a diagram illustrating an example of a synchronization method of the CAN communication according to the third embodiment, and FIG. 6 is a diagram illustrating a flow of a control period synchronization signal for performing the CAN communication synchronization method of FIG.
As shown, the
The controller may be configured as at least one
First, in
The
In
In other words, the
For example, upon receipt of the C_Hazard input, the
The mentioned
Thus, it is intended to synchronize the operation of the
In
The delay value may be a delay time for synchronization of operations between the
When the
For example, the
Here, the delay value D (sync_delay_time) can be calculated by the following equation (4).
D = [(T4 - T1) - (T3 - T2)
T1 is a first local counter value of the
T3 is a third local counter value of the
Since this example has been described in detail in Figs. 1 and 2, a more detailed description will be omitted. However, it goes without saying that the present invention is also applied to this embodiment.
As described above, it is preferable that the present embodiment performs the operation synchronization between the
In
The mentioned
In this way, it is possible to achieve an operation synchronization between the
The CAN communication synchronization method described above can be implemented in the form of program instructions that can be executed through various computer components and recorded in a computer-readable medium.
The computer readable medium may be any medium accessible by the processor. Such media can include both volatile and nonvolatile media, removable and non-removable media, storage media, and computer storage media.
delete
The storage medium may be any type of storage medium such as RAM, flash memory, ROM, EPROM, electrically erasable read only memory ("EEPROM"), registers, hard disk, removable disk, compact disk read only memory Or any other type of storage medium.
Computer storage media includes removable and non-removable, nonvolatile, and nonvolatile storage media implemented in any method or technology for storing information such as computer readable instructions, data structures, program modules or other data, Volatile media.
Such computer storage media may be embodied as program instructions, such as RAM, ROM, EPROM, EEPROM, flash memory, other solid state memory technology, CDROMs, digital versatile disks (DVDs) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage, Lt; RTI ID = 0.0 > and / or < / RTI >
Examples of program instructions may include machine language code such as those produced by a compiler, as well as high-level language code that may be executed by a computer using an interpreter or the like.
While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is to be understood that the invention is not limited to the exemplary embodiments or constructions. You can understand that you can do it. The embodiments described above are therefore to be considered in all respects as illustrative and not restrictive.
0, 400, 600:
220, 420: second controller 610: third controller
620:
201: Periodic message 202: Response message
401: first period message 402: second period message
501: Event message
Claims (17)
Transmitting a first local counter value (T1) generated at a transmission time point of a first controller to a second controller, which is a synchronization reference of the local counter, in a periodic message;
And transmits a second local counter value (T2) generated at the reception time of the second controller and a third local counter value (T3) generated at the time of transmission to the first controller in a response message to the first controller step;
A local counter synchronization (T3) of the second controller using the fourth local counter value (T4) generated at the time of receiving the third local counter value (T3) and the obtained first, second, Calculating a correction value required for the first controller;
Computing in the first controller a delay value generated between the first controller and the second controller using the first, second, third and fourth local counter values; And
Synchronizing the first controller and the second control period local counter through the calculated correction value and the delay value
/ RTI >
Wherein synchronizing the first controller and the second control period local counter comprises:
Wherein the first controller has a second reference time point by adding the delay value to a predetermined first reference time point and the second controller uses the correction value to have the second reference time point have a synchronization point;
/ RTI >
The delay value D is calculated by the following equation (1)
D = [(T4 - T1) - (T3 - T2)
Wherein the correction value is used to synchronize to the local counter of the second controller by adding an offset calculated by the following equation (2) to the local counter of the first controller:
offset = [(T2 - T1) + (T3 - T4)] /
Synchronization method of CAN communication.
Wherein the synchronizing comprises:
When the period between the first local counter value T1 and the fourth local counter value T4 is one period X and the period is maintained for N times and the delay value is larger than the period X And eliminating the delay value and the offset generated in each of the N times of the corresponding times.
Wherein the synchronizing comprises:
And if the period is maintained for N times, calculating an average of the N times of delay values to exclude a local counter value having a delay value of 1.5 times or more.
Wherein the first controller is a slave controller and the second controller is a master controller.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020150156662A KR101748268B1 (en) | 2015-11-09 | 2015-11-09 | Synchronization method of can communication and computer-readable medium storing program for executing the same |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020150156662A KR101748268B1 (en) | 2015-11-09 | 2015-11-09 | Synchronization method of can communication and computer-readable medium storing program for executing the same |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20170054013A KR20170054013A (en) | 2017-05-17 |
KR101748268B1 true KR101748268B1 (en) | 2017-06-16 |
Family
ID=59048734
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020150156662A KR101748268B1 (en) | 2015-11-09 | 2015-11-09 | Synchronization method of can communication and computer-readable medium storing program for executing the same |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR101748268B1 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR102103292B1 (en) | 2019-09-04 | 2020-04-22 | 콘티넨탈 오토모티브 시스템 주식회사 | Electric control unit commnication apparatus for vehicle |
CN111106987A (en) * | 2019-11-27 | 2020-05-05 | 珠海广通汽车有限公司 | CAN message sending method, device, storage medium and electronic equipment |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004266599A (en) * | 2003-03-03 | 2004-09-24 | Mitsubishi Electric Corp | Transmitting side terminal and receiving side terminal |
KR100900067B1 (en) * | 2007-12-13 | 2009-06-01 | 한국전자통신연구원 | Apparatus and method for clock synchronization |
JP5391964B2 (en) * | 2009-09-28 | 2014-01-15 | 沖電気工業株式会社 | Clock synchronization method and packet communication system |
-
2015
- 2015-11-09 KR KR1020150156662A patent/KR101748268B1/en active IP Right Grant
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004266599A (en) * | 2003-03-03 | 2004-09-24 | Mitsubishi Electric Corp | Transmitting side terminal and receiving side terminal |
KR100900067B1 (en) * | 2007-12-13 | 2009-06-01 | 한국전자통신연구원 | Apparatus and method for clock synchronization |
JP5391964B2 (en) * | 2009-09-28 | 2014-01-15 | 沖電気工業株式会社 | Clock synchronization method and packet communication system |
Also Published As
Publication number | Publication date |
---|---|
KR20170054013A (en) | 2017-05-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8321612B2 (en) | Method and device for synchronizing two bus systems by transmission of a time associated trigger signal from one system to another | |
US9942868B2 (en) | Synchronization control method within wireless network, wireless network and smart home device | |
US10284692B2 (en) | Control device and communication device | |
US9811336B2 (en) | Determining processor offsets to synchronize processor time values | |
US20180302461A1 (en) | Method and system for synchronizing robot with server | |
EP3528470B1 (en) | Control device, control system, control method, and control program | |
KR102291573B1 (en) | Synchronization method and system among multiple MCUs in EtherCAT-based slave system | |
CN112119365A (en) | Time synchronization method, multi-sensor system and movable platform | |
KR101748268B1 (en) | Synchronization method of can communication and computer-readable medium storing program for executing the same | |
KR101466501B1 (en) | Apparatus for controlling network traffic | |
CN111726185B (en) | Method for synchronizing system clocks of external device and local computing device | |
KR20170135384A (en) | Apparatus for distributed clock synchronization based on EtherCAT, method thereof and computer recordable medium storing the method | |
JP5372699B2 (en) | In-vehicle network device | |
CN109660310B (en) | Clock synchronization method and device, computing equipment and computer storage medium | |
CN111010339B (en) | Enterprise-level high-performance API service gateway design method | |
CN113014352A (en) | Equipment time synchronization method and device based on fiber channel protocol | |
JP6400553B2 (en) | Numerical control system with synchronous control function between units | |
CN108398151B (en) | Sensor control device and sensor system | |
JP4477486B2 (en) | TDMA communication device | |
WO2012093874A3 (en) | Network system | |
US10680849B2 (en) | Built-in apparatus, communication method, and computer readable medium | |
CN102104546A (en) | Synchronization method and system of forwarding table | |
KR102585141B1 (en) | Method for synchronizing time in multiple time domains, and apparatus implementing the same method | |
KR102655246B1 (en) | Controller system for vehicle and time synchronization method thereof | |
CN111193570A (en) | Method, device, system, medium and electronic equipment for executing instructions |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
GRNT | Written decision to grant |