# help with canbus



## boughtnotbuilt (Oct 31, 2020)

I need help figuring out why my Hyper 9's are complaining about canbus errors. 

I have 2 hyper 9's, Orion BMS 2 (which is communicating very happily on the canbus even after the Hyper 9's shut down), Elcon charger, Elcon DC/DC.

I've got 120 ohms on the Elcon charger terminating one end of my network. The 120 ohm resistor in the Orion has vanished, so I put a 120 ohm resistor on the connector to it as termination of the other 'end'. The Hyper 9's and Canbus to USB adapter are in the middle. 

Everything is working great, green lights and no faults on the Hyper 9's and the Orion until I hit the throttle, and then the Hyper 9's throw a series of errors relating to protocols - which I understand means canbus has failed. 

Any thoughts?


----------



## remy_martian (Feb 4, 2019)

Need to see how you connected the grounds, but that is likely the problem


----------



## boughtnotbuilt (Oct 31, 2020)

There's a high and a low - there is no ground. Unless you mean the 12v ground.


----------



## remy_martian (Feb 4, 2019)

ground*s*


----------



## boughtnotbuilt (Oct 31, 2020)

I'm sorry, I'm not following you at all.


----------



## cricketo (Oct 4, 2018)

There are different opinions on whether CAN requires a common ground. I will just say that building custom devices using MCP2515 I never had success without a common ground.


----------



## boughtnotbuilt (Oct 31, 2020)

Thanks for that clarification. But, there's no ground coming out of the Elcon or the Orion - or the Hyper 9's with the high and low wires. Each is grounded to the frame using the ground wire available to the case or in the harness. My connectors all have an extra pin, I could run a third wire and connect it to 12v ground - which the Orion and Elcon and Hyper 9's are connected to.


----------



## remy_martian (Feb 4, 2019)

Again...where are each of the grounds connected, including the motor controller? 

You can't ground high power stuff and control electronics anywhere you feel like to the frame and call it good.


----------



## cricketo (Oct 4, 2018)

Note that by common ground I meant a ground that's acceptable for I/O between the participating devices on the bus. Given the I/O is often optically isolated, there may be a separate pin designated as I/O ground as opposed to battery ground.


----------



## cricketo (Oct 4, 2018)

Here is Netgain's wiring diagram :


https://evwest.com/support/NETGAIN_ACX1_Traction_Wiring_Diagram_Rev01.pdf


I/O ground pins are all over the place. No specific call outs for its use in CAN.

Elcon DC-DC with CAN doc :


https://www.elconchargers.com/f/Elcon-TDC-IY_1KW_DC-DC-new.pdf


It calls out CAN_GND on the connector

I don't see Orion BMS calling out I/O or CAN ground, still looking
Orion BMS docs make this call out :
Please note that the CAN transceivers inside the BMS are referenced to the 12v-24vground (Main I/O pin 12) and are not electrically isolated from each other.While most motor controllers and chargers isolate the CANBUS from the battery pack, if the BMS is used with a motor controller, charger, or other device which does not have a CANBUS interfacethat is isolated from the battery pack, an appropriately rated CANBUS isolation device must be used.

Finally Elcon charger (picked a random one from the product list) also makes a call out for CANGND


https://www.elconchargers.com/f/6.6KW_User_Manual.pdf


----------



## boughtnotbuilt (Oct 31, 2020)

Thanks so much, I will go through all those. I think I have them all covered. but I'll make sure. I'll also take a picture of the project and label all the ground points currently in use.


----------



## boughtnotbuilt (Oct 31, 2020)

Here's a picture of where the grounds are on the frame, each ground location is drilled and tapped into the 2x4 box tube frame.


----------



## boughtnotbuilt (Oct 31, 2020)

On the Hyper 9's, I have K1-1 (black with blue stripe) grounded. Although that diagram shows a lot of grounds, they are all the same pin on K1. the only other ground is K1-12 - and it's the thermistor ground.

On the Elcon charger, there is one pair coming out other than CAN, a black ground to the chassis, and a red wire that gets +12 to enable charging. 

On the Elcon DC/DC. I am not currently using CAN, we are just using the Enable line in that connector

On the Orion BMS, I have the chassis of the BMS grounded to the frame. The big connector goes to the Hawkeye SCM and the SCM is also grounded to the frame.


----------



## boughtnotbuilt (Oct 31, 2020)

Also, here's what I'm using for connectors and the resistor I've added in to replace the Orion resistor that's gone away. I've read that using 'friction' connectors is not best, but I can't really solder everything together for a while, and there will always need to be some way to disconnect.


----------



## cricketo (Oct 4, 2018)

Not to comment on the additional information you provided, but I remembered another CAN advice I came across in the manual for my Curtis controller :
*It is recommended that the CAN wires be run as a twisted pair. However, many successful applications at 125 kbit/s are run without twisting, simply using two lines bundled in with the rest of the low current wiring. The CANbus wiring should be kept away from the high current cables and cross them at right angles when necessary.*


----------



## lnstech (Nov 20, 2009)

boughtnotbuilt said:


