Losing my mind diagonsing a CAN bus network - Page 1
Forum section: electronics / projects

author: shamooooot
author_rank: Regular Contributor
timestamp: April 18, 2025, 08:57:43 am
content: HelloFor a project that I am working on, where I am separating different EV car (Nissan Leaf) components to operate them outside the vehicle and after dismantling the main components and extending the wires to them, I am facing a problem with the CAN communication that the car is not only throwing error codes (that I can live with), but force the car to go in power limit mode.- First time I used my own electrical 0.5mm² wires and twisted them myself and just spliced into the harness inside the car and extended connecting them making stubs that were 10m and 15m long.- In my second attempt I used twisted shielded cablehttps://www.etkkablo.com/Uploads/Document/0eb83154-8481-4d7f-94ba-f0d498ef9772.pdfwhere I ran the cable as a loop passing through every module and connecting the modules from the connectors to the cable making stubs that were less than 20cm long. Surprisingly the car passed the power limit mode and I was able to run it at full power, but it still threw some communication error codes.- After the kind of successful test I disconnected the cable and I did the proper management for it, but this time I cut the wires in the cable (because I thought it won't make a difference anyways as they all will be the same node), while keeping them as twisted as possible and soldered each 3 wires together and connect the shield with a jumper.Then using the very same setup I added a CAN bus isolator/repeater one on each CAN bus almost in the middle physical positionhttps://shorturl.at/beVuQ, which made the car go crazy for example one of the new problems noticed was that the car started to turn on by itself.- My 3rd attempt after I gave up finding a dedicated CAN bus cable I brought an RS-485 cable which supposedly should have the exact impedance required (120ohm), but I couldn't confirm that from the manufacturer websitehttps://www.etkkablo.com/en-US/urunler/pvc-sheathed-cables/li2ystcy-tptt/6065/284481. Unfortunately, it didn't work and resulted in the same behavior.Attached is a picture of the RS-485 cable.- My 4th attempt was using a solid Cat 7 cable which was as well a fail and apparently resulted in more communication problems.More details:- I believe the grounding was done properly and the power as well has no issue.- The car has two CAN buses one is the EV CAN which connects the VCM-PDM (power delivery module)-Motor Inverter-Traction Battery. And the typical CAN bus which connects VCM-IPDM-brake-ABS-Meter-BCM (body control module)-- The termination (120ohm) does exist and is inside the modules at furthest ends of the bus.- I always grounded one side of the cable to the car chassis.- I am able to read every module connected through the OBDII diagnostic tool.The dilemma I face now is whether to exclude the cable from the troubleshooting process or to order and wait for a dedicated CAN bus cable.

author: eutectique
author_rank: Frequent Contributor
timestamp: April 18, 2025, 03:40:57 pm
content: Quote from: shamooooot on April 18, 2025, 08:57:43 amWhat exactly are you grounding?As I understand, one end of your CAN cable is connected to the bus. Do you terminate the other end with a resistor?

author: shamooooot
author_rank: Regular Contributor
timestamp: April 18, 2025, 03:49:40 pm
content: Quote from: eutectique on April 18, 2025, 03:40:57 pmMy bad.. I meant I ground one side of the shield of the cable to the chassis of the car. Both ends are connected to modules which both have 120ohm internal resistors, so when I test the resistance between the bus wires it is 60ohms..

author: dietert1
author_rank: Super Contributor
timestamp: April 18, 2025, 05:08:34 pm
content: I remember some CAN tests and it was all quite easy. At the time i used a USB type cable for the bus, in order to route Gnd and supply together with the differential pair. I usedRS232D-Sub 9 connectors with standard pinout for CAN.Instead of try and error you may have to look at the signals using a scope. You might discover very high, nonstandard bit rates..I would also look for wiring errors like wrong differential pair polarity. And the two 120 Ohm terminated units should be at/near the ends of the bus.Regards, Dieter

author: shamooooot
author_rank: Regular Contributor
timestamp: April 18, 2025, 05:15:21 pm
content: Quote from: dietert1 on April 18, 2025, 05:08:34 pmThank you for your input.Actually I checked many times and everything is wired properly evident from being able to communicate with different modules.The scope shows no signs of irregularities in the signals which make it kind of useless in diagnosing the issue.

author: BennoG
author_rank: Frequent Contributor
timestamp: April 18, 2025, 05:20:39 pm
content: Scope signals look ok, no obvious signs of cable stress, is that when jou have your device connected ?The alie can isolator is something you want to lose for now.When your test devices is connected check 2 things.CAN_H and CAN_L are not switched.is the address your device has already in use. (if it is a master you are fighting for master with the main controller in your car)Benno

author: dietert1
author_rank: Super Contributor
timestamp: April 18, 2025, 05:28:04 pm
content: In your video i found this image. There might be a grounding issue. All bus devices need a connection to the same ground, i mean besides the two bus signals. Or there may be an unstable supply for one of the two termination devices.

author: BennoG
author_rank: Frequent Contributor
timestamp: April 18, 2025, 05:30:43 pm
content: that looks like a NAC with the CAN_L not connected. (good find b.t.w.)The only strange thing is it is a white trace, what is the white ?Benno

author: shamooooot
author_rank: Regular Contributor
timestamp: April 18, 2025, 05:36:29 pm
content: Quote from: BennoG on April 18, 2025, 05:20:39 pmHello BennoThe Claimed CAN isolator is out of the picture now..Yes this is the signal when everything is connected to the bus!It happened before where I reversed the connection of H and L and the car does make crazy alarms when I did..Also, regarding the address it seems less applicable option here as there was no change to the car's original setup and no new modules were added to the system..

author: shamooooot
author_rank: Regular Contributor
timestamp: April 18, 2025, 05:41:45 pm
content: Quote from: BennoG on April 18, 2025, 05:30:43 pmThat would be the FFT of the signal..

author: BennoG
author_rank: Frequent Contributor
timestamp: April 18, 2025, 05:43:42 pm
content: Quote from: shamooooot on April 18, 2025, 05:36:29 pmyour test device has an address or is it a master, like a peak usb CAN dongle.P.S. I think most thins we see in your scope video are artifacts of camera shutter and refresh rate of the scope.you are using 500kbps so if you set the cope so you are sampling between 2.5 and 5 mSamples/sec. then stop the sampling and save all the samples to something we can look at it and zoom in to the data.Benno

author: shamooooot
author_rank: Regular Contributor
timestamp: April 18, 2025, 06:01:01 pm
content: Quote from: dietert1 on April 18, 2025, 05:28:04 pmCould you please point out where exactly have you noticed the grounding issue?Actually, all modules are grounded to the car chassis and 12V battery negative as they should..

author: shamooooot
author_rank: Regular Contributor
timestamp: April 18, 2025, 06:04:14 pm
content: Quote from: BennoG on April 18, 2025, 05:43:42 pmI'm just using a standard OBD-II diagnostic tool to read the car's data and error codes. It's not a specialized CAN analyzer or anything - just a basic scanner that plugs into the OBD port. The tool is only reading data passively when I check for errors, not actively controlling any systems. The communication issues persist even when the diagnostic tool is disconnected..

author: moffy
author_rank: Super Contributor
timestamp: April 18, 2025, 10:03:26 pm
content: Quote from: shamooooot on April 18, 2025, 06:01:01 pmThe grounding issue is suggested by the H and L waveforms having the same non flat shape, looks a bit like a ground is moving impressing the same signal on to what should be the flat portions of the waveform. There are other possibilities like a dodgy module, but it is good to check that all the module gnds are solid.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: April 18, 2025, 10:26:17 pm
content: Quote from: shamooooot on April 18, 2025, 05:15:21 pmWell, first, the edges and levels look pretty solid. Looks like termination resistors and such are present. There is a little bit of ringing after the signal flanks, but I think this is within normal boundaries.But then...In the screenshot below, the green and yellow signal traces are out of sync. that should never happen with CAN, and that is a pretty big "irregularity".I'm not familiar with your scope, neither do I know it's settings. It could be an artifact generated by the scope, but if the signals really look like that, there is a big problem with it.

