BlogoftheBiker.com Logo

Saturday, July 26, 2014

Custom CAN System Logs Motorcyle Data like Magic

Custom CAN System Logs Motorcyle Data like Magic

Custom CAN System Logs Motorcyle Data like Magic

RW-2x_on_stand_at_TRC
A student team at Ohio State University has designed and built a custom Controller Area Network (CAN) data acquisition system complete with a sensor interfacerider display, and a Linux-based data logger for a RW-2x motorcyle.
They call their small, convenient micro-controller circuit board the Magic CAN Node, and it measures automotive sensors throughout the electric vehicle. This includes a variety of thermistor resistors to check changes in temperature. A few 0-5V and 0-12V sensors to monitor brake pressure transducers along with some differential air pressure sensors can be added too. Since the vehicle is basically a “rolling electromagnetic noise bomb”, they wanted to keep all of these analog sensors as close to the source as possible.
The Magic CAN Node is based on a Texas Instruments microcontroller called theTMS320F28035. This keeps the energy consumption at a low level.
For message handling, the team, led by [Aaron], tapped into the built-in CAN module within the F28035. All of the CAN plugs have two of the pins shorted to GND or +12V, so when there’s only one plug connected, the analog switch IC will connect a 120 ohm resistor across the CAN lines.
The rest of the board is laid out in SI units, but the expansion interface is 0.1” pin headers on 0.1” centers. Seven of the analog inputs are available on the expansion header, as well as PWM outputs and digital interfaces (serial, SPI, I2C). Plus, a backpack can be made out of some perfboard if needed.
Software features can be programmable over CAN as well making it able to receive and respond to commands over the network bus. The user interface is made up of bright, illuminated push buttons and has a unique feature in which the buttons light up, either red or green, depending on which way current flows. Lights in the buttons indicate which ones are active. Tri-colors indicate the status of the motor controller and GPS/datalogging unit.
Capture
Combine together the CAN bus and a datalogger and they created the CANCorder! This is a device on RW-2x that uses a Beaglebone Black, which not only records all the data on the CAN bus but also provides a quick and easy way to access the current data inside. It can even find past data recorded as well.
It was created by [Jenn] who was equipped with a custom built cape and a USB WiFi dongle to transform the Beaglebone into the CANCorder. This provided the them with the basic features to start off the project: which was a way to access CAN data easily.
Their early goal for data logging was achieved by using a database file to cross check the various CAN messages that the CANCorder intercepted. They did this by programming the software to parses a specially formatted file that holds all the CAN messages. The data parsed by the software then had to be stored in a way that allowed quick searching later on.
An AVL tree was chosen because it self balances itself as nodes are inserted; allowing for quick searching. Since adding nodes would occur only once during execution and nodes would never be removed, the inefficiency with these two operations was not a concern.
download
For more CAN hacking, check out this introduction to CAN and automotive hacking.