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....

Friday, January 8, 2010

Delayed Delivery from Westfield

I just found out that the delivery of my clubman chassis is going to be delayed until proably the start of March. A time when I really wont have much time for building a car as I will be getting married!

So I've refocused the project and decided to pull the development of my electronic/computer dashboard closer and do it now :-) I kind of splurged and bought an ASUS 1gb GTS 250 graphics car, two 22" widescreen HD monitors, a Seagate Barracuda 1.5tb hard drive and a new desk as the coffee table just didnt cut it anymore. While a little bit of overkill this will make development of the dash quite pain free. The new setup looks a little like this, I might even try to get the old monitor going too. Yes, yes very geeky... But what can I say? I am a software developer anyways!


I've also decided to bring the rebuilding of the RX8 engine forward too, two months should be plenty of time to do that and also get the dash software looking pretty slick. I am probably going to do at least two dash designs. One will be a Honda S2000 looking dash and the other will have to be an RX8 one. I should have some decent screen shots pretty soon... Stay tuned!

The CAN Bus and loom developments

I spent most of my time off over the break working on still identifying the remaining plugs on the RX8 loom. I've got it to about 90% now and will have a few extra components delivered soon such as the Fuel Pump/Sender, ABS unit/computer, RX8 Instrument Cluster and a few switches for the dash. Unfortunately I need the computer from the dash to interperet the fuel level signal and possibly to also get the trip computer information. I should be able to make it a bit smaller than it is in this picture.


I also spent some time removing the non-standard things I found in the loom such as parts of an alarm. Whats really confusing though is it looks like some of the wiring going into one of the boxes picture below was coming directly out of the ignition switch plug and appears to be standard wiring but the connectors going into the same box on the other side are spliced into the loom with connectors one might find at a local electronics store...


Because I've identified most of the plugs on the loom I thought it was about time to buy myself a cheap battery and get some power to the loom and see if it works. I did find some damaged wires in the engine loom which were pretty easy to fix. But it seems that one of the horns and ABS sensors were too badly damaged and cut out of the loom before I got it :-( I was able to work out what the wires were at least.


One of the other things I did over the break was develop a program to listen to CAN bus messages on a car equipped with a OBD II port that speaks CAN bus. I was lucky enough to borrow a friends Mazda 2 for this. The program I developed allows me to filter messages, translate the bits of the messages into a number of data types and also perform a formula on this value to get a real world figure such as RPM, Speed etc. All of this can be done while receiving CAN messages and the data can be exported to be viewed later.

Currently the program works with the OBDLink tool I bought recently which translates the CAN headers for me. However the program was initially develop to read unproccessed CAN messages so in theory the application should work with any CAN receiver on a COM port with minor changes. If anyone is interested in a copy then let me know, I will try to find a way to put it up in blogger over the next few days. Here is a screen shot of the app...

Sunday, December 13, 2009

Making sense of Spaghetti

After receiving the engine, gearbox, loom etc a couple of weeks ago I decided that it was about time that I got stuck in to doing some work on the project. Having received my ODBLink on friday and also some wiring schematics for an RX8 earlier in the week I decided that the first place to start was the big mess of wiring that I have which looked like this...


After a few hours of looking over the wiring schematics and sifting through the big mess of wires I was able to untangle them somewhat and it started looking a little more reasonable. I identified about 40% of the plugs in the loom, still a bit to go though... Without the schematics though things would be near impossible, I guess thats one the issues of not taking the loom out of the car yourself.


This is what 20 odd pages of laminated (they should last the build laminated) schematics looks like. And this isn't all of them!


I also wanted to see how the new OBD tool I bought wworks but because I dont have a key for my loom I can't really talk to the RX8 ECU just yet. So I took the opportunity to borrow my fiance's freinds car while they were out looking for dresses and see what sort of data I could get from the CAN bus in her Mazda 2. I was a bit worried the tool I bought might not be able to give me the underlying CAN data from the car but after a bit of searching I found a great pdf for the ELM327 chipset used in the ODBLink. After a few 'AT' commands sent to the device I was able to receive the raw CAN data which I am going to write some basic software to interpreret. For the time being I am just using hyperterminal in windows.


Once I've written some .Net code to interperet the CAN frames I will post the source up here...

Thursday, December 3, 2009

S15 Sold, Engine Delivered

