Kelly, CANBUS and Arduino

jumpjack

100 W
Joined
Apr 11, 2011
Messages
197
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?
 
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).
 
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.
 
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.
 
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.
 
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/documentation/tutorials/can-bus-module-shield-tutorial-for-arduino-raspberry-pi-intel-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.
 
Found something about Kelly usage of CANBUS protocol:
http://www.oblibene.biz/userdata/shopimg/elektrolode/file/KBL%20User%20Manual.pdf
Table 2: KBL Controller CAN Commands List (page 15)

Any suggestion about USB/CANBUS module which could be used both on PC and on Arduino?


I also received from Kelly some tips about serial communications; they sent me this document, which is similar to this one but with more info.
I put this info in form of table here:
comandi-new.png

I think there are a couple of errors in the text:
* in ETS_GPIO_PIN_INPUT it is no_bytes=1 but there are 2 bytes in the payload
* in ETS_MONITOR response, data[6] is not described
 
Back
Top