Log in

View Full Version : Com wire


cpapplefamily
08-01-2016, 10:27
I have searched around for the discussion I'm sure has been touched on many times. Lots of post using phone wire for CAN in the past. My history started last spring so Roborio is my starting point. I would like the team I'm mentoring this winter to start using feed back to operate their robot this year. The off season labs we been preforming has got everyone excited with the possibilities. What I have observed though is many or most of the connection cables we have are pieced together sometimes with two or more solder joints and not always matching colors. I bought a supply of pins and sockets.

Now I'm asking for your experiences would phone and/or Ethernet cable work well for making cables? Solid or stranded? With both types i usually like this strip twice as much wire off and fold it back once to get a solid connection.

MrForbes
08-01-2016, 10:43
We haven't messed with the CAN bus stuff, except as needed for the connections between the computer and the VRM and PCM. But in general, you want to worry mostly about the physical aspects of the wiring--make sure it's robust, and easy to repair if needed. I would tend to want to use thicker wire than is found in LAN cables. The twisted pair that comes in the kit is pretty nice, but finding twisted pair of the same gauge, with an overall jacket, would be even better. The color codes are also a concern, it would be nice to have colors on the wires that are not shared by the power distribution, etc.

Let us know what you find, I'm sure others could use some help here too.

VacioArconte
08-01-2016, 10:47
Our team uses WAGO Levernuts and ferrules for CAN, no soldering required. They're easily changed and you can wire CAN in either series or parallel, for which you can have either two-connection for series or much larger levernuts for parallel.

http://www.andymark.com/product-p/am-2577.htm

Here's a five terminal connector.

