# Advanced dash controlls



## rwt33 (Dec 4, 2008)

Hi All,
I've started this thread to discuss advanced in-car and dash dials and controls.
Firstly, to clarify, I'm not talking about ones that you can buy off the shelf as they tend to have a fixed or only slightly flexible architecture. I'm referring to any "no constraints" setup and typically has some form of externally programmable processor.

I've come from an equally software and electronics background and not surprisingly when I started my MR2 EV project the displays were as equally as important as building/programming the motor controller and sundry components. 

One of the key points to mention before people wonder "what's with his Microsoft .NET fascination, why not Linux" is that I'm willing to spend a tiny bit more to cut development times down (I'm referring to a 'bit more' as possible code inefficiencies in .NET). By using techs like .NET I can turn out results incredibly quickly (no point in further arguing this here, anyone from Linux who's not convinced: beat .NET WPF and I'll listen). The other advantage of .NET is that I have been able to write drivers that work on the different hardware as they all use the same language (drivers such as the high speed + robust comms between the computers and the main motor controller). So here's what I evolved, what I'm planning on eventually ending up with and where it is at now:

The original plan was to

1) Have a small PC with a 7" screen as the center-console entertainment center but also able to display slow changing but content-rich car details ie charge levels/balancing of individual battery cells, much like what they have in other commercial EVs (hybrids) like Tesla, Prius* etc. The computer would also provide firmware and parameter management for the different onboard computers (motor controller, aux controller, guage computer). The key theme with the PC is that it is _not_ required to be operational to allow the car to run (due to obvious hardware+OS reliability issues). As I was getting other pcbs made for the car I drew up an ATX PSU that could run from 8v to 20v (aux 12v supply) and used the in-car 5v standby power. More details to come in section 2c...

2a) Use a dedicated micro with a TFT lcd with high speed comms to the main controller for gauges. I originally started with a 72MHz ARM7 with TFT display running .NET Micro (GHI Electronics - Embedded Master). I bought the controller and LCD and began drawing dials etc but quickly found that the advantage of using .NET Micro was short lived due to the lack of graphics APIs (some of the documented routines such as drawing circles etc only partly work and it's been confirmed). Not to mention I wasn't even going to get close to the fancy alpha-blended and layered controls I was hoping for.

2b) Given the limitations of the .NET Micro system I then thought of using a Windows Mobile PDA as I knew it had a rich subset of the Win32 APIs and I had done extensive programming in Windows Mobile before (SourceForge MAPIdotnet). This was looking really promising. I got a power 520MHz WinMob PDA (broken touchpanel input = perfect, don't have user feedback) and starting looking at how to lever the *hidden* GDI+ libraries that are actually in WinMob but they aren't exposed. After weeks of sweat and tears and effectively having to rewrite how layered controls in a Form are drawn so that I could get fancy transparent layered controls (where if the background control redrew it would redraw the layered foreground control would redraw too) I finally had something usable. It was fast and looked *ok* but I wasn't happy. I was back at having to apply a lot of effort to get what I wanted. It then occurred to me that I was trying to do all these things that a PC can do without even blinking an eyelid. Even if I did write everything I wanted, the PDA screen was only so big (4" I think) and would eventually run out of processing power too.
2c) Introduce Intel's dual core Atom proc + Nvidia's Ion chipset. For screens was now looking at at least twin 7" LCDs (one for guages, other for center console). I got hold of a 7" LVDS panel + VGA to LVDS board for a pretty penny. I later built a DVI to LVDS converter (more info on this at the bottom). My first Atom board was on the Intel ones which only had a single VGA connector (all before Nvidia released Ion). But I wanted at least dual 7" LCDs and don't you just hate the idea of going from a digital source to analog (VGA) then back again? I got hold of a dual DVI head PCI vid card (Quadro NVS 280) which worked (right on the limit of my homemade PSU). So it all worked but then along came Nvidia's ION didn't it? Thankfully I was able to sell the Intel board to a mate and before I bought a Zotac IONITX-D (DVI+HDMI+VGA outputs) I confirmed on another mate's that the DVI and HDMI could operate concurrently with two of my DIY DVI->LVDS converters + 7" LCDs. This all fit in beautifully with my desire for advanced gauge graphics (using .NET WPF which heavily leverages off DirectX). The worse thing that can happen is that if the PC goes down (insert Windows jokes here...) there'll be no dials to show power usage, battery level, regen etc on the trip home.