> I need help figuring out why my Hyper 9's are complaining about canbus errors.
> 
> I have 2 hyper 9's, Orion BMS 2 (which is communicating very happily on the canbus even after the Hyper 9's shut down), Elcon charger, Elcon DC/DC.
> 
> ...


As a consultant, I have wired several EV Canbus vehicles. You should use shielded twisted pair wire:


https://www.automationdirect.com/adc/shopping/catalog/cables/bulk_multi-conductor_cable/control_-a-_signal_cable/q0165-1



Here is more information:


Diagnosing CANBUS Communication Problems | Orion Li-Ion Battery Management System


----------



## boughtnotbuilt (Oct 31, 2020)

Thank you for that, nowhere else I looked said use shielded, but I can. Thanks for the link. Even the Hyper 9 canbus wires coming off the connector are not shielded - but the ones come off the Orion are.

I've read the Orion documentation and I've built the canbus as close to that as possible. And, it has worked in this configuration, and the Orion is totally fine. It's only the Slave Hyper 9 that seems to be having trouble - and I'm not sure what to make of that. As the slave gives up and throws and error, the Orion software continues to read the bus no problem.


----------



## Electric Forklift Guy (Dec 13, 2012)

boughtnotbuilt said:


> Thank you for that, nowhere else I looked said use shielded, but I can. Thanks for the link. Even the Hyper 9 canbus wires coming off the connector are not shielded - but the ones come off the Orion are.
> 
> I've read the Orion documentation and I've built the canbus as close to that as possible. And, it has worked in this configuration, and the Orion is totally fine. It's only the Slave Hyper 9 that seems to be having trouble - and I'm not sure what to make of that. As the slave gives up and throws and error, the Orion software continues to read the bus no problem.


Given the quality of your build I doubt you have a bad ground or configuration problem.

I strongly suspect your CANBUS wires are acting like antennas and picking up interference from the primary wires ( motor leads ) 

A protocol error isnt a failure to communicate , its signals the system doesnt recognize showing up on the CANBUS.

Since you need twisted pairs ( and/or shielded ) wires for the entire CANBUS you should correct that first and see if the problem goes away.


----------



## boughtnotbuilt (Oct 31, 2020)

Awesome, thanks, cable is on the way.


----------



## remy_martian (Feb 4, 2019)

I bet it still won't work. Because it worked fine before...magic antennas, I guess.

Let us know how your random troubleshooting turns out.


----------



## boughtnotbuilt (Oct 31, 2020)