RyanN
08-01-2016, 11:45
AndyMark (http://www.andymark.com/product-p/am-3071.htm) provides it, and it looks very similar to this cable (http://www.waytekwire.com/products/1459/CAN-Bus-Cable/), with the Mississippi State University AVTC team uses in their vehicles for CAN communication. It's probably the best CAN cable you can get.

However, in my experience, it's a pain to strip that oil-resistant insulation off. I often would try to strip it and end up cutting the insulation off the internal wires. YMMV

CTR Electronics (http://www.ctr-electronics.com/can-bus-cable-10ft.html) also provides it. It's uninsulated, which makes it really easy to strip the wires. I would recommend this over the AndyMark stuff because it's easier to use.

Our team just bought some off of eBay (http://www.ebay.com/sch/&_green+yellow+twisted+wire).

Big thing to look for in CAN is if it's twisted. CAN uses differential signaling for communication, meaning one wire goes logic low while the other wire goes logic high. What this does is allow the CAN controllers to detect signaling errors do to electromagnetic interference (EMI), and attempt to resend the message. Sources of EMI? Motors, overhead lights, static, bad crimps, solar flares... you name it!

Next biggest thing to look for is the size. All the CAN connectors use Weidmuller Connectors, which can accept wire from 16AWG to 24AWG (https://wpilib.screenstepslive.com/s/4485/m/13503/l/144971-wiring-the-2016-frc-control-system). All the above wire will work.

Can you twist it yourself? Sure! I've done this before by taping up the ends in a drill and spinning it for a while. Number of turns per meter does matter in the real world, but for our application, anything will probably work. I've seen teams just run normal wires, untwisted, and have it work fine.

cpapplefamily
08-01-2016, 12:51
I was thinking for PWM and DIO as well.

Knufire
08-01-2016, 13:33
I was thinking for PWM and DIO as well.

We just use hobby servo wire for these.

RyanN
08-01-2016, 16:56
I was thinking for PWM and DIO as well.

https://www.servocity.com/html/servo_wire__bulk_.html
https://www.servocity.com/html/servo_extensions___leads.html
http://www.andymark.com/Cables-s/65.htm
http://www.amazon.com/Remote-Control-Female-Servo-Extension/dp/B00EZE90WQ/ref=sr_1_fkmr1_2?ie=UTF8&qid=1452290263&sr=8-2-fkmr1&keywords=servo+extension+unshrouded

On the ServoCity and Amazon assembled ones, you'll have to remove the plastic shroud on the male side, but that's pretty easy to do with pliers or a small flat-head / standard screwdriver.

The first ServoCity wire requires assembly, in which pins, housings, and crimpers are needed. If you're not comfortable with assembling them, then don't do it. It's easy to mess up and will cost you matches if not done right.

Bob Potts
08-01-2016, 17:10
[QUOTE=
Our team just bought some off of eBay (http://www.ebay.com/sch/&_green+yellow+twisted+wire).


Thanks for the tip! We just bought the last one! :cool:

DonRotolo
08-01-2016, 21:21
CAN uses differential signaling for communication, meaning one wire goes logic low while the other wire goes logic high. What this does is allow the CAN controllers to detect signaling errors do to electromagnetic interference (EMI), and attempt to resend the message.
That isn't exactly correct. Differential signaling causes any effects of EMI to be nullified, since the EMI (nominally) affects both wires equally. So if CAN is looking for a voltage differetial of 5 Volts, it does not matter if a 20 V EMI signal is superimposed upon both wires, the difference is still 5 volts.

Error detection is performed with mechanisms like a CRC checksum.

Twisted wires help maintain a constant impedance, important towards suppressing reflections, which can cause data errors.

RyanN
08-01-2016, 22:37
That isn't exactly correct. Differential signaling causes any effects of EMI to be nullified, since the EMI (nominally) affects both wires equally. So if CAN is looking for a voltage differetial of 5 Volts, it does not matter if a 20 V EMI signal is superimposed upon both wires, the difference is still 5 volts.

Error detection is performed with mechanisms like a CRC checksum.

Twisted wires help maintain a constant impedance, important towards suppressing reflections, which can cause data errors.

You made me review some electrical notes. You're right (of course). EMI affects both signals identically (because they're twisted). The controller's are ground independent meaning that the signals don't need a ground. The controller uses a comparator (just think of a voltage meter measuring the voltage across the signals) to see if the signal is logic low (voltages separate, 2V measured) or logic high (voltages come together, 0V measured).

If something happens, the CRC portion of the CAN message will request the other CAN controller to resend the message.

CAN is a very robust standard used by all automotive manufacturers and many companies. Fortunately, or unfortunately, FIRST and NI doesn't really expose you to the fun stuff in CAN. It all kind of... just works.

So what makes CAN really cool is no one is a master controller and no one is a slave device. Any device can talk to any device. It's a broadcast network with wither 11-bit IDs or 29-bit extended IDs. In practice, CAN is usually limited to speeds up to 500 kbps, but will reach speeds up to 1 Mbps. Newer standards (CAN FD) push that speed even higher. Not very fast, right, but when you're talking about the data we're transmitting, it's pretty fast.

I also saw on another thread about how they're using a signal-splitter to run the network as a star network rather than daisy chaining. I do not recommend doing that because of signal reflections. Most devices give you an 'in' and an 'out' port if you want to call it that. Use that, it's better for signal integrity. You have a chance of running into signal reflections on the network.

adciv
09-01-2016, 19:53
The wire for FRC CAN doesn't really matter. I would use stranded as the equipment is made to hold it in easier than solid core. During Beta, I used the KOP Link Connector Cable (Black, Red, White Green 4 conductor). I used R & B for power and W & G for CAN. It worked even without a can bus termination resistor. Really, for our distances and usage, it's robust you don't need to worry about it.

Typically we use 22AWG 4C unshielded wire.

RyanN
11-01-2016, 22:29
Our team just bought some off of eBay (http://www.ebay.com/sch/&_green+yellow+twisted+wire).


Thanks for the tip! We just bought the last one! :cool:

I just received ours. Item was not as described. I got 50' of green wire with a yellow tracer. Hopefully just a mess-up, but I contacted the seller.

Al Skierkiewicz
12-01-2016, 07:53
The wire for FRC CAN doesn't really matter. ...It worked even without a can bus termination resistor. Really, for our distances and usage, it's robust you don't need to worry about it.
The wire and the terminations really do matter, sorry.
The twist of the wires or at least the constant spacing between wires sets the transmission line impedance. The CAN transceivers need the termination resistors to operate correctly. They help set the signalling voltage level and terminate the transmission line. Without them, the reflections at each end of the line allow errors to build up. This is an effect of the length of the line. The longer the line, the worse the effect. Also, the CAN buss should never be parallel wired. In short systems it may seem to work but, as is typical, this system will fail you when you need it the most.
The twisted wiring allows both wires to be exposed to external noise. Since the intruding noise is in phase as it passes through the wire, the twist will cause the 'in phase' noise to be cancelled at the source. Any noise that remains will also be in phase and that will be cancelled at the differential input to the transceiver chip. The twist of 2-3 turns per inch will produce a shunt capacitance of ~20-30pf per foot.
Murphy is always lurking...

s1900ahon
12-01-2016, 11:55
So what makes CAN really cool is no one is a master controller and no one is a slave device. Any device can talk to any device. It's a broadcast network with wither 11-bit IDs or 29-bit extended IDs.

The IDs (MessageID) isn't just used to identify a device. The MessageID is part of the arbitration mechanism on CAN and so as multiple devices start to send their message, the lowest valued MessageID wins (simplified). As the bits are transmitted, if the value on the bus doesn't correspond to the value being transmitted, the node backs off (lost arbitration, but keeps listening so it can later ACK/NACK the packet for CRC). Since the MessageID is sent most-significant bit first, and 0s are dominant, the node sending a 0 beats a node sending a 1 (hence the lower value wins).

When developing Jaguar, I spent time fracturing up the extended MessageID to ensure things like "everyone stop!" got through, to everyone. In effect the Jaguar CAN protocol uses the MessageID field divided such that functions arbitrate before src/dst, where the important safety functions are low valued and broadcast (i.e. Vendor=All=0, MessageID=0 is like FunctionGroup=Safety=0, Function=Halt=0, Dest=Everybody=0--it has been almost 8 yrs since this was worked out so this is from memory).

In practice, CAN is usually limited to speeds up to 500 kbps, but will reach speeds up to 1 Mbps.

FRC CAN is 1 Mb/s.

kiettyyyy
12-01-2016, 12:41
The twisted wiring allows both wires to be exposed to external noise. Since the intruding noise is in phase as it passes through the wire, the twist will cause the 'in phase' noise to be cancelled at the source. Any noise that remains will also be in phase and that will be cancelled at the differential input to the transceiver chip.
Murphy is always lurking...

Make sure your wires have a consistent twist ratio, otherwise, it is possible to have the P and N signals arrive out of phase.

This is where you use those awesome formulas from your physics classes regarding the speed of light and velocity factors through copper transmission mediums.

RyanN
12-01-2016, 12:43
I just received ours. Item was not as described. I got 50' of green wire with a yellow tracer. Hopefully just a mess-up, but I contacted the seller.



The seller admitted the mistake and is resenting the wire. You should be okay.

Al Skierkiewicz
12-01-2016, 12:54
Make sure your wires have a consistent twist ratio, otherwise, it is possible to have the P and N signals arrive out of phase.

???

kiettyyyy
12-01-2016, 12:59
???

You want to ensure that both lengths of the positive and negative wires in the differential pair are the same.

It's common practice to ensure you don't have data skew.

Al Skierkiewicz
12-01-2016, 13:46
Kiet,
At higher data rates that is true. At 1 MPS, the wavelength is approaching 1000 ft. so you would have to fudge the twist by several feet to skew the data.

kiettyyyy
12-01-2016, 14:45
Kiet,
At higher data rates that is true. At 1 MPS, the wavelength is approaching 1000 ft. so you would have to fudge the twist by several feet to skew the data.

Definitely true. I've been working on much higher speed busses for too long :)

CAN is pretty robust.

adciv
14-01-2016, 16:44
The wire and the terminations really do matter, sorry.
The twist of the wires or at least the constant spacing between wires sets the transmission line impedance. The CAN transceivers need the termination resistors to operate correctly. They help set the signalling voltage level and terminate the transmission line. Without them, the reflections at each end of the line allow errors to build up. This is an effect of the length of the line. The longer the line, the worse the effect. Also, the CAN buss should never be parallel wired. In short systems it may seem to work but, as is typical, this system will fail you when you need it the most.
The twisted wiring allows both wires to be exposed to external noise. Since the intruding noise is in phase as it passes through the wire, the twist will cause the 'in phase' noise to be cancelled at the source. Any noise that remains will also be in phase and that will be cancelled at the differential input to the transceiver chip. The twist of 2-3 turns per inch will produce a shunt capacitance of ~20-30pf per foot.
Murphy is always lurking...

Given the length of wiring in FRC robots, reflections are not an issue. Large industrial systems are another matter.

As for twisting and external noise, running the wires together is what allows it to be robust and to cancel out the noise with the differential receiver, not the twisting. The twisting creates an inductance in the line, running the wire in parallel (twisted or not) creates capacitance between the two. The inductance added by the twisting helps to cancel this out.

Al Skierkiewicz
14-01-2016, 17:31
At 1 MPS, the wire all by itself has inductance. The series inductance and the parallel capacitance sets the line impedance. I use twisted pair shielded cable for a variety of applications, mostly audio. Typical cable has an impedance that is approaching 60 ohms with a parallel capacitance of ~23pf per foot. Ironically, a low impedance transmitter sending into the bus will "see" a 60 ohm load when the bus is terminated at both ends. This is similar to the twisted pair the phone company has used for more than a century. They found that terminating in 600 ohms (about 10 times the actual line impedance) they were able to minimize line loss while getting a flat response if they maintained a source impedance of the same load. I linked a TI CAN document in another thread that shows the waveform distortion with mis-matched loads.

Sparks333
14-01-2016, 19:15
Also, the CAN buss should never be parallel wired. In short systems it may seem to work but, as is typical, this system will fail you when you need it the most.

Hate to disagree with you, Al, but CAN as a standard is supposed to be a multidrop communications protocol - it's specifically designed to be wired in parallel. In fact, most CAN devices don't have termination built in; they expect termination to be included at either end of the bus. Now for the caveat: I believe the variation of CAN FIRST uses is called Falut-Tolerant CAN, which has terminations at every endpoint, and expects the daisy - chained connection topology implied by the in/out ports of the speed controllers. This means there is a termination at every endpoint, which, when wired in parallel, drastically reduces the overall bus resistance and causes the voltage swing to drop (CAN, like most differential signalling schemes, is current driven instead of voltage level driven). So, while I agree FIRST teams should definitely not connect their devices in parallel, CAN in pretty much any other application is designed to be used as such. Just so none of our bright young minds gets the wrong idea about CAN.

-Sparks
Edit: The Talon SRX manual recommends a parallel linear wiring topology. They're not doing any crazy - just vanilla CAN. Absolutely wire your CAN in parallel

ozrien
14-01-2016, 19:49
FRC CAN is DW_CAN (aka Dual wire CAN, ISO11898 ).
There are only two termination points, each end of the cable (120ohm).
This means one long transmission line, where each ECU taps in (with a small stub length).

FRC CAN is NOT LSFT-CAN(aka Fault Tolerant CAN, Low Speed Fault Tolerant). Fault-tolerant means something very specific.

The two green wires (Talon) and two green connectors (PCM/PDP) are common. Same is true for yellow. So this produces one long bus-harness that each device taps into (albeit internally, but it is a tap). That's kinda why I never really liked the term daisy-chain, but as far as the person wiring it all, it does all hookup in that fashion, so I'm okay with it.

Sure we could put one single small pigtail on every CTRE CAN Device and force teams to create a bus harness (like in a car) but I think the solution we have now is more robust.

timytamy
15-01-2016, 08:19
FRC CAN is 1 Mb/s.

Do you have a source for this? Particarly one that delves into more of the specifics of the FRC CAN protocol?

RyanN
15-01-2016, 08:35
Do you have a source for this? Particarly one that delves into more of the specifics of the FRC CAN protocol?

http://www.ctr-electronics.com/pcm.html#product_tabs_tech_specs
http://www.ctr-electronics.com/control-system/pdp.html#product_tabs_tech_specs

Look at the technical specifications.

More detailed information would be great. I'm thinking of adding a CAN device to the bus, but I'm having trouble getting the timing just right for 1Mbps.

evanperryg
15-01-2016, 09:12
I have searched around for the discussion I'm sure has been touched on many times. Lots of post using phone wire for CAN in the past. My history started last spring so Roborio is my starting point. I would like the team I'm mentoring this winter to start using feed back to operate their robot this year. The off season labs we been preforming has got everyone excited with the possibilities. What I have observed though is many or most of the connection cables we have are pieced together sometimes with two or more solder joints and not always matching colors. I bought a supply of pins and sockets.

Now I'm asking for your experiences would phone and/or Ethernet cable work well for making cables? Solid or stranded? With both types i usually like this strip twice as much wire off and fold it back once to get a solid connection.

A lot of the phone wire usage has stopped with the new CAN interface. Before 2015, the only option for CAN motor controllers, the Jaguar, required you to use phone cable-esque connectors, hence the use of phone wire. Last season, with the new CAN interface used on the Talon SRX, we just used some yellow and green 22AWG stranded core wire, twisted together by hand. The beauty of CAN is that it's not overly sensitive, as long as you have it terminated properly. If you're looking for a way to connect CAN lines together, I suggest these. (http://www.kinequip.com/222-412.html?gclid=CNz30d7_q8oCFYVAaQoda6MAlg) They are tool-less, easy to use, and they hold well.

FrankJ
15-01-2016, 09:40
The first documentation in the Crio days suggested regular 6 wire flat phone cable for the canbus. Only two wires is needed for the CAN but the RS232/can converter was in the first Jaguar in the chain so you needed 3 wires for the RS232 to the Crio. (unless you where using the Cross the Road ethernet/can convector) The CAN physical layer standard (CIA 102) allows flat or twisted pairs. Both NI and TI have application papers saying that short stub lengths connecting the devices to the daisy chain is OK. I know a lot of people blamed the com wiring for motor control problems back in the day, but I expect it was more programming issues. The FRC implementation of CAN had a lot of gotchas in it. Not yet mentioned is stranded wire is better than solid from a physical stand point.

So what is my point? The com wiring is pretty forgiving, especially the short length in you typical FRC robot. But if you do right from the start, it is not one the things you have to trouble shoot when having robot problems. You can use flat or twist pairs. My preference is for twisted. You can get away stub lengths that approach what looks like a star configuration. My preference is to keep it flat as possible. You want to avoid running the CANBUS parallel to the motor control wires. You want to securely splice the CANBUS wire together either using connectors or terminals. Loose wires will cause com errors.

s1900ahon
15-01-2016, 11:22
Do you have a source for this? Particarly one that delves into more of the specifics of the FRC CAN protocol?

You mean other than my faint memories?

You can get all of the published documentation, including the protocol documentation:
1. Goto http://www.ti.com/tool/rdk-bdc24-cd, click the 'Get Software' red button, fill out the export regulatory stuff, and download the last distribution.
2. In the Folder, you should find Software > StellarisWare > docs > SW-RDK-BDC24-UG-xxxx.pdf (where xxxx was the last release #).

Section 4.1 contains the partitioning of the 29-bit MessageID. Note that since the most-significant bits of the message contain Device Type and Manufacturer, CTRE can, and probably has, defined their own API. The APIs in that document were for Jaguar.

JReid
17-03-2016, 11:13
We used a high quality 22 gauge stranded wire that we twisted ourselves, the CTRE CAN connector (http://www.ctr-electronics.com/can-connector-5-pack.html) and crimped ferrules with reasonable strain relief using shrink tubing. Zero problems to date. While the CTRE connectors are a bit unwieldy, the familiarity with the Weidmueller connectors made that choice clear for us.

We used short stubs to the bus per this diagram (http://digital.ni.com/public.nsf/$CXIV/ATTACH-AEEE-8P65LW/$FILE/CAN%20Bus%20Picture.JPG) that I just found which pretty much summarizes all that I learned in the below documentation.

I found several helpful resources just surfing around the internet.

Honestly, the Wikipedia (https://en.wikipedia.org/wiki/CAN_bus) article is pretty good.

One in particular that I really found helpful was Understanding and Using the Controller Area Network (https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=6&ved=0ahUKEwiou5el_MfLAhXDs4MKHbCwClQQFgg6MAU&url=http%3A%2F%2Finst.cs.berkeley.edu%2F~ee249%2Ff a08%2FLectures%2Fhandout_canbus2.pdf&usg=AFQjCNHWAYCu8y2g2y0vj8JARGznVN_CVw&sig2=PB6JvkaPn66cnlPfAUBqUg&cad=rja) by Marco Di Natale posted at berkley.edu It is long, but it references many standards documents and gives a good understanding of how it all works.

If you really want to get your geek on try http://www.can-wiki.info/ which has an excellent network of links.

teslalab2
17-03-2016, 21:18
I used phone wires that I cut in the center and then inverted the connections and soldered it back together. I did try take the last terminator resistor out and the 4 jags didn't care. honestly though I think it would be easier just to get a crimping set...

juchong
24-03-2016, 18:20
In a pinch, you can take apart a CAT5e cable with stranded inner conductors and use it to daisy-chain your CAN devices. Alternatively, as cheap as the cable is from CTRE, AndyMark, etc. I would highly recommend buying the correct cable instead of making your own.

Alternatively, you could find some green/yellow 22 or 24 AWG wire and twist your own.