_Graphical layout (code)_
With a single computer for the center console and gauges I've started looking at how to do the graphics. From the start I've had this dream of drawing a couple of gauges etc (and a 7-segment display to show what gear I'm in like Ferraris) and being able to have a notification box popup in the middle (to show important messages - seatbelt?) but be semi-opaque so that you can still see the dials etc behind it (Aero Glass anyone...). Given that I can't justify running Vista or Win 7 on it (money, reliability, sluggishness, bloatedness, shall I go on... fine for a personal PC, not a car) and am sticking to XP I had a go making windows opaque. At first (like many) I thought it was easy. You can easily make a _whole_ windows and all it's components semi-opaque but in Windows Forms (.NET) you can't make ie the Form background semi opaque but it's child controls fully opaque. Introduce Windows Presentation Foundation. I'd never used it before but I gave it a go and after getting my head around the XAML layout, it can do some _wicked_ eye candy in no time at all, and it's turned out to be really fast (mostly GPU processing rather than CPU due to DirectX implementation). Two other big plusses is that it does full alpha-blending (opaqueness) on everything, and using DirectX mean it goes like stink on the ION board.

So far I've written comms interface library (Param/Var/Commands) to the motor controller. Mainly due to the need to be able to write/read parameters+vars+commands in the car microcontrollers for the motor control, BMS etc. The same interface has been reused about 5 times now for several param managers, firmware downloaders etc. One big advantage of C# is that there's tons of online user projects. I've tested Aqua Gauge (Codeproject) and a few others, and have made a few example projects to test that I can do all the transparency things I wanted to do. Just a whole lot of coding ahead of me now!

_DIY DVI to LVDS conv_
I had a look around online but the cheapest I could find a DVI to LVDS converter for driving LCD panels started at well over a few hundred dollars. A lucky browse through TI's site one day uncovered that they sell an all-in-one DVI to TTL converter IC and then TTL to LVDS shift register. Combining this with an I2C EEPROM for the EDID (DVI/HDMI doesn't work without it) and a backlight boost converter on a PCB (great fun soldering .5mm pitch ICs) eventually gave me a working DVI LCD display. My heart was on the floor a few times before I work out how to generate and download the EDID data to the EEPROM. FYI, if other people want to do the same thing (literally take one of these pcbs and connect it to any surplus LCD panel ie out of a laptop etc) let me know. The chips I used are the TFP401A and something like the sn75lvds83b. I can share hints etc if people are interested.

_The third screen..._
I saw a couple of months ago that Samsung and some other company have started making/selling small LCD screens (7") that connect using USB (using DisplayLink chipsets). At the exact time I found out about this I had a quick look on trademe and there was one there for only $130 that was getting no attention, so I snapped it up. Works like a charm as a 7" LCD (no graphics acceleration of course) and also has linux support now (people use them with the beagleboards). I'm thinking of using it as a "graphical" set of buttons (where the gear stick used to be) and perhaps a winamp player etc. Who said you can have too much screens!

Feel free to make comments, ask questions, and most importantly, write up what you're doing!

Cheers,


----------



## evlowrider (Jul 23, 2009)

What a great post, I think you've saved me a few hundred dollars because I was thinking about going down the micro .NET path. I dont think I'll do that now. I'll look at the Intel Atom based MB's and go from there, I'm still not sure if I want go use Windows tho, while development would certainly be easier I really don't want to buy another license.

I saw some nice 8" touch screen LCD on trade me last nite that would fit my requirements, I just need to get all my idea's together and make a bit of a plan on how its going to come together. 

I got to go for now, I'll re-read your post again tonight.

Cheers,
Pete.


----------



## Biostudent (Jul 13, 2010)

What ended up coming out of this project? 


I have dreams of doing this my self. I wanted a very similar set up. Probably both touch screens if I could so the gauges could be manipulated directly. One as a stereo with different screens...maybe a gps screen/a rear view camera/ browser w/keyboard. Might take me a few years I am still in my first year of computer science degree


----------



## evlowrider (Jul 23, 2009)

I have completed my dash controls, I ended up developing the software for the android platform. Primarily I wanted it to work with my smart phone but I have also been thinking about using a larger 7" to 10" tablet. There are now numerous Android tablets coming out since the release of iPad.

I am integrating with my controller (Soliton1) over WIFI since its data output stream is via an ethernet port, I will be running a wireless router in the car.

Biostudent - if you're interested all the code from the 1st release is on http://code.google.com/p/evdash/

Its also on the Android Market under the name 'EV Speedo'

I'd like to thank rwt33 again for the above post, it was helpful to me even tho my technology choices are different.

Pete.


----------



## rwt33 (Dec 4, 2008)

Nice work Pete!
I don't suppose you could put some screen shots up for our amusement?

Cheers,
Robert


----------



## rwt33 (Dec 4, 2008)

As a further update to my first post, I recently had a bit of interest in the DVI to LVDS LCD converter board I made. It's a really handy board that allows you to connect just about any bare LCD panel (LVDS or TTL signals) to a DVI or HDMI port.
If anyone's interested I've got about 20 spare unpopulated PCBs that I'm willing to sell, or if more convenient I'm also happy to sell the design documents and provide support for programming the EEPROM (which tells the PC how to drive the LCD).
PM me for details


----------



## JRoque (Mar 9, 2010)

Wow, that's some post there Robert. Excellent information. So did you decide on using your DVI converter after all or did you switch to lower res USB display? Or kept both?

One thing I would suggest is that user input capability is a must. While there should be no critical system controls with Windows dependencies, entering parameters to display certain functions or views should be an included feature. For example, you might want to have a generic MPH, RPM and battery gauge as your main screen but may want to switch to another to show pack temps, current flow and distance to empty.

So that's a way I see if you go the .Net route. But I can see it now, you're driving down the highway and all of a sudden Bill Gates wakes up and displays a pop-up window warning you to download the latest SP. Perhaps you won't get as nice applets as you would with WPF but, if you look at Pete's Android app, it shows it's really possible to create something neat yet portable between common embedded type devices. Android works with a lot of different environments. I launch Android from within Windows Mobile 6.1 in my phone and it works great. I can't use all features in Pete's app but what's there for me works well.

Before I forget, congrats on getting that DVI to LVDS converter working. That is NOT an easy task. However, for us mere mortals, there's a variety of 7" HDMI LCD monitors out there that might fit this application.

Got any screenshots/pics of your progress so far? I like your idea of blending critical information onto the main screen - much different that the Windows pop-up, of course. 

Regards,
JR


----------



## rwt33 (Dec 4, 2008)

Hi JR,
You raise good points regarding user input and using windows, and I completely agree. What I have is two LCDs (using an Nvidia Ion mobo that has dual DVI) with one going to the dash for drawing dials etc (no user input), and a second in the centre console where the stereo used to be with full touch screen. The touch screen one will be for doing all the extra functions as you mentioned, ie detailed car info (batteries, motor control param etc) and also things like the stereo, gps etc. 
So I've ended up going for two DVI -> LVDS 7" 1024x600 panels. I do have one of the 7" (800x480) USB screens which I may use as a third if I feel the need  Thankfully using the DVI panels means I have full boot info.

I'm still of two minds about the Android route. I originally tried using a Win Mob 6.5 device as my display but in the end it wasn't the performance or the screen size (which Android is not limited by), but of the programming API and programming efficiency. WinForms .NET is pretty average in that it offers pretty much the same features as any other gui framework (Qt, GTK etc), but I'm using it for the WPF which is undoubtedly better than any other gui framework. Sure you could get something similar by coding directly in OpenGL but you'd be there for years (not surprisingly the Mono guys have immediately said they're not even going to try to take it on). So for basic dials etc Android or any linux/windows device would do, but to do really neat stuff quickly and efficiently I went down the .NET path. Although getting Bill Gates would seriously sour any of the advantages which is why damn near all of the those features will be turned off!

By building my own motor controller, BMS, charger and DC/DC converter I've screwed myself by exposing so many parameters that I envisage both LCDs completely chocker with data, so it'll be interesting to see how I eventually do it. At present I'm leaning towards having the dash screen look pretty standard with only a few dials (I have the original speedo) ie current, power (positive and neg), basic battery level, gear etc. Then have a whole lot of optional pages on the touch screen that I can bring up and/or adjust.

To make my mind up over the final dash via I've been saving images of every 'neat' looking dash I've seen online for the last year or so. I've got a good 30 or so pics now so I'm hoping I'll take the best of all of them and make something pretty neat.
I look forward to seeing other people's pics too!


----------



## JRoque (Mar 9, 2010)

Hello Robert,



> So I've ended up going for two DVI -> LVDS 7" 1024x600 panels.


Where did you fit those two? I'm hoping you've taken some pictures to show us.



> Although getting Bill Gates would seriously sour any of the advantages which is why damn near all of the those features will be turned off!


This is true. In fact, you might be able to run as service before Gates has a chance to load any of his stuff. Now that I think of it, my CNC computer runs XP and everything that is not required for CNC has been turned off. I've had no problems at all running the CNC machine with it for nearly 6 years straight and there's some very precise timing that takes place there... not that I would trust XP to drive my car but for monitoring and reporting its fine.



> By building my own motor controller, BMS, charger and DC/DC converte


Whoa! hold on there, Robert. You're not getting off that easy by just saying you built it and not showing us pics... and maybe even schematics. What kind of controller, AC or DC? Charger? DC/DC? BMS? Do you have a build thread or log somewhere to show this stuff? Did I ask for pictures already?

In all seriousness, I bought an industrial VFD off eBay to build my own 100kW IGBT final stage but I just can't wait any longer to convert my car. Once I'm driving on batteries, I'll go back and see what damage I can do in terms of controllers, etc. For now, I'm leaning towards the ready-made AC50/Curtis package. How do you find the time to work on all this stuff?? I mean, it's a full time job to fully understand that .Net GUI framework, let alone the hardware portion of it too.

Regards,
JR

ps: pictures!!!


----------



## rwt33 (Dec 4, 2008)

I've made a bit of a build log here:
http://www.oldvcr.com/projects/index.html?Mode=View&ID=24 and there's a couple of pics there of my recent progress too.


----------

