Thursday, October 25, 2012

CANBUS 2011-2012

One of my courses last year involved choosing a topic, designing a system around that topic and then building it.The goal of this course was not to have a working product but to follow the protocol of working in a group. This included having team roles (chairman, minutes secretary), creating a list of system requirements and creating and executing a plan of attack.

 My group of five decide to tackle CANBUS and create our very own CANBUS system to control car headlights. This project alone could have used up half a years worth of blog posts but as I am doing this retroactively it will all have to fit into one.

In combination with developing the system we had to conduct group meetings, maintain hour logs and carefully document everything we had done along the way. I have a rather hefty binder full of information here at home and an empty toner cartridge for this reason.

It did teach me a lot about the process of working in projects. I was fortunate enough to be project leader of our small team and it was my task to steer the team into the right direction. Our team only had 5 members so everyone participated in the development on a technical level. One of the major issues of our team was a member who did not learn or add to anything and refused to do any of the work assigned. We followed our established protocols (written in our bylaws) as far as disciplinary action but nothing helped. After conversing with our teachers he was put out of the group. This was hard for us and him but if he could not contribute he was only going to slow the team down.

But enough of that, on to the technical bits!

We started with matrix multimedia. They have a system called eblocks that are pre-made chips ready for programing. Using a program called flowcode we were able to very easily put down basic programs to make buttons operate lights. When adding a CANBUS controller between the input and output it got a bit trickier.
After many hours of messing with flowcode I finally got a working example:


Of course our goal was to build a system that could be placed into a vehicle so we made the decision to build our own chips. By looking at the schematics of the eblocks chips we were able to find out the bare essentials of what we needed to get the system working. We started with a single chip without CANBUS. Using a breadboard we were able to create this:

We stumbled into issues of pull down resistors while searching for a way to get our lights to turn off after being turned on. After figuring this out we moved on to making a full system on breadboards and got this:


The photo doesn't show it but this system worked like a charm. The input was translated to and from a CANBUS signal and fed to the chip to create our output in LED's.

This system of course could not be fitted into a vehicle but we knew what worked so we could get on to creating a chip. We all had limited soldering skills but with a bit of practice we were able to create this beauty:

This is the chip with sockets for the PIC, CANBUS and transceiver chips. This was the input board.

Then disaster struck, in the rush to get everything done by our deadline a team member accidently hooked up a board without a voltage stepdown. The chips were designed for 5 volts, they did not fare well when hooked up to a 12v source. We had a limited number of chips and with the end of the school year only a few days away it did not seem we would be able to deliver a finished product. 

This was a chance to use my black belt in google and I was able to find a supplier in Poland who had the parts we needed. We negotiated with our teachers to come in the week after school and present our finished product as soon as the chips were delivered.

We had the second issue of not being able to get our output CANBUS board to function. This was a also a major setback but we decided to present a hybrid system to show that we had grasped the technicalities. Our hybrid system had an input board that we had built and soldered ourselves but the output board was the Eblock system we had used in the early stages of development.

We did away with the LED's and push buttons and hooked up our system to a car switch and headlights. The headlights were controlled with MOSFETs to avoid ruining a second set of chips. Our finished product:


On the foreground is our own chip, behind it are the eblocks and in the rear is the MOSFET board. To the right are the headlights.
It worked! To prove to our teachers we had indeed created a CANBUS signal we hooked up a scope
It showed the block signal particular to a CANBUS signal including message ID, filler and message body.

As a team we learned a lot about the different setbacks that can happen during a project and it gave us a healthy respect of Murphy's law. Sorry for the wall of text, if you have made it this far here is a video of the product in action.

A quick disclaimer first: During the production of the system I had decided to add a feature that could showcase the versatility of a CANBUS system: the MAGIC button. When this button was pressed the lights would blink in a sequence, similar to a light show. The intention was to leave it out of the final product but by then we had become too attached to remove it. The video starts by showcasing that feature.



No comments:

Post a Comment