120Rs on CAN Network

Discussion in 'Embedded Systems and Microcontrollers' started by piraticman, Apr 27, 2015.

  1. piraticman

    Thread Starter New Member

    Apr 27, 2015
    9
    0
    Hi there.

    I'm relatively new to electronics, I can solder stuff but not great with theory/schematics.
    I am going to be creating a CAN network soon but I understand I need 120ohm termination resistors at the start and the end of the bus network.

    "I have been told I need one 120R resistor between CAN_L and CAN_H at one end of the bus and the second one between CAN_L and CAN_H at the other end."

    Here is a link to a schematic. http://www.scielo.org.ar/img/revistas/laar/v35n2/2a10g90.gif

    Is there anywhere online I can see an image of what this would look like? I mean, I guess it's as simple as cutting the two wires within the cable and soldering them back together with a common resistor between them. But I'm curious as to how to keep it relatively shielded. I guess I could add some shrink plastic over the resistor legs but leave the actual resistor unshielded?

    Secondly, I'm just not 100% sure my the way I imagine the network to be correct. A single twisted pair cable with multiple nodes dotted throughout. A resistor is placed on the cable between the CAN interface and the first node and a second resistor after the final node? So I'd have an extra bit of wire coming out the end of my final node with a resistor on it?

    Finally, bonus points if you have any tips/videos on how to neatly solder a cable to a sub-D connector in parallel (so as far as I understand, the cable again, is split in two and each side stripped back and soldered to the relevant pins within the connector). I'm curious how to keep this neat without losing to much shielding.

    Thanks in advance
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,790
    The usual way to build a CAN Network is called Trunkline-Dropline. The trunkline can be as long as the datarate you select allows. We used 500 Meters @ 125 KBaud. At arbitrary points along the trunkline we allowed drops of up to 10 meters each and we limited the number of nodes to 32. In a long network you have a number of problems and shielding is not one of them.
    1. common mode ground differences.
    2. degradation of transmit signal level.
    3. receiver sensitivity
    4. total delay through the transceiver
    5. reflections that occur at the sample point.
    6. velocity factor of the cable.
    7. IR losses in the cable
    the terminators need to be on the trunkline cable. Do not make the mistake of putting them in a node.
     
  3. piraticman

    Thread Starter New Member

    Apr 27, 2015
    9
    0
    Shielded cable is what I've been reccomended by Trinamic so I'll go with that anyway, might as well make sure I have no interference as I need it to be as reliable as possible.

    I am not sure what datarate I need yet, but my network does not need to be too long. As for the drops, I will probably just have the connectors connected directly, without branching off.

    Yes, I understand to put the resistors in the cable and not the nodes, however, is my approach correct as in. to put a single resistor between the CAN interface and the first node (on the wire) by splitting the cable in two and placing a single resistor which both wires go through. and then the same again after the final node? I've read (on texas instruments manual on CAN) that if I'm using a shielded wire I should use a pig-tail at the end of the cable, but I'm not quite sure how to achieve this.
    1 - 4. I guess most of these issues will be solved by having good quality boards, i.e. trinamic and peak boards. But I'm not sure as it's all quite new to me.
    5. Reflections I think can be avoided by having a small dropline?
    6. I don't know, do I need this as fast as possible? I'll be using twisted pair with 120ohm characteristic impedence.
    7. Not sure?

    I thought I almost had everything figured out, seems things have just got more complicated :(
     
  4. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,790
    Things are actually way more complicated than you imagine, and I didn't even give you an extensive list. The good news is that a short network is much easier to engineer than a long one.
    #1,#2, & #4 actually have nothing to do with board layout.
    #3 & #4 are properties of the transceiver.
    #6 puts a limit on the maximum cable length
    #5 & #7 apply to long cable systems

    You can break the shielded cable for the purpose of placing the terminators. If you are concerned about the loss of shield you can enclose things in a metal box, but I wouldn't bother unless you encounter problems.

    Where will the shield be grounded?
    How is the network, primarily the transceivers, going to be powered?
    Will you be using optoisolators?
     
    Last edited: Apr 28, 2015
  5. piraticman

    Thread Starter New Member

    Apr 27, 2015
    9
    0
    Cool. Thanks for the info.

    I am hoping to expand to 100 nodes eventually, but I'm just looking for 1 or 2 initially. I'll probably eventually hire someone to help. Even when it is expanded to 100 or so units though, the cables should still be short.

    From what I've read the shield should be grounded only at the first node? But I'm not 100% sure, I'm double checking with trinamic. Then I need to find out how to actually ground, I know it involves pin 3. lmao.

    As for powring I will be using a DIN railed power supply for constant voltage of 24v. I'm just not sure how to power multiple units yet as they all seem to have 1 output. Perhaps there is a special cable with multiple ends, or perhaps the trinamic units can be daisychained together? I'm not sure. :\

    Optoisolators, as I've never heard of them I'm going to say 'no.
     
  6. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,790
    Whoa there. One Hundred transceivers in parallel on the bus lines will be too many. Tell me what is 100 transceivers @ 10K each in parallel is, as an impedance for each transmitter to drive? On our industrial systems we limited ourselves to 32 nodes for what we thought were very good reasons. The transmitters in chips like the 82C251 are just not that powerful.
    The shield should be grounded as close to the power supply as possible.
    Power supplies are not usually daisy chained together. Using multiple supplies is doable as long as they have a common ground.
     
  7. piraticman

    Thread Starter New Member

    Apr 27, 2015
    9
    0
    Woops. Okay, well it's just I read that wrong. 120 or so for a slow speed. But if I'm using up to 1MBPs over 40 metres it will be more like 30 max. I'd be happy with 30 as I could just have multiple networks. But I'd really like to squeeze as many as possible, without affecting performance.

    Is there any way to calculate what data speed I'll need and how much nodes I could have under this conditions etc?

    As for power supplies I would have thought that I would be able to have a large power supply with a cable with multiple ends on it to plug into multiple boards, as long as I don't go over required ampage. Because DIN railed power supplies from what I can see seem to be quite expensive.

    Silly question I know, but how do I ground the shield?
     
  8. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,790
    The basic calculation for number of nodes depends on the input impedance of the bus transceiver. When you add nodes in parallel it drops the impedance. As the impedance drops, each transceiver has a harder time driving the cable and all the other transceivers. The worst case experiment is to put a single node at one end of your cable system and 31 nodes clustered together at the other end. Have the single node poll each of 31 while each of the 31 poll the single node.

    For maximum datatrate, given the velocity factor of the cable, a signal from one end of the cable needs to make a round trip in 75-80% of a bit time.

    If you use a single power supply and run a power cable in the same bundle with the data cable then you need to make sure there is adequate voltage at the far end. We often had no more than 11VDC from a 24VDC power supply.

    Grounding the shield is done by connecting it to power supply ground at the power supply. If the power supply has a separate earth connection you can use that as well if you understand what the power supply is doing with the two terminals.
     
  9. piraticman

    Thread Starter New Member

    Apr 27, 2015
    9
    0
    Thanks for taking the time to help. I'm still a little lost.
    The network stuff is now all starting to make sense. But I still don't understand grounding.

    I won't be running the power through the same cable as it's a bit out of my depth at the moment. I would have thought there would been a power supply like this...

    [​IMG]

    ... which is obviously designed for guitar effects and is 9v, but I thought there would be something similar but 24v that could supply power to multiple things. Ribbon cables within computers etc do this also, provide power for multiple devices. Even for 3 or 4 devices would be nice. But I guess it's not essential.

    Anyway, my main problem is grounding. But I'm struggling with the very basics. Before I get into grounding shields, how about grounding the connectors.

    i.e. Pin number 3 on my Sub-D connector must be grounded. Is this done, simply by connecting a small wire from the pin to the metal chasis? Or must it go somewhere else? Also, as far as I'm aware I should only be grounding one of the connectors, probably the one coming out my PCI express card (Peak CAN interface).

    Sorry to have to ask such a basic question, little bit embarassed.
    After I understand this, then I'll try and figure out how to ground the shield :D I understand now after reading this following document why it's necessary to ground shielding, but just not 100% sure how to do it. I know you explained above, but if you see my previous question you'll understand I need my hand held. Believe me I've googled it for 2 days, but this basic thing I just can't seem to find online :\ maybe it's the terrible internet at work :(
    http://www.newark.com/pdfs/techarticles/alphaWire/Understanding_Shielded_Cable.pdf

    Thanks so much for your help so far though. Top lad :D
     
  10. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,790
    How you do your grounding will affect network performance and safety. At the moment you appear to be planning on a 24 VDC supply to power not only the transceivers but also the entire nodes, 32 or more of them. See, I don't think you have thought this through because if you had you would relaize that the power demands of 32 node will probably outstrip even a modest size +24VDC power supply. I hope the devices on the network are not planning to use linear regulators because +5V @ 50 mA will make a 7805 get very warm with a +24V input.

    CAN is not a true differential network. It is quasi differential with respect to a COMMON GROUND . This means each transceiver needs to reference a common ground. In a long network the grounds of two transceivers can be different by only 5 Volts before things start to malfunction. It also means there must be a common ground wire for all the nodes to reference. If your data cable is two wires (CAN_H and CAN_L) and a shield, you can't use the shield for the ground reference. You need a separate ground reference wire and you might as well run that with the +24VDC power that goes to each node. If you want to power just the transceiver and some optos then you can limit the network power budget. To do it right you need two twisted pairs and a shield for a total of five wires. You can buy this cable from Belden as they made it for Allen-Bradley's DeviceNet network.

    You should get an ohmeter and measure the DC resistance of those 9V connectors. Now extend that number to the length of your network and using ohms law figure out how much of your 24 V will left after two times that length. Remeber the ground return to the power supply has the same IR drop as the hot lead.

    For Class 2 compliance you are limited to 100 VA which means that your 24 VDC supply is limited to about 4A. 32 nodes will eat that up pretty quickly.

    http://www.smar.com/en/devicenet
     
    Last edited: Apr 29, 2015
  11. piraticman

    Thread Starter New Member

    Apr 27, 2015
    9
    0

    I was thinking of using 1 power supply for 3-5 units at a time only. But yes, I realise now, either way it's not appropriate and you seem to know what you're talking about, so I'll attempt to set it up with power wire in the same cable as you have described.

    So belden cable with two twisted pairs (I'm assuming shielded from eachother as one is data and the other, power) and a 5th ground cable. The ground cable will be connected to the ground pin of each connector at the nodes on the network.

    That devicenet looks interesting. If I'm correct (I'm from UK) Class 2 compliance is basically necessary for some businesses in US for safety reasons and the devicenet is a method of using a CAN network that is very efficient in terms of how it operates, it's an open standard and method to follow that should have good results.

    One thing I'm failing to understand though is that if the voltage drops over the network (which it clearly will) from 24v to say 11v as you say, then how do you power all 30 nodes? Or do you use a lower voltage? It's just that the manual for the nodes http://bit.ly/1KwplYr states that it needs a 24v supply, although it says 24v compatible, so I'm not sure if maybe it will in fact support less voltage. :\
     
  12. piraticman

    Thread Starter New Member

    Apr 27, 2015
    9
    0
    Also. Now that I think of it, I don't think any of my nodes are transmitting information. As I will be working with open stepper motors, as opposed to closed, they only receive data. I think when sending data from the CAN interface within the PC and it is ignored by node 1, for example, it automatically goes to the next node anyway without having to be 'transmitted' but I could be wrong.
     
  13. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,790
    Each transmitted CAN frame has an identifier field which you can use in the receiving nodes to select messages to be received. I urge you to make the link bidirectional so you can extract information from each node after the network is up and running.

    The DeviceNet cable I spoke of had two twisted pairs each with different insulation. Each twisted pair is foil shielded. There is also an outer braid shield with a drain wire.
    The power pair has a Red and a Black wire. The black wire is your power ground. The shield is only connected to the power ground at one place, and that is at the power supply.

    In terms of physical construction you can break the cable at convenient locations and make an "open tee". I would not worry about the break in shielding for the time being. If you insist you can spend extra money for sealed connectors and tees that maintain 360° shielding. These components are made by Daniel Woodhead/Brad Harrison and others. Your distributor can run these down for you.


    Let me know how it goes.
     
  14. piraticman

    Thread Starter New Member

    Apr 27, 2015
    9
    0
    Okay, but what power supply do I hook the black and red wires up to? and how do I stop the voltage dropping after it's gone into a number of nodes?
     
  15. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,790
    You start at the power supply and you got to the first node, and you continue from there until you get to the end. Usually the supplies are +24 VDC. The voltage will not begin to drop until the current consumption of all the connected nodes exceeds the capacity of the supply. On a long cable system, there is nothing you can do. The node next to the power supply will see +24VDC while the node at the end of say 500 meters of cable will see +11V from the +24VDC supply. You work with what you have and hope that things don't fall apart on you as you put this stuff together. You have the distinct advantage of having a relatively short network for the baudrate you plan to use.

    Here's the kicker. If the black wire at one end is at a different potential than at the other end by more ±5 VDC, most CAN transceivers/CAN Controllers will start throwing ERROR frames and quickly go BUSOFF. Trying to find the culprit on an installed network can be a stone bitch, to quote my favorite moderator.

    Nobody said that you have to distribute power on the network cable. You do have to ensure that the ground pin on each an every CAN transceiver is within 5 volts of every other CAN transceiver. This way you can use separate supplies, but you have to hook their grounds together.
     
  16. piraticman

    Thread Starter New Member

    Apr 27, 2015
    9
    0
    Thanks for all the advice, you've been a great help.

    Definetly have a bit of a clearer understanding now.

    Thanks
     
Loading...