Weird Can bus peak and deformation i need help understanding

Thread Starter

MikeLavoie

Joined Jun 2, 2023
7
Hi,

I have an issue i'm trying to solve on a cnc press brake CAN bus. I get generic error on the bus often.

On one of the 2 Bus all is perfect.

On the second one i have weird peak at the end and sometime the waveform is deformed at the start. I hope someone will be able to help me understand what's going on there. Finding ressources to help with niche issues like that is quite hard...

Thanks you all and have a nice day!
 

Attachments

Ian0

Joined Aug 7, 2020
9,803
The larger pulse towards the end of each packet is easy to explain - it's the acknowledge pulse, and that is provided by aone or more nodes receiving the signal, not the node sending the signal. The receiving node is either nearer your scope, or has a different driver with better voltage output.
The larger pulses at the beginning could be part of the arbitration process, and may be from a nearer node that loses the arbitration leaving the farther node to continue to send the packet.
 

LowQCab

Joined Nov 6, 2012
4,063
You should have Signals from 2.5V to 5V, and, 2.5V to 0V.
The fact that You don't see these Voltages would tend to indicate that
You may have either weak Power-Supplies, or
very long Network-Wiring-Runs, or
doubled-up Termination-Resistors somewhere, or,
a missing Termination-Resistor at either end of the Network-Wiring-Run.

These erroneous Voltages,
and the excessive Noise on the Signal,
could also be caused by the methods used to
connect your Pico-Scope-Probes to the Network-Lines.

CAN-Buss-Network Twisted-Pairs operate just like an RF-Transmission-Line.
If the Wiring violates any of the "best-practices",
You are likely to have Signal-Reflections running back and forth from
one end of the line to the other, causing all sorts of weirdness.

Check to make sure that your Network-Wiring, and Termination-Resistors,
are following all the rules.
.
.
.
CAN-Buss Wiring and Resistors .png.
CAN-Buss Resistors

The following was in an RTF File which can't be downloaded in this Forum.


The purpose of the Resistors is to match the Impedance of the Wiring used.

"" Why has the CAN standard selected 120 Ohm resistors at each end ?
The answer is that most automotive cables are single wire.
If you take the wires typically used in a car and twist them into a pair,
you will get an impedance of ~120 Ohms.
If you then squeeze the twisted-wires into a Cable,
the Impedance typically drops to around ~105-Ohms,
and then if You use thin insulation, ( as in CAT-5 Networking-Cable ),
the Impedance may then drop even further to around ~100-Ohms. ""

The Resistors basically eliminate the effects of
the Capacitance contained in the "Twisted-Pair" Conductors.
This sharpens-up the corners of the Data-Waveform.
This allows for High-Speed Data-Transfers with fewer corupted Data-Bits.

The shorter the Buss is, the less critical the Resistors are,
because there is less total-Capacitance in the Wiring.

The CAN-Buss Transceiver-Chips are designed to
normally operate into a ~60-Ohm Load.
Therefore,
the total value of all resistors should not be less than ~60-Ohms.

"" A simple solution is to place two 120 Ohm Resistors
on the cable at 2 locations that will assure a 60 Ohm load.
This will result in a proper Recessive-Level for any
number of Nodes connected to the Buss.
For bit-rates above 125 Kbit/s, or, over long Cables,
will it be necessary to place the load at the two ends of
the cable to prevent Oscillations at the "Bit-Edge. ""


"" What is the impedance of my cable ?
This is not a simple question because it depends on
the cable’s composition, and isolation properties,
together with its mechanical dimensions.
A typical Coax-Cable will be ~50 to ~75 Ohms,
and a CAT-5 Cable will have a ~100 Ohm Impedance.
A Resistor with the same value as the Cable
should be placed at both ends of the Buss. ""

"" To achieve a certain load to create the "Recessive-Level",
a Resistance is placed between the Twisted-Pair Wires.
This Load ensures that a certain amount of energy is required
to create an adequate Differential-Voltage between the two wires.
The Resistor also ensures that the Voltage-Difference
returns to zero when the "Dominant-Level-Signal" disappears.

One challenge is to select an appropriate value for the Resistor
which will define the "Recessive-Level".
During a "Dominant-Level" Signal-Transmission,
when a CAN-Transceiver is sending a binary 0,
it is necessary to achieve a certain signal level,
while at the same time,
recognizing that a lower Resistor value will demand a
higher Current from the CAN-Transceiver.
In other words, to save energy,
the Resistor value should be as high as possible.
However, this has it's drawbacks.

There are two challenges related to high Resistor-Value.
Firstly, if the Resistor has a high-value,
the Communication-Stream will be more vulnerable to Errors.

Secondly, during a dominant state, ( Low ),
Capacitance in the Buss will need to be discharged.
To get the best performance,
the Resistor should have the lowest practical value.

For low speed communication (< 125 Kbit/s),
the rise and fall time is ~500 nanoseconds,
and this Signal change will be spread out over ~100 meters.
So if the CAN-Buss is less than ~100 Meters,
it is possible to place the Resistor at any place along the Buss.

For Bit-Rates above 125 Kbit/s, a new problem is created,
because an increased Bit-Rate also demands higher Slew-Rate.
If a Slew-Rate of ~500 nanoseconds works at 125 Kbit/s,
then a slew-rate of ~50 nanoseconds will be
required when sending at 1 Mbit/s,
this causes the Bit-Edge to be spread out over a ~10 meter Buss-length.
If the CAN-Buss is longer than ~5 meters,
the Bit-Edge will reach the other end of the CAN-Buss
and be reflected back again,
where it will be reflected over and over again until all the Energy
is absorbed in the Cable-Resistance.

Reflections and Ringing in the Signal are both bad,,
and to remove these, it is necessary to somehow absorb the Energy.
This can be done by placing a Resistor at each end of the CAN-Buss
with the same value as the Impedance of the Cable.

A properly sized Resistor will absorb
all the Energy in the Edge of the Signal,
resulting in an almost perfectly shaped Square-Wave,
without any Ringing or Reflections. ""
.
.
.
 

Ian0

Joined Aug 7, 2020
9,803
I didn't see excessive noise on the signal. The noise seems like par-for-the-course to me. In fact it looks like power supply ripple from a switched-mode. It would have to be a LOT bigger to upset a CAN receiver.
You can also see a small DC shift after acknowledge pulse, which confirms that is being transmitted from a different node.

Is perhaps the main signal coming from a 3.3V CAN transceiver and the ack from a 5V?
 

Thread Starter

MikeLavoie

Joined Jun 2, 2023
7
You should have Signals from 2.5V to 5V, and, 2.5V to 0V.
The fact that You don't see these Voltages would tend to indicate that
You may have either weak Power-Supplies, or
very long Network-Wiring-Runs, or
doubled-up Termination-Resistors somewhere, or,
a missing Termination-Resistor at either end of the Network-Wiring-Run.

....................................

A properly sized Resistor will absorb
all the Energy in the Edge of the Signal,
resulting in an almost perfectly shaped Square-Wave,
without any Ringing or Reflections. ""
.
.
.
Before going for the scope i verified the resistance, 60.1. So both end resistor seems good. I also verifier resistance of all 7 servo drives on that can line to ground, and resistance on the drive between can hi and can lo and all was to specs.

The only things that i find low is the resistance to ground that hover around 12kohm. I've calculated the parralel resistance of the 7 drives + the controller that is around 1.5M and it gives me 190K...
 

Thread Starter

MikeLavoie

Joined Jun 2, 2023
7
I didn't see excessive noise on the signal. The noise seems like par-for-the-course to me. In fact it looks like power supply ripple from a switched-mode. It would have to be a LOT bigger to upset a CAN receiver.
You can also see a small DC shift after acknowledge pulse, which confirms that is being transmitted from a different node.

Is perhaps the main signal coming from a 3.3V CAN transceiver and the ack from a 5V?
Thank you for both of you comment i appreciated the help. I did not put the whole info on the table to focus on the one i spoke about so far. You seem to think that all you there is normal.
Another things that could cause my issue is the interference from the switching frequency of the servo. I took this trace before activating the servo to have a cleaner signal to show. When i activate the servo i have 16KHz interference pulse on the signal too. I was seeing them way worst then they actually are i think. I focused on that first but after having looked that all cable are grounded properly, all rj-45 are shielded cable and all look proper i realised that it was my scope lead that was mostly picking the interference. But still i have around 1.5volt pulses at 16khz, dont think it enough to mess with can but it could be. I will post more picture i took when i'll be back from vacantion in a week. In the meantime if you have any clue about a possible thing let me know.

Thank you again!
 
Top