CN112702145B - CAN bus baud rate self-configuration method and system - Google Patents

CAN bus baud rate self-configuration method and system Download PDF

Info

Publication number
CN112702145B
CN112702145B CN202011529341.XA CN202011529341A CN112702145B CN 112702145 B CN112702145 B CN 112702145B CN 202011529341 A CN202011529341 A CN 202011529341A CN 112702145 B CN112702145 B CN 112702145B
Authority
CN
China
Prior art keywords
baud rate
control subunit
pulse
controller
bus
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202011529341.XA
Other languages
Chinese (zh)
Other versions
CN112702145A (en
Inventor
吴正中
吴爱娟
胡定旭
常海利
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Urban Construction Intelligent Control Technology Co ltd
Original Assignee
Beijing Urban Construction Intelligent Control Technology Co ltd
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 Beijing Urban Construction Intelligent Control Technology Co ltd filed Critical Beijing Urban Construction Intelligent Control Technology Co ltd
Priority to CN202011529341.XA priority Critical patent/CN112702145B/en
Publication of CN112702145A publication Critical patent/CN112702145A/en
Application granted granted Critical
Publication of CN112702145B publication Critical patent/CN112702145B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0002Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission 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
    • 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)
  • Quality & Reliability (AREA)
  • Small-Scale Networks (AREA)
  • Dc Digital Transmission (AREA)

Abstract

The utility model relates to a CAN bus baud rate self-configuration method and system, the system comprises a controller and one or more control subunits connected with the controller; the controller sends a first pulse to the tail end control subunit according to a preset frequency and receives a second pulse sent by the tail end control subunit in response to the first pulse; acquiring the time difference between the first pulse and the second pulse; and the actual baud rate of the CAN bus is set according to the time difference, so that accurate and efficient CAN bus baud rate self-configuration is realized.

Description