author: Niklas
author_rank: Frequent Contributor
timestamp: April 18, 2025, 10:44:07 pm
content: CAN is a differential bus with ground reference. The transceiver measures the voltage difference between CANH and CANL and it can cope with some amount of common mode voltage difference. How much depends on the transceiver, so it cold be a couple of volts or more than 40-50 V.Did not see anything alarming in the video, but it would be easier to follow if you kept the time base fixed at 2 us/div.What is the difference between when you can access the ECUs with the diagnostic tool and when it does not work? Are the ECUs in fully operating mode (ignition key on), radio mode or off?The ground potential can vary significantly between different locations in a vehicle due to both R*i and L*di/dt. This could cause a transceiver with not so wide input voltage range to detect wrong bus data, resulting in error frames from the CAN controller it is connected to.I suggest that you disconnect the grounding of the shield and see if that makes any difference.Another test would be to disconnect the shield from the chassie connection. Thereis a risk that some load current is fed through the shield to the chassie and could couple to the CAN signal.A shield should typically be connected to the metal housing of the ECUs. However, the plastic connectors commonly used in automotive are not ideal for this and would require a pigtail connection of the shield braid to a crimped terminal.

author: shamooooot
author_rank: Regular Contributor
timestamp: April 19, 2025, 04:54:30 pm
content: Thank you very much guys for all the help..Unfortunately, I spent the whole day today as well trying without any progress and without even narrowing it to which of the buses is causing the communication issues.I mainly tried running extra grounding cables from the grounding point of the body internal ECU's to each of the now external modules. I also tried grounding the shield of the wires and not shielding them. I finally tried moving these modules as narrow as possible to the car/main ECU's in the body these are the small modules that can be actually relocated that are related to the typical CAN bus and not EV CAN bus.I still don't know how essential is it to use a proper CAN bus cable for this job at 500kbps.. Should I go ahead and order an expensive dedicated CAN bus cable?, and which gauge should I go for?.

author: Sorama
author_rank: Frequent Contributor
timestamp: April 19, 2025, 05:02:08 pm
content: forget about cable (issues).your signal is way too clean for that.what if you put the devices back in place and test in between?are you sure it's related to bringing the modules outside the car?

author: Siwastaja
author_rank: Super Contributor
timestamp: April 19, 2025, 05:24:14 pm
content: Quote from: Doctorandus_P on April 18, 2025, 10:26:17 pmNothing's "out of sync", scope is just continuously triggering on random different points in the signals, so that different parts in time are overlapped on screen. You can see that from the fact that both yellow and screen traces show multiple different Y values for some given X."Single shot" button is your friend on situations like that.

author: shamooooot
author_rank: Regular Contributor
timestamp: April 19, 2025, 06:38:31 pm
content: I am kind of sure if I put back the modules at their original locations they would work as the car was in a perfect condition before dismantling, and I was putting it off since it's a tedious job and the big modules are really hard to put back..Apparently the 500 kbps is picky "15m might be problematic with even the most perfect cabling", and I don't know what’s with CAN specifications (ISO 11898) suggesting that 500 kbps can have maximum bus lengths of 100m."With the wrong sampling point and low-quality cable the error counters might start increasing, but communication anyway work. Without termination it might totally stop working even with short cabling in a table-top development setup."I believe the issue isn't noise related, but something else -maybe reflections that can cause CRC or ACK errors...

author: Sorama
author_rank: Frequent Contributor
timestamp: April 19, 2025, 06:44:52 pm
content: Quote from: shamooooot on April 19, 2025, 06:38:31 pmdon't you have decoding possibility to see if and how many packet errors there are?