@Eric Can you give me a little more understanding of "A protocol error isn't a failure to communicate , its signals the system doesn't recognize showing up on the CANBUS." So, if all the elements (Elcon, Orion, Master Hyper 9, Slave Hyper 9) are physically connected, and the Slave is giving a protocol error, then that means it can't see the can bus??? I'm trying to figure out how to debug this. going to go out to day and rearrange the canbus and try to move they Hyper 9 connections as far away from the HV lines as possible (which isn't easy). I had run them for simplicity of wiring the car, but I will change it to keep them away from HV as much as possible.


----------



## boughtnotbuilt (Oct 31, 2020)

Okay, I took all the Canbus out of here.










Where it used to work and put it here outside the controller box and on the other side of all the HV.










and now the motors are doing this






So, thanks for the help. It was magic antennas. 

Now, I have a wobble in the drive train that I'm guessing is flywheel or clutch induced.


----------



## boughtnotbuilt (Oct 31, 2020)

Okay, here's an update. Got the new flange in the rear differential and the new driveline in and a couple of tires on the back. Fired up the Hyper 9's up, spun the tires for the first time - Yea! and when I took my hand off the throttle, the Hyper 9's threw a protocol error. So, I looked at the can bus and realized the Elcon was not connected. Which is interesting, because without the Elcon, there's no terminating resistor at that end - so how did it work at all. And now, with the Elcon connected, The hyper 9's are throwing errors when I first press the throttle again. So, I apparently moved the problem, but did not solve it. 






I will post canbus and general schematic shortly.


----------



## remy_martian (Feb 4, 2019)

🍿


----------



## boughtnotbuilt (Oct 31, 2020)

Here is a very crude schematic of the layout.


----------



## remy_martian (Feb 4, 2019)

Red lines, blue lines. No legend. Impossible to read.

Are you really splicing into the can wires to split them out? That's a no no.


----------



## boughtnotbuilt (Oct 31, 2020)

Remy - why are you such a negative ass all the time - all ... the ... time.


----------



## remy_martian (Feb 4, 2019)

Your "schematic" is unreadable and lacks context/explantion. Fix it


----------



## boughtnotbuilt (Oct 31, 2020)

Here's a revised schematic


----------



## boughtnotbuilt (Oct 31, 2020)

Okay, did some more playing, pulled the Orion's canbus cable out of a bundle that included the SCM's HV wiring. And I don't get the results. If I unplug the Elcon charger, there's 120 ohms on the canbus, but it works fine, the Hyper 9's accellerate and declerate, no errors. 

If I plug the Elcon in (60 ohms resistance), then they Hyper 9's throw a canbus error as soon as I hit the throttle. 

Here's some more about how I have it all hooked up.
This is how the Elcon is connected to the network. There is no ground (or shielding) in the Elcon wire. 











This is how the Orion BMS (black wire at top) has ground and it's attached to the connector). CanAdapter is on the bottom, and wire to the Hyper 9's is on the right. Neither has a ground right now.










And here's the Hyper 9's. No ground coming out of the Hyper 9's to connect to. I kept the leads as short as possible and as far away from the HV as possible.


----------



## cricketo (Oct 4, 2018)

One other thing - make sure all of your devices are configured for the same communication speed. I was thinking that perhaps there are collisions / corruption due to increased message rates when throttle is engaged and there are CAN events in relation to that.


----------



## remy_martian (Feb 4, 2019)

You should not create long stubs when you tap into the main bus run. 








Anything more than an inch or two stubbing off will affect the transmission characteristics of the bus and could create signal errors. 

The termination resistor has to go at end of the furthest run of wire.


----------



## asymptonic (Oct 14, 2021)

remy_martian said:


> You should not create long stubs when you tap into the main bus run.
> View attachment 125396
> 
> Anything more than an inch or two stubbing off will affect the transmission characteristics of the bus and could create signal errors.
> ...


Yeah, I don't know much about canbus, but in CAT6 ethernet, I did a home installation and was chastised for having more than 1/4" untwisted at the end. I don't think at 500kbps canbus is that sensitive. My money would be on termination problems first ala my _super_ old days in SCSI.


----------



## remy_martian (Feb 4, 2019)

All depends on his noise margins, which are gunna be shit with that rat's nest. If canbus wasn't sensitive, they'd have pullup instead of termination resistors that you could put anywhere on the bus vs at the end of it.

Start with best practices, then troubleshoot from there.

Twisted pair's a good start.


----------



## DMPstar (Mar 2, 2016)

@boughtnotbuilt
I found this thread when searching for insight into CANbus errors related to motor noise. It has come up a lot lately in my meandering. Bumping your thread as it would be great if you could continue to post, if any, further progress with sorting out your CANbus.
I see from a different thread that you found a workaround for your issue:



boughtnotbuilt said:


> My problem was a configuration issue with the second motor that cause it to not want to turn, and the first motor was turning it - against it's will, which was causing some horrible things. But, once we got that all sorted, it's better. However, I could never get the 2 hyper 9's to live in harmony with the rest of the canbus system. As soon as I hit the pedal (and the amount of canbus traffic increased dramatically) the second hyper 9 would throw a canbus error. I could never figure out what the issues was. And I ended up just having the two hyper 9's on their own bus (with two resistors) and the rest of the system (BMS, charger) on their own bus, and everyone seems happy.


I'm thinking CANbus issues here were likely not _entirely_ caused by the bus termination resistance, location of those resistors, proximity of CAN wires to high-current cables, etc... as critiqued and discussed above. Our good friend remy_martian may have been on the right track with inquiries about grounding (in its many forms), but an algorithm to translate his less-friendly posts into useful assistance is still in its early development stages. 

When you found that unplugging the Elcon charger helped your situation (while bringing the bus termination resistance down to a less desirable 60ohms), was there any chance that charger was being powered at that time and transmitting CAN traffic? Assuming it was not, I will rule-out busload increase from that device for the moment. 



cricketo said:


> There are different opinions on whether CAN requires a common ground. I will just say that building custom devices using MCP2515 I never had success without a common ground.


As above, with an untested or custom design there will be a lot of ground reference considerations to be made. More on this below.



boughtnotbuilt said:


> On the Elcon charger, there is one pair coming out other than CAN, a black ground to the chassis, and a red wire that gets +12 to enable charging.


This sounds like there was a ground from the Elcon communications connector to chassis, but you later said:


boughtnotbuilt said:


> This is how the Elcon is connected to the network. There is no ground (or shielding) in the Elcon wire.


Did you remove this connection when relocating your CAN wiring, or can you clarify?

I happened to notice I was resting my beer on a TC/Elcon charger, 96V older black style. On the communications connector I probed the ground pin (between the 12V and enable pins) against battery negative of the charge output and they are common/connected. Same test on a 300-400VDC TC/Elcon charger had no connection there. Several of the motor controllers I have encountered in the sub-144V range have their communications/low voltage reference common with battery (-). It is nice to know what your different components use for low voltage and/or CAN reference. In EV systems I have worked on where the CANbus devices did not share a common reference/ground (due to isolating 12V and battery grounds from each other), and did not have a CAN repeater/isolator in between these components, CAN errors and eventual CAN circuit failures occurred.

When you have the opportunity, do some continuity tests between the battery (-) contact/post of your different CAN related components and any of the ground/shield/encoder return/+0V/etc..etc.. pins on that device. This knowledge will help you in troubleshooting failures as well as understanding how to get your CANbus back together, if desired. Some products have good explanations of this in their documentation, such as Orion as quoted above, but others are sketchy or hard to determine without actually ohm-meter probing to see what is what.

🍺🍺🍺🍺🍺 good luck with the project, it looks like you have the skills and willingness to learn {edit: and progress so far} to do it!


----------