CAN bus baud rate self-configuration method and system
Technical Field
The disclosure relates to the field of CAN bus control, in particular to a CAN bus baud rate self-configuration method and system.
Background
At present, in the fields of a screen door system, an automobile internal control system or other industrial automation and the like, a CAN (controller Area network) bus communication technology is one of the most widely applied field buses. The baud rate is the root of ensuring normal communication between the controller of the CAN bus and each control subunit, and if the baud rate is not matched, the controller of the CAN bus and the control subunits CAN not perform normal data transmission. Since the baud rate of the CAN bus is not unique, in the related art, in order to ensure normal communication of the CAN bus, the same baud rate needs to be manually set for the controller and each control subunit of the CAN bus, but the manual setting of the baud rate is complex in process, low in efficiency and easy to generate errors.
Disclosure of Invention
In order to solve the above problems, the present disclosure provides a method and a system for self-configuring a baud rate of a CAN bus.
In a first aspect, the present disclosure provides a method for self-configuring a baud rate of a CAN bus, the method being applied to a controller of a CAN bus system, the CAN bus system including the controller and one or more control subunits connected to the controller, the method including:
sending a first pulse to a tail end control subunit according to a preset frequency, wherein the tail end control subunit is the control subunit which is farthest from the controller in one or more control subunits;
receiving a second pulse transmitted by the end control subunit in response to the first pulse;
acquiring a time difference between the first pulse and the second pulse;
and setting the actual baud rate of the CAN bus according to the time difference.
Optionally, the setting the actual baud rate of the CAN bus according to the time difference includes: calculating to obtain a baseline baud rate of the CAN bus according to the time difference; and taking the baud rate with the minimum absolute value of the difference value with the baseline baud rate as the actual baud rate from the preset candidate baud rates.
Optionally, before the sending the first pulse to the end control subunit according to the preset frequency, the method further includes: detecting whether communication with the terminal control subunit is faulty;
the sending of the first pulse to the end control subunit according to the preset frequency includes: in case of a communication failure with the end control subunit, a first pulse is sent to the end control subunit at a preset frequency.
Optionally, after the setting the actual baud rate of the CAN bus according to the time difference, the method further includes: and sending data to the one or more control subunits according to the actual baud rate.
In a second aspect, the present disclosure provides a CAN bus baud rate self-configuration system, the system comprising a controller, one or more control subunits connected to the controller, wherein:
the controller is used for sending a first pulse to the tail end control subunit according to a preset frequency; receiving a second pulse transmitted by the end control subunit in response to the first pulse; acquiring a time difference between the first pulse and the second pulse; setting the actual baud rate of the CAN bus according to the time difference; the terminal control subunit is a control subunit which is farthest away from the controller in one or more control subunits;
and the tail end control subunit is used for receiving the first pulse sent by the controller and sending a second pulse to the controller according to the first pulse.
Optionally, the controller is specifically configured to: calculating to obtain a baseline baud rate of the CAN bus according to the time difference; and taking the baud rate with the minimum absolute value of the difference value with the baseline baud rate as the actual baud rate from the preset candidate baud rates.
Optionally, the controller is further configured to: detecting whether communication with the terminal control subunit is faulty; in case of a communication failure with the end control subunit, the step of sending a first pulse to the end control subunit at a preset frequency is performed.
Optionally, the controller is further configured to: and after the actual baud rate of the CAN bus is set according to the time difference, sending data to the one or more control subunits according to the actual baud rate.
Optionally, the control subunit is configured to: receiving data sent by the controller; acquiring a minimum time interval according to the time of receiving the data; and setting the actual baud rate of the control subunit according to the minimum time interval.
Optionally, the control subunit is specifically configured to: calculating to obtain a baseline baud rate of the control subunit according to the minimum time interval; and taking the baud rate with the minimum absolute value of the difference value with the baseline baud rate of the control subunit as the actual baud rate of the control subunit from preset candidate baud rates.
By adopting the technical scheme, the controller sends a first pulse to the tail end control subunit according to a preset frequency, and receives a second pulse sent by the tail end control subunit in response to the first pulse; acquiring the time difference between the first pulse and the second pulse; and setting the actual baud rate of the CAN bus according to the time difference. Therefore, accurate and efficient CAN bus baud rate self-configuration is realized.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
fig. 1 is a schematic structural diagram of a CAN bus baud rate self-configuration system according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a method for self-configuring a baud rate of a CAN bus according to an embodiment of the present disclosure.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
In the description that follows, the terms "first," "second," and the like are used for descriptive purposes only and are not intended to indicate or imply relative importance nor order to be construed.
First, an application scenario of the present disclosure will be explained. The method and the device CAN be applied to the field of CAN bus control, and particularly CAN be applied to the field of CAN bus baud rate self-configuration. The CAN-bus system may comprise a controller and one or more control subunits, wherein different control subunits may be used to control different nodes or devices. For example, in the case that the CAN bus system is applied to vehicle control, the vehicle controller may be used as a controller of the CAN bus, and the control subunit may include: the device comprises a light control subunit, an electric seat control subunit, a vehicle window control subunit, a windshield wiper control subunit, an instrument control subunit and the like. In another example, in the case that the CAN bus system is applied to Platform Door control of a train, the Controller therein may be a PEDC (Platform Electrical Door Controller) for sending a control signal to each control subunit according to a user instruction; the Control subunit may be a Door Control Unit (DCU), and each DCU corresponds to one platform Door and is used for controlling the opening or closing of the corresponding platform Door.
In order to ensure normal communication of the CAN bus, the same baud rate is generally set for the controller and each control subunit of the CAN bus manually. However, because the number of the control subunits of the CAN bus is large, for example, the CAN bus applied to the platform door control of the train CAN have 30 to 60 control subunits, the baud rate is manually set for each control subunit, the process is complex, the efficiency is low, and once a certain control subunit is set incorrectly, communication faults CAN be caused. In addition, in the related art, a mode of tentatively searching and matching one baud rate at a time is also adopted, but because the available baud rates of the CAN bus are more and the number of control subunits is large, the time for obtaining the reasonable baud rate by the self-adaptive matching of the mode is also more, and the efficiency is low.
In order to solve the above problems, the present disclosure provides a method and a system for self-configuration of a CAN bus baud rate, the system includes a controller, and one or more control subunits connected with the controller; the controller sends a first pulse to the tail end control subunit according to a preset frequency and receives a second pulse sent by the tail end control subunit in response to the first pulse; acquiring the time difference between the first pulse and the second pulse; and the actual baud rate of the CAN bus is set according to the time difference, so that accurate and efficient CAN bus baud rate self-configuration is realized.
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings.
Fig. 1 is a CAN bus baud rate self-configuration system provided in an embodiment of the present disclosure, and as shown in fig. 1, the system may include a controller 101, one or more control subunits 102 connected to the controller (i.e., a control subunit 1021, a control subunit 1022, control subunits 1023, …, and a control subunit 102n, where n is a positive integer), and a control subunit 1021 farthest from the controller 101 in the one or more control subunits is taken as an end control subunit 1021, where:
the controller 101 may be configured to send a first pulse to the end control subunit 1021 at a predetermined frequency; receiving a second pulse transmitted by the end control subunit 1021 in response to the first pulse; acquiring the time difference between the first pulse and the second pulse; and setting the actual baud rate of the CAN bus according to the time difference.
The end control subunit 1021 may be configured to receive a first pulse sent by the controller 101, and send a second pulse to the controller 101 according to the first pulse.
It should be noted that the first pulse may be a rectangular pulse with a preset frequency, and the preset frequency may be any frequency between 1HZ and 1000HZ, and for example, the preset frequency may be 4 HZ. The second pulse may be a rectangular pulse having the same preset frequency as the first pulse.
The distance may be a CAN bus distance, and the magnitude of the time difference may represent the distance between the end control subunit 1021 and the CAN bus of the controller 101. The further the end control subunit 1021 is from the CAN bus of the controller 101, the larger the time difference, the smaller the corresponding actual baud rate that CAN be set. The controller 101 may obtain the baud rate corresponding to the time difference as the actual baud rate according to a preset time difference baud rate correspondence relationship, where the time difference baud rate correspondence relationship is a preset time difference and baud rate correspondence relationship. The method comprises the following steps: the time difference of 20us may correspond to a baud rate of 55 kbps; a time difference of 10us may correspond to a baud rate of 90 kbps.
Thus, through the CAN bus baud rate self-configuration system, the controller sends a first pulse to the tail end control subunit according to a preset frequency and receives a second pulse sent by the tail end control subunit in response to the first pulse; acquiring the time difference between the first pulse and the second pulse; and the actual baud rate of the CAN bus is set according to the time difference, so that accurate and efficient CAN bus baud rate self-configuration is realized.
It should be noted that, in the system, each control subunit may have a preset different control subunit number, and the control subunit number is set in the server. In this way, the controller can communicate with each control subunit according to the respective control subunit number. Wherein, each control subunit has different distance from the CAN bus of the controller 101, the control subunit farthest from the controller CAN be used as the end control subunit 1021, and the control subunit number thereof is set as the end control subunit number. In this way, control can determine and communicate with the end control subunit based on its number. The distance between the terminal control subunit and the CAN bus of the controller limits the baud rate of the CAN bus, and if the setting of the baud rate of the CAN bus is too large and the distance between the control subunit and the controller is too far, the communication between the control subunit and the controller is abnormal. Therefore, an appropriate baud rate needs to be set according to the distance between the end control subunit and the CAN bus of the controller.
Optionally, the end control subunit 1021 may have a CAN bus input interface and a schmitt delay circuit, after being powered on, the end control subunit 1021 sets the corresponding CAN bus input interface as an I/O interrupt input for receiving a first pulse sent by the controller 101, where the first pulse triggers an interrupt signal after passing through the schmitt delay circuit, and the end control subunit 1021 sends a second pulse to the controller 101 according to the interrupt signal.
In some other embodiments of the present disclosure, the controller may be specifically configured to: calculating to obtain a baseline baud rate of the CAN bus according to the time difference; and taking the baud rate with the minimum absolute value of the difference value with the baseline baud rate as the actual baud rate from the preset candidate baud rates.
The formula for the controller to calculate the baseline baud rate may be: the baseline baud rate is 1/time difference. Illustratively, the time difference is 5us, then a baseline baud rate of 200kbps can be obtained according to this equation.
The candidate baud rate CAN be one or more baud rates which CAN realize reliable communication after the CAN bus is tested and verified, and the candidate baud rate CAN be preset in a controller of the CAN bus. For example, the candidate baud rates may include 50kpbs, 100kpbs, 125kpbs, 200kpbs, 500kpbs, and 1000 kpbs; when the time difference is 7us, the calculated baseline baud rate is 143kpbs, and the closest 125kpbs from the candidate baud rates can be selected as the actual baud rate.
Thus, the actual baud rate selected from the candidate baud rates in this manner enables reliable communication of the CAN bus.
Optionally, the controller may also select, from preset candidate baud rates, a baud rate that is the smallest in absolute value of the difference from the baseline baud rate and is smaller than the baseline baud rate as the actual baud rate. Therefore, the problem of unreliable communication caused by selecting a larger baud rate CAN be avoided, and the reliability of CAN bus communication is further improved.
Further, the controller may be further configured to: after the actual baud rate of the CAN bus is set according to the time difference, data is sent to one or more control subunits according to the actual baud rate. Thus, normal data communication of the CAN bus is realized.
In some other embodiments of the present disclosure, the control subunit may be configured to: receiving data sent by a controller; acquiring a minimum time interval according to the time of receiving the data; the actual baud rate of the control subunit is set according to the minimum time interval.
Wherein the control subunit may perform the above steps after power-up. Each control subunit is provided with a CAN bus data interface, the control subunit CAN set the corresponding CAN bus input interface as I/O interrupt input after being powered on, if continuous interrupt signals are input, the data are sent by a controller on the CAN bus, the control subunit CAN receive the data, automatically calculate a minimum time interval according to the signals input by the I/O interrupt, then set the actual baud rate of the control subunit according to the minimum time interval, and initialize the CAN bus according to the actual baud rate, so that the CAN bus CAN normally communicate. Therefore, each control subunit CAN use the baud rate of data sent by the controller as the actual baud rate of the control subunit by the mode, so that the correct configuration of the baud rate of the CAN bus is realized, and the normal communication of the CAN bus is ensured.
In addition, the control subunit may further preset a first preset time, acquire an interval between every two received data within the first preset time, and take a minimum value of the intervals as the minimum time interval. Therefore, the time for setting the baud rate by the control subunit can be limited through the first preset time, and the efficiency is improved.
Further, the control subunit may be specifically configured to: calculating to obtain a baseline baud rate of the control subunit according to the minimum time interval; and taking the baud rate with the minimum absolute value of the difference value with the baseline baud rate of the control subunit as the actual baud rate of the control subunit from the preset candidate baud rates.
Therefore, when the acquired minimum interval has slight deviation due to time precision, the baud rate of each control subunit is consistent with that of the controller through the selection of the candidate baud rate, and the normal communication of the CAN bus is ensured.
Similarly, in this step, the control subunit may also select, from the preset candidate baud rates, a baud rate having the smallest absolute value of the difference from the baseline baud rate of the control subunit and smaller than the baseline baud rate of the control subunit as the actual baud rate. Therefore, the problem of unreliable communication caused by selecting a larger baud rate CAN be avoided, and the reliability of CAN bus communication is further improved.
It should be noted that the above-mentioned method for self-configuring the baud rate of the CAN bus may be completed in a process of power-on initialization of the controller and the control subunit of the CAN bus, or may be performed after the controller detects a communication fault with the end control subunit, and therefore, in some other embodiments of the present disclosure, the controller may be further configured to: detecting whether communication with the terminal control subunit is faulty; executing a step of transmitting a first pulse to the end control subunit at a preset frequency in case of a communication failure with the end control subunit; in the case where the communication of the terminal subunit is normal, the communication can be continued at the current baud rate.
The controller may wait for a response signal of the end control subunit to the data after sending the data to the end field, and if the response signal is not received within a second preset time, confirm a communication failure with the end control subunit; otherwise, if the response signal is normally received within the second preset time, the communication with the terminal control subunit is confirmed to be normal. The second preset time may be a time threshold preset by the controller, and may be any value between 1ms and 100ms, for example.
Therefore, under the condition that CAN bus communication is abnormal, the controller CAN actively detect and carry out baud rate self-adaptive reconfiguration, so that normal CAN bus communication CAN be recovered.
Fig. 2 is a method for self-configuring a CAN bus baud rate provided by an embodiment of the present disclosure, and as shown in fig. 2, an execution subject of the method may be a controller in a CAN bus system, where the CAN bus system includes the controller and one or more control subunits connected to the controller, and the method includes:
s201, sending a first pulse to the terminal control subunit according to a preset frequency.
The terminal control subunit is a control subunit farthest from the controller in one or more control subunits. May be determined by the number of control subunits.
The first pulse may be a rectangular pulse of a preset frequency, which may be any frequency between 1HZ and 1000HZ, and for example, the preset frequency may be 4 HZ.
And S202, receiving a second pulse sent by the terminal control subunit in response to the first pulse.
It should be noted that, after receiving the first pulse, the end control subunit may reply the corresponding second pulse to the controller. The second pulse may be a rectangular pulse having the same preset frequency as the first pulse.
And S203, acquiring the time difference of the first pulse and the second pulse.
In this step, the transmission time of the first pulse and the reception time of the second pulse may be recorded, and the difference between the reception time and the transmission time may be regarded as the time difference.
And S204, setting the actual baud rate of the CAN bus according to the time difference.
It should be noted that the time difference may represent the distance between the end control subunit and the CAN bus of the controller. The larger the distance between the end control subunit and the CAN bus of the controller is, the larger the time difference is, and the smaller the corresponding actual baud rate CAN be set.
In this step, the baud rate corresponding to the time difference may be obtained as the actual baud rate according to a preset time difference baud rate correspondence relationship, which is a preset time difference and baud rate correspondence relationship. The method comprises the following steps: the time difference of 20us may correspond to a baud rate of 55 kbps; a time difference of 10us may correspond to a baud rate of 90 kbps.
By adopting the method, the controller sends a first pulse to the tail end control subunit according to a preset frequency, and receives a second pulse sent by the tail end control subunit in response to the first pulse; acquiring the time difference between the first pulse and the second pulse; and the actual baud rate of the CAN bus is set according to the time difference, so that accurate and efficient CAN bus baud rate self-configuration is realized.
In some other embodiments of the present disclosure, the actual baud rate of the CAN bus may be set according to the time difference in the following manner:
firstly, the baseline baud rate of the CAN bus is calculated according to the time difference.
Wherein, the calculation formula may be: the baseline baud rate is 1/time difference. Illustratively, the time difference is 5us, then a baseline baud rate of 200kbps can be obtained according to this equation.
Secondly, from the preset candidate baud rates, the baud rate with the minimum absolute value of the difference value with the baseline baud rate is used as the actual baud rate.
In this step, the candidate baud rate may be one or more baud rates that CAN achieve reliable communication after the CAN bus is tested and verified, and the candidate baud rate may be preset in the controller of the CAN bus. For example, the candidate baud rates may include 50kpbs, 100kpbs, 125kpbs, 200kpbs, 500kpbs, and 1000 kpbs; when the time difference is 7us, the calculated baseline baud rate is 143kpbs, and the baud rate 125kpbs with the smallest absolute value of the difference value selected from the candidate baud rates can be used as the actual baud rate.
Thus, the actual baud rate selected from the candidate baud rates in this manner enables reliable communication of the CAN bus.
Optionally, in this step, the baud rate that is the smallest in absolute value of the difference from the baseline baud rate and smaller than the baseline baud rate may also be selected from the preset candidate baud rates as the actual baud rate. Therefore, the problem of unreliable communication caused by selecting a larger baud rate CAN be avoided, and the reliability of CAN bus communication is further improved.
Further, after setting the actual baud rate of the CAN bus according to the time difference, the method further comprises: and sending data to one or more control subunits according to the actual baud rate. Thus, normal data communication of the CAN bus is realized.
It should be noted that the above-mentioned method for self-configuring the baud rate of the CAN bus may be completed in a process of power-on initialization of the controller and the control subunit of the CAN bus, or may be performed after the controller detects a communication fault with the end control subunit, and therefore, in some other embodiments of the present disclosure, the method may further include:
first, it is detected whether the communication with the end control subunit is faulty.
In this step, the controller may wait for a response signal of the end control subunit to the data after sending the data to the end field, and if the response signal is not received within a second preset time, confirm a communication failure with the end control subunit; otherwise, if the response signal is normally received within the second preset time, the communication with the terminal control subunit is confirmed to be normal.
Secondly, under the condition that the communication of the terminal control subunit is normal, the communication can be continued according to the current baud rate. The steps of the above described CAN bus baud rate self-configuration method may be performed in case of a communication failure with the end control subunit.
Therefore, under the condition that CAN bus communication is abnormal, the controller CAN actively detect and carry out baud rate self-adaptive reconfiguration, so that normal CAN bus communication CAN be recovered.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that the various features described in the above embodiments may be combined in any suitable manner without departing from the scope of the invention. In order to avoid unnecessary repetition, various possible combinations will not be separately described in this disclosure.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (10)