author: shamooooot
author_rank: Regular Contributor
timestamp: April 19, 2025, 06:51:54 pm
content: Quote from: Sorama on April 19, 2025, 06:44:52 pmI don't have that unfortunately

author: Sorama
author_rank: Frequent Contributor
timestamp: April 19, 2025, 07:01:48 pm
content: there are very cheap but very good and helpful decoders available.I think it would be a good way of troubleshooting your issues.Or maybe you know someone who has a scope with decoding option?

author: shamooooot
author_rank: Regular Contributor
timestamp: April 19, 2025, 07:04:30 pm
content: Quote from: Sorama on April 19, 2025, 07:01:48 pmPlease do suggest me a budget decoder that could help.

author: Sorama
author_rank: Frequent Contributor
timestamp: April 19, 2025, 07:10:37 pm
content: at work we use a few scopes that have decoding possibilities, so no need here for a dedicated decoder device.I'm sure others on the forum can suggest some good stuff.My (20 yr) experience with differential signals like RS485 taught me that improper cabling, even at 456800 baud is rarely the reason why communication got wrong.

author: MacIntoshCZ
author_rank: Regular Contributor
timestamp: April 19, 2025, 07:18:22 pm
content: If you look up to aliexpress there are very budget logic analyzers. I own this onehttps://www.aliexpress.com/item/1005005993277484.html?spm=a2g0o.order_list.order_list_main.17.152c1802bz3mjoIts only 5$ and works for me. So this is probably the cheapest option, but it meets my needs.

author: bobxyz
author_rank: Contributor
timestamp: April 19, 2025, 09:04:59 pm
content: Quote from: shamooooot on April 18, 2025, 08:57:43 amWhat error codes? and from one module or multiple modules?Quote from: shamooooot on April 18, 2025, 08:57:43 amIs that a typo? Stubs of 10cm and 15cm???For your scope video, where were you monitoring the bus? Was it at the connector of a failing module?

author: shamooooot
author_rank: Regular Contributor
timestamp: April 20, 2025, 06:15:14 am
content: Quote from: bobxyz on April 19, 2025, 09:04:59 pm- The errors were from almost all modules on each of the two buses. And mainly it was U1000 which says "When VCM is not transmitting or receiving CAN communication signal or EV system CAN communication for 2 seconds or more"- That was not a typo- Yes the scope was connected at just before the connector of one of the failing modules on the EV CAN bus.Another thing worth mentioning is that when checking the error codes in the manual none of them have the fail safe of making the car go into "power limiting mode/turtling mode/limp mode".Here's a helpful video talking about Nissan Leaf - CAN communication:

author: dietert1
author_rank: Super Contributor
timestamp: April 20, 2025, 07:07:42 am
content: As long as you are spoofing only without tampering the methods shown in the video won't detect that. So you can theoretically spoof without causing errors, but it requires a reasonable bus tap.You don't need to touch any CAN units, but only the CAN bus. You need one short stub with a bus receiver chip. Connecting scope probes to the bus signals can already cause bad termination. In fact one of the images above (at 200 ns time base) showed the step in the leading signal edge indicating that problem.And the bus receiver needs a good Gnd.Regards, Dieter

author: Sorama
author_rank: Frequent Contributor
timestamp: April 20, 2025, 07:21:00 am
content: I think you should go back to basics and start from scratch.Put all the modules back in place and analyse the bus on any easily reachable connection.Too many variables now in your equation.Also, your goal is not clear to my: why do you need to have the modules outside the car?

author: shamooooot
author_rank: Regular Contributor
timestamp: April 20, 2025, 06:22:13 pm
content: I am just building a test bench for the Leaf.Two things I think I really should've mentioned before:1- I've added a lot of test leads tapped into various points of the wiring harness to be employed as test points (they are floating from the other side), none of them includes CAN communications. While the original harness connections remained intact,could these added test leads be causing electromagnetic interference or impedance issues with the ECU's?, even though they're not directly connected to the CAN wires themselves?.2- When the connection points where my extended wires rejoin the harness from the other side. Could these junction points alone introduce enough impedance discontinuity or signal reflection to cause communication problems?:https://youtu.be/QWCoqoA6Va4

author: bobxyz
author_rank: Contributor
timestamp: April 21, 2025, 04:23:33 pm
content: The best CAN bus topology for good signal integrity has the nodes spaced out evenly on the main trunk, and each node connected with short stubs. A couple technical papers for CAN and RS-485 (which has similar signal integrity guidelines) are:https://www.ti.com/lit/an/slla270/slla270.pdfhttps://www.analog.com/en/resources/technical-articles/rs485-cable-specification-guide--maxim-integrated.htmlAs a guess, let's say that 99% of the CAN messages are working OK. To catch a bad message on a scope, you need either a scope with CAN bus decoding&triggering built-in, or a scope with deep memory and enough patience to scroll through the deep memory looking for bad waveforms. If your scope has a Peak or min/max acquisition mode, it might capture the bad message more easily.You can also use your scan tool to target a specific module and/or display realtime data for a single module, which improves the odds of capturing a failure on the scope.For your added cabling, you want to use something with ~120 ohm impedance so that it doesn't have too much of a mismatch with the factory CAN cable segments. If you keep it short, I'd guess that unshielded 100 to 120 ohm twisted pair would work OK. Start with the factory wiring and splice in your new wiring a node at a time to see if/when it starts to fail.For cheap CAN analysis tools, I saw this one a few years ago, but never tried it out:https://canislabs.com/canpico/

author: shamooooot
author_rank: Regular Contributor
timestamp: April 23, 2025, 10:03:21 am
content: Quote from: bobxyz on April 21, 2025, 04:23:33 pmThank you for your valuable reply..I've ordered the logic analyzer and a CAN bus cable:https://products.lappgroup.com/fileadmin/documents/technische_doku/datenblaetter/unitronic/DB2170263EN.pdfI am planning to cut and solder the cable, to the built in wires going to the connectors/nodes. And on the stubs locations making as well a soldered Y connection.While waiting I kept trying without success yet.. I relocated the modules to be as close as possible to each other and connected a 100ohm CAT-7 cable again such that:CAT cable was 3m connected to 120-ohm/10cm wires going to Node A from one side and then connecting the other side of the CAT cable to a 1.5m/120-ohm going to Node B. That didn't work.I am using these connectors now instead of keep soldering/desoldering for quick easy access while keep the twist as firm as possible..https://www.amazon.ca/Four-Out-Five-Port-Connector-Construction-Electrician/dp/B08Y75VTLD?th=1I am tempted, but at the same time hesitant to order a CAN bus repeater/isolator after the failed attempt with the Chinese module, as I don't want to introduce more problems..

author: dietert1
author_rank: Super Contributor
timestamp: April 23, 2025, 11:00:13 am
content: Here i have an image of some CAN adapters that worked well. Of course the CAN232 is limited by RS232 speed and as RS232 does not provide supply it was modded with that red supply input, in case the CAN doesn't provide supply either.The other two are USB adapters. The PEAK adapter is a more expensive pro tool. It comes with a nice analyzer software. We also used a IXXAT CAN to Ethernet adapter, once more a pro tool with rather complex software. Those used to be offered at ebay.We also have a vintage hitex learning board with a Philips P82C150 (multifunction CAN peripheral).Regards, Dieter

