CAN communication control circuit, communication equipment and building control system
By designing the redundant configuration and switching modules of two CAN transceiver chips in the CAN communication system, the problems of low fault tolerance and lack of fault response in the existing CAN communication system are solved, and the polarity switching and fault recovery of CAN communication are realized, which improves the stability and reliability of the system.
Patent Information
- Application Number
- CN202422084517.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2034-08-26
AI Technical Summary
The existing CAN communication system has low fault tolerance during installation and lacks effective measures to deal with faults, which can easily lead to communication failures due to wiring errors or environmental interference.
A CAN communication control circuit is designed, and two CAN transceiver chips are used for redundant configurations of forward and reverse connections. The switching module and control module are used to realize the polarity switching and fault recovery of data.
The polarity switching of CAN communication is realized, the installation error tolerance is improved, and when one CAN transmitter and receive chip fails, it can temporarily recover through another chip to ensure the stability of communication.
Smart Images

Figure CN223024429U_ABST
Abstract
Description
Technical Field
[0001] The utility model relates to the technical field of CAN bus communication, and particularly relates to a CAN communication control circuit that does not need to consider polarity and can handle faults. Background Art
[0002] Building control, as an important part of intelligent buildings and automated management, covers various systems and devices for managing the internal environment, energy, security, lighting, and the operating status of other facilities in a building. Through centralized monitoring and management of these systems, the Building Automation System (BAS) can not only significantly improve the energy efficiency of the building but also enhance the living comfort and security.
[0003] In a building control system, many devices need to communicate through a network to achieve coordinated operation. The following lists some common devices in a building control system.
[0004] Heating, Ventilation, and Air Conditioning (HVAC) equipment: including central air conditioning systems, ventilation equipment, heating systems, etc. These devices monitor parameters such as temperature, humidity, and air flow in real time through sensors and controllers to maintain the comfort of the indoor environment.
[0005] Lighting control system: including indoor and outdoor lighting, achieving energy conservation and comfortable lighting by adjusting the switch, brightness, and color temperature of the lights.
[0006] Security monitoring system: including video monitoring, access control systems, fire alarm systems, etc., ensuring the safety of the building through real-time monitoring and alarm functions.
[0007] Energy management system: achieving efficient utilization of energy and energy conservation and emission reduction through monitoring and optimized management of resources such as electricity, heat energy, and water.
[0008] Elevator and escalator control systems: used to manage the operation of elevators and escalators in a building to ensure safe and efficient vertical transportation.
[0009] During the communication process of these devices, CAN (Controller Area Network) communication is a common and widely used communication method, especially important in large buildings and complex environments.
[0010] The physical layer of CAN communication uses differential signals, which means there are two signal lines on the communication line: CAN_H and CAN_L. The transmission of signals is achieved through the voltage difference between these two lines. Usually, when the voltage of CAN_H increases, the voltage of CAN_L decreases, and vice versa. This differential signal design enables CAN communication to have strong anti-interference ability and can maintain stable signal transmission even in a noisy environment. Therefore, CAN communication has obvious advantages in building control systems that require high reliability and real-time performance.
[0011] However, when data is exchanged through CAN communication, since the physical layer signal of its communication mechanism is a differential signal, in the entire communication network, CAN communication must ensure that the directions of CAN_H and CAN_L signals are the same to achieve normal communication. Therefore, the fault tolerance rate is extremely low during the actual construction process.
[0012] Although CAN communication is relatively stable due to its own characteristics, in building control systems, due to the complex engineering environment, it may be affected by leakage or transient voltage of high-power electrical equipment and lines during use, often burning out chips and causing communication failures.
[0013] Therefore, how to provide a CAN communication control circuit with a high fault tolerance rate during installation and capable of coping with faults is a technical problem to be solved. Utility Model Content
[0014] The present utility model aims to solve the technical problems in the prior art that the installation fault tolerance rate of CAN communication is low and there are no measures to cope with faults, and proposes a CAN communication control circuit, a communication device, and a building control system.
[0015] The CAN communication control circuit proposed by the present utility model includes:
[0016] A transceiver module, including a first CAN transceiver chip connected to the positive of the CAN communication bus and a second CAN transceiver chip connected to the negative of the CAN communication bus;
[0017] A switching module, which controls the first or second CAN transceiver chip to transmit and receive data through the CAN communication bus according to a control signal;
[0018] A control module, which issues corresponding control signals, preferentially selects the first CAN transceiver chip to send data, and when the first CAN transceiver chip fails, inverts the data to be sent, and then issues corresponding control signals to select the second CAN transceiver chip to send data.
[0019] Further, when the first CAN transceiver chip fails, the control module performs a logical exclusive OR operation on the mask of all 1s and the data to be sent or received through an exclusive OR calculator to invert the data to be sent or received;
[0020] The number of bits of the mask is the same as the number of bits of the corresponding data to be transmitted or received.
[0021] Furthermore, the switching module includes a first data selector and a second data selector;
[0022] Two input terminals of the first data selector are respectively connected to the receiving ports of the first and second CAN transceiver chips, the output terminal is connected to the signal line CAN_TX, and the S terminal of the first data selector receives the control signal;
[0023] The input terminal of the second data selector is connected to the signal line CAN_RX, two output terminals are respectively connected to the transmitting ports of the first and second CAN transceiver chips, and the S terminal of the second data selector receives the control signal.
[0024] Furthermore, the switching module further includes: a first shutdown unit connected to the first CAN transceiver chip, and a second shutdown unit connected to the second CAN transceiver chip.
[0025] Furthermore, the first shutdown unit and / or the second shutdown unit adopt an optocoupler, and the optocoupler receives the control signal and outputs a power control signal for the first CAN transceiver chip or the second CAN transceiver chip.
[0026] Furthermore, the control signal is a high level or a low level.
[0027] Furthermore, the control module initially sets the control signal to a high level or a low level. If the received check code is inconsistent with the preset code, the control module switches the control signal to the opposite level.
[0028] The communication device of the present invention includes the CAN communication control circuit described in the above technical solution.
[0029] The building control system of the present invention includes a plurality of communication devices described in the above technical solution.
[0030] By providing two CAN transceiver chips with one being connected in the correct polarity and the other in the reverse polarity, the present invention enables technicians to connect the wires arbitrarily, realizes the polarity switching of CAN communication. At the same time, the present invention can also use another CAN transceiver chip to restore communication after one CAN transceiver chip is damaged. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The present invention will be described in detail below in conjunction with embodiments and drawings, wherein:
[0032] Figure 1 is the overall block diagram of the present invention.
[0033] Figure 2 It is one of the circuit diagrams of an embodiment of the present utility model.
[0034] Figure 3 It is one of the partial circuit diagrams of the switching module of an embodiment of the present utility model.
[0035] Figure 4 It is the second partial circuit diagram of the switching module of an embodiment of the present utility model.
[0036] Figure 5 It is the control flow chart of the present utility model. Specific embodiments
[0037] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present utility model clearer, the present utility model will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present utility model and are not used to limit the present utility model.
[0038] Therefore, a feature pointed out in this specification will be used to illustrate one of the features of one embodiment of the present utility model, rather than implying that each embodiment of the present utility model must have the illustrated feature. In addition, it should be noted that this specification describes many features. Although some features can be combined together to show a possible system design, these features can also be used in other combinations not explicitly described. Therefore, unless otherwise stated, the illustrated combination is not intended to be limiting.
[0039] In a building control system, CAN communication is usually used to connect multiple controllers and sensors. For example, each subsystem in a heating, ventilation and air conditioning (HVAC) system, such as a temperature controller, a fan controller, a cooling tower, etc., is interconnected through a CAN bus to share data and instructions in real time. This networked communication method enables each device to work in coordination to ensure that the internal environment of the building is always in an optimal state.
[0040] In addition, in the lighting control system of a building, CAN communication is also widely used. Through the CAN bus, the lighting controllers in the building can receive instructions from the central control system in real time and perform operations such as switching on / off and dimming. Cameras, sensors and alarm devices in the security system can also be interconnected through the CAN network to form a highly integrated security monitoring system.
[0041] However, building control systems are usually deployed in complex building environments, with relatively high construction difficulty and long wiring. During the construction process, wiring errors are likely to occur, leading to system failures. Additionally, although CAN communication has strong anti-interference capabilities, in actual applications, factors such as high-power electrical equipment, leakage, and transient voltages in the building environment may interfere with the CAN bus, and even cause chip damage, resulting in system paralysis. The CAN communication control circuit of the present utility model provides a good solution.
[0042] As Figure 1 shown, the CAN communication control circuit of the present utility model includes: a transceiver module, a switching module, and a control module.
[0043] The transceiver module is provided with two CAN transceiver chips. In the present utility model, the CAN transceiver chip connected to the CAN communication bus in the positive direction is referred to as the first CAN transceiver chip, and the CAN transceiver chip connected to the CAN communication bus in the reverse direction is referred to as the second CAN transceiver chip. By using two CAN transceiver chips connected in the positive and reverse directions, users do not need to care about the wiring direction during the wiring process, and can handle any wiring direction. Moreover, by setting redundant CAN transceiver chips, when one CAN transceiver chip fails, the other CAN transceiver chip can handle the normal transceiver work during the failure.
[0044] The switching module is used to switch, through a circuit, whether to use the first CAN transceiver chip or the second CAN transceiver chip for transceiver. Specifically, the switching module controls the first or second CAN transceiver chip to send and receive data through the CAN communication bus according to a control signal.
[0045] The control module issues a corresponding control signal. This control signal can be used to control the switching module to switch the transceiver channel to the corresponding CAN transceiver chip. Since the CAN transceiver chip connected in the positive direction is the first CAN transceiver chip, the control signal issued by the control module preferentially selects the first CAN transceiver chip to send data, and when the first CAN transceiver chip fails, the data to be sent is inverted, and then a corresponding control signal is issued to select the second CAN transceiver chip to send data.
[0046] Due to the present utility model having two redundant CAN transceiver chips, two CAN transceiver chips can be arranged in a positive and negative manner in the CAN communication control circuit, enabling the CAN communication control circuit to communicate normally regardless of how it is connected to the signal lines CAN_H and CAN_L. Moreover, when the first CAN transceiver chip connected in the positive direction is damaged, the second CAN transceiver chip can be used for a temporary transceiver work.
[0047] In one embodiment, when the first CAN transceiver chip in the forward connection fails, the control module needs to use the second CAN transceiver chip to perform temporary transceiver operations. However, the second CAN transceiver chip is in the reverse connection state, so the received data needs to be converted. The control module sends a mask consisting entirely of 1s and the data to be transmitted or received into an exclusive OR calculator for logical exclusive OR operation to invert the data to be transmitted or received, and then obtains the correct data, and then performs transmission and reception. Here, the transmission and reception refer to the control module, that is, the data to be transmitted and received by the control module. Through the conversion of the control module, when the first CAN transceiver chip in the forward connection fails, the second CAN transceiver chip can be temporarily used for replacement work. It should be noted that the number of bits of the mask is the same as that of the corresponding data to be transmitted or received.
[0048] In one embodiment, the switching module includes a first data selector and a second data selector.
[0049] The two input terminals of the first data selector are respectively connected to the receiving ports of the first CAN transceiver chip and the second CAN transceiver chip. The output terminal of the first data selector is connected to the signal line CAN_TX. The signal line CAN_TX is connected to the control module. The S terminal of the first data selector receives the control signal sent by the control module.
[0050] The input terminal of the second data selector is connected to the signal line CAN_RX. The signal line CAN_RX is connected to the control module. The two output terminals of the second data selector are respectively connected to the sending ports of the first and second CAN transceiver chips. The S terminal of the second data selector receives the control signal sent by the control module.
[0051] In this embodiment, the transceiver channels are switched by two data selectors, and the structure is simpler. In addition to the circuit structure shown in this embodiment, those skilled in the art can also use other switching circuits to select the first CAN transceiver chip or the second CAN transceiver chip. For example, a method using a level inverter and two switching control tubes is used to receive the control signal and switch between the first CAN transceiver chip and the second CAN transceiver chip. The implementation of the specific switching circuit is not limited to the two specific circuit examples listed in the present invention, and it is also feasible to use other existing switching circuits.
[0052] Based on the above embodiment, in one embodiment, the switching module further includes a first shutdown unit and a second shutdown unit.
[0053] The first cut-off unit is connected to the first CAN transceiver chip, and the second cut-off unit is connected to the second CAN transceiver chip. The first CAN transceiver chip and the second CAN transceiver chip are controlled to be turned on or off through the first cut-off unit and the second cut-off unit, so as to prevent unnecessary data from being generated when the first CAN transceiver chip or the second CAN transceiver chip is not in normal use, thus reducing the processing burden on the control module.
[0054] The first cut-off unit and / or the second cut-off unit adopt optocouplers. That is to say, there are three embodiments. The first one is that the first cut-off unit adopts an optocoupler, while the second cut-off unit adopts other devices, such as switching tubes and other circuits. The second one is that the second cut-off unit adopts an optocoupler, while the first cut-off unit adopts switching tubes and other circuits. The third one is that both the first cut-off unit and the second cut-off unit adopt optocouplers. The corresponding optocoupler receives the control signal and outputs the power control signal for the first CAN transceiver chip or the second CAN transceiver chip, so that when the first CAN transceiver chip is not in normal use, unnecessary data will not be generated, thus reducing the processing burden on the control module.
[0055] In one embodiment, the control signal is a high level or a low level. For example, when the control signal is a high level, the transceiver channel where the first CAN transceiver chip is located can be triggered to be connected. When the control signal is a low level, the transceiver channel where the second CAN transceiver chip is located can be triggered to be connected. In another specific application example, it can also be that when the control signal is a low level, the transceiver channel where the first CAN transceiver chip is located is triggered to be connected, and when the control signal is a high level, the transceiver channel where the second CAN transceiver chip is located is triggered to be connected. This control signal is relatively simple, and all control chips corresponding to the control module can generate it, so it has strong applicability.
[0056] In one embodiment, since the control module initially sets the control signal to a high level or a low level, if the received check code is inconsistent with the preset code, the control module will switch the control signal to the opposite level. Since the wiring layout in the building control system is usually hidden, it is difficult to distinguish the polarity of the CAN signal lines during later wiring. With the solution of the present utility model, although the polarity of the CAN signal lines can be ignored, when the CAN communication control circuit works for the first time, it is impossible to know in advance whether its polarity is reversed. Therefore, the control module can judge whether it is consistent with the preset code through the check code. If it is consistent, it means that the polarity is not reversed, and the control module can determine which control signal corresponds to which transceiver channel to be connected. If the polarity is inconsistent, the control module only needs to switch the level, that is, the low level becomes the high level, and the high level becomes the low level. In this way, it can also be determined which control signal corresponds to which transceiver channel to be connected.
[0057] See Figures 2 to 4 , Figures 2 to 4Shows a preferred embodiment of the present utility model.
[0058] This preferred embodiment includes a first CAN transceiver chip U2, a second CAN transceiver chip U1, a first data selector U3, and a second data selector U4.
[0059] In order to enable the control module to implement the selection of the first and second CAN transceiver chips, the present utility model sets a CAN_INV signal. Through this control signal, the first data selector U3 and the second data selector U4 are controlled to select one of the two CAN transceiver chips for transceiver, so as to implement the selection of the RX and TX channels of the transceiver signals of the CAN chip, thereby enabling engineers to have a corresponding CAN chip whether it is connected correctly or reversely.
[0060] Figure 3 、 Figure 4 Then it shows the specific embodiments of the first shutdown unit and the second shutdown unit. The power supply pins of the first and second CAN transceiver chips are controlled by two optocouplers to select the corresponding target CAN transceiver chip for power supply, saving energy consumption.
[0061] The signal line CAN_TX is connected to the receiving end of the control module, and the signal line CAN_RX is connected to the sending end of the control module. The data sent from the outside, after passing through the first CAN transceiver chip U2, passes through the input terminal IN1 of the first data selector U3, is output from the output terminal OUT, and then reaches the receiving end of the control module through the signal line CAN_TX.
[0062] The sending end of the control module, through the signal line CAN_RX, sends the data to be sent through the input terminal IN of the second data selector U4 to the output terminal OUT1, and then sends it out through the first CAN transceiver chip U2.
[0063] When the first CAN transceiver chip U2 is damaged, the data sent from the outside, after passing through the second CAN transceiver chip U1, passes through the input terminal IN2 of the first data selector U3, is output from the output terminal OUT, and then reaches the receiving end of the control module through the signal line CAN_TX. The control module reverses the received data, and then obtains the correct data to be received.
[0064] After the control module reverses the data to be sent, it then passes through the sending end through the signal line CAN_RX, sends the data to be sent through the input terminal IN of the second data selector U4 to the output terminal OUT2, and then sends it out through the second CAN transceiver chip U1.
[0065] When the CAN_INV signal is at a high level, the optocoupler Q1 is turned off, and the optocoupler Q2 is turned on. As a result, VCC_1 is turned off and VCC_2 is turned on. The second CAN transceiver chip U1 stops working, and the first CAN transceiver chip U2 works normally. At this time, the external signal enters the first CAN transceiver chip U2 through the signal lines CAN_H and CAN_L. Since the control signal CAN_INV is at a high level, the first selector U3 and the second selector U4 respectively select the corresponding pins to conduct or disconnect. The control module determines whether the signal polarity is correct at this time. If it is incorrect, CAN_INV is pulled low, and the circuit selects the second CAN transceiver chip U1. Repeating the above process once can achieve a non-polar connection for CAN communication. When the second CAN transceiver chip U1 is not working, it is in a power-off state, and the pins CAN_H and CAN_L are in a high-impedance state or floating state. Therefore, when the communication line is affected by interference such as leakage or high-voltage coupling, it will not be affected.
[0066] The present invention provides a CAN communication redundancy network construction scheme that takes into account polarity switching, and switches the CAN communication polarity through a control module, enabling users to not need to consider installation issues, and can also call a spare CAN transceiver chip to handle chip failure problems in the CAN communication network. The implementation methods for switching the first and second CAN transceiver chips of the present invention include but are not limited to using a switching transistor to control, identifying through a chip select signal, etc. By using two CAN chips, engineers can connect them randomly without distinguishing between the CAN_L and CAN-H lines, thus avoiding communication failures caused by incorrect connection by engineers.
[0067] To facilitate a further understanding of the implementation of this case, a simple method for non-polar connection of CAN communication will be specifically described below to achieve direct communication of CAN signals without concerning about the polarity.
[0068] Refer to Figure 5 , the usage process of the present invention is specifically as follows.
[0069] When the signal is accessed, the control module first judges the polarity. If it is correctly connected, the first CAN transceiver chip is adopted. If it is reversely connected, the second CAN transceiver chip is adopted, and then normal signal transmission and reception are carried out.
[0070] During the signal transmission and reception process, the control module can monitor the working status of the currently working first CAN transceiver chip or second CAN transceiver chip, including the success rate and error rate of transmission and reception, etc. If it is detected that the currently working CAN chip fails, the switching logic is triggered.
[0071] After triggering the switching logic, the control module reverses the CAN_INV signal, thereby triggering the power supply of another standby CAN transceiver chip and the paths of the first and second selectors, and the signal will be communicated by the standby CAN transceiver chip.
[0072] After switching to the standby CAN transceiver chip, the control module needs to take measures to reverse the CAN communication polarity. Take sending as an example.
[0073] Intercept the CAN data frame to be sent;
[0074] Create a mask or use a preset mask. The number of bits of the mask is the same as that of the CAN data frame to be sent, and all bits are 1;
[0075] Send the intercepted CAN data frame to be sent and the mask to an exclusive OR logic calculator for exclusive OR logical operation to reverse the data bits, that is, when the data bit is 0, it is reversed to 1, and when the data bit is 1, it is reversed to 0;
[0076] Send the modified CAN data frame to the CAN bus.
[0077] If the communication is successful after the switch, it means the repair is successful; if the CAN communication still cannot be repaired after the switch, it means the communication failure is caused by non-chip factors; the control module can record the situation and report it to the user to inform the user of the result.
[0078] The present utility model also protects a communication device, which includes the CAN communication control circuit of the above technical solution. The communication device includes but is not limited to a central air-conditioning system, a ventilation device, a heating device, a lighting device, a security monitoring device, etc.
[0079] The present utility model also includes a building control system, which includes but is not limited to the above-mentioned multiple communication devices.
[0080] The present utility model realizes the non-polar connection of CAN_L and CAN_H at the hardware level, reduces the main control resource loss caused by polarity switching, and improves the system operation efficiency. The CAN communication polarity is reversed through software, which simplifies the system implementation and maintenance process, and reasonably utilizes the idle hardware resources, improves the reliability and stability of the system, and can effectively handle various abnormal situations that occur in the CAN communication in the actual engineering environment.
[0081] The above are only the preferred embodiments of the present utility model and are not intended to limit the present utility model. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present utility model shall be included in the protection scope of the present utility model.
Claims
1. A CAN communication control circuit, characterized in that: include: The transceiver module comprises a first CAN transceiver chip positively connected to the CAN communication bus, and a second CAN transceiver chip reversely connected to the CAN communication bus; A switching module controls the first or second CAN transceiver chip to send and receive data via the CAN communication bus according to a control signal; The control module sends out a corresponding control signal, preferentially selects the first CAN transceiver chip to send data, and when the first CAN transceiver chip fails, reverses the data to be sent, and then sends out a corresponding control signal to select the second CAN transceiver chip to send data.
2. The CAN communication control circuit according to claim 1, characterized in that: When the first CAN transceiver chip fails, the control module sends the mask of all 1s and the data to be sent or the data to be received to the XOR operator for a logical XOR operation to invert the data to be sent or the data to be received; The number of bits of the mask is the same as the number of bits of the corresponding data to be sent or to be received.
3. The CAN communication control circuit according to claim 1, characterized in that: The switching module includes a first data selector and a second data selector; The two input ends of the first data selector are respectively connected to the receiving ports of the first and second CAN transceiver chips, and the output end is connected to the signal line CAN_TX, and the S end of the first data selector receives the control signal; The input end of the second data selector is connected to the signal line CAN_RX, and the two output ends are respectively connected to the sending ports of the first and second CAN transceiver chips. The S end of the second data selector receives the control signal.
4. The CAN communication control circuit according to claim 3, characterized in that: The switching module further includes: a first shutdown unit connected to the first CAN transceiver chip, and a second shutdown unit connected to the second CAN transceiver chip.
5. The CAN communication control circuit according to claim 4, characterized in that: The first shutdown unit and / or the second shutdown unit adopts a photoelectric coupler, and the photoelectric coupler receives the control signal and outputs a power control signal to the first CAN transceiver chip or the second CAN transceiver chip.
6. The CAN communication control circuit according to any one of claims 1 to 5, characterized in that: The control signal is a high level or a low level.
7. The CAN communication control circuit according to claim 6, characterized in that: The control module initially sets the control signal to a high level or a low level. If the received check code is inconsistent with the preset code, the control module switches the control signal to an opposite level.
8. A communication device, characterized in that: Comprising the CAN communication control circuit as described in any one of claims 1 to 7.
9. A building control system, characterized in that: Comprising a plurality of communication devices as claimed in claim 8.