Wednesday, February 3, 2010

Digital Instrument Cluster Development

Since my last post I've been spending most of my spare time developing the software for my digital instrument cluster. I started this over the christmas break by mocking up a Honda S2000 style cluster. This required quite a bit of math that even if I paid attention in trigonometry in school I probably still never would have remembered. But after some pain and headaches I was able to get something that looked somewhat like a Honda S2000 cluster.

Over the last few weeks I have extended this basic screen into a fully working application using the model/view/presenter development design pattern which for what I am doing makes adding new cluster designs, data providers and logic very simple. Think of is a a plug and play system with lots of small components that can easily be interchanged without rewritting software.

I've added three color schemes to the S2000 cluster based on some color designs that Qube Engineering actually make for the real Honda cluster. Here are some samples of the computer based cluster images and below them their originals.










Because I dont have a working Mazda CAN bus system (still collecting parts for the RX8 to get the system working, they should arrive by Friday I hope) I have been using my fiance's Toyota Echo for testing using generic OBD-II (on board diagnostics) port to obtain the data needed for display on a cluster. The problem with this is that I have to query the car for this data and I can only get between 4-6 responses from the car per second so data isn't displayed all that fast. On a CAN bus system I can get hundreds of packets of data in a second so data display will be in real time (the cluster on CAN equiped vehicles uses the exact same data) and in essence be getting the data from the source. The other benefit of the CAN bus is that I am able to obtain information that simply isn't available via diagnostic commands such as when the indicators are on, handbrake is up, brakes are active and quite a lot more.

I've recorded and uploaded two live test runs videos. The first one is a very short test run showing a few more revs, while the second one is recorded in peak hour traffic leaving the city.

Both of the recordings show the following data:
  • Vehicle Speed
  • Engine RPM
  • Coolant Temperature Gauge
  • Intake Air Temperature (Top left hand side of the info box)
  • Current time
  • Coolant Temperature (Top right of the info box prefixed by 'w')
  • Odometer (Bottom left of the info box)
  • Selected Gear (Calculated based on known gear ratios, engine rpm and vehicle speed)
  • Trip Meter A (Bottom right of info box)
The odometer and trip meters are also a calculated value based on the vehicle speed. After some live testing I noticed that they seemed to read a little higher than the cars on board trip meter. I expectED inconsistencies because of the lag in data coming from the OBD requests but I thought I would see how they both compared to a GPS odometer on a clear day. It turns out after 30km of highway/city driving my odometer was about ~50m more than the GPS unit, whereas the cars odometer was ~500m less than the GPS unit. Some more testing in a car with better electronics will be needed to triple check everything but from what I can see the odometer I wrote is actually quite accurate! Nice...

Down the track once I have a working dash running from CAN data I will add some more gadgets such as GPS navigation (basic and driven from google maps like xGPS) combined with an accelerometer (probably from a Wiimote normaly used for a Nintendo Wii) and digital compass. With these combined I should be able to make a halfway decent navigation system that knows which way my car is facing at a standstill. This will also double as a data logger and lap timer for when I race on the track.

So I will know gear, speed, revs, g-forces etc for every single point I am on the race track. A display like what you can get on popular racing games like Gran Turismo shouldn't be to hard to acheive either!

I do have a few other things in the works for the cluster such as a better design based on a Lexus but I will save that for another post once I have made the software more reliable and robust. Until then....