Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   Can I branch the CAN to go to two separate places? (http://www.chiefdelphi.com/forums/showthread.php?t=151509)

Wasabi Fan 24-09-2016 14:21

Can I branch the CAN to go to two separate places?
 
So far, we've always been wiring CAN devices in series so that one pair of CAN wires on a device feeds directly into a pair on the next device, and all devices are in series. What would happen if I were to branch the CAN so that the output wires on a device split and I sent the two resultant pairs to different devices? I've read technical documentation on the CAN so I have some ideas, but I'd like to get an opinion from someone who knows about this in detail before I draw a (potentially incorrect) conclusion.

teslalab2 24-09-2016 14:31

Re: Can I branch the CAN to go to two separate places?
 
If you get it Phased correctly it should work. Do you have the access to just try it? I am curios to find out.

AllenGregoryIV 24-09-2016 14:40

Re: Can I branch the CAN to go to two separate places?
 
It's not recommended but I've seen teams do it and not have any issues. It's probably one of those things where it may work, but it may also cause problems. If you start seeing anything strange like devices not responding it would be a good place to start troubleshooting.

The CAN network seems pretty resilient, I've seen teams run with out any termination in the line. We've used a variety of interconnects between nodes without any issues, etc.

Wasabi Fan 24-09-2016 14:40

Re: Can I branch the CAN to go to two separate places?
 
Yes, we're planning to try it and see how it goes. My main concerns are that it is either not legal (and by extension we would fail inspection) or not functional (the protocol depends on it being sequential and would not function correctly without it). Am I correct that I would theoretically need to add a 120-ohm termination resistor to whichever end doesn't ultimately end up in the PDP? And what do you mean by "phased correctly"?

dirtbikerxz 24-09-2016 15:14

Re: Can I branch the CAN to go to two separate places?
 
My advice would just be to not do that. I get that you might have one talon on one end of your bot, and another talon on the other end. But can wire is so thin anyway, just run a really long strip. No point in introducing points of failure into an already relatively "fragile" system.

techhelpbb 24-09-2016 15:34

Re: Can I branch the CAN to go to two separate places?
 
When you split a terminated bus like this you create the probability of reflections. If you look up a tool called TDR:
https://en.wikipedia.org/wiki/Time-domain_reflectometer

It is not recommended to do this.
Certain patterns of communication traffic might become garbled.
Resulting in intermittent errors you can't see a cause for.

Leaving an end unterminated is actually worse, as well would be using the wrong value terminators.

Arhowk 24-09-2016 17:42

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by dirtbikerxz (Post 1608816)
just run a really long strip. No point in introducing points of failure into an already relatively "fragile" system.

From both a CSA and a head electrical's perspective these seem like two conflicting points. I've seen a great deal of wire cut because of things like drilling, nuts/bolts, zip ties, or just normal wear and tear (robot on robot action). Resilience does not favor one or the other in an "all encompassing" scenario.

jnicho15 24-09-2016 19:32

Re: Can I branch the CAN to go to two separate places?
 
Early in the season, we tried using a central distribution panel for our SRXs in order to decrease the chance of cascading failures. Although this should work since CAN is wired in parallel, we had many problems especially since we were using "PWM" connectors to each one. We then switched to a soldered chain and had fewer problems.

ratdude747 24-09-2016 21:37

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by techhelpbb (Post 1608817)
When you split a terminated bus like this you create the probability of reflections. If you look up a tool called TDR:
https://en.wikipedia.org/wiki/Time-domain_reflectometer

It is not recommended to do this.
Certain patterns of communication traffic might become garbled.
Resulting in intermittent errors you can't see a cause for.

Leaving an end unterminated is actually worse, as well would be using the wrong value terminators.

QFT. Any time termination matters (such as CAN), you've entered the wonderful world of RF where reflections and the like are real. In RF you get to throw away everything you know about electricity and circuits, aside from Kirchoff's laws. Ohm's law? Kiss it goodbye, it doesn't apply any more. Wire spacing and twist rate do matter a ton.

Generally RF rules apply if you're at high frequency (such as CAN, ethernet, or Wifi/Bluetooth) or you're over a massively long distance (such as a 10 mile power transmission line).

TLDR: Don't branch CAN wires, while it seems like it will work in reality it's asking for trouble.

Alan Anderson 26-09-2016 12:14

Re: Can I branch the CAN to go to two separate places?
 
If the entire collection of CAN devices and wiring is physically small enough, you can get away with just about any topology without it breaking.

My advice: don't tempt fate. Use the system as specified and as designed, with a single "chain" of devices each having their own internal very short tap on the bus. Troubleshooting will be much more straightforward.

jee7s 26-09-2016 12:19

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by jnicho15 (Post 1608835)
Early in the season, we tried using a central distribution panel for our SRXs in order to decrease the chance of cascading failures. Although this should work since CAN is wired in parallel, we had many problems especially since we were using "PWM" connectors to each one. We then switched to a soldered chain and had fewer problems.

Emphasis above is mine.

For the record, CAN is "wired in parallel" if and only if you regard the conductors as ideal. The real world scenario has imperfections like resistance, inductance, and capacitance, that make for a much more complicated electrical reality than "wired in parallel". Particularly at 1Mb/s, those lumped elements and the aforemnetioned reflection problem mean that the CAN topology is best implemented as a terminated bus with short branches. The PWM connectors are not the issue, and many teams use that style of connector in a canonical implementation of CAN with no issue. Go back to the Jaguar and the CAN bus uses RJ style connectors with no issues if the connectors are properly assembled and inserted. Connectors in CAN are perfectly acceptable, it's the network topology that needs to be respected.

In other words, like Alan and others have said, don't tempt fate. Wire CAN as recommended in the documentation for best results.

philso 26-09-2016 14:11

Re: Can I branch the CAN to go to two separate places?
 
The CAN standards allow "star" configurations for low data rates over long distances. For your peace of mind, it is probably best to avoid using the star configuration if it can be avoided. With the (low) quality of the wiring I have seen in many FRC robots, a bad connection is at least as likely to be the real cause of their CAN Bus problems.

It is the high edge-rate (short rise-time and fall-time) of the signal that directly leads to reflections, not the data rate. Of course, as the data rate rises, faster edge-rates are required to maintain signal integrity. Many of the CAN transceiver chips have the ability to reduce the edge-rate to minimize reflections when running at lower data rates. Without looking at CTRE and NI's schematics, it is difficult to know if they are using such a feature.

The length of the various line lengths determines whether a reflection causes interference or not. With the rule-of-thumb signal propagation delay of 2 nsec/foot, your CAN wiring would have to be pretty long (in the order of 100 ft.) for it to have an effect on a 1 Mbps signal, longer than one could reasonably put on an FRC robot.

If one wires the CAN Bus with the PDP "at the end of the chain" then one should always have the terminations. With a star configuration (or multi-star), the PDP should still be the furthest from the RoboRio.


Quote:

Originally Posted by ratdude747 (Post 1608843)
QFT. Any time termination matters (such as CAN), you've entered the wonderful world of RF where reflections and the like are real. In RF you get to throw away everything you know about electricity and circuits, aside from Kirchoff's laws. Ohm's law? Kiss it goodbye, it doesn't apply any more. Wire spacing and twist rate do matter a ton.

Generally RF rules apply if you're at high frequency (such as CAN, ethernet, or Wifi/Bluetooth) or you're over a massively long distance (such as a 10 mile power transmission line).

TLDR: Don't branch CAN wires, while it seems like it will work in reality it's asking for trouble.

My coworkers and I are puzzled by some your statements.

wireties 26-09-2016 16:06

Re: Can I branch the CAN to go to two separate places?
 
Do NOT do this! Your goal is to make the robot as robust as possible. One way to make the robot more robust is to wire the power, sensors and control lines per the recommendations of the relevant standards committees or OEMs. Use the correct tools and the correct techniques then test everything over and over again.

Could you get lucky? Sure

Is it worth it? No, a hundred times no

Is it a "professional" thing to do? No buyer would sign off and pay you for something wired incorrectly. You might be thinking "if it works then who cares"? This is where engineering ethics comes in - you are not compliant and you know it. So fix it!

That is my two cents. I've delivered many dozens of high performance systems. And I've been on the receiving end of non-compliant subsystems and made them fix everything (using their own money).

wireties 26-09-2016 16:17

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by ratdude747 (Post 1608843)
QFT. Any time termination matters (such as CAN), you've entered the wonderful world of RF where reflections and the like are real. In RF you get to throw away everything you know about electricity and circuits, aside from Kirchoff's laws. Ohm's law? Kiss it goodbye, it doesn't apply any more. Wire spacing and twist rate do matter a ton.

All the normal rules still apply but there are additional rules (terms in the equations). You are looking at the complex impedance of the load (which did not factor in at low frequencies) rather than simple resistance. The size and shape of the wire and connector pins all matter because they help determine the reactance portion of the impedance (resistance plus reactance). Balancing the impedance of the source and the load become important to reduce mismatches that can cause ringing (reflected waves bouncing around willy-nilly).

So for CANbus the sources have a particular output impedance that performs best when the load has a matching impedance (same resistance and opposite reactance). To keep things simple use wire much like the green/yellow that comes with the Talons. Use connectors with cross sections close to the cross section of the wire. Wire things in series from source to load (like CTE recommends and the CANbus standards dictate). Use a 100-ish ohm resistor for the load (termination). To do otherwise is to ask for troubles that are very difficult to diagnose.

wireties 26-09-2016 16:26

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by philso (Post 1609040)
The CAN standards allow "star" configurations for low data rates over long distances.

QFT - I should have mentioned this. But on the roboRio the CANbus is running near full-speed. You would have to slow the bus down and all kinds of things might stop working (PCM control loops not closing, not enough bandwidth to query/set Talons etc).

jee7s 26-09-2016 16:50

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by wireties (Post 1609055)
All the normal rules still apply but there are additional rules (terms in the equations).

This is taking the thread a tad off topic, but, I respectfully disagree. It's not that there are additional rules. The rules are the same but you can't use as simple a model of the rules.

The so-called "normal" rules are really a number of simplifications and assumptions that apply at DC that don't apply when there is change in the signal. Even the complex impedance is a simplification that applies to lumped element models. Fundamentally, both of these are case specific subsets/simplifications of Maxwell's Equations, which are the set of laws that govern electromagnetism at non-relativistic conditions.

I say this because I think it further illustrates the bad thinking I highlighted earlier: one must acknowledge the assumptions that are used (like assuming conductors are ideal) before applying a concept. It's one thing to use a suitable simplification because a set of conditions are met. I don't think any engineering would happen if we needed to do vector calculus when determining a load instead of using V=IR. But, as a good engineer, you need to know when you can simplify the model and when you cannot.

As an aside, @ratdude: even Kirchhoff's Laws don't always apply, particularly if a changing magnetic flux is present.

wireties 26-09-2016 23:10

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by jee7s (Post 1609061)
This is taking the thread a tad off topic, but, I respectfully disagree. It's not that there are additional rules. The rules are the same but you can't use as simple a model of the rules.

Thus the "terms in the equations" comment ...

philso 26-09-2016 23:54

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by wireties (Post 1609058)
QFT - I should have mentioned this. But on the roboRio the CANbus is running near full-speed. You would have to slow the bus down and all kinds of things might stop working (PCM control loops not closing, not enough bandwidth to query/set Talons etc).

What is "full speed"? A quick search did not turn up any specs on the data rate of the RoboRio's CAN Port. In fact, NI's spec sheet totally neglects to mention the CAN Port in any way.

What do you mean by "slow the bus down"? Do you mean a slower data-rate or do you mean a slower edge-rate?

ratdude747 27-09-2016 01:02

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by philso (Post 1609040)
My coworkers and I are puzzled by some your statements.

That's how I was taught in Electromagnetics class. Of course resistance is still present, but it's not 100% of the picture and looking at it alone will lead to results more puzzling that the statements I made.

Quote:

Originally Posted by wireties (Post 1609055)
All the normal rules still apply but there are additional rules (terms in the equations). You are looking at the complex impedance of the load (which did not factor in at low frequencies) rather than simple resistance. The size and shape of the wire and connector pins all matter because they help determine the reactance portion of the impedance (resistance plus reactance). Balancing the impedance of the source and the load become important to reduce mismatches that can cause ringing (reflected waves bouncing around willy-nilly).

That's more or less what I was trying to say. But that means the normal rules do NOT apply, as V doesn't nessarily equal IR any more. As mentioned earlier in this post resistance doesn't go away, but it's not the only factor and in many situations is negligible.

Quote:

Originally Posted by jee7s (Post 1609061)
This is taking the thread a tad off topic, but, I respectfully disagree. It's not that there are additional rules. The rules are the same but you can't use as simple a model of the rules.

The so-called "normal" rules are really a number of simplifications and assumptions that apply at DC that don't apply when there is change in the signal. Even the complex impedance is a simplification that applies to lumped element models. Fundamentally, both of these are case specific subsets/simplifications of Maxwell's Equations, which are the set of laws that govern electromagnetism at non-relativistic conditions.

I say this because I think it further illustrates the bad thinking I highlighted earlier: one must acknowledge the assumptions that are used (like assuming conductors are ideal) before applying a concept. It's one thing to use a suitable simplification because a set of conditions are met. I don't think any engineering would happen if we needed to do vector calculus when determining a load instead of using V=IR. But, as a good engineer, you need to know when you can simplify the model and when you cannot.

As an aside, @ratdude: even Kirchhoff's Laws don't always apply, particularly if a changing magnetic flux is present.

I was taught in electromagnetics class that Kirchoff's laws do apply in RF, and specifically those alone are what do translate from circuit theory to RF unchanged. While a changing flux can cause all sorts of fun voltages, in a pure snapshot of an RF system all voltages will be accounted for someplace. It may be someplace you don't expect, but it will be accounted for.

Otherwise, obviously I agree.

wireties 27-09-2016 01:38

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by philso (Post 1609111)
What is "full speed"? A quick search did not turn up any specs on the data rate of the RoboRio's CAN Port. In fact, NI's spec sheet totally neglects to mention the CAN Port in any way.

1Mb/s but the actual throughput may vary. CANbus uses NRZ encoding and bit stuffing etc so realized throughput is usually in the 850kb/s range.

Quote:

Originally Posted by philso (Post 1609111)
What do you mean by "slow the bus down"? Do you mean a slower data-rate or do you mean a slower edge-rate?

one implies the other (but not really sure what you mean by edge rate)

techhelpbb 27-09-2016 09:29

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by ratdude747 (Post 1609118)
I was taught in electromagnetics class that Kirchoff's laws do apply in RF, and specifically those alone are what do translate from circuit theory to RF unchanged. While a changing flux can cause all sorts of fun voltages, in a pure snapshot of an RF system all voltages will be accounted for someplace. It may be someplace you don't expect, but it will be accounted for.

Otherwise, obviously I agree.

I agree. In any active AC circuit at a given instant in time Kirchoff's Law ought to work. Now over time, that's a whole different matter. Once one starts decoupling the voltage and the current over time (phase) with capacitance and inductance that transition makes interesting things happen like resonance. Then we gotta start pulling in math like Fourier transforms and Laplace transforms.

Since CAN signals are NRZ digital (with the 1&0 voltages dependent on the PHY layer design) they represent a typical digital square wave of odd-integer harmonics with differential signal. The issue, and the TDR neatly demonstrates this concept, is that an analysis over time (not at any given instant) can produce reflections when the termination or legs (even the legs of the circuit inside the devices) get too long. So it's not merely the real component of the terminator resistance at work. It's the capacitance, inductance and impedance of the circuit as a whole. (Active AC components tend to introduce mathematical imaginary or polar numbers into circuit analysis so when I say real resistance I mean DC resistance.)

Long story short - I don't think anyone in the last few posts disagrees that students shouldn't follow the guidelines. No one wants to have intermittent phantom problems that only happen when a certain pattern of traffic is sent over that CAN bus. I don't think I've ever seen a FRC team test their CAN bus with a BERD/BERT even though the speed is pretty high on that circuit (a T1 digital telephone circuit is basically 1.544Mbps and these are usually tested with something like a T-BERD). There's limited rational reason in the last few years of robots that the CAN bus configuration as recommended can't be achieved. Even if you somehow put a Talon 14 feet up an end-effector you could avoid doubling back with the CAN buss wire (which given you'd be running the power up there seems sort of strange) by simply ending the buss up there.

There are some good examples of why a star configuration has advantages if you suspect your devices might fail to be connected. However, like in computer networking, how far does one want to go to get a star network without the circuit implications? Active CAN hubs? How about a CAN switch? (NOTE: I am making no suggesting the 2 links I provided are FRC legal or even recommended, just pointing out that such devices exist with evidence.)

adciv 27-09-2016 10:23

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by techhelpbb (Post 1609137)
Even if you somehow put a Talon 14 feet up an end-effector you could avoid doubling back with the CAN buss wire (which given you'd be running the power up there seems sort of strange) by simply ending the buss up there.

30 feet, in 2015. And we did end the canbus there (had to find the right resistor for it too).

Related notes, from discussions with CTRE and beta testing the CAN BUS is fixed at 1Mbps (raw rate, not payload) and will not auto negotiate down. I don't think this has changed since then.

Related note if I'm understanding the CAN spec correctly, if a star configuration is used, the termination resistor values need to change so the effective resistance is still ~100 ohms. This would be interesting in conjunction with the fixed values inside the roboRIO & PDP.

philso 27-09-2016 10:42

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by wireties (Post 1609120)
1Mb/s but the actual throughput may vary. CANbus uses NRZ encoding and bit stuffing etc so realized throughput is usually in the 850kb/s range.

one implies the other (but not really sure what you mean by edge rate)

Where does this 1 Mbps figure come from?

Most of the CAN transceiver chips, like the ones I am using at work, are rated by their manufacturers for operation up to a maximum data-rate of 1 Mbps but that does not mean the system they are installed in are running at that data-rate.

Data-rate is a measure (bits per second) of the instantaneous rate at which the data is transmitted over the bus, when there is data. One can also measure the average data-rate taking into account the time when the bus is inactive (unused) and any error correction made necessary due to noise or other problems (resending of packets).

Edge-rate is a measure (volts per microsecond) of how fast the high-to-low and low-to-high state transitions take place. It is the high frequency energy contained in fast transitions that causes reflections. It is possible to have a CAN bus system with a low data-rate (say 1 bit per second) that has significant reflections because there are impedance mismatches AND the edge-rate is very high (the parts I am using have a spec of 35 nsec. minimum).

Once a CAN Bus system is assembled, the line lengths, actual line characteristic impedances, actual termination resistance values, impedance mismatches and actual edge-rates are what determine what the peak voltage and the duration of the reflections will be. The characteristics of the reflections will generally remain constant unless the system is changed in some way.

The CAN Bus receivers are connected to a circuit (usually incorporated in the microprocessor) that roughly synchronizes with the bit edges. The state of each bit is sampled in the middle of the bit period, often multiple times. As long as the reflections after a bit transition has died down by the middle of the bit period, the detected state of the bit will be accurate. This technique was developed a long time ago to make it easier for communication systems like CAN Bus to minimize the effects of reflections in the system.

Many of the CAN transceiver chips can be set to produce lower edge-rates, often using an external resistor. This allows the system/circuit designer to reduce the energy in the reflections (and hence their peak voltage and duration) in the system based on his/her knowledge of the length of the transmission lines (bus length), the amount of impedance mismatch expected and the maximum data-rate required.

The long and the short of it is that the CAN Bus standards were set up with the ability to tolerate some amount of reflections since the people developing the standards understood that the world is not perfect and that the systems will not be manufactured and installed perfectly. Therefore, while it is best to avoid using the star configuration since it is non-ideal, it is not "certain death" to use a star configuration or to add a branch as long as one is taking some simple precautions. Because of the inherent robustness, CAN Bus systems have found many applications outside of the original intended use in cars.

wireties 28-09-2016 00:23

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by philso (Post 1609144)
Where does this 1 Mbps figure come from?

From looking at the CANbus driver code

Quote:

Originally Posted by philso (Post 1609144)
Most of the CAN transceiver chips, like the ones I am using at work, are rated by their manufacturers for operation up to a maximum data-rate of 1 Mbps but that does not mean the system they are installed in are running at that data-rate.

That is because 1Mbps is the recommended maximum rate.

Quote:

Originally Posted by philso (Post 1609144)
Edge-rate is a measure (volts per microsecond) of how fast the high-to-low and low-to-high state transitions take place.

This is more commonly called rise time. And you are correct, it does cause reflection issues.

Quote:

Originally Posted by philso (Post 1609144)
Once a CAN Bus system is assembled, the line lengths, actual line characteristic impedances, actual termination resistance values, impedance mismatches and actual edge-rates are what determine what the peak voltage and the duration of the reflections will be. The characteristics of the reflections will generally remain constant unless the system is changed in some way.

Thus the generic recommendation to wire it in series with a 120 ohm termination.

Quote:

Originally Posted by philso (Post 1609144)
The CAN Bus receivers are connected to a circuit (usually incorporated in the microprocessor) that roughly synchronizes with the bit edges. The state of each bit is sampled in the middle of the bit period, often multiple times.

CANbus does not work exactly like asynchronous serial methods. CANbus receivers attempt to synch synthesized clocks with the transmitter. That is the entire purpose of the NRZ encoding and the RLL coding - to have enough transitions to phase lock a synthesized clock.

Quote:

Originally Posted by philso (Post 1609144)
Therefore, while it is best to avoid using the star configuration since it is non-ideal, it is not "certain death" to use a star configuration or to add a branch as long as one is taking some simple precautions. Because of the inherent robustness, CAN Bus systems have found many applications outside of the original intended use in cars.

With respect using a star configuration is an unwise and strictly unnecessary technical risk. It is a good thing to teach students to follow the recommended use of communications links, sensors and other subsystems on the robot. Otherwise, a FIRST robot can quickly become unreliable. And nearly impossible to diagnose.

philso 28-09-2016 01:25

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by wireties (Post 1609243)
This is more commonly called rise time. And you are correct, it does cause reflection issues.

I had referred to rise-time and fall-time in my original post in this thread. They both contribute to reflection issues.


Quote:

Originally Posted by wireties (Post 1609243)
Thus the generic recommendation to wire it in series with a 120 ohm termination.

I referred to "actual line characteristic impedances, actual termination resistance values, impedance mismatches and actual edge-rates" because the 120 Ohms is only an ideal value for an ideal 120 Ohm transmission line. It is the non-ideal characteristics of a real world system that will cause some minor reflections even though one is using the recommended termination resistance.


Quote:

Originally Posted by wireties (Post 1609243)
CANbus does not work exactly like asynchronous serial methods. CANbus receivers attempt to synch synthesized clocks with the transmitter. That is the entire purpose of the NRZ encoding and the RLL coding - to have enough transitions to phase lock a synthesized clock.

And the phase locked synchronous clock is used by the UARTs to sample the state of the bit in the middle of the bit time to avoid the ringing that can occur with each bit transition. Yes, the coding increases the number of transitions making it easier to implement the PLL. The low-level circuitry used to detect the state of each bit is not really affected by the coding. A bit is a bit.


Quote:

Originally Posted by wireties (Post 1609243)
With respect using a star configuration is an unwise and strictly unnecessary technical risk. It is a good thing to teach students to follow the recommended use of communications links, sensors and other subsystems on the robot. Otherwise, a FIRST robot can quickly become unreliable. And nearly impossible to diagnose.

One of the lessons that the team members learn is management of risk. You are correct that there is risk in using a star configuration. Since there is not really anything with zero risk, the challenge is to quantify the risk and determine if it is acceptable.

For an example, consider a branch on a CAN Bus that is 10 ft long to reach a Talon SRX that is mounted on some arm on the robot using the same wire as the rest of the system. With a 1 Mbps data-rate, the bit time is 1000 nsec. With a rule of thumb value for the propagation time for a pulse down the transmission line of 2 nsec/ft, a 10 ft long branch would cause a reflection that returns in 40 nsec. after the bit transition that caused it. Assuming that the proper termination resistances at the RoboRio and the PDP are in place, it is reasonable to expect that the amplitude of the reflections would have diminished to become insignificant by the middle of the bit time, 500 nsec. after the bit transition.

Based on the calculation shown above, I would determine that the risk of using the 10 ft long branch is minimal. Since each person/team is willing to accept different levels of risk, I can understand if you choose not to use such a branch.

wireties 28-09-2016 08:46

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by philso (Post 1609248)
For an example, consider a branch on a CAN Bus that is 10 ft long to reach a Talon SRX that is mounted on some arm on the robot using the same wire as the rest of the system. With a 1 Mbps data-rate, the bit time is 1000 nsec. With a rule of thumb value for the propagation time for a pulse down the transmission line of 2 nsec/ft, a 10 ft long branch would cause a reflection that returns in 40 nsec. after the bit transition that caused it. Assuming that the proper termination resistances at the RoboRio and the PDP are in place, it is reasonable to expect that the amplitude of the reflections would have diminished to become insignificant by the middle of the bit time, 500 nsec. after the bit transition.

Based on the calculation shown above, I would determine that the risk of using the 10 ft long branch is minimal. Since each person/team is willing to accept different levels of risk, I can understand if you choose not to use such a branch.

A better choice is to put the CANbus termination at the top of the arm. If you had two such arms live with the increased wire length. CANbus can be 40m long, plenty long enough to wire anything on a FIRST robot properly. Lesson #1 in risk management is to avoid risk whenever possible.

techhelpbb 28-09-2016 08:53

Re: Can I branch the CAN to go to two separate places?
 
As I am a CSA: I usually make my recommendations and explain that the default recommended configuration includes ample consideration of system traits, that a star configuration adds risk.

If a team proceeds, has issues, and refuses to change course there is nothing I can do than to keep suggesting that using the branches/star puts additional potential for issues into that system. Sure if all the connections are great the reflection shouldn't be an issue, but then again if those CAN bus wires are moving around...

With the telephone style Jaguar CAN/serial connectors and a Jaguar say 15 feet away on an end-effector are you really sure the connector will not move at all so you can predict the characteristic of that network? Maybe on a bench test this would be okay but what about when that extended end-effector gets smacked by another robot?

philso 28-09-2016 09:43

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by wireties (Post 1609255)
A better choice is to put the CANbus termination at the top of the arm. If you had two such arms live with the increased wire length. CANbus can be 40m long, plenty long enough to wire anything on a FIRST robot properly. Lesson #1 in risk management is to avoid risk whenever possible.

Yes, it would be better to put the termination at the end of the longest branch. I am not sure if the termination resistors in the RoboRio and PDP can be disconnected easily so this might not be possible.


Quote:

Originally Posted by techhelpbb (Post 1609256)
As I am a CSA: I usually make my recommendations and explain that the default recommended configuration includes ample consideration of system traits, that a star configuration adds risk.

If a team proceeds, has issues, and refuses to change course there is nothing I can do than to keep suggesting that using the branches/star puts additional potential for issues into that system. Sure if all the connections are great the reflection shouldn't be an issue, but then again if those CAN bus wires are moving around...

With the telephone style Jaguar CAN/serial connectors and a Jaguar say 15 feet away on an end-effector are you really sure the connector will not move at all so you can predict the characteristic of that network? Maybe on a bench test this would be okay but what about when that extended end-effector gets smacked by another robot?

In your example of the wiring on a moving arm, I would be more concerned about an outright interruption in the connection (connector or wire breaking) than the changes in the characteristic impedance of the cables on the moving arm. My personal experience with moving wires around on such networks (while monitoring with a scope and using proper high-frequency probing techniques) is that the "lumps and bumps" move around in time a little but the overall peak amplitude and the decay time of the reflections are not affected in a significant way.

I may have overlooked them but I don't recall seeing strict limits on the wire size and the twists per foot for the CAN Bus wires to make the characteristic impedance of the wiring more uniform in any documentation from NI, CTRE or any other FRC related sources. I also don't recall seeing requirements for shielding of the CAN Bus wires. There is no requirement that the termination resistors are high accuracy types. Those are the sorts of things one would have to do to make the CAN Bus characteristics more stable but doing those things probably takes one past the point of diminishing returns and greater/unnecessary cost/effort.

With regard to risk management, please keep in mind that the size of the CAN Bus network in an FRC robot is a small fraction of the maximum size intended in the standard. Digital communication systems like the CAN Bus are developed with significant noise margins to guarantee successful implementations by relatively unskilled installers. That is where the restrictions such as the maximum length of the bus come from. As long as one is only using a fraction of the noise margin that has been built into the technology, one should be pretty certain of success.

Looking at the big picture, by following some fairly simple recommendations, the risk of the CAN Bus being the cause of a failure on the field is significantly less than other sources of risk such as choosing the wrong sort of drive train or scoring mechanism.

techhelpbb 28-09-2016 09:57

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by philso (Post 1609266)
Looking at the big picture, by following some fairly simple recommendations, the risk of the CAN Bus being the cause of a failure on the field is significantly less than other sources of risk such as choosing the wrong sort of drive train or scoring mechanism.

Normally, with test data in hand I would agree. However the CAN bus as implemented by the Jagaurs sort of demonstrated how what you get that uses a CAN bus can greatly impact the risk of CAN bus. There were a lot of people that had Jaguar issues and when those were the only ESC with CAN one gets one problem leading to another.

I am not being overly critical of the Jaguar, but FRC11 finally decided to stop fielding them and they now are in a box in my one shop as a result. They were too complex to debug in the 6 week season, changed manufacturer too many times to get fixes and we had some design issues that the Jaguars took heat for. There were some teams that stood out as Jaguar success stories and credit goes where it was well deserved, but it was not the best investment of FRC11 time and resources.

I look at branches and star in a similar way. It would seem to be an interesting rabbit hole. The recommended design does work so why invest in the alternative?

Andrew Schreiber 28-09-2016 10:22

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by techhelpbb (Post 1609267)
I look at branches and star in a similar way. It would seem to be an interesting rabbit hole. The recommended design does work so why invest in the alternative?

It's good to know the limits of the system so you know what you can get away with should you have the need to. Or there's the argument of knowing points of failure... Or there's just the general concept of liking to know things.

techhelpbb 28-09-2016 10:33

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by Andrew Schreiber (Post 1609268)
It's good to know the limits of the system so you know what you can get away with should you have the need to. Or there's the argument of knowing points of failure... Or there's just the general concept of liking to know things.

True but knowing all the points of failure and liking to know things usually does not play well with a 6 week build. There are many examples of KISS in FIRST builds.

Andrew Schreiber 28-09-2016 10:48

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by techhelpbb (Post 1609270)
True but knowing all the points of failure and liking to know things usually does not play well with a 6 week build. There are many examples of KISS in FIRST builds.

I've never had a terribly good sense of time, did I miss the game release again? Crap, I hate it when I do that.

techhelpbb 28-09-2016 11:03

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by Andrew Schreiber (Post 1609271)
I've never had a terribly good sense of time, did I miss the game release again? Crap, I hate it when I do that.

LOL, yeap it is almost bag and tag already.
Time for robot delivery heroics!:D

Seriously, not to discourage those who have the time and motivation but there is nothing wrong with the recommended way. So most of those I know that made Jaguars work and other interesting unusual CAN things on an FRC robot (including my Propeller based CAN ESC) leveraged the off season, or knowledge acquired by someone off season, or even knowledge and resources outside of FRC channels.

It is wonderful to give that extra dimension, but as the complexity climbs you leave the common denominator behind. FIRST picked a design for the CAN bus that should make everyone work in the 6 week build season and then made sure to build process around it. We should acknowledge potential alternatives exist but not create a situation where the CSA job requires a CAN BERD/BERD in the spare parts kit.

FrankJ 28-09-2016 11:33

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by techhelpbb (Post 1609267)
...I am not being overly critical of the Jaguar, but FRC11 finally decided to stop fielding them and they now are in a box in my one shop as a result. ...

I look at branches and star in a similar way. It would seem to be an interesting rabbit hole. The recommended design does work so why invest in the alternative?

The CRio Canbus was RS232 to the first jaguar. That limited throughput to the CRio to 9600 BPS. There were significant programming gotchas on the CRio Canbus implementation. For instance it didn't do well with being loaded with more data than the throughput could handle. I think many issues blamed on Jaguars and wiring was actually programming. Anyway as a system the Canbus Jaguars were problematic. The current Roborio/Talon SRX is way better.

By standard, the maximum recommended stub length is .3 M. Which limits star configurations. Although with the short bus length of your typical FRC robot, you can get away with a lot, but I would stick to the standard. TI has a good application paper on CANBUS here.

techhelpbb 28-09-2016 11:41

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by FrankJ (Post 1609273)
I think many issues blamed on Jaguars and wiring was actually programming. Anyway as a system the Canbus Jaguars were problematic. The current Roborio/Talon SRX is way better.

Agreed there were a lot of issues programming could have addressed with the Jaguars and cRIO, and software fixes have been released to the RoboRIO and accessories, but it is hard on students trying to learn programming to address that sort of thing especially with the time it takes to reload test code into the cRIO and to some extent the RoboRIO.

Programmers without deep hardware/firmware familiarity and knowledge often face these kind of issues when they do embedded work and robotic systems. It becomes extremely important to have clear disclosure and support.

In a way, more CAN devices puts pressure and focus on the system providers to find, resolve and support lest we accumulate risk. I am much more comfortable with how we use CAN now.

FrankJ 28-09-2016 15:37

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by techhelpbb (Post 1609274)
..., but it is hard on students trying to learn programming to address that sort of thing especially with the time it takes to reload test code into the cRIO and to some extent the RoboRIO....

I agree completely. I didn't mean to sound as if I was throwing programmers under the bus.

It is one of those gotchas that you do have to look for in real life. Which generally made PWM a better choice unless you really needed something that canbus gave you.

wireties 28-09-2016 16:48

Re: Can I branch the CAN to go to two separate places?
 
Quote:

Originally Posted by philso (Post 1609266)
Yes, it would be better to put the termination at the end of the longest branch. I am not sure if the termination resistors in the RoboRio and PDP can be disconnected easily so this might not be possible.

You just move a jumper. They made it pretty easy!


All times are GMT -5. The time now is 09:49.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi