KR102274671B1 - Apparatus and method for setting baud rate of electronic control unit based on can communication - Google Patents

Apparatus and method for setting baud rate of electronic control unit based on can communication Download PDF

Info

Publication number
KR102274671B1
KR102274671B1 KR1020190161719A KR20190161719A KR102274671B1 KR 102274671 B1 KR102274671 B1 KR 102274671B1 KR 1020190161719 A KR1020190161719 A KR 1020190161719A KR 20190161719 A KR20190161719 A KR 20190161719A KR 102274671 B1 KR102274671 B1 KR 102274671B1
Authority
KR
South Korea
Prior art keywords
communication
bit
time
frame
controller
Prior art date
Application number
KR1020190161719A
Other languages
Korean (ko)
Other versions
KR20210071490A (en
Inventor
이봉구
이성진
Original Assignee
현대오트론 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 현대오트론 주식회사 filed Critical 현대오트론 주식회사
Priority to KR1020190161719A priority Critical patent/KR102274671B1/en
Publication of KR20210071490A publication Critical patent/KR20210071490A/en
Application granted granted Critical
Publication of KR102274671B1 publication Critical patent/KR102274671B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/4013Management of data rate on the bus
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • H04L12/40032Details regarding a bus interface enhancer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L25/00Baseband systems
    • H04L25/02Details ; arrangements for supplying electrical power along data transmission lines
    • H04L25/05Electric or magnetic storage of signals before transmitting or retransmitting for changing the transmission rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0894Packet rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Power Engineering (AREA)
  • Environmental & Geological Engineering (AREA)
  • Quality & Reliability (AREA)
  • Communication Control (AREA)
  • Small-Scale Networks (AREA)

Abstract

캔 통신 기반 전자 제어 장치의 통신속도 설정 장치 및 방법이 개시된다. 본 발명의 일 측면에 따른 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치는, 통신속도 설정모드를 선택하기 위한 스위치부, 통신속도(Baud rate)를 저장하는 메모리, 캔(CAN) 버스 라인을 통해 비트 신호를 송신 또는 수신하는 인터페이스부, 상기 스위치부에 설정된 통신속도 설정모드에 따라, 통신속도를 상기 메모리에 저장된 통신속도로 동작하도록 제어하거나, 상기 인터페이스부로부터의 비트 신호에서 감지된 캔 프레임에 기초하여 통신속도를 설정하는 컨트롤러를 포함하고, 상기 컨트롤러는, 상기 캔 프레임에서 한(one) 비트(1 bit)의 최소 시간을 산출하고, 상기 산출된 최소 시간을 이용하여 통신속도를 산출하는 것을 특징으로 한다. Disclosed are an apparatus and method for setting a communication speed of a CAN communication-based electronic control device. A communication speed setting device of a CAN communication-based electronic control device according to an aspect of the present invention includes a switch for selecting a communication speed setting mode, a memory for storing a baud rate, and a CAN bus line. According to the interface unit for transmitting or receiving a bit signal and the communication rate setting mode set in the switch unit, the communication rate is controlled to operate at the communication rate stored in the memory, or to the can frame detected from the bit signal from the interface unit. a controller for setting a communication rate based on the controller, wherein the controller calculates a minimum time of one bit in the can frame, and calculates the communication rate using the calculated minimum time characterized.

Description

캔 통신 기반 전자 제어 장치의 통신속도 설정 장치 및 방법{APPARATUS AND METHOD FOR SETTING BAUD RATE OF ELECTRONIC CONTROL UNIT BASED ON CAN COMMUNICATION}Apparatus and method for setting communication speed of electronic control device based on can communication {APPARATUS AND METHOD FOR SETTING BAUD RATE OF ELECTRONIC CONTROL UNIT BASED ON CAN COMMUNICATION}

본 발명은 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치 및 방법에 관한 것으로서, 보다 상세하게는 CAN 버스 라인을 통해 수신되는 비트 신호를 모니터링하고, 이를 이용하여 CAN 통신의 통신속도(Baud Rate)를 자동으로 설정하는 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치 및 방법에 관한 것이다. The present invention relates to an apparatus and method for setting a communication speed of an electronic control device based on CAN communication, and more particularly, by monitoring a bit signal received through a CAN bus line, and using this to monitor the baud rate of CAN communication. The present invention relates to an apparatus and method for setting a communication speed of a CAN communication-based electronic control device for automatically setting.

일반적으로 차량에는, ETACS(Electronic Time Alarm Control System), 도어 구동 모듈(DDM), 어시스트 도어 모듈(ADM), INPANEL 유닛, 에어백 유닛, NAVI 세트, 각종 멀티미디어 기기(예컨대, TV 세트, DVDC와 CDC, RADIO유닛, AMP 유닛 등)와 같은 전자장치가 다량 장착된다.In general, in a vehicle, an Electronic Time Alarm Control System (ETACS), a door drive module (DDM), an assist door module (ADM), an INPANEL unit, an airbag unit, a NAVI set, various multimedia devices (eg, a TV set, DVDC and CDC, A large number of electronic devices such as RADIO unit, AMP unit, etc.) are mounted.

차량에 장착된 전자장치는 전자 제어 장치(ECU: Electronic Control Unit)와 네트워크 통신을 통해 데이터를 송수신하게 되며, 이때 사용되는 차량용 네트워크 통신 프로토콜이 CAN(Controller Area Network) 프로토콜이다. 즉, 차량에서는 수많은 정보가 각종의 전자 제어 장치간에 통신되고 있고, 이러한 정보 교환은 캔을 통해서 주로 이루어진다.An electronic device mounted on a vehicle transmits and receives data through network communication with an electronic control unit (ECU), and the vehicle network communication protocol used at this time is a CAN (Controller Area Network) protocol. That is, in a vehicle, a lot of information is communicated between various electronic control devices, and such information exchange is mainly performed through a can.

캔을 지원하는 전자 제어 장치는 캔 통신방식에 따라 데이터를 송수신하는 통신모듈인 캔 컨트롤러와 캔 버스 라인을 통해 신호를 송수신하는 트랜시버(transceiver)를 캔 통신방식에 기반한 통신을 위해 포함하고 있으며, 캔 버스에 연결된 노드들 간에는 수백 kbps ~ 1Mbps 범위 내에서 정해진 속도로 통신하게 된다. 이러한 전자 제어 장치를 캔 트랜시버(CAN Transceiver)의 캔 버스에 연결할 때, 캔 버스의 통신속도, 즉 보드 레이트(Baud Rate)를 미리 알아 내어 그 값으로 통신속도 변수를 변경하고, 해당 프로그램을 전자 제어 장치에 다시 깔아주어야 한다. 또한, 차량의 통신사양이 변경될 경우 차량에 장착된 전자 제어 장치들에 SW 배포 및 리프로그래밍을 해야 한다. The electronic control device supporting the CAN includes a CAN controller, which is a communication module that transmits and receives data according to the CAN communication method, and a transceiver that transmits and receives signals through the CAN bus line for communication based on the CAN communication method. Nodes connected to the bus communicate at a fixed speed within the range of several hundred kbps to 1 Mbps. When this electronic control device is connected to the CAN bus of the CAN transceiver, the communication speed of the CAN bus, that is, the baud rate, is found in advance, the baud rate is changed with the value, and the program is controlled electronically. It must be reinstalled on the device. In addition, when the communication specifications of the vehicle are changed, it is necessary to distribute and reprogram the software to the electronic control devices installed in the vehicle.

그러나, 상품화된 캔 모듈(전자 제어 장치)은 외함으로 싸여져 있기 때문에 그것을 제거하고 프로그래밍할 경우 그 절차가 매우 복잡하고 번거로우며, 프로그래밍하는 수고를 감수한다 하더라도, 통신속도를 모르는 캔 버스에는 캔 모듈을 설치할 수 없는 문제점이 있다.However, since the commercialized can module (electronic control device) is enclosed in an enclosure, the procedure is very complicated and cumbersome when it is removed and programmed. There is a problem that it cannot be installed.

본 발명의 배경기술은 대한민국 등록특허공보 제10-1987890호(2019.09.30. 공고)의 '통신모듈의 버스에의 연결을 매개하기 위해 그 통신모듈의 전송속도를 확인하는 방법과 그 방법을 위한 기기'에 개시되어 있다.The background technology of the present invention is a method for checking the transmission speed of a communication module in order to mediate the connection of the communication module to the bus of the Republic of Korea Patent Publication No. 10-1987890 (2019.09.30. Announcement) and for the method device' is disclosed.

본 발명은 상기와 같은 문제점들을 개선하기 위하여 안출된 것으로, 본 발명의 일 측면에 따른 목적은 CAN 버스 라인을 통해 수신되는 비트 신호를 모니터링하고, 이를 이용하여 CAN 통신의 통신속도(Baud Rate)를 자동으로 설정함으로써, 전자 제어 장치에서 프로그램 변경 없이 어떠한 캔 버스에도 연결이 가능하도록 하여 다른 전자 제어 장치와의 원활한 통신이 이루어질 수 있도록 하는 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치 및 방법을 제공하는 것이다. The present invention has been devised to improve the above problems, and an object according to an aspect of the present invention is to monitor a bit signal received through a CAN bus line, and use it to increase the baud rate of CAN communication. Provided is an apparatus and method for setting a communication speed of a CAN communication-based electronic control device that enables smooth communication with other electronic control devices by automatically setting it to enable connection to any CAN bus without program change in the electronic control device. will be.

본 발명이 해결하고자 하는 과제는 이상에서 언급한 과제(들)로 제한되지 않으며, 언급되지 않은 또 다른 과제(들)은 아래의 기재로부터 당업자에게 명확하게 이해될 수 있을 것이다.The problem to be solved by the present invention is not limited to the problem(s) mentioned above, and another problem(s) not mentioned will be clearly understood by those skilled in the art from the following description.

본 발명의 일 측면에 따른 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치는, 통신속도 설정모드를 선택하기 위한 스위치부, 통신속도(Baud rate)를 저장하는 메모리, 캔(CAN) 버스 라인을 통해 비트 신호를 송신 또는 수신하는 인터페이스부, 상기 스위치부에 설정된 통신속도 설정모드에 따라, 통신속도를 상기 메모리에 저장된 통신속도로 동작하도록 제어하거나, 상기 인터페이스부로부터의 비트 신호에서 감지된 캔 프레임에 기초하여 통신속도를 설정하는 컨트롤러를 포함하고, 상기 컨트롤러는, 상기 캔 프레임에서 한(one) 비트(1 bit)의 최소 시간을 산출하고, 상기 산출된 최소 시간을 이용하여 통신속도를 산출하는 것을 특징으로 한다. A communication speed setting device of a CAN communication-based electronic control device according to an aspect of the present invention includes a switch for selecting a communication speed setting mode, a memory for storing a baud rate, and a CAN bus line. According to the interface unit for transmitting or receiving a bit signal and the communication rate setting mode set in the switch unit, the communication rate is controlled to operate at the communication rate stored in the memory, or to the can frame detected from the bit signal from the interface unit. a controller for setting a communication rate based on the controller, wherein the controller calculates a minimum time of one bit in the can frame, and calculates the communication rate using the calculated minimum time characterized.

본 발명에서 상기 인터페이스부는, 상기 캔 버스 라인을 통해 비트 신호를 송신하는 송신 포트, 상기 캔 버스 라인을 통해 비트 신호를 수신하는 수신 포트, 상기 캔 프레임의 수신 시간을 카운팅하기 위한 클럭 카운터 포트(Clock Counter)를 포함할 수 있다. In the present invention, the interface unit includes a transmission port for transmitting a bit signal through the CAN bus line, a reception port for receiving a bit signal through the CAN bus line, and a clock counter port (Clock) for counting the reception time of the CAN frame. Counter) may be included.

본 발명에서 상기 컨트롤러는, 상기 스위치부에 자동 설정모드가 설정된 경우, 상기 클럭 카운터 포트의 인터럽트를 통해 타이머를 활성화시킬 수 있다. In the present invention, when the automatic setting mode is set in the switch unit, the controller may activate the timer through the interrupt of the clock counter port.

본 발명에서 상기 컨트롤러는, 상기 비트 신호의 비트 수에 기초하여 캔 프레임 여부를 판단하고, 캔 프레임인 경우 상기 타이머를 통해 상기 캔 프레임의 수신 시간을 카운팅할 수 있다. In the present invention, the controller may determine whether a CAN frame is based on the number of bits of the bit signal, and if it is a CAN frame, count the reception time of the CAN frame through the timer.

본 발명에서 상기 컨트롤러는, 상기 캔 프레임의 전체 비트가 수신되는 시간을 카운팅하고, 상기 캔 프레임의 전체 비트 수를 상기 카운팅된 시간으로 나누어 한 비트(1bit)의 제1 시간을 산출하며, 상기 산출된 제1 시간을 최소 시간으로 산출할 수 있다. In the present invention, the controller counts a time for which all bits of the CAN frame are received, divides the total number of bits of the CAN frame by the counted time to calculate a first time of one bit (1 bit), and the calculation The first time may be calculated as the minimum time.

본 발명에서 상기 컨트롤러는, 상기 캔 프레임에서 동일한 비트값이 연속되지 않은 한 비트(1bit)의 제2 시간을 추출하고, 상기 추출된 제2 시간을 최소 시간으로 산출할 수 있다. In the present invention, the controller may extract a second time of a bit (1 bit) as long as the same bit value is not continuous in the CAN frame, and calculate the extracted second time as a minimum time.

본 발명에서 상기 컨트롤러는, 상기 캔 프레임이 동일한 비트값이 2개 이상 연속으로 구성된 경우, 상기 캔 프레임에서 비트값이 변하는 모든 지점의 시간을 추출하고, 상기 추출된 모든 지점의 시간에 대한 평균을 산출하며, 상기 산출된 평균 시간을 한 비트(1bit)의 제3 시간으로 설정하며, 상기 설정된 제3 시간을 최소 시간으로 산출할 수 있다. In the present invention, when the CAN frame has two or more consecutive bit values of the same CAN frame, the controller extracts the times of all points at which the bit values change in the CAN frame, and calculates the average of the times of all the extracted points. is calculated, the calculated average time may be set as a third time of one bit (1 bit), and the set third time may be calculated as a minimum time.

본 발명에서 상기 컨트롤러는, 상기 최소 시간의 역수를 통신속도로 산출할 수 있다. In the present invention, the controller may calculate the reciprocal of the minimum time as a communication rate.

본 발명에서 상기 컨트롤러는, 상기 산출된 통신속도로 테스트 메시지를 캔 버스 라인을 통해 전자 제어 장치로 전송하여 에러가 없는 경우 상기 통신속도를 최종 통신속도로 자동 설정할 수 있다. In the present invention, the controller may automatically set the communication rate to the final communication rate when there is no error by transmitting the test message to the electronic control device through the CAN bus line at the calculated communication rate.

본 발명의 다른 측면에 따른 캔 통신 기반 전자 제어 장치의 통신속도 설정 방법은, 통신속도 설정모드가 자동 설정모드인 경우, 컨트롤러가 타이머를 활성화시키고, 캔(CAN) 버스 라인을 통해 캔 프레임을 수신하는 단계, 상기 컨트롤러가 상기 캔 프레임에서 한 비트(1bit)의 최소 시간을 산출하는 단계, 상기 컨트롤러가 상기 산출된 최소 시간을 이용하여 통신속도를 산출하는 단계를 포함한다. In the communication speed setting method of the CAN communication-based electronic control device according to another aspect of the present invention, when the communication speed setting mode is the automatic setting mode, the controller activates the timer and receives the CAN frame through the CAN bus line. and calculating, by the controller, a minimum time of one bit (1 bit) in the CAN frame, and calculating, by the controller, a communication speed using the calculated minimum time.

본 발명은 상기 캔 프레임에서 한 비트(1bit)의 최소 시간을 산출하는 단계에서, 상기 컨트롤러는, 상기 캔 프레임의 전체 비트가 수신되는 시간을 카운팅하고, 상기 캔 프레임의 전체 비트 수를 상기 카운팅된 시간으로 나누어 한 비트(1bit)의 제1 시간을 산출하며, 상기 산출된 제1 시간을 최소 시간으로 산출할 수 있다. In the present invention, in the step of calculating the minimum time of one bit (1 bit) in the CAN frame, the controller counts the time that all bits of the CAN frame are received, and determines the total number of bits of the CAN frame as the counted time. A first time of one bit may be calculated by dividing by time, and the calculated first time may be calculated as a minimum time.

