Want to Write CAN bus Communication Protocols, No Idea Where to Start

Hey Guys,

In my first thread written here, I had concluded I wanted to use the CTRE HERO developement board as a supplement from the RoboRIO because I will be using Rev Robotics new NEO Brushless Motors with their SparkMax Motor Controller for a personal project. The only problem is, Rev doesn’t support non-RoboRIO Boards for CAN bus, so I would have to implement CAN bus communication protocols myself. Can someone link me a good tutorial or thread that will teach me how to write the communication protocols for the CAN bus using the CTRE HERO Developement board, thanks!

1 Like

I hope you don’t mind a mentor responding.

I’m not sure about the Hero board, but for CANBus, there are a ton of resources available online.

I would recommend finding out what messaging protocol the Talons use. I’m assuming it will be CANOpen, but it could also be the SAE J1939 protocol.

The next thing I’d recommend is finding and purchasing a CANBus adapter for your workstation (I use Kvaser, but it’s not a cheap date). You can read the messages on the CANBus and see what data those messages contain and how they are formatted.

Python has a python-can module you can use to read messages over socketcan (which Kvaser supports), to give you an idea of what’s happening on the wire. When you decode those messages, you would know what messages are being used to control the talons. Reconstructing those messages would then allow you to perform those tasks.

For the Hero dev board, I’d be surprised if Talon didn’t provide you with a library for those upon request.

Python-can library.
https://python-can.readthedocs.io/en/2.1.0/

Open source CAN module:
https://canable.io/

Kvaser CAN module:

Hope this helps.
D

2 Likes

Thanks for the help, but I have a few questions. Are you suggesting finding out the protocols for the Talon because they share the same Protocol with the Spark Max Controllers? Also why would I need a CANbus adapter when the CANBus is already implemented within my HERO board. Thanks.

I’m suggesting if they don’t have the message or pgn definitions available to the public, you could take a workstation and the above linked CAN adapter to read the messages and decode them.

If you can sniff and read the network on the HERO board (I’m not familiar with it), then use that, obviously.

D

Also, sorry for the delay. I’m away on business with limited connectivity or time.

D

Just to put more options on your radar, my setup at work is Vector CANalyzer with the J1939 option. It cost me just north of $5K though, so I echo the whole not a cheap date sentiment. Vector has good free online resources nonetheless. :sunglasses:

1 Like

Another option to add is Intrepid Control Systems’s Vehicle Spy.

We’ve had good experiences with this tool in the past, and it helps that they are based out of metro-Detroit.

Thanks guys! I took a look, but these don’t seem to support my current needs. I’ll keep my eye on them.

@MatthewWinchell, have you had any luck?

D