Well after about five weeks and very few actual shoppers and plenty of time wasters I've finally sold my S15. And not a moment too soon, next week I need to make final payment on my clubman so everything is running smooth at the moment.

I also had the RX8 engine and parts delivered yesterday. This on the other hand was not the smoothest of deliveries. Firstly they tried to deliver it on Tuesday without calling me first so that I could arrange to be home to unpackage the 320kg box off the truck. So I arranged for redelivery the following day between 9-12am. It didn't arrive... So after about 5 phone calls to TNT the package arrived at 5:05pm. A wonderful day of daytime TV it was...

I've also been looking into how I am going to tackle the task of wiring everything up. I have the majority of the electrical components from the donor RX8 and I learned recently thanks to a blog named Madox.NET the some Mazda's (RX8 included) run a CAN network that allows all of the electronics in the car to talk to each other much like computers do on a normal network.

With some specialist devices such as OBDLink a normal computer can also talk on this network through the cars diagnostic port. This port will allow me to do two things, firstly I will be able to check error codes from the engine ECU which will help me to pass emissions and trouble shoot setup issues. Secondly I will be able to intercept signals that would normally go to the dash for things like engine revs, speed, trip computer etc

What I am proposing to do is instead of using a dash from a car or motor bike is to instead use an Asus EEE PC T91 tablet PC with the CAN hardware and some software I will develop myself to create my own dash. Because I will be getting data directly from the Mazda sensors, some of which isn't normally displayed to the driver I will be able to show all ADR required gauges and more. What's great about this is it will be far cheaper and easier than buying seperate gauges and having to install new sensors for them. Plus, if I can have a whole range of dash designs and flick through them with a touch of the screen and adding warning lights/buzzers will be a matter of a few lines of code rather than a heap of wiring/cutting etc...

Here is a sample screen shot of a RX8 style dash design written in .Net using Dundas Gauges, I also added a basic three stage shift light that lights up yellow, then organge then completely red when it's time to shift.

Monday, November 23, 2009

RX8 Powerplant Sourced

After a bit of thought and discussion with those in the know (i.e. someone who has rebuilt a rotary engine before) it turns out that the engine that I declined initially could be fixed and relatively cheaply.

One of the benefits other than a cheaper price is that when the engine is rebuilt is will be better than an old second hand one and will also be tweaked a bit to make a bit more power, cant leave it stock when I rebuild it can I??? hehe

I secured a very very good price and made payment today. Another bonus is any of the damaged parts such as the charcoal canister and cold start air pump will be replaced for free once they get another RX8 in. Given that I want the clubman going in about twelve months that gives them ample time.

I also bought an electronic RX8 workshop manual today which should have electrical diagrams in it. The wiring is probably the trickiest part of the build, but it will be the second time I've rewired a car/engine. So while I am waiting for the chassis to arrive I can spend the next month or so going over the wiring harness and trimming it down to just the bare essentials (no air con, heater, power windows, door sensors etc etc etc).

Not long now until I start clogging up my friends garage with clubman parts, very exciting (for me that is!).

Thursday, November 19, 2009

Tools, Tools and more Tools... Oh and an Auction!

Well the sale of the S15 is going rather slow, even after several price drops :-( At the moment I've dropped it to my rock bottom price of $22,999 (last night). So *fingers crossed*.

The really annoying thing is the number of tools who are making ridiculous offers (e.g. $17k) or even others who say they have the money. Come and test drive (see test poliot) and then say 'oh, I've got to sell my car first and then I can buy yours'. Very frustrating.

On the clubman side of things after the engine sale fell through due to it being a dud I decided to take a look over the Australian auctions to see if any local RX8's we for sale. I managed to come across a June 2009 series 2 RX8 with some heavy suspension/frame damage that had not affected the running gear or engine. I am having Option 1 Garage bid for me today.

The offer I made is a little more than I would have liked to of spent but for brand new running gear including a revised motor, gearbox and diff ratios I really cant complain. All of the wearable parts would be in tip top condition.

I will find out if I am lucky enough to get these parts today after the auction.

Update: Well as I suspected the car went for a lot more than I am Option 1 Garage were willing to spend on the car. It was repairable so I guess some one bought it to repair. Back to the drawing board, something will come up soon and with Christmas looming I should probably wait until January to buy hardware. I wont have the clubman until then anyways :-)