Specification
Claims:1. A system (100) for detecting controller area network (CAN) bus communication faults, comprising:
a CAN interface (104) configured to read data from the CAN bus;
a voltage measuring circuit (106) configured to measure voltage values at CANH and CANL wires, on at least one error being detected;
a resistance measuring circuit (108) configured to measure a resistance value between a CANH and CANL wires of the CAN bus in bus-off state, on at least one error being detected; and
a controller (102) configured to
detect an error frame from the read data collected from the CAN interface (104);
decode the at least one error from the error frame based on at least one pre-defined logic;
identify at least one fault by comparing the measured voltage values and the measured resistance value with a pre-defined voltage values and a pre-defined resistance value respectively for the at least one detected error.
2. The system (100), as claimed in claim 1, wherein the at least one error decoded from the error frame comprises at least one of a stuff error, a bit error, a form error, a CRC error, and an ACK error.
3. The system (100), as claimed in claim 1, wherein the at least one fault identified by the controller (102) comprises at least one of a CAN bus open fault, a CAN bus short fault, a voltage mismatch, and a resistance mismatch.
4. The system (100), as claimed in claim 1, wherein the voltage measuring circuit (106) comprises a first voltage measuring circuit (106a) which is connected to an ADC (118) peripheral and a second voltage measuring circuit (106b) which is connected to a GPIO (120) peripheral.
5. The system (100), as claimed in claim 4, wherein the ADC (118) and GPIO (120) peripherals are implemented with at least one software interrupt and at least one logic for faster voltage detection.
6. The system (100), as claimed in claim 1, wherein the resistance measuring circuit (108) is enabled in bus OFF state and disabled in bus ON state through a relay control (122).
7. The system (100), as claimed in claim 1, wherein the controller (102) comprises a communication interface (112), wherein the communication interface (112) is configured to communicate the at least one detected error and the at least one fault to an external device or to a cloud server either through wired or wireless communication.
8. The system (100), as claimed in claim 1, wherein the controller (102) comprises at least one display (114) which is configured to display the at least one detected error and the identified at least one fault.
9. The system (100), as claimed in claim 8, wherein the at least one display (114) comprises at least one LED indicator, and wherein the at least one LED indicator is configured to display the at least one detected error and the identified at least one fault.
10. A method (400) for detecting controller area network (CAN) bus communication faults, comprising:
reading, by a CAN interface (104), data from CAN bus;
detecting, by a controller (102), an error frame from the read data;
decoding, by the controller (102), at least one error from the error frame based on at least one pre-defined logic;
measuring, by a voltage measuring circuit (106), voltage values at CANH and CANL wires, in case the at least one error is identified;
measuring, by a resistance measuring circuit (108), a resistance value between the CANH and CANL wires in bus-off state, in case the at least one error is identified; and
identifying, by the controller (102), at least one fault by comparing the measured voltage value and the resistance value with a pre-defined voltage value and a pre-defined resistance value respectively for the at least one detected error.
11. The method (400), as claimed in claim 10, wherein the at least one error decoded from the error frame comprises at least one of a stuff error, a bit error, a form error, a CRC error, and an ACK error.
12. The method (400), as claimed in claim 10, wherein the at least one fault identified by the controller (102) comprises at least one of a CAN bus open fault, a CAN bus short fault, a voltage mismatch, and a resistance mismatch.
13. The method (400), as claimed in claim 10, wherein measuring a voltage value comprising:
connecting a first voltage measuring circuit (106a) to an ADC (118) peripheral of the controller (102); and
connecting a second voltage measuring circuit (106b) to a GPIO peripheral (120) of the controller (102).
14. The method (400), as claimed in claim 13, wherein implementing the ADC (118) and GPIO (120) peripherals with at least one software interrupt and at least one logic for faster voltage detection.
15. The method (400), as claimed in claim 10, wherein enabling the resistance measuring circuit (108) in bus OFF state and disabling in bus ON state through a relay control (122).
16. The method (400), as claimed in claim 10, wherein communicating the at least one detected error and the at least one fault to an external device or to a cloud server either through wired or wireless communication, by using a communication interface (112) which is connected to the controller (102).
17. The method (400), as claimed in claim 10, wherein displaying the at least one detected error and the identified at least one fault, by using at least one display (114) which is connected to the controller (102).
18. The method (400), as claimed in claim 17, wherein displaying the at least one detected error and the identified at least one fault, using at least one LED indicator of the at least one display (114).
, Description:TECHNICAL FIELD
[001] Embodiments disclosed herein relate to error detection systems for CAN communication in vehicles, and more particularly to an automated effective system for detecting and reporting exact faults in CAN communication.
BACKGROUND
[002] Typically, vehicles comprise of multiple electronic control units (ECUs). The ECUs need to communicate each other for better management and reporting the faults. A master ECU communicates and controls each ECU based on one or more vehicle parameters. The communication between the ECUs can be carried out over a Controller Area Network (CAN).
[003] In certain scenarios, the messages may not be transmitted or received due to a controller failure or a disconnection or short circuit of the communication line, open circuit of communication line, resistance mismatch, voltage mismatch, software errors including CRC mismatch and acknowledgement error. Such a failure is collectively referred to as a CAN communication error. Examples of the CAN communication errors can be, but not limited to, bit error, stuff error, CRC Error etc.
[004] In case of a CAN communication error, manual intervention may be required to decode the errors through assumptions and several checks may be performed to find the root cause for each error. In some of the existing technologies, software modules can be used to find the errors. However, they may be unable to detect the exact root cause of error as the CAN bus error occurs mostly due to hardware or environmental conditions.
[005] Other existing technologies utilize passive debugging (like connecting oscilloscopes and multi-meters) to detect the exact root cause of error, but that takes more time and efforts. Some other technologies utilize a method to detect separate faults like open circuit, but the method does not detect errors detected in microcontroller and may detect false errors.
[006] Other technologies use software to detect errors and make assumptions based on several combinations of errors, and are costly and less flexible. But these technologies do not work if there is a complete communication outage. Hence, exact root cause cannot be detectable by the software (such as whether the error is due to voltage or resistance changes).
OBJECTS
[007] The principal object of embodiments herein is to disclose systems and methods using both hardware and software intelligence for detecting CAN communication error(s) and detecting one or more root causes of the CAN communication error(s).
[008] Another object of embodiments herein is to disclose automated systems and methods to detect and report the CAN communication faults without any manual intervention.
[009] Another object of embodiments herein is to disclose systems and methods for detecting CAN communication faults during a complete communication outage.
[0010] Another object of embodiments herein is to disclose systems and methods for detecting CAN communication faults that can be installed inside any existing unit within the vehicle or can be connected as an external device.
[0011] These and other aspects of the embodiments herein will be better appreciated and understood when considered in conjunction with the following description and the accompanying drawings. It should be understood, however, that the following descriptions, while indicating at least one embodiment and numerous specific details thereof, are given by way of illustration and not of limitation. Many changes and modifications may be made within the scope of the embodiments herein without departing from the spirit thereof, and the embodiments herein include all such modifications.
BRIEF DESCRIPTION OF FIGURES
[0012] Embodiments herein are illustrated in the accompanying drawings, through out which like reference letters indicate corresponding parts in the various figures. The embodiments herein will be better understood from the following description with reference to the drawings, in which:
[0013] FIG. 1A depicts a system for detecting CAN communication faults in vehicles, according to embodiments as disclosed herein;
[0014] FIG. 1B depicts an example system with components connected to the peripherals of the controller, according to embodiments as disclosed herein;
[0015] FIG. 2 depicts a voltage measuring circuit which is connected to the controller, according to embodiments as disclosed herein;
[0016] FIG. 3 depicts a resistance measuring circuit which is connected to the controller, according to embodiments as disclosed herein;
[0017] FIG. 4 depicts a method for detecting CAN communication faults in vehicles using the controller, according to embodiments as disclosed herein;
[0018] FIG. 5 represents a state machine for detecting CAN communication faults, according to embodiments as disclosed herein;
[0019] FIG. 6 depicts an example flow chart of process for detecting CAN communication faults, according to embodiments as disclosed herein;
[0020] FIG. 7 depicts an example of voltage levels on CAN transmission, according to embodiments as disclosed herein; and
[0021] FIG. 8 depicts a calibration flow chart of the circuits used in the system, according to embodiments as disclosed herein.
DETAILED DESCRIPTION
[0022] The embodiments herein and the various features and advantageous details thereof are explained more fully with reference to the non-limiting embodiments that are illustrated in the accompanying drawings and detailed in the following description. Descriptions of well-known components and processing techniques are omitted so as to not unnecessarily obscure the embodiments herein. The examples used herein are intended merely to facilitate an understanding of ways in which the embodiments herein may be practiced and to further enable those of skill in the art to practice the embodiments herein. Accordingly, the examples should not be construed as limiting the scope of the embodiments herein.
[0023] The embodiments herein achieve an effective solution for detecting CAN communication errors and detecting one or more root causes of the CAN communication errors by using combination of hardware and software hardware and software intelligence. Referring now to the drawings, and more particularly to FIGS. 1 through 8, where similar reference characters denote corresponding features consistently throughout the figures, there are shown embodiments.
[0024] The present disclosure relates to communication networks where various modules/components present in the vehicle, (such as electronic control units (ECUs)) communicate with each other using a Controller Area Network (CAN) protocol over a CAN bus. Embodiments herein disclose systems and methods which can detect errors occurring in the CAN bus, pinpoint the exact fault of the error caused in the CAN communication hardware layer and report the faults to one or more external devices.
[0025] FIG. 1A depicts a system 100 for detecting CAN communication faults in vehicles. The system 100 comprises a controller 102 which is configured to identify at least one fault due to voltage and resistance mismatch in a CAN bus. The controller 102 can further report the identified fault(s) to one or more external devices or to a cloud server.
[0026] In an embodiment, the controller 102 is connected with various components to detect and report the faults. In an embodiment herein, the controller 102 can be a microcontroller. The components comprise a CAN interface 104, a first voltage measuring circuit 106a, a second voltage measuring circuit 106b, a resistance measuring circuit 108, a communication interface 112, and a display 114. The components can be connected to the peripherals of the controller 102.
[0027] The ECUs transmit and receive messages across a CAN via the CAN bus. The CAN message has a predetermined format and can be corrupted with errors. The errors may comprise at least one of a stuff error, a bit error, a form error, a CRC error, and an ACK error. The CAN interface 104 can be configured to read data from the CAN bus.
[0028] The controller 102 can be configured to collect the read data from the CAN interface 104 and detect error frame(s) (if any) present in a data stream present on the CAN bus. The error frames are identified from continuous 0 bits from the data stream. At least one error can be further decoded from the error frame based on one or more pre-defined logics. In an embodiment, the pre-defined logics are configured in the controller 102 for each error check.
[0029] In an example, consider that a stuff error check has been detected. The CAN protocol specifies that the sender must transmit a complementary bit after five homogeneous bits for synchronization purposes. There exists a stuffing error if more than five homogeneous contiguous bits are received by the controller 102. The stuff error is generally caused by mismatch in resistance.
[0030] In an example, consider that a bit error check has been detected. A bit error exists if the sender detects a discrepancy between the two levels such as dominant and recessive levels. The bit error levels comprise 0 and 1.
[0031] In an example, consider that a form error check has been detected. A form error exists if a receiver detects a dominant bus level at a fixed format component of the CAN bus.
[0032] In an example, for a Cyclic Redundancy Check (CRC), a polynomial R(x) associated with data being received should equal a multiple of the generator polynomial G(x). The R(x) and the G(x) are the representative terms.
[0033] In an example, for an Ack error check, an acknowledgement mechanism defined in the CAN protocol specifies that all receivers must acknowledge every arriving CAN message after performing the CRC successfully. If the CRC has not been performed successfully or even one positive acknowledgement does not arrive at the sender, then it may be considered that an acknowledgement error has occurred.
[0034] In an embodiment, the first voltage measuring circuit 106a and the second voltage measuring circuit 106b both are configured to measure a voltage value at CANH and CANL wires.
[0035] In an embodiment, the resistance measuring circuit 108 is configured to measure a resistance value between the CANH and CANL wires. The resistance measuring circuit 108 can measure the resistance in a bus-off state.
[0036] In an embodiment, the controller 102 can be configured to compare the measured voltage values and the resistance value with threshold voltage and resistance values respectively. If there is a mismatch between the measured voltage values and the resistance value with the respective threshold voltage and resistance values, the controller 102 can determine the presence of at least one fault. Examples of the determined fault may be, but not limited to, a CAN bus open fault, a CAN bus short fault, a voltage mismatch, a resistance mismatch, and so on. The controller 102 can be configured to detect all the errors and measure the voltage and resistance values at CANH and CANL wires to detect the exact fault.
[0037] In an embodiment, the communication interface 112 can communicate the error and information related to the error to an external device or to a cloud server either through wired or wireless communication.
[0038] In an embodiment herein, the communication interface can communicate the error and information related to the error to the display 114, wherein the display 114 can be present in at least one of the instrument cluster of the vehicle, a dashboard of the vehicle, and so on.
[0039] In an example herein, the display 114 may comprise a plurality of LED indicators, where the LED indicator can display the at least one detected error and the identified at least one fault, using a pre-defined sequence of one or more indicators.
[0040] FIG. 1B depicts an example system 100 with components connected to the peripherals of the controller 102. Examples of the peripherals may comprise a serial peripheral interface (SPI) 116, an analog-to-digital converter (ADC) 118, and a general-purpose input/output (GPIO) 120.
[0041] The CAN interface 104 can be connected to the SPI 116 peripheral to collect data from the CAN bus. The SPI 116 peripheral can be used to communicate to a transceiver for detecting CAN data values. The first voltage measuring circuit 106a and the resistance measuring circuit 108 are connected to the ADC 118 peripheral, wherein the first voltage measuring circuit 106a and the resistance measuring circuit 108 can measure the voltage level and resistance at the CAN bus respectively. In an example herein, the CAN bus voltage in bus ON state may be 2.5V in logic 0 at CANH and CANL wires, and 3.5V at CANH and 1.5V at CANL in logic 1. In bus OFF state, the CAN bus voltage will be continuously at 2.5V.
[0042] The second voltage measuring circuit 106b and a relay control 122 are connected to the GPIO 120 peripheral. The GPIO 120 peripheral is configured to control the relay control 122 to enable and disable the resistance measuring circuit 108. The resistance measuring circuit 108 is disabled in bus ON state, as the CAN bus has some voltage and it is not safe to measure the resistance when the CAN bus has voltage. The resistance measuring circuit 108 is enabled only in bus OFF state through the relay control 122, such that the resistance measuring circuit 108 can measure the resistance.
[0043] In an example scenario, if the controller 102 detects that the error count is more than 255, the controller 102 moves the CAN bus to OFF state. When the CAN bus is on OFF state, the controller 102 activates the GPIO 120 peripheral and the GPIO 120 enables the resistance measuring circuit 108. The resistance measuring circuit 108 measures the resistance between CANH and CANL.
[0044] In addition, since voltages are measured to detect logic 0 and logic 1 faster than the baud rate of the communication, measuring should be carried out on interrupts. For example, if the baud rate of the communication is 125kbit/s. To capture each bit successfully, change in voltage has to be measured at a rate faster than 8us. Therefore, measuring should be carried out on interrupts. Thus, the GPIO 120 peripheral is configured to create software interrupt(s) based on voltage levels which are measured through the second voltage measuring circuit 106b. The software interrupt(s) are created on rising and falling edge messages of GPIO inside the software. The second voltage measuring circuit 106b detects the rising and falling edges.
[0045] The voltage measurement of the CAN bus is carried out through the ADC 118 and GPIO 120 peripherals. For example, in case of form error, start of frame should always be at “0” and it may become “1”, when the detection takes place. But measurement through the ADC 118 may get delayed. Therefore, software interrupts are implemented specially for form error and logics and are incorporated in both the ADC 118 and GPIO 120 peripherals to make faster detection by measuring voltages using the first voltage measuring circuit 106a and the second voltage measuring circuit 106b. The software interrupts are implemented to count number of bits and compare the bits with their fixed form. For example, CRC Delimiter (i.e. 99th bit in a STD frame) should be high. But, in case you detect 99th bit a 0, then it is an error.
[0046] FIG. 2 depicts a voltage measuring circuit 106 with logics implemented to create software interrupt to measure voltage levels using the first voltage measuring circuit 106a and the second voltage measuring circuit 106b through the ADC 118 and GPIO 120 peripheral inputs.
[0047] FIG. 3 depicts a resistance measuring circuit 108. The circuit 108 measures change in resistance between the CANH and CANL wires.
[0048] The circuit 108 comprises a voltage source V1, a switch S1, controlled by the controller 102, a series resistor R1, and a circuit to measure the current flowing through the switch S1. The switch S1 is turned off during CAN bus ON state and the circuit is isolated from the CANH and CANL lines. During the bus OFF state, the switch S1 is closed by the controller 102 and the current flowing through the series resistor R1 is measured. The current being dependent on the resistance between the CAN lines can be used by the controller 102 to determine resistance.
[0049] FIG. 4 depicts a method 400 for detecting CAN communication faults in vehicles using the controller. The method 400 begins with reading data from CAN bus, as depicted at step 402, by using the CAN interface. Subsequently, an error frame is detected from the data, and at least one error is decoded from the error frame based on one or more pre-defined logics, as depicted at step 404, by using the controller. The errors frames are differentiated from normal frame and error frame. The error frames are detected from continuous 0 bits in a data stream present on the CAN bus Later, verification is carried out at step 406, to check whether the error is identified. In case of data frame, the frame is ignored.
[0050] Thereafter, voltage values are measured at CANH and CANL wires, as depicted at step 408, in case the error is identified such as stuff error, a bit error, a form error, a CRC error, and an ACK error. The voltage values are measured by using the first voltage measuring circuit and the second voltage measuring circuits through software interrupts and logics. Therefore, the first voltage measuring circuit of ADC and the second voltage measuring circuit of the GPIO are both activated at once to measure the voltage levels. The second voltage measuring circuit of the GPIO measures the voltage limits through interrupts, whereas the first voltage measuring circuit of the ADC measures the actual voltage values.
[0051] Later, a resistance value is measured between the CANH and CANL wires in bus-off state by using the resistance measuring circuit, as depicted at step 410, in case the at least one error is identified.
[0052] Subsequently, the measured voltage values and the resistance value are compared with their threshold voltage and resistance values respectively, as depicted at step 412. Thereafter, at least one fault such as CAN bus open fault, a CAN bus short fault, a voltage mismatch, and a resistance mismatch, is identified from the compared result, as depicted at step 414, if there is a mismatch between the measured voltage values and the resistance value with the respective threshold voltage and resistance values. Later, the identified fault and corresponding error is displayed on LED indicator, as depicted at step 416, and optionally communicated to one or more external devices or to a cloud server through wired and wireless communication.
[0053] FIG. 5 represents a state machine 500 for detecting CAN communication faults. Once the system gets power supply and is in standby mode, system detects for error frame, as depicted at step 502. Thereafter, error type is detected from the error frame based on pre-defined error codes.
[0054] First, the system checks for stuff error (S_Error) at step 504. If stuff error is not detected, then system checks for form error (F_Error) at step 506. If form error is not detected, then system checks for bit error (B_Error) at step 508. If bit error is not detected, then system checks for Ack error (A_Error) at step 510. If Ack error is not detected, then system checks for CRC error (C_Error) at step 512.
[0055] Thus, first level of error is declared here. If no error is detected at the end, then error may be concluded as SW Error based on CRC and ACK.
[0056] If any of the error is detected, then the system checks for voltage mismatch (V_Error) at step 514. The voltage is checked at CANH and CANL lines at this state. The ideal voltage referred for dominant bit is, 2.5V for both CANH and CANL line. The ideal voltage referred for recessive bit is, 3.5V for CANH line and 1.5V for CANL line.
[0057] If voltage mismatch exists, then the fault is confirmed as root cause of the error at step 524. If voltage mismatch does not exists, then the system checks for resistance at step 516. The resistance is measured between CANH and CANL lines. This circuit only gets enabled in bus OFF state.
[0058] Based on the resistance values measured, the fault is further classified in 3 states. If R>1M, then the fault occurred is CAN bus open fault (O_Error), as depicted at step 518. If R<1Ohm, then the fault occurred is CAN bus short fault (Sh_Error), as depicted at step 520. If 1Ohm6, then the verification of error code is carried out at step 604. If dominant bits not greater than 6, then it is confirmed as data frame at step 606. If error code=0, then the error is confirmed as bit error, as depicted at step 608. Otherwise, verification whether the error code=1 is carried out at step 610. If error code=1, then the error is confirmed as form error, as depicted at step 612.
[0060] Otherwise, verification whether the error code=2 is carried out at step 614. If error code=2, then the error is confirmed as stuff error, as depicted at step 616. Otherwise, verification whether the error code=4 is carried out at step 618. If error code=4, then the error is confirmed as CRC error, as depicted at step 620. Otherwise, verification whether the error code=5 or 7 is carried out at step 622. If error code=5 or 7, then the error is confirmed as ACK error, as depicted at step 624.
[0061] Once the error is identified, then the voltage from ADC is checked at step 626. At step 628, verification is done to check if CANH>2.4 and CANH<2.6, or CANH >3.4 and CANH<3.6. If the verification is matched, then verification is done at step 630 to check if CANL>2.4 and CANL<2.6, or CANL >1.4 and CANL<1.6. If the verification is not matched at step 628, then it is declared as CANH voltage mismatch issue at step 632. If the verification is not matched at step 630, then it is declared as CANL voltage mismatch issue at step 634.
[0062] If the verification is matched at step 630, then waiting is carried out for bus OFF condition at step 636. If bus OFF condition is 1 as depicted at step 638, then the resistance measuring circuit is enabled at step 640. If resistance value verified at step 642 as R<1Ohm, then the fault identified as CAN bus short fault as depicted at step 644. If resistance value verified at step 646 as R>1M, then the fault identified as CAN bus open fault as depicted at step 648. If resistance value verified at step 650 as 1Ohm
Documents
Application Documents
| # |
Name |
Date |
| 1 |
202241020594-STATEMENT OF UNDERTAKING (FORM 3) [05-04-2022(online)].pdf |
2022-04-05 |
| 2 |
202241020594-REQUEST FOR EXAMINATION (FORM-18) [05-04-2022(online)].pdf |
2022-04-05 |
| 3 |
202241020594-PROOF OF RIGHT [05-04-2022(online)].pdf |
2022-04-05 |
| 4 |
202241020594-POWER OF AUTHORITY [05-04-2022(online)].pdf |
2022-04-05 |
| 5 |
202241020594-FORM 18 [05-04-2022(online)].pdf |
2022-04-05 |
| 6 |
202241020594-FORM 1 [05-04-2022(online)].pdf |
2022-04-05 |
| 7 |
202241020594-DRAWINGS [05-04-2022(online)].pdf |
2022-04-05 |
| 8 |
202241020594-DECLARATION OF INVENTORSHIP (FORM 5) [05-04-2022(online)].pdf |
2022-04-05 |
| 9 |
202241020594-COMPLETE SPECIFICATION [05-04-2022(online)].pdf |
2022-04-05 |
| 10 |
202241020594-Correspondence_Form-1_08-04-2022.pdf |
2022-04-08 |
| 11 |
202241020594-PA [06-07-2023(online)].pdf |
2023-07-06 |
| 12 |
202241020594-ASSIGNMENT DOCUMENTS [06-07-2023(online)].pdf |
2023-07-06 |
| 13 |
202241020594-8(i)-Substitution-Change Of Applicant - Form 6 [06-07-2023(online)].pdf |
2023-07-06 |