A kind of optical fiber CAN bus network of double star
Technical field
The invention belongs to a kind of optical fiber CAN bus network of CAN bus network, particularly a kind of double star.
Background technology
CAN (Control Area Network) bus is a kind of many main station controllers of serial local bus, and the CAN bus is a kind of fieldbus that is widely used in industrial control fields such as automobile, electric power, machinery and chemical industry.The communication media of CAN can be twisted-pair feeder, coaxial cable and optical fiber.The CAN bus network that present transmission medium is a twisted-pair feeder is used widely, and every technology is ripe.The interface circuit of twisted-pair feeder CAN bus network is made up of CAN controller (as SJA1000) and CAN transceiver (as 82C250) usually, wherein CAN controller input and output level is a Transistor-Transistor Logic level, 82C250 realizes the mutual conversion between Transistor-Transistor Logic level and the CAN bus differential wave, makes bus have stronger anti-EMI (ElectromagneticInterference) characteristic.
The technical easy realization of twisted-pair feeder CAN, cheap, radiation has certain inhibition ability to environment electromagnetics.But the antijamming capability at abominable industry spot twisted-pair feeder CAN still can not be satisfied the demand.Transmission medium optical fiber has superior function---and powerful anti-EMI ability, for improving the anti-EMI performance of CAN network, this patent adopts optical fiber as transmission medium, forms the optical fiber CAN network.
The CAN network is similar as a kind of industry spot bottom control network on topological structure with local area network (LAN), and that the basic topological structure that realize the optical fiber CAN local area network (LAN) has is always linear, annular and star.Because the one-way of optical signal transmission, and the time-delay of signal transport process, the self-excitation phenomena of signal may appear at looping optical fiber CAN net, and will cause loop to stop up.
The stellate reticulum that current application is the widest is the stellate reticulum that adopts star-type coupler to constitute.Each node is connected to the star-type coupler of central authorities by point-to-point link.But less when single optical fiber CAN star-type coupler interface, in the time of can not satisfying the demand of numerous nodes, need star network is extended to many stars topological structure.As double star optical fiber CAN bus network, adopt interface control circuit can overcome the signal blockage that many StarNet network links to each other and produces between two star-type couplers.This interface control circuit can not only regenerated signal, can suppress the message loopback and stop up, and can also suppress the obstruction that the answer signal delay inequality produces.
Optical fiber CAN bus net to this double star does not also have concrete solution at present, a lot of technical barriers are still unresolved, and the as noted above anti-CAN net of example stops up interface control circuit, and CAN net plugging reason has two, be that message loopback obstruction and answer signal delay inequality stop up, division is as follows:
Message loopback blockage problem.When two star-type couplers (hereinafter to be referred as coupler) directly connected by two pairs of optical fiber transceiver modules, two optical fiber carried out unidirectional transmission to data.When coupler 1 transmission message, when coupler 2 receives messages; Coupler 2 is finished three work: receive the message that coupler 1 sends, the message that receives is sent to all CAN nodes of this coupler 2 subordinaties, the message that receives is transmitted back to coupler 1 through optical fiber.Producing the message signals self-excitation on transmission and the receive path between double star like this, it will cause the obstruction of whole optical fiber CAN net.
The blockage problem of answer signal delay inequality.Based on the CAN2.0B agreement, when receiving node is correctly received message on the bus, it all can send a dominance level (answer signal) on bus, notice sending node message successfully receives, and all will send an answer signal at each receiving node on the network like this and (receive under the normal condition at node) on bus.For the receiving node that is on the different couplers, the answer signal that they send is sent to the delivery time difference of sending node, is called the delay inequality that has produced answer signal.And this delay inequality also will cause the self-excitation of whole C AN net, cisco unity malfunction.
Summary of the invention
Technical problem to be solved by this invention is: a kind of concrete network configuration and the interface control circuit that prevents above-mentioned two kinds of network congestions are provided, set up a kind of optical fiber CAN bus network of double star.
The present invention solves the problems of the technologies described above the technical scheme that is adopted: constitute double star CAN bus network by two star-type couplers, be characterized in: on the PORT COM (CANH, CANL) of each star-type coupler, be connected with an interface control circuit, the function that interface control circuit will be finished is to suppress to receive the message loopback of coupler, suppress the transmission of delay inequality answer signal, eliminate network blockage, the interface control circuit of two star-type couplers is connected, thereby constitutes double star CAN bus network;
Above-mentioned double star CAN bus network adopts optical fiber as transmission medium, constitutes the optical fiber CAN bus network of double star;
Above-mentioned interface control circuit by the CAN transceiver (for example: 85C250), a delay circuit, a NAND gate and one or a formation, PORT COM (the CANH of CAN transceiver wherein, CANL) with the PORT COM (CANH of star-type coupler, CANL) be connected, CAN transceiver data output end Rx D be connected to or the door an input, the data input pin of CAN transceiver connects input of NAND gate, and be connected with another input of NAND gate by delay circuit, the output of NAND gate with or another input of door be connected, or the output of door is as the output of interface control circuit;
The input TxD of above-mentioned interface control circuit is connected with photoelectric conversion module PIN, its output (or output of door) is connected with electrooptic conversion module LED, and the interface control circuit input of two star-type couplers, corresponding the interconnecting by optical fiber of output form the double star looped network;
Above-mentioned star-type coupler is active, and after node hung up, the power of output light signal was undamped.
The present invention adopts two star-type couplers.On coupler 1, the message that the CAN controller of each node sends is transferred to coupler 1 by optoelectronic transceiver module and gets on, and this signal is through behind the interface control circuit, be sent to coupler 2 by the optoelectronic transceiver module conversion by optical fiber, can realize that message sends smoothly; Be any node on any star when sending message, message will be sent to all nodes of CAN net.This interface control circuit of while will suppress message and be transmitted back to the transmission star, eliminate the blockage problem that the message loopback causes the optical fiber CAN net.
For the message loopback blockage problem that the double star internal networking structure produces, solution is to utilize this node to send the message that message blocks loopback on the optical fiber loop.
Network congestion for the generation of answer signal delay inequality, from top analysis know problem to be that at all node on the different couplers sends answer signal to bus asynchronous, make sending node during replying the gap, not receive correct answer signal, think that sending message is not correctly received by bus node.After the reception mistake reached wrong extreme value, this node broke away from bus, causes whole network cisco unity malfunction.For each single StarNet network structure, promptly do not exist to send the message loopback, do not have the answer signal delay inequality yet, therefore single StarNet network can constitute one very stable, the network of high reliability.When two single StarNet rutons are crossed interface control circuit establishment double star CAN network, sending node will receive the answer signal of two coupler loopbacks.At first will receive the answer signal of other node of this coupler, and after having passed through certain transmission delay, receive from the answer signal of another coupler node.Solution is: another coupler answer signal of answer signal deoppilation that utilizes the sending node coupler.
Description of drawings
Fig. 1 is the optical fiber CAN bus web frame block diagram of embodiment of the invention double star.
Fig. 2 is an optical fiber CAN bus interface structure block diagram.
Fig. 3 is for eliminating the oscillogram that the message loopback is stopped up.
Fig. 4 is that star-type coupler 1 answer signal stops up star-type coupler 2 answer signal oscillograms.
Specific embodiments
The invention will be further described below in conjunction with drawings and Examples, but this embodiment should not be construed as limitation of the present invention.
As shown in Figure 2, when CAN controller TX end sent data, because the TX and the RX of CAN controller are Transistor-Transistor Logic level, so directly be transferred on the fibre circuit through electrooptic conversion module LED, the optical fiber CAN node was directly hung on the Active Star Coupler.
As shown in Figure 1, each optical fiber CAN node is directly linked the single star optical fiber CAN net that constitutes on the star-type coupler, and star network CAN link layer protocol is guaranteed and realized by star-type coupler.So in single star CAN network, each node can pass through the star-type coupler normal communication.Convert Transistor-Transistor Logic level to from the CAN transceiver of CANH/CANL differential signal on the process interface control circuit of star-type coupler 1 or 2 outputs, be connected to the optical fiber transceiver module through a delay control circuit.The data transmit-receive of the interface control circuit between two star-type coupler nets couples together by two pairs of optical fiber and transceiver module, constitutes a kind of optical fiber CAN bus network of double star.
Eliminate message loopback blockage problem waveform as shown in Figure 3, the TXD2 axle represents that the CAN transceiver 82C250 of coupler 2 ends of accepting state receives the waveform signal of coupler 1; RXD2 is the waveform of TXD2 end waveform through feedback output behind the 82C250, has the device time-delay of a 82C250 this moment, probably is 80ns.A2 is the waveform behind the TXD2 process RC delay circuit, and this time-delay should be greater than the time-delay of 82C250 less than the bit period of CAN.B2 be TXD2 and A2 and non-after waveform.C2 is RXD2 and B2 process or waveform behind the door.As can be seen when TXD2 termination when literary composition receiving, the level that outputs to the LED2 end is always ' 1 ' by oscillogram, and for fiber medium, no light signal is exported.Be interface control circuit had stoped the loopback of message by control logic after star-type coupler 2 received the message of star-type coupler 1, thereby solved the blockage problem of the optical fiber CAN network that the message loopback causes.
The waveform of the blockage problem of elimination answer signal delay inequality supposes that certain node on the coupler 1 sends message as shown in Figure 4, and the receiving node on coupler 1 and the coupler 2 all sends answer signal to bus.The TXD2 axle represents that the CAN transceiver 82C250 of coupler 2 ends of accepting state receives the answer signal that node sends on the coupler 1; RXD2 is that node receives the answer signal that sends behind the message on the star-type coupler 2, and A2 is the waveform behind the TXD2 process RC delay circuit, and this time-delay should be greater than the 82C250 time-delay less than the bit period of CAN.B2 is TXD2 and A2 and non-waveform.C2 is RXD2 and B2 warp or door output waveform.The level that is outputed to LED2 end by oscillogram as can be seen is always ' 1 ', when the TXD2 termination is received on the coupler 1 answer signal, blocks or door with this answer signal, and answer signal sends on the coupler 1 on the prevention coupler 2.So the sending node on the coupler 1 is only received the answer signal that this coupler receiving node is sent.Thereby solved the blockage problem of the optical fiber CAN network that the answer signal delay inequality causes.
Through the reality test, all node communications are normal in the embodiment of the invention networking structure, and when the node on any star-type coupler sent message, other online node of whole C AN can both be received correct reception message.And this node can correctly be received the acknowledgement frame that sends from other node on this star-type coupler, and whole network is normally moved.Meet whole C AN bus protocol fully.
Node among the present invention both can be the intelligent node of band CAN controller, also can be the non intelligent type node of band CAN controller.