Tuesday 24 August 2010

The CANBus Plunge!

After spending some time trying to get the communications running better on the valve controller boards (VIC-E) which were using a RS485 multi-drop serial bus at 921600bps, and my own protocol, I finally took the plunge and switched to using a CAN bus. I had made the pcbs with the necessary CAN hardware, so it was just a case of getting my head around the CAN bus protocol and deciding how I was going to use it on the Mantis.



I ordered up a USB CAN converter, a pretty cheap unit from www.canusb.com (Blue device in picture above). Then I re-programmed one of the VIC-E units to simply transmit a message on the bus. It wasn't long before I had some satisfactory results, and after spending the rest of last week and the weekend working on the CAN / VIC-E conversion its pretty much done.To simplify things, I have left the configuration of VIC-E under RS485 control, and the position and feedback via CAN. This means that to change PID settings I plug in a USB to 485 converter to the VIC-E, change settings and can test the output result by driving the valve through the CAN bus interface.

I have written a new windows application to control the valves via the CAN bus, and changed the existing windows app that usees the RS485 bus for configuration.

CANBus Debug View