1. A CAN bus baud rate self-configuration method is applied to a controller of a CAN bus system, the CAN bus system comprises the controller and a plurality of control subunits connected with the controller, and the method comprises the following steps:
sending a first pulse to a tail end control subunit according to a preset frequency, wherein the tail end control subunit is the control subunit which is farthest from the controller in the plurality of control subunits;
receiving a second pulse transmitted by the end control subunit in response to the first pulse;
acquiring a time difference between the first pulse and the second pulse;
setting the actual baud rate of the CAN bus according to the time difference;
wherein, the setting the actual baud rate of the CAN bus according to the time difference comprises:
and acquiring the baud rate corresponding to the time difference according to a preset time difference baud rate corresponding relation as an actual baud rate, wherein the time difference baud rate corresponding relation is the preset time difference and baud rate corresponding relation.
2. The method of claim 1, wherein setting an actual baud rate of a CAN bus based on the time difference comprises:
calculating to obtain a baseline baud rate of the CAN bus according to the time difference;
and taking the baud rate with the minimum absolute value of the difference value with the baseline baud rate as the actual baud rate from the preset candidate baud rates.
3. The method of claim 1, wherein prior to said transmitting a first pulse to the end control subunit at a preset frequency, the method further comprises:
detecting whether communication with the terminal control subunit is faulty;
the sending of the first pulse to the end control subunit according to the preset frequency includes:
in case of a communication failure with the end control subunit, a first pulse is sent to the end control subunit at a preset frequency.
4. The method according to any of claims 1 to 3, wherein after said setting an actual baud rate of a CAN bus according to said time difference, the method further comprises:
and sending data to the plurality of control subunits according to the actual baud rate.
5. A CAN bus baud rate self-configuration system is characterized in that the system comprises a controller and a plurality of control subunits connected with the controller, wherein:
the controller is used for sending a first pulse to the tail end control subunit according to a preset frequency; receiving a second pulse transmitted by the end control subunit in response to the first pulse; acquiring a time difference between the first pulse and the second pulse; acquiring a baud rate corresponding to the time difference according to a preset time difference baud rate corresponding relation as an actual baud rate, wherein the time difference baud rate corresponding relation is the preset time difference and baud rate corresponding relation; the tail end control subunit is a control subunit which is farthest away from the controller in the plurality of control subunits;
and the tail end control subunit is used for receiving the first pulse sent by the controller and sending a second pulse to the controller according to the first pulse.
6. The system of claim 5, wherein the controller is specifically configured to:
calculating to obtain a baseline baud rate of the CAN bus according to the time difference;
and taking the baud rate with the minimum absolute value of the difference value with the baseline baud rate as the actual baud rate from the preset candidate baud rates.
7. The system of claim 5, wherein the controller is further configured to:
detecting whether communication with the terminal control subunit is faulty;
in case of a communication failure with the end control subunit, the step of sending a first pulse to the end control subunit at a preset frequency is performed.
8. The system of any of claims 5 to 7, wherein the controller is further configured to:
and after the actual baud rate of the CAN bus is set according to the time difference, sending data to the plurality of control subunits according to the actual baud rate.
9. The system of claim 8, wherein the control subunit is configured to:
receiving data sent by the controller;
acquiring a minimum time interval according to the time of receiving the data;
and setting the actual baud rate of the control subunit according to the minimum time interval.
10. The system according to claim 9, wherein the control subunit is specifically configured to:
calculating to obtain a baseline baud rate of the control subunit according to the minimum time interval;
and taking the baud rate with the minimum absolute value of the difference value with the baseline baud rate of the control subunit as the actual baud rate of the control subunit from preset candidate baud rates.
CN202011529341.XA 2020-12-22 2020-12-22 CAN bus baud rate self-configuration method and system Active CN112702145B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011529341.XA CN112702145B (en) 2020-12-22 2020-12-22 CAN bus baud rate self-configuration method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011529341.XA CN112702145B (en) 2020-12-22 2020-12-22 CAN bus baud rate self-configuration method and system

Publications (2)

Publication Number Publication Date
CN112702145A CN112702145A (en) 2021-04-23
CN112702145B true CN112702145B (en) 2022-02-15

Family

ID=75510495

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011529341.XA Active CN112702145B (en) 2020-12-22 2020-12-22 CAN bus baud rate self-configuration method and system

Country Status (1)

Country Link
CN (1) CN112702145B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102201960A (en) * 2011-04-28 2011-09-28 华南理工大学 Baud rate adaptive method based on sequencing pulse width differential
CN202502152U (en) * 2012-03-13 2012-10-24 深圳市航天泰瑞捷电子有限公司 Electric energy meter
CN103559164A (en) * 2013-11-05 2014-02-05 深圳市科曼医疗设备有限公司 Method and device for identifying serial port baud rate
CN103970698A (en) * 2014-02-28 2014-08-06 北京经纬恒润科技有限公司 Serial communication baud rate identification method and device, microcontroller and system
CN104199298A (en) * 2014-08-18 2014-12-10 广西师范大学 Controller area network (CAN) bus Baud rate self-adapting method
CN106788907A (en) * 2017-03-24 2017-05-31 湖南浩奇通讯技术有限公司 Master-salve station communication baud rate Auto-matching
CN106941399A (en) * 2017-03-15 2017-07-11 广州致远电子股份有限公司 A kind of dual rate CAN FD baud rate measuring method and device
CN109471425A (en) * 2018-12-14 2019-03-15 上海星融汽车科技有限公司 A method of commercial vehicle OBD mouthfuls of CAN communication stitch baud rate of identification
CN110688338A (en) * 2019-09-12 2020-01-14 深圳市航顺芯片技术研发有限公司 Baud rate generation method, terminal and storage medium
CN111211869A (en) * 2020-01-02 2020-05-29 深圳震有科技股份有限公司 Method for automatically adapting baud rate, intelligent terminal and storage medium
CN111431783A (en) * 2020-04-02 2020-07-17 希尔塔(苏州)信息技术有限公司 CAN bus baud rate self-adaption method

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5495358A (en) * 1992-11-23 1996-02-27 Hewlett-Packard Company Optical transceiver with improved range and data communication rate
US6263033B1 (en) * 1998-03-09 2001-07-17 Advanced Micro Devices, Inc. Baud rate granularity in single clock microcontrollers for serial port transmissions
CN104009856A (en) * 2013-02-22 2014-08-27 西门子公司 Device and method for determining position of fault in fieldbus network
US9698939B2 (en) * 2013-06-13 2017-07-04 Ciena Corporation Variable spectral efficiency optical modulation schemes
CN105262490B (en) * 2015-09-18 2018-10-12 重庆川仪自动化股份有限公司 Based on Manchester Code/decode Adaptable System and its method
CN108490888B (en) * 2018-01-19 2020-06-30 北京神州龙芯集成电路设计有限公司 Detection control system and method based on Internet of things
CN111314019A (en) * 2020-01-19 2020-06-19 浙江恒强科技股份有限公司 Method for improving baud rate of parallel bus

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102201960A (en) * 2011-04-28 2011-09-28 华南理工大学 Baud rate adaptive method based on sequencing pulse width differential
CN202502152U (en) * 2012-03-13 2012-10-24 深圳市航天泰瑞捷电子有限公司 Electric energy meter
CN103559164A (en) * 2013-11-05 2014-02-05 深圳市科曼医疗设备有限公司 Method and device for identifying serial port baud rate
CN103970698A (en) * 2014-02-28 2014-08-06 北京经纬恒润科技有限公司 Serial communication baud rate identification method and device, microcontroller and system
CN104199298A (en) * 2014-08-18 2014-12-10 广西师范大学 Controller area network (CAN) bus Baud rate self-adapting method
CN106941399A (en) * 2017-03-15 2017-07-11 广州致远电子股份有限公司 A kind of dual rate CAN FD baud rate measuring method and device
CN106788907A (en) * 2017-03-24 2017-05-31 湖南浩奇通讯技术有限公司 Master-salve station communication baud rate Auto-matching
CN109471425A (en) * 2018-12-14 2019-03-15 上海星融汽车科技有限公司 A method of commercial vehicle OBD mouthfuls of CAN communication stitch baud rate of identification
CN110688338A (en) * 2019-09-12 2020-01-14 深圳市航顺芯片技术研发有限公司 Baud rate generation method, terminal and storage medium
CN111211869A (en) * 2020-01-02 2020-05-29 深圳震有科技股份有限公司 Method for automatically adapting baud rate, intelligent terminal and storage medium
CN111431783A (en) * 2020-04-02 2020-07-17 希尔塔(苏州)信息技术有限公司 CAN bus baud rate self-adaption method

