Perhaps the ''fastest'' way to get started with the CAN Bus is with an Arduino Shield. There's more than one way to lay out a board with the SPI based MCP2551 & MCP2515 chips.

+

Access to a Microchip CAN BUS Analyzer tool is nice, but definitely not necessary. Each of these products has a different [[media:Db9-types.png|pinout on the DB9 port]], but that's not really necessary anyway. If you want to connect to your car, then maybe you will care. We are interested in wheelchair hacking, so the shield with the screw terminals may win right off the bat.

+

+

[[File:IMG_20130408_234148.jpg|thumb|right| The ''easiest'' way may be using the shield sold by sparkfun, which includes 2 LEDs, a little joystick, and some other goodies.]]

+

[[File:IMG_20130410_103821.jpg|thumb|left| The ''cheapest'' way is with the seeed studio shield, which has a nice screw terminal for the CAN bus physical layer connection.]]

+

;[[media:canjoy.pde|Code to generate and send CAN messages]]

+

: Happens to use the joystick on the sparkfun shield

+

;[[media:canblink.pde|Code to receive CAN messages and display them over serial]]

: Including the excellent CAN library, and demos which inspired the code examples above.

Latest revision as of 13:02, 10 April 2013

Our electric wheel chair appears to use a derivative of the CAN bus for it's control network, we need some tools for working on this. There are some different ways to go, however on something like this we need known-good tools to start out with. If anyone wants to go in on a CANUSB cable we can begin hacking on this wheel chair controller. From what I've read this cable essentially gives you a serial interface to the CAN bus, use minicom/hyperterminal/etc. to read data off the bus and to inject commands into it. In theory we could watch the joystick issue commands to the controller and then write some arduino code to mimic the joystick.

PIC dxbus hacking (dosman's note: this search no longer finds schematics for the controller, included for completeness only):

[19]
...
Google this --- Dynamic DX Joystick Controller schematic -- and you will get a rather larger [93 page PDF file] that explains the whole specification. This is suppose to be THE 1101 joystick module.
...

...
Programmable parameters relating to the SLM are contained in the DX Remote
(UCM Remote) and the SLM programs. These programs can be modified using
the PCD (Programming Configuration Diagnostic) tool.
...

Quote from the paper from the paper Schedulability Analysis of CAN based Systems with
Precedence Constraints [22]

DXBus is a four wire communications system
(two power lines and two data lines, CANL and
CANH) with a maximum length of 15 meters
and a transmission rate of 2/19 Mbits/s.
Basically, DXBus uses CAN protocol with
some extensions, i. e. special voltage values
on the data lines are used for “emergency
stops” or power up.
CAN identifiers are assigned to modules and
not to messages. As a result, 1 byte in the
message data field must be used to indicate
the message type, and up to 7 bytes for
message data.
During normal operation, DX modules
communicate using Network Variables (NVs).
NVs are transmitted periodically (during time
slot), with period either 20ms (fast NV) or
200ms (slow NV).
A more detailed description of DXBus can be
obtained from [10]. In this paper, we focus on
the processes associated to DXSIR functions.
DXSIR is a wheelchair with two driver wheels

Perhaps the fastest way to get started with the CAN Bus is with an Arduino Shield. There's more than one way to lay out a board with the SPI based MCP2551 & MCP2515 chips.
Access to a Microchip CAN BUS Analyzer tool is nice, but definitely not necessary. Each of these products has a different pinout on the DB9 port, but that's not really necessary anyway. If you want to connect to your car, then maybe you will care. We are interested in wheelchair hacking, so the shield with the screw terminals may win right off the bat.

The easiest way may be using the shield sold by sparkfun, which includes 2 LEDs, a little joystick, and some other goodies.

The cheapest way is with the seeed studio shield, which has a nice screw terminal for the CAN bus physical layer connection.