author: shamooooot
author_rank: Regular Contributor
timestamp: April 24, 2025, 06:54:38 pm
content: I have sniffed the LOW CAN bus using PulseView as below:1- For EV CAN: sniffed at the battery side, from no power connection - to 12V power connection - to power ON.2- For EV CAN: sniffed at the battery side, from power ON to RESET the EV/HEV using the OBDII - to car READY(driving).3- For EV CAN: power was connected at the start of sniffing - to power ON - and READY(driving) without RESET needed.5- For EV CAN sniffed at VCM side from battery disconnected to power on to ready to power off.4- For theCAR CANbus sniffed at VCM side from from no power connection - to connecting battery - to power on - to READY (driving) without RESET.I pulled out the VCM to be closer to the rest of the modules of the EV CAN bus.The errors are random, yet somehow repetitive: rarely, I just switch power ON and press the brake and press the power again and the car is in READY (drive). Most of the times, I power ON and it won't go into READY until I RESET the VCM using the OBD tool. Sometimes, even if I did a RESET it wouldn't go into READY.Errors description:- When VCM detects an error signal that is received from LBC (Battery controller) via CAN communication.- When EV system starts up, Li-ion battery or traction motor inverter does not permit EV system activation.- When VCM is not transmitting or receiving CAN communication signal or EV system CAN communication for 2 seconds or more.- Traction motor inverter is unable to receive the EV system CAN signal from Li-ion battery controller continuously for 2 seconds or more.- VCM cannot receive EV system CAN communication signal from LBC and traction motor inverter for 5 seconds or more when VCM starts-up.At this point I feel I am barking up the wrong tree, and I really believe the cable I am waiting for will be useless..

author: moffy
author_rank: Super Contributor
timestamp: April 25, 2025, 01:24:54 am
content: Have you replicated the startup power sequencing that the modules experience in a real Nissan Leaf? Is standby power always available to those modules that require it?

author: shamooooot
author_rank: Regular Contributor
timestamp: April 25, 2025, 06:18:32 am
content: Quote from: moffy on April 25, 2025, 01:24:54 amEach module is still being powered from the very same wires that were extended as it was in the original car setup, so I assume so.

author: shamooooot
author_rank: Regular Contributor
timestamp: April 25, 2025, 04:36:01 pm
content: This is actually a good point.There're two annoying errors preventing turning the car into ready. These keep circulating randomly and they don't happen at the same time. Whenever the 12V battery is disconnected and reconnected, or whenever car is left without powering it ON for some minutes:- COMMUNICATION ERROR: VCM cannot receive EV system CAN communication signal from LBC and traction motor inverter for 5 seconds or more when VCM starts-up.- ECU ACTIVATION ERROR: When EV system starts up, Li-ion battery or traction motor inverter does not permit EV system activation.

author: moffy
author_rank: Super Contributor
timestamp: April 25, 2025, 11:05:09 pm
content: Both of those errors look like they can be caused by an EV CAN communication problem/EV startup power issue.

author: shamooooot
author_rank: Regular Contributor
timestamp: April 26, 2025, 06:35:26 am
content: Quote from: moffy on April 25, 2025, 11:05:09 pmLife has taught me to not mess with a car harness, but I went and cut out the very same CAN bus wires in the car that are used for the EV CAN bus and used them for the now outside EV CAN bus, also didn't work.How could the startup sequence be altered by changing the modules' locations while using extended wiring? I am running 34mm²/12m wires for the 12V and GND from the car to the inverter and PDM (Power Delivery Module).

author: Sorama
author_rank: Frequent Contributor
timestamp: April 26, 2025, 06:50:24 am
content: Unless I’m mistaking, you haven’t told what the initial issue with the car/bus is.Why did you try to run the modules outside the car?Why not debugging it while modules are in their original position and wiring?

author: moffy
author_rank: Super Contributor
timestamp: April 26, 2025, 07:19:26 am
content: Quote from: shamooooot on April 26, 2025, 06:35:26 amI have no idea, but it could be related to a bad startup from the symptoms. Wiring issues can be some of the hardest and most obscure faults to fix, not saying it is it could also be a module fault.

author: dietert1
author_rank: Super Contributor
timestamp: April 26, 2025, 10:02:02 am
content: Maybe one of the bus connected components needs an extra Gnd connection that would normally be implemented by the car chassis mount. I mean if some component is now outside of the chassis it may have lost its Gnd.Regards, Dieter