Also Published As

Publication number Publication date
CN112702145A (en) 2021-04-23

Similar Documents

Publication Publication Date Title
US9568533B2 (en) Method and apparatus for open-wire fault detection and diagnosis in a controller area network
CN112764410B (en) Vehicle-mounted controller testing device, system and method
CN107959599B (en) Bus_off fault test system and test method
US11095475B2 (en) Communication failure detection device
US10611244B2 (en) Method for processing throttle control signal, electronic speed regulator, controller, and mobile platform
CN112165438A (en) Vehicle communication method and communication system
JP5867605B2 (en) Failure diagnosis system, failure diagnosis apparatus and failure diagnosis method
CN115441889A (en) Transceiver device
CN112702145B (en) CAN bus baud rate self-configuration method and system
CN105874816B (en) Method for starting batteries management system
CN113282070A (en) Bus port fault judgment method and system
CN110008165B (en) NTB link management method, system and related device
JP4968169B2 (en) Communication system and communication method
CN207652457U (en) A kind of Bus_Off fault test systems
CN116149301A (en) Fault diagnosis device and method and vehicle
US20240013648A1 (en) Ground short failure detection device and node device
CN212811725U (en) Vehicle bus problem point detection equipment
CN108650101B (en) Data transmission method and equipment
JP6617091B2 (en) Electronic control unit for automobile
KR101745199B1 (en) Failure detection method of sensor
CN109067567A (en) A kind of network communication method for diagnosing interruption
CN111141966A (en) Method for detecting hardware fault through single communication line and hardware module
CN110471399A (en) Vehicular diagnostic method, device, system and vehicle based on ECU
KR102085731B1 (en) Interconnection Evaluation System for Switchboard
US12113647B2 (en) Controller area network apparatus with reconfiguration signalling

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100040 Room 203, building 5, 13 Fuqian 1st Street, Tianzhu District, Shunyi District, Beijing

Applicant after: Beijing Urban Construction Intelligent Control Technology Co.,Ltd.

Address before: 100040 Room 203, building 5, 13 Fuqian 1st Street, Tianzhu District, Shunyi District, Beijing

Applicant before: BEIJING URBAN CONSTRUCTION INTELLIGENT CONTROL TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant