Kelly, CANBUS and Arduino

Electric Motors and Controllers
Post Reply
jumpjack   100 W

100 W
Posts: 184
Joined: Apr 11 2011 6:16am

Kelly, CANBUS and Arduino

Post by jumpjack » Mar 19 2018 3:53am

My Kelly KHB72701C controller is equipped with CANBUS.
Any advice/tutorial/experience about connecting to an Arduino to read data?
Can I also *write* data, i.e. change controller configuration, using CANBUS? (i.e. damage it...)
I read about several CANBUS shields existing: is that all I need? A shield, two wires and an Arduino? It's not very clear to me how data are sent through CANBUS, which one I can read, how they are formatted...
When I connect my PC to controller via RS232, I can see an undocumented CANBUS configuration screen, any idea what is its use?

jumpjack   100 W

100 W
Posts: 184
Joined: Apr 11 2011 6:16am

Re: Kelly, CANBUS and Arduino

Post by jumpjack » Apr 02 2018 10:22am

Anybody?

User avatar
amberwolf   100 GW

100 GW
Posts: 25082
Joined: Aug 17 2009 6:43am
Location: Phoenix, AZ, USA, Earth, Sol, Local Bubble, Orion Arm, Milky Way, Local Group
Contact:

Re: Kelly, CANBUS and Arduino

Post by amberwolf » Apr 02 2018 1:11pm

Kelly would have to provide you the specific documentation on each specific controller model and version's CANBUS info (what they support, what each thing that can be read is, how to read it / interpret the data, whether any data can be written and what it is, and what values are safe to write and what they mean, etc).

CANBUS is really just a data transfer standard / communications protocol--everything after that is up to the device manufacturer to come up with, so each manufacturer does different things with each device they make, and other than just poking around in there with sniffing experiments, and guessing, the manufacturer is teh only certain place to get that info (which they don't have to provide, sometimes will and sometimes won't).

jumpjack   100 W

100 W
Posts: 184
Joined: Apr 11 2011 6:16am

Re: Kelly, CANBUS and Arduino

Post by jumpjack » Apr 02 2018 1:42pm

thanks.
:(

User avatar
flippy   10 kW

10 kW
Posts: 851
Joined: Aug 12 2015 3:07pm

Re: Kelly, CANBUS and Arduino

Post by flippy » May 01 2018 5:21pm

it should not be difficult to use the rs232 to decode and be processed by the arduino. no need for canbus.
also, canbus is a optional extra for most controllers from kelly.
Lithium beats liquid dinosaurs.

thefabus   100 µW

100 µW
Posts: 7
Joined: Jul 28 2017 10:47am

Re: Kelly, CANBUS and Arduino

Post by thefabus » May 01 2018 6:36pm

CAN bus is better suited for automotive applications because it has higher resistance to noise (even though rs232 should work fine too). If you want to use it, you can either use an arduino shield (i think the due is the only one supporting CAN) or you could use a breakout board like http://s.aliexpress.com/QB363uQF. In either case, you have to place proper termination resistors (60ohms at each end between high and low). The kelly controller might already have that internally, you could measure using a multimeter to find out. In software, there is a CAN library which you can use, every decent tutorial should show you how. The last step would be to program the actual communication, for which as amberwolf already mentioned, you will need some sort of documentation which messages you'll need to send. I found some documentation on their website, maybe that's all you need.

Btw, you could also just generate a voltage signal with the arduino and plug it to the throttle input of the controller. But that way you wouldn't get stuff like rpm and current which it should give you on the CAN.

User avatar
flippy   10 kW

10 kW
Posts: 851
Joined: Aug 12 2015 3:07pm

Re: Kelly, CANBUS and Arduino

Post by flippy » May 02 2018 7:14am

making changes on the fly is not possible with most controllers. the kelly will only accept changes after a reboot. also changing stuff while the motor is turning is a awesome way to kill the controller.
the speed signal you can take off the hall output of the kelly, its the grey wire if memory serves.

a decent heavy shunt, hall signal and voltage dividers means you can make a pretty accurate power meter that can register and display a huge amount of data, no canbus needed.
Lithium beats liquid dinosaurs.

User avatar
macribs   1 GW

1 GW
Posts: 3478
Joined: Jul 22 2014 5:59pm

Re: Kelly, CANBUS and Arduino

Post by macribs » May 07 2018 8:09pm

First you need to look up which can bus standard Kelly uses for your controller. Personally I would only go can bus if you got a display hooked up so you can view those data. If you got arduino hooked up ie with own battery you could monitor i.e. voltage over time and other cool stuff. Write to file and present in a graphical user friendly manner.

Maybe start here? https://www.cooking-hacks.com/documenta ... el-galileo


Here is an example of what you can read from a APT controller via canbus:

CAN Bus 2.0 B.

SAE J1939-21 reference standard

[*]The running direction
[*]The high and low speed
[*]Mode selection
[*]Speed low byte (motor rpm)
[*]Speed high byte (motor rpm)
[*]Low power consumption mode
[*]Subtotal mileage. low byte
[*]Subtotal mileage. high byte
[*]Fault code
[*]DC voltage- low byte
[*]DC voltage - high byte
[*]Motor current- low byte
[*]Motor current - high byte

I know some kelly controllers uses this standard as well. Check your manual or contact Kelly directly. They are pretty quick to respond.

Post Reply