Sorry for my limited English ability and Technical ability.
It is very common in our company that, the engineers don't care about (or don't know) the termination resistors on a CAN-Bus. They just simply put one 60-Ohm resistor between two or several CAN-Devices (mainly for testing purpose). I know this is not standard, and I don't like this workaround. I tried to figure out why such a workaround is bad, but failed.
It seems that many engineers use such a workaround. ==============================> www.microchip.com/.../m177894-print.aspx a single 60 ohm termination for lab testing when bus is only a few feet (probably not allowed, but it works).
www.microchip.com/.../m144034-print.aspx If you don't have two 120-ohm resistors, you can accomplish the termination (on a small network) with a single 60 ohm resistor(120 in parallel with 120 is 60) or anything close 55-65 is fine. <==============================
I found a document saying this workaround is a mistake, but it does not provide why. ==============================> www.scribd.com/.../SAE-J1939 The bus is linear and should be terminated with 120-Ohm resistors at either end. It is a common mistake to use one 60-Ohm resistor instead of two 120-Ohm resistors. This does not work correctly, however. <==============================
What is the disadvantage/mistake, if we use one 60-Ohm resistor instead of two 120-Ohm termination resistors on a CAN-Bus, assuming the communication distance is not very long and only 3-5 CAN-Nodes (Devices) involved? In another words, when will such a workaround fail to work?
-- It is very difficult to find another job in southern Taiwan. So I am still struggle with idiotic things, and busy in urgent projects.
Depends on what is about to be tested.
If testing some software, it may be ok to have just a 10 cm cable between two devices.
Many thanks for the helps.
====================> en.wikipedia.org/.../CAN_bus
ISO11898-2 describes the electrical implementation formed from a multi-dropped single-ended balanced line configuration with resistor termination at each end of the bus. In this configuration a dominant state is asserted by one or more transmitters switching the CAN- to supply 0 V and (simultaneously) switching CAN+ to the +5 V bus voltage thereby forming a current path through the resistors that terminate the bus. As such the terminating resistors form an essential component of the signalling system and are included not just to limit wave reflection at high frequency.
Does the "the terminating resistors form an essential component of the signalling system and are included not just to limit wave reflection at high frequency" apply to the terminating resistors of CAN-Bus particularly? or it applies to every kind of terminating resistors? <====================
====================> In a nutshell, a single termination resistor is always wrong --- the exact gravity of the inevitable consequences depends on your network's propagation delay compared to the bit time.
So, if
the configuration of "propagation delay compared to the bit time" is not proper, and only one single termination resistor is used,
then even on a low baudrate CAN-Bus, the signals could be damaged? (Am I right?) <====================
Many thanks for your experiences and wisdoms.
_Some_ busses requires the resistors for both DC purposes and for stopping reflection.
_Some_ busses only needs the resistors for stopping reflection.
And for CAN, there exists more than one physical layer standard (just as Ethernet have thin and thick coaxial cables and TP cables). Some variants are very similar to RS-485.
Since the wire have quite low DC resistance, it is easy to believe that two 120 ohm resistors with a low-resistance cable between them is equivalent with a 60 ohm resistor. It is - but only for the DC case.
For the AC case - i.e. taking care of reflections - a 60 ohm resistor is not equivalent. A 60 ohm resistor is much off compared to the characteristic impedance of the cable. And next thing - where to place this single resistor since it can't be at both ends of the cable at the same time.
Anyway, the case of recessive and dominant bits is a big different from many other busses, since all transceivers on the cable are involved. It is a form of an open-collector drive, where multiple transmitters can start to send at the same time - if one transmitter then "sends" a recessive bit while another sends a dominant bit, the guy sending a recessive bit will notice on the cable that the transmission failed. So it will stop sending and wait for a later time to try again. The transmitter(s) that sent a dominant bit at that position will not see any errors, so it/they will continue to send more frame bits.
You can find a bit of information in this application note for a TI chip: www.ti.com/.../slla270.pdf
Note that this specific document is for ISO 11898:1993 and relates to high-speed CAN.
Many other busses do not have any recessive/dominant bits but instead use other means to figure out who may send, to avoid collissions, and what means to use for acknowledge. Maybe a specific master. Maybe some form of token passing. Maybe time slots. In that case, they can make use of a fully symmetric definition of the bits.
then even on a low baudrate CAN-Bus, the signals could be damaged? (Am I right?)
You're asking the wrong question. Why even bother with what exactly will go wrong if you don't terminate properly, when it's so enormously much cheaper just to terminate correctly and be done with it? You've wasted more time (and thus money) on writing here already than proper termination could possibly cost.
That said, yes, not only could they be, they will be damaged. CAN's MAC layer relies on any node on the bus being able to overpower each recessive bit on the bus into a dominant bit, within that same bit time, and all nodes on the bus seeing that dominant state instead of the recessive one. Improper termination causes reflections, which effectively shortens the usable bit time, because a new bit cannot generally start successfully until the reflections from the previous edge, a sort of ringing effect, have died out. So sooner or later these reflections will keep one node on the bus from detecting the following bit correctly, and thus signals will indeed be damaged.
The question the OP ask is "what happens if I do not do it right" what an utterly stupid question, what excuse does any engineer have for not doing it right (at least when the cost difference, like here, is $0.01). the answer is "if you do not do it right it will fail on the unit farthest away from you at the most inconvenient time" (Murphy's law).
The question "what happens if I do not do it right" can also be seen as an expectation that someone, knowing that things must be done right, spent hours, upon hours analyzing something he was not going to do in the first place.
Erik
Why even bother with what exactly will go wrong if you don't terminate properly, when it's so enormously much cheaper just to terminate correctly and be done with it? You've wasted more time (and thus money) on writing here already than proper termination could possibly cost.
The question the OP ask is "what happens if I do not do it right" what an utterly stupid question, what excuse does any engineer have for not doing it right (at least when the cost difference, like here, is .01). the answer is "if you do not do it right it will fail on the unit farthest away from you at the most inconvenient time" (Murphy's law).
I am a totally and completely software guy, don't know anything about hardware and signals. In this company, only 2 or 3 persons believe "one 60-Ohm instead of two 120-Ohm resistors" is wrong. And I need to convince the hardware engineers to do something for me.
Many thanks for your experiences and wisdom.
Hans-Bernhard and Per,
Many thanks for sharing your experiences and wisdom.
Both of you emphasizing the "overpower each recessive bit on the bus into a dominant bit", so I believe this is one of the key-points.
I did some more quick reading, cache.freescale.com/.../AN1798.pdf
2.3 Propagation Segment
The existence of the propagation delay segment, PROP_SEG, is due to the fact that the CAN protocol allows for non-destructive arbitration between nodes contending for access to the bus, and the requirement for in-frame acknowledgement. In the case of non-destructive arbitration, more than one node may be transmitting during the arbitration field. Each transmitting node samples data from the bus in order to determine whether it has won the arbitration, and also to receive the arbitration field in case it loses arbitration. When each node samples each bit, the value sampled must be the logical superposition of the bit values transmitted by each of the nodes arbitrating for bus access. In the case of the acknowledge field, the transmitting node transmits a recessive bit but expects to receive a dominant bit, i.e. a dominant value must be sampled at the sample point(s). The propagation delay segment, PROP_SEG, exists to delay the earliest possible sample of the bit by a node until the transmitted bit values from all the transmitting nodes have reached all of the nodes.
2.4 Synchronisation
Hard synchronisation is performed only at the beginning of a message frame, when every CAN node aligns the SYNC_SEG of its current bit time to the recessive to dominant edge of the transmitted Start-Of-Frame bit. Re-synchronisation is subsequently performed during the remainder of the message frame, whenever a change of bit value from recessive to dominant occurs outside of the expected SYNC_SEG segment.
www.softing.com/.../signal-propagation.php
You have to add up the following delays depending on the selected components: CAN controller (50 ns to 62 ns), optocoupler (40 ns to 140 ns), transceiver (120 ns to 250 ns), and cable (about 5 ns/m).
Improper termination causes reflections, which effectively shortens the usable bit time, because a new bit cannot generally start successfully until the reflections from the previous edge
I don't think I have already understood the above texts completely and correctly. Could you please provide some more hints?
Sorry for my very limited English ability and Technical ability.
If one listener is close and another is far away on the cable, then the message takes different time to reach them.
And the buffers used means that from the transmitter wanting to send something, it takes some while until the signal have jumped through the transceiver or opto-isolator and even reached the bus.
So the transmitter must be patient and make sure that all listeners have had time to get the bit and sample it - and potentially respond and have this response reach back to the transmitter - before the transmitter can check if cable is in dominant or recessive state.
But if the cable is improperly terminated, or there are long stubs cables from the bus cable out to some listeners, or someone have splitted the bus, then there will be reflections in the cable. These reflections are added to the actual transmitted signal. The reflection will also move with the same propagation speed of the cable, so for a longer cable, the reflection will manage to destroy a longer part of the initial part of a transmitted bit. That is why you need to switch to slower transfer speeds when you increase the cable length - so your initial sampling happens after the reflections no longer affects the correct detection of low/high signal state.
Several of the links I posted do show oscilloscope images showing the result on the signal from these reflections. As can be seen, it is vital to minimize reflections if you want to run a high bitrate on a long cable.
So, this is very similar to, several persons A/B/C yell to a valley. A starts to talk. A has to wait for the first voice arriving B/C, after the first voice, if it is necessary; B or C yells back (replace recessive with dominant). Everyone has to wait a while to listen the word clearly; after that, everyone has to wait for the echo. After the echo, one word communication finishes, next word communication starts.
We need to minimize the echo; or we need to slowdown the talking speed. The propagation delay segment provides some buffers for replacing recessive with dominant, also provides some buffers for echo waiting. But with the same baud-rate, propagation delay segment can not provide enough buffers. If the propagation delay (the content of the word) has some good relationship with the echo, we may be still able to hear the word clearly; but it depends on luck.
Am I right?
And the echo may change the word unknowingly. everyone hears a wrong word without any problem noticed.
No - no buffering. The propagation delay segment is just how long to wait before starting to sample the contents of the bit.
When the frame starts, all receivers starts their timing clock - after that, they will just count time to figure out how far they are inside all the individual bits of a frame.
Signal delays affects how much error there will be for the different listeners to pick up the start of the transmission and start their individual stop watches.
And an echo that destroys a part of the beginning of every bit will further introduce errors in how well the different listeners can figure out where the bit starts.
So a bit can't be just sampled once. Instead, each individual bit is separated into a large number of small time slots. The first time slots are ignored because of the problem starting the stop watch at the same time - every listener must wait enough time that they are sure that what they read haven't already been overwritten by a competing transmitter. After having ignored the start of the bit, the CAN receiver can then start to sample the bit to figure out if it is recessive or dominant.
Your analogy with shouting fails a bit because there every token is a full word containing lots of information. In CAN, every token is a single bit.
So the guys in the mountains aren't shouting words. They are whistling morse, and the other guys needs to know if what they hear is whistling or the echo from whistling. So each beep of the morse code must be so slow that you really know if you hear whistling or if you hear silence - the echo of the whistling must end well before someone starts to whistle again so you know you hear silence.
Another difference in the analogy is that if I whistle for 10 seconds, the echo will also continue to echo that full 10 second sound (+ number of reflections etc). With reflection in the cable, it isn't the DC state that gets reflected but the flanks of the pulse. So for a high bit speed compared to cable length, the reflection will be as long as (or longer) than the pulse sent. For lower bit speeds, the reflection will end well before the pulse ends, since the reflection is just an edge that bounces (actually multiple times but weaker for every reflection). So a listener close to the end of the cable will instantly hear both original signal and reflection. A listener in middle of cable with start hearing a good signal, and after the signal have continued to the end of the cable and then bounced back, the reflection will start to interfere.
That is why you need to have a dead zone at the beginning of bits to compensate for cable delays and for any reflections to be low enough that they don't destroy the bit. And with a lower bit rate, each bit will be longer in time. So you can support a longer cable with correspondingly longer transfer times of signal and reflection.
If you look at water rippling, you can see how two waves can either cancel each other or magnify each other. Each edge of the CAN signal produces such a wave when the signal reaches some part that isn't 100% impedance-matched. With reasonably good matching, the new wave will have low amplitude and can be mostly ignored. With bad matching of impedance, the new wave will be very strong - almost as strong as the original signal. And sometimes it will add to the original bit data. Sometimes it will cancel.
A single 60 ohm resistor is always a bad match for a cable that have 120 ohm characteristic impedance. So there will always be strong reflections. If the cable is very short in relation to baudrate, the reflections will jump forward/backward many times in the cable but still lose enough amplitude before it's time to start actually sampling the data. If the cable length is increased, you will quickly get lots of transfer failures - the real data will drown in all the ripples that goes forward/backward in the cable.
Hi Per,
I am very sorry for my lack of hardware and signal knowledge.
I had read once, and will read your post many times until I really get a clear image.
Many thanks.
Think about a "cloud" of whistlers in the mountains.
Whistling is dominant. Silence is recessive.
If I whistle, I will not know if others are also whistling - I'm too noisy. If I stop whistle, I may still hear echos from my own whistling, so I need to wait a while before I can decide that there are silence - or if someone else is whistling.
That wait time depends on time until echo dies (travel time to bouncing location and back) and time to the other people (time for their sound to reach me).
If two people whistle at same time, neither will notice. If one whistle and one is silent, the silent guy will notice (taking into account the delay for transfer of sound, and the delay for echo to end).
If the mountains are removed or covered with dampening material, then the speed to whistle or be silent will much be controlled by just transfer time to/from all other people. When there is echo, the transfer times for the echo must also be taken into acount.
So the bigger distance you have, the lower whistle speed you may have. The more echo you have, the lower whistle speed you may have.
Because of this, CAN controllers starts with a specific synch pattern before every frame - besides collision detection it's also important that they have a reasonably good idea when time windows starts for each bit of the frame. Think about whistlers. The guy who whistles can't know if someone else whistles. But when silent, he can detect if someone else whistles. CAN isn't unique in sending a synchronization pattern before the frame (or sometimes called packet in other protocols).