본 발명은 상기 캔 프레임에서 한 비트(1bit)의 최소 시간을 산출하는 단계에서, 상기 컨트롤러는, 상기 캔 프레임에서 동일한 비트값이 연속되지 않은 한 비트(1bit)의 제2 시간을 추출하고, 상기 추출된 제2 시간을 최소 시간으로 산출할 수 있다. According to the present invention, in the step of calculating the minimum time of one bit (1 bit) in the CAN frame, the controller extracts a second time of one bit (1 bit) in which the same bit value is not continuous in the CAN frame, The extracted second time may be calculated as the minimum time.

본 발명은 상기 캔 프레임에서 한 비트(1bit)의 최소 시간을 산출하는 단계에서, 상기 컨트롤러는, 상기 캔 프레임이 동일한 비트값이 2개 이상 연속으로 구성된 경우, 상기 캔 프레임에서 비트값이 변하는 모든 지점의 시간을 추출하고, 상기 추출된 모든 지점의 시간에 대한 평균을 산출하며, 상기 산출된 평균 시간을 한 비트(1bit)의 제3 시간으로 설정하며, 상기 설정된 제3 시간을 최소 시간으로 산출할 수 있다. In the present invention, in the step of calculating the minimum time of one bit (1 bit) in the can frame, when the can frame consists of two or more consecutive bit values with the same can frame, all bits of which the bit value changes in the can frame The time of the point is extracted, the average of the time of all the extracted points is calculated, the calculated average time is set as a third time of one bit (1 bit), and the set third time is calculated as the minimum time can do.

본 발명은 상기 산출된 최소 시간을 이용하여 통신속도를 산출하는 단계 이후, 상기 컨트롤러가 상기 산출된 통신속도로 테스트 메시지를 캔 버스 라인을 통해 전자 제어 장치로 전송하여 에러가 없는 경우 상기 통신속도를 최종 통신속도로 자동 설정하는 단계를 더 포함할 수 있다. In the present invention, after calculating the communication rate using the calculated minimum time, the controller transmits a test message to the electronic control device through the CAN bus line to increase the communication rate when there is no error. It may further include the step of automatically setting the final communication rate.

본 발명의 일 실시예에 따른 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치 및 방법은 CAN 버스 라인을 통해 수신되는 비트 신호를 모니터링하고, 이를 이용하여 CAN 통신의 통신속도(Baud Rate)를 자동으로 설정함으로써, 전자 제어 장치에서 프로그램 변경 없이 어떠한 캔 버스에도 연결이 가능하도록 하여 다른 전자 제어 장치와의 원활한 통신이 이루어질 수 있게 한다. An apparatus and method for setting a baud rate of a CAN communication-based electronic control device according to an embodiment of the present invention monitors a bit signal received through a CAN bus line and automatically adjusts the baud rate of CAN communication using this By setting, it is possible to connect to any CAN bus without changing a program in the electronic control device, thereby enabling smooth communication with other electronic control devices.

한편, 본 발명의 효과는 이상에서 언급한 효과들로 제한되지 않으며, 이하에서 설명할 내용으로부터 통상의 기술자에게 자명한 범위 내에서 다양한 효과들이 포함될 수 있다.On the other hand, the effects of the present invention are not limited to the above-mentioned effects, and various effects may be included within the range apparent to those skilled in the art from the contents to be described below.

도 1은 본 발명의 일 실시예에 따른 차량용 네트워크 시스템을 개략적으로 나타낸 구성도이다.
도 2는 본 발명의 일 실시예에 따른 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치를 설명하기 위한 도면이다.
도 3은 도 2에 도시된 컨트롤러의 기능을 설명하기 위한 도면이다.
도 4는 본 발명의 일 실시예에 따른 캔(CAN) 프레임의 구조를 설명하기 위한 도면이다.
도 5는 본 발명의 일 실시예에 따른 캔 프레임의 전체 비트에 기초하여 최소 시간을 산출하는 방법을 설명하기 위한 도면이다.
도 6은 본 발명의 일 실시예에 따른 캔 프레임의 비트값에 기초하여 최소 시간을 산출하는 방법을 설명하기 위한 도면이다.
도 7은 본 발명의 일 실시예에 따른 캔 통신 기반 전자 제어 장치의 통신속도 설정 방법을 설명하기 위한 흐름도이다.
1 is a configuration diagram schematically showing a network system for a vehicle according to an embodiment of the present invention.
2 is a diagram for explaining a communication speed setting device of a CAN communication-based electronic control device according to an embodiment of the present invention.
FIG. 3 is a diagram for explaining a function of the controller shown in FIG. 2 .
4 is a view for explaining the structure of a can (CAN) frame according to an embodiment of the present invention.
5 is a diagram for explaining a method of calculating a minimum time based on all bits of a CAN frame according to an embodiment of the present invention.
6 is a diagram for explaining a method of calculating a minimum time based on a bit value of a CAN frame according to an embodiment of the present invention.
7 is a flowchart for explaining a communication speed setting method of a CAN communication-based electronic control device according to an embodiment of the present invention.

이하, 첨부된 도면들을 참조하여 본 발명의 일 실시예에 따른 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치 및 방법을 설명한다. 이 과정에서 도면에 도시된 선들의 두께나 구성요소의 크기 등은 설명의 명료성과 편의상 과장되게 도시되어 있을 수 있다. Hereinafter, an apparatus and method for setting a communication speed of a CAN communication-based electronic control device according to an embodiment of the present invention will be described with reference to the accompanying drawings. In this process, the thickness of the lines or the size of the components shown in the drawings may be exaggerated for clarity and convenience of explanation.

또한, 후술되는 용어들은 본 발명에서의 기능을 고려하여 정의된 용어들로서 이는 사용자, 운용자의 의도 또는 관례에 따라 달라질 수 있다. 그러므로 이러한 용어들에 대한 정의는 본 명세서 전반에 걸친 내용을 토대로 내려져야 할 것이다.In addition, the terms to be described later are terms defined in consideration of functions in the present invention, which may vary according to the intention or custom of the user or operator. Therefore, definitions of these terms should be made based on the content throughout this specification.

도 1은 본 발명의 일 실시예에 따른 차량용 네트워크 시스템을 개략적으로 나타낸 구성도이다. 1 is a configuration diagram schematically showing a network system for a vehicle according to an embodiment of the present invention.

본 발명의 일 실시예에 따른 차량용 네트워크 시스템은 차량 내 전자 제어 장치들 간의 통신을 위한 차량 내부 네트워크 시스템으로서, 도 1에 도시된 바와 같이, 2가닥의 와이어가 꼬여서 형성된 하나의 CAN 버스 라인(100)과 이 CAN 버스 라인(100)에 연결된 복수의 전자 제어 장치(200a, 200b,..., 200n, 이하 200이라 칭함)를 포함하여 구성될 수 있다.A network system for a vehicle according to an embodiment of the present invention is an in-vehicle network system for communication between electronic control devices in a vehicle. As shown in FIG. 1, one CAN bus line 100 formed by twisting two wires ) and a plurality of electronic control devices (200a, 200b, ..., 200n, hereinafter referred to as 200) connected to the CAN bus line 100 .

CAN 버스 라인(100)의 양 끝단에는 각각 종단저항(미도시)이 연결되고, 전자 제어 장치들(200)은 CAN 통신 프로토콜을 이용하는 복수의 전자 제어 장치(200)로 구성될 수 있다. A terminating resistor (not shown) is respectively connected to both ends of the CAN bus line 100 , and the electronic control devices 200 may include a plurality of electronic control devices 200 using a CAN communication protocol.

전자 제어 장치들(200)은 각각 CAN 버스 라인(100)에 모두 연결되어서, CAN 버스 라인(100)을 통해 데이터를 전송할 수 있다.Each of the electronic control devices 200 may be connected to the CAN bus line 100 to transmit data through the CAN bus line 100 .

이러한 전자 제어 장치들(200)은 CAN 버스 라인(100)을 통해 캔 트랜시버(미도시)에 각각 연결되며, 전자 제어 장치(200)내 각각의 송수신 포트는 캔 트랜시버내 해당 송수신 포트에 연결된다.Each of these electronic control devices 200 is connected to a CAN transceiver (not shown) through a CAN bus line 100 , and each transmission/reception port in the electronic control device 200 is connected to a corresponding transmission/reception port in the CAN transceiver.

CAN 버스 라인(100)을 사용하는 모든 전자 제어 장치들(200)은 다른 전자 제어 장치로부터 수신(피드백)되는 CAN 프레임을 감지하고, 감지된 CAN 프레임에서 1 Bit의 최소 시간을 통신속도(Baud Rate)로 검출하며, 검출된 통신속도로 같은 CAN 버스 라인을 사용하는 전자 제어 장치들(200)의 통신속도를 자동으로 변경할 수 있다. All electronic control devices 200 using the CAN bus line 100 detect a CAN frame received (feedback) from another electronic control device, and set the minimum time of 1 bit in the detected CAN frame to the baud rate. ), and it is possible to automatically change the communication speed of the electronic control devices 200 using the same CAN bus line as the detected communication speed.

도 2는 본 발명의 일 실시예에 따른 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치를 설명하기 위한 도면, 도 3은 도 2에 도시된 컨트롤러의 기능을 설명하기 위한 도면, 도 4는 본 발명의 일 실시예에 따른 캔(CAN) 프레임의 구조를 설명하기 위한 도면, 도 5는 본 발명의 일 실시예에 따른 캔 프레임의 전체 비트에 기초하여 최소 시간을 산출하는 방법을 설명하기 위한 도면, 도 6은 본 발명의 일 실시예에 따른 캔 프레임의 비트값에 기초하여 최소 시간을 산출하는 방법을 설명하기 위한 도면이다. 2 is a view for explaining a communication speed setting device of a CAN communication-based electronic control device according to an embodiment of the present invention, FIG. 3 is a view for explaining a function of the controller shown in FIG. 2, and FIG. 4 is a view for explaining the present invention 5 is a diagram for explaining the structure of a CAN frame according to an embodiment of the present invention, FIG. 5 is a diagram for explaining a method of calculating a minimum time based on all bits of a CAN frame according to an embodiment of the present invention; 6 is a diagram for explaining a method of calculating a minimum time based on a bit value of a CAN frame according to an embodiment of the present invention.

도 2를 참조하면, 본 발명의 일 실시예에 따른 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치는 스위치부(210), 인터페이스부(220), 컨트롤러(240)(MCU, Micro Control Unit) 및 메모리(250)를 포함한다. Referring to FIG. 2 , the communication speed setting device of the electronic control device based on can communication according to an embodiment of the present invention includes a switch unit 210 , an interface unit 220 , a controller 240 (MCU, Micro Control Unit) and and memory 250 .

스위치부(210)는 통신속도 설정모드를 선택하기 위한 구성으로, 자동 설정 모드 또는 이전 속도 이용 모드로 변환시킨다. 즉, 스위치부(210)는 자동 설정 모드 또는 이전 속도 이용 모드 중에서 선택된 모드로 동작하도록 할 수 있다. 자동 설정 모드는 CAN 프레임에 기초하여 통신속도를 검출 및 설정하는 모드일 수 있고, 이전 속도 이용 모드는 메모리(250)에 저장된 통신속도를 이용하는 모드일 수 있다. The switch unit 210 is a configuration for selecting a communication speed setting mode, and converts it to an automatic setting mode or a previous speed use mode. That is, the switch unit 210 may operate in a mode selected from the automatic setting mode or the previous speed use mode. The automatic setting mode may be a mode for detecting and setting the communication speed based on the CAN frame, and the previous speed use mode may be a mode using the communication speed stored in the memory 250 .

인터페이스부(220)는 CAN 버스 라인(100)을 통해 비트 신호를 송신 또는 수신한다. 이러한 인터페이스부(220)는 CAN 버스 라인(100)을 통해 비트 신호를 송신하는 송신 포트, CAN 버스 라인(100)을 통해 비트 신호를 수신하는 수신 포트, 및 피드백되는 비트 신호를 수신하는 클럭 카운터 포트(Clock Counter)를 포함할 수 있다. 클럭 카운터 포트는 캔 프레임의 시간을 카운팅하기 위해 이용할 수 있다. 예를 들어, ECU1(200a)에서 송신 포트로 비트 신호를 전송하면, 전송된 비트 신호는 CAN 버스 라인(100)으로 출력되되, 이때 출력되는 비트 신호는 ECU1(200a)의 피드백 신호 입력단인 클럭 카운터 포트로 피드백되어 전송된 비트 신호의 출력으로 확인할 수 있다. 또한, ECU2(200b)에서 ECU1(200a)으로 비트 신호를 전송한 경우, ECU1(200a)은 수신 포트를 통해 비트 신호를 수신하되, 이때 CAN 버스 라인(100)을 통해 수신되는 비트 신호는 ECU1(200a)의 피드백 신호 입력단인 클럭 카운터 포트로 피드백되어 수신된 비트 신호로 확인할 수 있다. The interface unit 220 transmits or receives a bit signal through the CAN bus line 100 . The interface unit 220 includes a transmit port for transmitting a bit signal through the CAN bus line 100 , a receiving port for receiving a bit signal through the CAN bus line 100 , and a clock counter port for receiving a feedback bit signal. (Clock Counter) may be included. A clock counter port can be used to count the time of can frames. For example, when a bit signal is transmitted from the ECU1 200a to the transmission port, the transmitted bit signal is output to the CAN bus line 100, and the output bit signal is a clock counter that is a feedback signal input terminal of the ECU1 200a. It can be confirmed by the output of the transmitted bit signal fed back to the port. In addition, when a bit signal is transmitted from ECU2 ( 200b ) to ECU1 ( 200a ), ECU1 ( 200a ) receives a bit signal through a receiving port, and at this time, the bit signal received through the CAN bus line 100 is ECU1 ( 200a), it can be confirmed by the received bit signal fed back to the clock counter port, which is the input terminal of the feedback signal.

컨트롤러(240)는 스위치부(210)에 설정된 통신속도 설정모드에 따라, 통신속도를 메모리(250)에 저장된 통신속도로 동작하도록 제어하거나, 인터페이스부(220)로부터의 비트 신호에서 감지된 캔 프레임에 기초하여 통신속도를 설정한다. 즉, 스위치부(210)에서 이전 속도 이용 모드가 설정된 경우, 컨트롤러(240)는 메모리(250)에 저장된 통신속도를 현재의 통신속도로 설정할 수 있다. 또한, 스위치부(210)에서 자동 설정 모드가 설정된 경우, 컨트롤러(240)는 캔 프레임에서 통신속도를 검출하고, 검출된 통신속도를 캔 버스 라인(100)을 사용하는 전자 제어 장치들의 통신속도로 자동으로 변경할 수 있다. The controller 240 controls the communication speed to operate at the communication speed stored in the memory 250 according to the communication speed setting mode set in the switch unit 210 , or the can frame detected from the bit signal from the interface unit 220 . Set the communication speed based on That is, when the previous speed use mode is set in the switch unit 210 , the controller 240 may set the communication speed stored in the memory 250 to the current communication speed. In addition, when the automatic setting mode is set in the switch unit 210 , the controller 240 detects a communication speed from the CAN frame, and sets the detected communication speed as the communication speed of electronic control devices using the CAN bus line 100 . can be changed automatically.

이하, 컨트롤러(240)의 기능에 대해 도 3을 참조하여 설명하기로 한다. 컨트롤러(240)는 도 3에 도시된 바와 같이 모드 확인부(241), CAN 프레임 감지부(242), 통신속도 산출부(243) 및 검증부(244)를 포함한다.Hereinafter, the function of the controller 240 will be described with reference to FIG. 3 . The controller 240 includes a mode confirmation unit 241 , a CAN frame detection unit 242 , a communication rate calculation unit 243 , and a verification unit 244 as shown in FIG. 3 .

모드 확인부(241)는 스위치부(210)에 설정된 모드를 확인한다. 스위치부(210)에 자동 설정 모드가 설정된 경우, 모드 확인부(241)는 캔 프레임의 수신 시간을 카운팅하기 위한 타이머(미도시)를 활성화시킬 수 있다. 여기서, 타이머는 클럭 카운터 포트의 인터럽트를 이용할 수 있다.The mode check unit 241 checks the mode set in the switch unit 210 . When the automatic setting mode is set in the switch unit 210 , the mode check unit 241 may activate a timer (not shown) for counting the reception time of the can frame. Here, the timer may use an interrupt of the clock counter port.

CAN 프레임 감지부(242)는 인터페이스부(220)를 통해 수신되는 비트 신호의 비트 수에 기초하여 캔 프레임 여부를 판단한다. 즉, CAN 프레임 감지부(242)는 수신되는 비트 신호가 CAN 통신 프로토콜에 따른 프레임인 경우 캔 프레임으로 판단할 수 있다. 이때, CAN 프레임 감지부(242)는 캔 프레임의 비트 수를 통해 캔 프레임인지 판단할 수 있다. The CAN frame detection unit 242 determines whether a CAN frame exists based on the number of bits of the bit signal received through the interface unit 220 . That is, when the received bit signal is a frame according to the CAN communication protocol, the CAN frame detection unit 242 may determine it as a CAN frame. In this case, the CAN frame detection unit 242 may determine whether the CAN frame is a CAN frame based on the number of bits of the CAN frame.

CAN 통신을 위한 프레임(캔 프레임)은 도 4와 같은 구조일 수 있다. 도 4에 도시된 바와 같이, 캔 프레임은 프레임 시작을 알리는 SOF(Start od Frame), 데이터 우선순위 중재를 위한 중재 ID 삽입을 위한 중재 ID 필드(Arbitration ID Field), 특정 ID(Identification)의 데이터 전송을 요청하기 위한 RTR(Remote Transmission Request) 비트, 제어 신호의 전송을 위한 제어필드(Control Field), 소정의 데이터 길이를 갖는 데이터가 실리는 데이터 필드(Data Field), 에러 검출을 위해 CRC Sequence와 CRC Delimiter로 구성된 CRC(Cyclic Redundancy Check) 필드, 데이터 수신의 정확성을 알리기 위해 ACK 슬롯과 ACK Delimiter로 구성된 ACK(Acknowledgement) 필드, 및 EOF(End of Frame)으로 구성될 수 있다. 제어필드(Control Field)에는 일반적으로 중재 ID의 길이가 표준(11비트)인지 확장(29 비트)인지를 알리기 위한 IDE(Identifier Extension)와 데이터 길이를 나타내는 DLC(Data Length Code)를 포함한다. A frame (can frame) for CAN communication may have a structure as shown in FIG. 4 . As shown in FIG. 4 , the CAN frame includes a Start od Frame (SOF) indicating the start of a frame, an Arbitration ID Field for inserting an arbitration ID for data priority arbitration, and data transmission of a specific ID (Identification). RTR (Remote Transmission Request) bit for requesting a control signal, a control field for transmission of a control signal, a data field in which data having a predetermined data length is loaded, and a CRC sequence and CRC for error detection It may be composed of a CRC (Cyclic Redundancy Check) field composed of a delimiter, an ACK (Acknowledgement) field composed of an ACK slot and an ACK Delimiter to inform accuracy of data reception, and an End of Frame (EOF). The control field generally includes an identifier extension (IDE) for indicating whether the length of the arbitration ID is standard (11 bits) or extended (29 bits) and a data length code (DLC) indicating the data length.

따라서, CAN 프레임 감지부(242)는 피드백되는 비트 신호가 도 4와 같은 구조를 갖는 경우, 해당 비트 신호를 캔 프레임으로 판단할 수 있다.Accordingly, when the fed back bit signal has a structure as shown in FIG. 4 , the CAN frame detecting unit 242 may determine the corresponding bit signal as a CAN frame.

통신속도 산출부(243)는 캔 프레임에서 한(one) 비트(1 bit)의 최소 시간을 산출하고, 산출된 최소 시간을 이용하여 통신속도로 구한다. The communication rate calculating unit 243 calculates the minimum time of one bit (1 bit) in the can frame, and obtains the communication rate by using the calculated minimum time.

이때, 통신속도 산출부(243)는 캔 프레임에서 한 비트(1bit)의 시간을 측정하고, 측정된 1bit의 시간을 최소 시간으로 산출할 수 있다. 그러나, 1bit의 최소 시간은 외부 노이즈 등의 외란으로 1bit를 인지하기 어려울 수 있다. 예컨대, Start Bit 하나로 최소 단위의 시간 측정은 가능하나, Start Bit의 감지가 제대로 되지 않을 경우 통신속도(Baud rate)의 결정도 불가하기 때문이다.In this case, the communication rate calculating unit 243 may measure the time of one bit (1 bit) in the can frame, and may calculate the measured time of one bit as the minimum time. However, in the minimum time of 1 bit, it may be difficult to recognize 1 bit due to disturbances such as external noise. For example, it is possible to measure time in the smallest unit with one start bit, but if the start bit is not properly detected, it is impossible to determine the baud rate.

이에, 통신속도 산출부(243)는 캔 프레임의 전체 비트가 수신되는 시간을 카운팅하고, 캔 프레임의 전체 비트 수를 카운팅된 시간으로 나누어 1bit의 제1 시간을 산출하며, 산출된 제1 시간을 최소 시간으로 산출할 수 있다. 통신속도 산출부(243)는 캔 프레임이 수신되는 시간을 카운팅하기 위해 클럭 카운터 포트(Clock Counter)의 인터럽트를 이용할 수 있다.Accordingly, the communication rate calculator 243 counts the time when all bits of the can frame are received, divides the total number of bits of the can frame by the counted time to calculate the first time of 1 bit, and calculates the calculated first time. It can be calculated in the minimum time. The communication rate calculator 243 may use an interrupt of a clock counter port to count the time that the CAN frame is received.

예를 들어, 도 5와 같은 캔 프레임(51 bit)을 수신하는(피드백 받은) 전체 시간을 F2라고 가정하여 설명하기로 한다. 이 경우, 통신속도 산출부(243)는 캔 프레임의 전체 비트 수(51 bit)을 F2로 나누어, 1bit의 제1 시간을 산출할 수 있다. For example, a description will be made on the assumption that F2 is the total time for receiving (receiving feedback) of the can frame (51 bits) as shown in FIG. 5 . In this case, the communication rate calculating unit 243 may calculate the first time of 1 bit by dividing the total number of bits (51 bits) of the can frame by F2.

통신속도 산출부(243)는 제1 시간을 이용하여 캔 버스 라인(100)의 통신속도를 산출할 수 있다. 즉, 통신속도 산출부(243)는 제1 시간의 역수를 구하고, 구해진 제1 시간의 역수를 통신속도로 산출할 수 있다. 하지만 상술한 방법은 측정된 시간 파라미터의 값이 부정확할 경우 신뢰하지 못하는 문제가 있다.The communication speed calculator 243 may calculate the communication speed of the canvas line 100 using the first time. That is, the communication rate calculating unit 243 may obtain the reciprocal of the first time and calculate the obtained reciprocal of the first time as the communication rate. However, the above-described method has a problem of unreliability when the value of the measured time parameter is inaccurate.

이에, 통신속도 산출부(243)는 캔 프레임에서 동일한 비트값이 연속되지 않은 한 비트(1bit)의 시간을 제2 시간으로 산출하고, 제2 시간을 이용하여 통신속도를 산출할 수 있다. 예를 들어, 도 6의 (a)와 같이 1bit 값이 '1', '0', '1' 순으로 변하는 구간이 존재하는 경우, 통신속도 산출부(243)는 1bit 값이 '1'에서 '0'으로 변하는 시간인 T2를 제2 시간으로 산출할 수 있다.Accordingly, the communication rate calculating unit 243 may calculate the time of one bit (1 bit) as the second time as long as the same bit value is not continuous in the can frame, and calculate the communication rate using the second time. For example, if there is a section in which the 1-bit value changes in the order of '1', '0', and '1' as shown in FIG. 6(a), the communication rate calculating unit 243 sets the 1-bit value from '1' to '1'. T2, which is the time to change to '0', may be calculated as the second time.

한편, 캔 프레임은 도 6의 (b)와 같이 동일한 비트값이 2개 이상 연속으로 구성될 수 있다. 이런 경우 통신속도를 산출하기 위해 1비트의 최소 시간을 찾을 수 없다. 이처럼 캔 프레임에서 동일한 비트값이 연속되지 않은 1비트가 존재하지 않은 경우, 통신속도 산출부(243)는 캔 프레임에서 비트값이 변하는 모든 지점의 시간을 추출하고, 추출된 모든 지점의 시간에 대한 평균을 산출하며, 산출된 평균을 1bit의 제3 시간으로 산출할 수 있다. Meanwhile, in the can frame, two or more identical bit values may be consecutively configured as shown in FIG. 6B . In this case, the minimum time of 1 bit cannot be found to calculate the communication speed. As such, when there is no one bit in which the same bit value is not continuous in the can frame, the communication rate calculating unit 243 extracts the times of all points in the can frame at which the bit values change, and calculates the time of all the extracted points in the can frame. The average is calculated, and the calculated average can be calculated as the third time of 1 bit.

예를 들어 도 6의 (b)를 참조하면, 통신속도 산출부(243)는 비트값이 '0'에서 '1'로 변하는 지점 D1 및 D3의 시간, 비트값이 '1'에서 '0'으로 변하는 지점 D2의 시간을 각각 추출하고, 추출된 D1, D2 및 D3의 시간들의 평균을 산출하여, 제3 시간으로 산출할 수 있다. For example, referring to (b) of FIG. 6 , the communication rate calculating unit 243 determines the time at the points D1 and D3 at which the bit value changes from '0' to '1', and the bit value is from '1' to '0'. It is possible to extract the time of the point D2 that changes to , and calculate the average of the extracted times D1, D2, and D3 to calculate the third time.

통신속도 산출부(243)는 제1 시간, 제2 시간 및 제3 시간 중 하나를 선택하여 통신속도를 구할 수 있다. 즉, 통신속도 산출부(243)는 제1 시간, 제2 시간 및 제3 시간 중에서 가장 짧은 시간을 최소 시간으로 선택할 수 있다. 그런 후, 통신속도 산출부(243)는 선택된 최소 시간의 역수를 계산하여 통신속도(보드 레이트)를 구한다. 즉, 통신속도 산출부(243)는 '1/최소 시간'을 통신속도로 산출할 수 있다. The communication rate calculating unit 243 may obtain a communication rate by selecting one of the first time, the second time, and the third time. That is, the communication rate calculator 243 may select the shortest time among the first time, the second time, and the third time as the minimum time. Then, the communication rate calculation unit 243 calculates the reciprocal of the selected minimum time to obtain the communication rate (baud rate). That is, the communication rate calculating unit 243 may calculate '1/minimum time' as the communication rate.

검증부(244)는 통신속도 산출부(243)에서 구한 통신속도로 테스트 메시지를 캔 버스 라인(100)을 통해 다른 전자 제어 장치로 전송하여 에러가 없는 경우 통신속도를 최종 결정한다. 이때, 검증부(244)는 에러 프레임의 발생 여부를 확인하여, 에러 프레임이 발생되지 않으면 그 통신속도를 최종 통신속도로 최종 결정함으로써, 전자 제어 장치간의 원활한 통신이 가능해지도록 한다.The verification unit 244 transmits the test message to another electronic control device through the CAN bus line 100 at the communication rate obtained by the communication rate calculation unit 243 to finally determine the communication rate when there is no error. At this time, the verification unit 244 checks whether an error frame has occurred, and if an error frame does not occur, the communication rate is finally determined as the final communication rate, thereby enabling smooth communication between electronic control devices.

상기와 같이 구성된 통신속도 설정 장치는 전자 제어 장치(200) 자체 또는 전자 제어 장치(200)의 내부에 구비된 장치일 수 있다. The communication speed setting device configured as described above may be the electronic control device 200 itself or a device provided inside the electronic control device 200 .

도 7은 본 발명의 일 실시예에 따른 캔 통신 기반 전자 제어 장치의 통신속도 설정 방법을 설명하기 위한 흐름도이다. 7 is a flowchart for explaining a communication speed setting method of a CAN communication-based electronic control device according to an embodiment of the present invention.

도 7을 참조하면, 통신속도 설정 장치는 통신속도 설정모드가 자동 설정모드인지 판단한다(S710). 즉, 통신속도 설정 장치는 스위치부(210)를 확인하여 자동 설정모드 또는 이전 속도 이용모드인지를 판단한다. Referring to FIG. 7 , the communication speed setting device determines whether the communication speed setting mode is an automatic setting mode (S710). That is, the communication speed setting device checks the switch unit 210 to determine whether it is an automatic setting mode or a previous speed use mode.

S710 단계의 판단결과, 자동 설정모드이면, 통신속도 설정 장치는 캔 프레임의 펄스 변화 시간을 카운팅하기 위한 타이머(230)를 활성화시킨다(S720).As a result of the determination in step S710, in the automatic setting mode, the communication speed setting device activates the timer 230 for counting the pulse change time of the can frame (S720).

S720 단계 수행 후, 통신속도 설정 장치는 다른 전자 제어 장치로부터 캔 프레임이 수신되는지를 판단한다(S730). 이때, 통신속도 설정 장치는 다른 전자 제어 장치로부터의 비트 신호가 CAN 통신 프로토콜에 따른 프레임인 경우 캔 프레임으로 판단할 수 있다. After performing step S720, the communication speed setting device determines whether a CAN frame is received from another electronic control device (S730). In this case, when the bit signal from another electronic control device is a frame according to the CAN communication protocol, the communication speed setting device may determine it as a CAN frame.

S730 단계의 판단결과, 캔 프레임이 수신되면, 통신속도 설정 장치는 캔 프레임에서 1bit의 최소 시간을 산출하고(S740), 산출된 최소 시간을 이용하여 통신속도를 구한다(S750). 즉, 통신속도 설정 장치는 캔 프레임의 전체 비트가 수신되는 시간을 카운팅하고, 캔 프레임의 전체 비트 수를 카운팅된 시간으로 나누어 1bit의 제1 시간을 산출하며, 산출된 제1 시간을 최소 시간으로 산출할 수 있다. 또한, 통신속도 설정 장치는 캔 프레임에서 동일한 비트값이 연속되지 않은 한 비트(1bit)의 시간을 제2 시간으로 산출할 수 있다. 또한, 캔 프레임에서 동일한 비트값이 연속되지 않은 1비트가 존재하지 않은 경우, 통신속도 설정 장치는 캔 프레임에서 비트값이 변하는 모든 지점의 시간을 추출하고, 추출된 모든 지점의 시간에 대한 평균을 산출하며, 산출된 평균을 1bit의 제3 시간으로 산출할 수 있다. As a result of the determination in step S730, when the CAN frame is received, the communication speed setting device calculates a minimum time of 1 bit in the CAN frame (S740) and obtains a communication speed using the calculated minimum time (S750). That is, the communication rate setting device counts the time when all bits of the can frame are received, divides the total number of bits of the can frame by the counted time to calculate the first time of 1 bit, and sets the calculated first time as the minimum time. can be calculated. In addition, the communication rate setting apparatus may calculate the time of one bit (1 bit) as the second time as long as the same bit value is not consecutive in the CAN frame. In addition, if there is no one bit in which the same bit value is not continuous in the can frame, the communication speed setting device extracts the time at all points where the bit value changes in the can frame, and calculates the average of the times of all the extracted points in the can frame. and the calculated average can be calculated as the third time of 1 bit.

통신속도 설정 장치는 제1 시간, 제2 시간 및 제3 시간 중 하나를 선택하여 통신속도를 구할 수 있다. 즉, 통신속도 설정 장치는 제1 시간, 제2 시간 및 제3 시간 중에서 가장 짧은 시간을 최소 시간으로 선택할 수 있다. 그런 후, 통신속도 설정 장치는 선택된 최소 시간의 역수를 계산하여 통신속도(보드 레이트)를 구한다. 즉, 통신속도 산출부(243)는 '1/최소 시간'을 통신속도로 산출할 수 있다. The communication speed setting device may obtain the communication speed by selecting one of the first time, the second time, and the third time. That is, the communication speed setting apparatus may select the shortest time among the first time, the second time, and the third time as the minimum time. Then, the communication rate setting device calculates the reciprocal of the selected minimum time to obtain the communication rate (baud rate). That is, the communication rate calculating unit 243 may calculate '1/minimum time' as the communication rate.

S750 단계가 수행되면, 통신속도 설정 장치는 구한 통신속도로 테스트 메시지를 캔 버스 라인(100)을 통해 다른 전자 제어 장치로 전송하여 에러가 없는 경우 통신속도를 최종 결정한다(S760). When step S750 is performed, the communication speed setting device transmits the test message to the other electronic control device through the CAN bus line 100 to finally determine the communication speed when there is no error (S760).

만약, S710 단계의 판단결과, 이전 속도 이용 모드이면, 통신속도 설정 장치는 메모리(250)에 저장된 통신속도를 로딩하고(S770), 로딩된 통신속도를 현재의 통신속도로 설정한 후(S780), S760 단계를 수행한다. If, as a result of the determination of step S710, if the previous speed use mode, the communication speed setting device loads the communication speed stored in the memory 250 (S770), and sets the loaded communication speed to the current communication speed (S780) , step S760 is performed.

상술한 바와 같이, 본 발명의 일 실시예에 따른 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치 및 방법은 CAN 버스 라인을 통해 수신되는 비트 신호를 모니터링하고, 이를 이용하여 CAN 통신의 통신속도(Baud Rate)를 자동으로 설정함으로써, 전자 제어 장치에서 프로그램 변경 없이 어떠한 캔 버스에도 연결이 가능하도록 하여 다른 전자 제어 장치와의 원활한 통신이 이루어질 수 있게 한다. As described above, the apparatus and method for setting a communication rate of a CAN communication-based electronic control device according to an embodiment of the present invention monitors a bit signal received through a CAN bus line, and uses it to monitor the baud rate (Baud) of CAN communication. Rate), it is possible to connect to any canvas bus without changing the program in the electronic control device, thereby enabling smooth communication with other electronic control devices.

본 발명은 도면에 도시된 실시예를 참고로 하여 설명되었으나, 이는 예시적인 것에 불과하며, 당해 기술이 속하는 분야에서 통상의 지식을 가진 자라면 이로부터 다양한 변형 및 균등한 타 실시예가 가능하다는 점을 이해할 것이다.Although the present invention has been described with reference to the embodiment shown in the drawings, this is merely exemplary, and it is understood that various modifications and equivalent other embodiments are possible by those of ordinary skill in the art. will understand

따라서 본 발명의 진정한 기술적 보호범위는 아래의 특허청구범위에 의해서 정하여져야 할 것이다.Therefore, the true technical protection scope of the present invention should be defined by the following claims.

100 : CAN 버스 라인
200 : 전자 제어 장치
210 : 스위치부
220 : 인터페이스부
240 : 컨트롤러
241 : 모드 확인부
242 : CAN 프레임 감지부
243 : 통신속도 산출부
244 : 검증부
250 : 메모리
100: CAN bus line
200: electronic control unit
210: switch unit
220: interface unit
240: controller
241: mode confirmation unit
242: CAN frame detection unit
243: communication speed calculation unit
244: verification unit
250 : memory

Claims (14)

통신속도 설정모드를 선택하기 위한 스위치부;
통신속도(Baud rate)를 저장하는 메모리;
캔(CAN) 버스 라인을 통해 비트 신호를 송신 또는 수신하는 인터페이스부; 및
상기 스위치부에 설정된 통신속도 설정모드에 따라, 통신속도를 상기 메모리에 저장된 통신속도로 동작하도록 제어하거나, 상기 인터페이스부로부터의 비트 신호에서 감지된 캔 프레임에 기초하여 통신속도를 설정하는 컨트롤러;를 포함하고,
상기 컨트롤러는,
상기 캔 프레임에서 한(one) 비트(1 bit)의 최소 시간을 산출하고, 상기 산출된 최소 시간을 이용하여 통신속도를 산출하며,
상기 컨트롤러는,
상기 캔 프레임에서 동일한 비트값이 연속되지 않은 한 비트(1bit)의 제2 시간을 추출하고, 상기 추출된 제2 시간을 최소 시간으로 산출하는 것을 특징으로 하는, 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치.
a switch unit for selecting a communication speed setting mode;
a memory for storing the baud rate;
an interface unit for transmitting or receiving a bit signal through a CAN bus line; and
A controller that controls the communication speed to operate at the communication speed stored in the memory according to the communication speed setting mode set in the switch unit, or sets the communication rate based on the can frame detected from the bit signal from the interface unit; including,
The controller is
calculating a minimum time of one bit in the can frame, and calculating a communication speed using the calculated minimum time,
The controller is
Communication speed of a CAN communication-based electronic control device, characterized in that the second time of one bit (1 bit) is extracted from the CAN frame in which the same bit value is not continuous, and the extracted second time is calculated as the minimum time setting device.
제1항에 있어서,
상기 인터페이스부는,
상기 캔 버스 라인을 통해 비트 신호를 송신하는 송신 포트;
상기 캔 버스 라인을 통해 비트 신호를 수신하는 수신 포트; 및
상기 캔 프레임의 수신 시간을 카운팅하기 위한 클럭 카운터 포트(Clock Counter)를 포함하는 것을 특징으로 하는 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치.
According to claim 1,
The interface unit,
a transmission port for transmitting a bit signal through the can bus line;
a receiving port for receiving a bit signal through the can bus line; and
and a clock counter port for counting the reception time of the CAN frame.
제2항에 있어서,
상기 컨트롤러는,
상기 스위치부에 자동 설정모드가 설정된 경우, 상기 클럭 카운터 포트의 인터럽트를 통해 타이머를 활성화시키는 것을 특징으로 하는 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치.
3. The method of claim 2,
The controller is
When the automatic setting mode is set in the switch unit, the communication speed setting device of the CAN communication-based electronic control device, characterized in that the timer is activated through the interrupt of the clock counter port.
제3항에 있어서,
상기 컨트롤러는,
상기 비트 신호의 비트 수에 기초하여 캔 프레임 여부를 판단하고, 캔 프레임인 경우 상기 타이머를 통해 상기 캔 프레임의 수신 시간을 카운팅하는 것을 특징으로 하는 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치.
4. The method of claim 3,
The controller is
and determining whether a CAN frame exists based on the number of bits of the bit signal, and counting the reception time of the CAN frame through the timer in case of a CAN frame.
제3항에 있어서,
상기 컨트롤러는,
상기 캔 프레임의 전체 비트가 수신되는 시간을 카운팅하고, 상기 캔 프레임의 전체 비트 수를 상기 카운팅된 시간으로 나누어 한 비트(1bit)의 제1 시간을 산출하며, 상기 산출된 제1 시간을 최소 시간으로 산출하는 것을 특징으로 하는 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치.
4. The method of claim 3,
The controller is
Counting the time when all bits of the CAN frame are received, dividing the total number of bits of the CAN frame by the counted time to calculate a first time of one bit (1 bit), and using the calculated first time as a minimum time A communication speed setting device of a can communication-based electronic control device, characterized in that calculated as
삭제delete 제3항에 있어서,
상기 컨트롤러는,
상기 캔 프레임이 동일한 비트값이 2개 이상 연속으로 구성된 경우, 상기 캔 프레임에서 비트값이 변하는 모든 지점의 시간을 추출하고, 상기 추출된 모든 지점의 시간에 대한 평균을 산출하며, 상기 산출된 평균 시간을 한 비트(1bit)의 제3 시간으로 설정하며, 상기 설정된 제3 시간을 최소 시간으로 산출하는 것을 특징으로 하는 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치.
4. The method of claim 3,
The controller is
When the can frame consists of two or more consecutive bit values having the same bit value, time of all points at which the bit value changes in the can frame is extracted, and an average of the times of all the extracted points is calculated, and the calculated average A communication speed setting device for a can communication-based electronic control device, wherein the time is set as a third time of one bit, and the set third time is calculated as a minimum time.
제1항에 있어서,
상기 컨트롤러는,
상기 최소 시간의 역수를 통신속도로 산출하는 것을 특징으로 하는 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치.
According to claim 1,
The controller is
A communication rate setting device for a CAN communication-based electronic control device, characterized in that the reciprocal of the minimum time is calculated as a communication rate.
제1항에 있어서,
상기 컨트롤러는,
상기 산출된 통신속도로 테스트 메시지를 캔 버스 라인을 통해 전자 제어 장치로 전송하여 에러가 없는 경우 상기 통신속도를 최종 통신속도로 자동 설정하는 것을 특징으로 하는 캔 통신 기반 전자 제어 장치의 통신속도 설정 장치.
According to claim 1,
The controller is
Communication rate setting device for CAN communication-based electronic control device, characterized in that when there is no error by transmitting a test message at the calculated communication rate to the electronic control device through the CAN bus line, the communication rate is automatically set to the final communication rate .
통신속도 설정모드가 자동 설정모드인 경우, 컨트롤러가 타이머를 활성화시키고, 캔(CAN) 버스 라인을 통해 캔 프레임을 수신하는 단계;
상기 컨트롤러가 상기 캔 프레임에서 한 비트(1bit)의 최소 시간을 산출하는 단계; 및
상기 컨트롤러가 상기 산출된 최소 시간을 이용하여 통신속도를 산출하는 단계를 포함하되,
상기 캔 프레임에서 한 비트(1bit)의 최소 시간을 산출하는 단계에서,
상기 컨트롤러는, 상기 캔 프레임에서 동일한 비트값이 연속되지 않은 한 비트(1bit)의 제2 시간을 추출하고, 상기 추출된 제2 시간을 최소 시간으로 산출하는 것을 특징으로 하는 캔 통신 기반 전자 제어 장치의 통신속도 설정 방법.
when the communication speed setting mode is an automatic setting mode, the controller activates a timer and receives a can frame through a CAN bus line;
calculating, by the controller, a minimum time of one bit (1 bit) in the can frame; and
Comprising the step of calculating, by the controller, the communication speed using the calculated minimum time,
In the step of calculating the minimum time of one bit (1 bit) in the can frame,
wherein the controller extracts a second time of a bit (1 bit) in which the same bit value is not continuous in the CAN frame, and calculates the extracted second time as a minimum time. baud rate setting method.
제10항에 있어서,
상기 캔 프레임에서 한 비트(1bit)의 최소 시간을 산출하는 단계에서,
상기 컨트롤러는, 상기 캔 프레임의 전체 비트가 수신되는 시간을 카운팅하고, 상기 캔 프레임의 전체 비트 수를 상기 카운팅된 시간으로 나누어 한 비트(1bit)의 제1 시간을 산출하며, 상기 산출된 제1 시간을 최소 시간으로 산출하는 것을 특징으로 하는 캔 통신 기반 전자 제어 장치의 통신속도 설정 방법.
11. The method of claim 10,
In the step of calculating the minimum time of one bit (1 bit) in the can frame,
The controller counts a time when all bits of the CAN frame are received, divides the total number of bits of the CAN frame by the counted time to calculate a first time of one bit (1 bit), and the calculated first time A communication speed setting method of a can communication-based electronic control device, characterized in that the time is calculated as the minimum time.
삭제delete 제10항에 있어서,
상기 캔 프레임에서 한 비트(1bit)의 최소 시간을 산출하는 단계에서,
상기 컨트롤러는, 상기 캔 프레임이 동일한 비트값이 2개 이상 연속으로 구성된 경우, 상기 캔 프레임에서 비트값이 변하는 모든 지점의 시간을 추출하고, 상기 추출된 모든 지점의 시간에 대한 평균을 산출하며, 상기 산출된 평균 시간을 한 비트(1bit)의 제3 시간으로 설정하며, 상기 설정된 제3 시간을 최소 시간으로 산출하는 것을 특징으로 하는 캔 통신 기반 전자 제어 장치의 통신속도 설정 방법.
11. The method of claim 10,
In the step of calculating the minimum time of one bit (1 bit) in the can frame,
the controller extracts the times of all points at which the bit values change in the CAN frame when the CAN frame consists of two or more consecutively identical bit values, and calculates an average of the times of all the extracted points, A communication speed setting method for a CAN communication-based electronic control device, wherein the calculated average time is set as a third time of one bit, and the set third time is calculated as a minimum time.
제10항에 있어서,
상기 산출된 최소 시간을 이용하여 통신속도를 산출하는 단계 이후,
상기 컨트롤러가 상기 산출된 통신속도로 테스트 메시지를 캔 버스 라인을 통해 전자 제어 장치로 전송하여 에러가 없는 경우 상기 통신속도를 최종 통신속도로 자동 설정하는 단계를 더 포함하는 것을 특징으로 하는 캔 통신 기반 전자 제어 장치의 통신속도 설정 방법.
11. The method of claim 10,
After calculating the communication speed using the calculated minimum time,
CAN communication base, characterized in that the controller transmits the test message to the electronic control device through the CAN bus line at the calculated communication rate and automatically setting the communication rate as the final communication rate when there is no error. How to set the communication speed of the electronic control device.
KR1020190161719A 2019-12-06 2019-12-06 Apparatus and method for setting baud rate of electronic control unit based on can communication KR102274671B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020190161719A KR102274671B1 (en) 2019-12-06 2019-12-06 Apparatus and method for setting baud rate of electronic control unit based on can communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020190161719A KR102274671B1 (en) 2019-12-06 2019-12-06 Apparatus and method for setting baud rate of electronic control unit based on can communication

Publications (2)

Publication Number Publication Date
KR20210071490A KR20210071490A (en) 2021-06-16
KR102274671B1 true KR102274671B1 (en) 2021-07-08

Family

ID=76603254

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190161719A KR102274671B1 (en) 2019-12-06 2019-12-06 Apparatus and method for setting baud rate of electronic control unit based on can communication

Country Status (1)

Country Link
KR (1) KR102274671B1 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100447165B1 (en) * 2001-06-26 2004-09-04 엘지전자 주식회사 detecting method of communication speed in device through receiver signal detection
KR100764201B1 (en) * 2003-10-06 2007-10-05 주식회사 만도 A communicaton speed setiing method of can communication node
KR102204954B1 (en) * 2016-12-05 2021-01-20 한국전자통신연구원 Can controller and method for transmission of data using the same

Also Published As

Publication number Publication date
KR20210071490A (en) 2021-06-16

Similar Documents

Publication Publication Date Title
EP2898632B1 (en) Controller area network with flexible data-rate
JP5664799B2 (en) Communication system and communication method
US7620075B2 (en) Serial communication system with baud rate generator
KR101936450B1 (en) Method and device for serial data transmission which is adapted to memory sizes
KR101932787B1 (en) Method and device for increasing the data transmission capacity in a serial bus system
US8983714B2 (en) Failsafe communication system and method
EP2684323B1 (en) Microcontroller with can bus module and auto speed detect
CN102170347B (en) Sync signal detection apparatus
CN112134652A (en) OAM message transmission method, transmission device and storage medium
US10491418B2 (en) Can controller and data transmission method using the same
CN112751738B (en) Baud rate self-adaption method and device, computer equipment and readable storage medium
KR20140029431A (en) Method and apparatus for adapting the data transmission security in a serial bus system
KR20120099295A (en) Improved pattern detection for partial networking
KR20150128658A (en) Dithering circuit for serial data transmission
CN107078932B (en) Subscriber station of a bus system and method for checking the correctness of messages
KR102274671B1 (en) Apparatus and method for setting baud rate of electronic control unit based on can communication
JP5064161B2 (en) Electronic control unit
CN114128221B (en) Subscriber station for a serial bus system and method for communication in a serial bus system
JP5892890B2 (en) Communication control device
EP2713537A1 (en) High speed data transmission methods and systems upon error detection
JP5958335B2 (en) Communication node and communication system
JP6520729B2 (en) Communication device
JP5678828B2 (en) Transceiver
EP2922243A1 (en) Monitoring method and device of two-channel bus data in network system
JP5374025B2 (en) Differential transmission equipment

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right