View Single Post
Old 05-19-2008, 10:51 AM   #90 (permalink)
Yoshi
SuperMID designer
 
Yoshi's Avatar
 
Join Date: Mar 2008
Location: Yokohama, JAPAN
Posts: 37
Thanks: 0
Thanked 13 Times in 2 Posts
Hello from Japan,
I'm an author of the unfamous SuperMID.
SuperMID portal
Prius DIY
SuperMID M-1
My project is open hardware and open binary software.
The program is written in AVR assembler and my source is very dirty now, so it is not open-source yet.
However, you can dis-assemble my binary (intel hex file), then you'll be able create the assembler source.

Anyway, let me explain how I built it.

* interface
I place an interface box for injector and VSS signals as close as the ECU, because I don't want to pass noises to 5V logic part.
The Prius VSS signal is very clean, but we'll need some filter circuit to clean up the mechanical chattering used on some vehicles.

* signal capture
- VSS signal
I use INT1 falling edge interrupt.
Prius, Honda and others, VSS specification is 637*4=2548 pulses per km, or 4100 pulses per mile.
I would like to get 10 meter increment of distance, so I need 25.48 pulses per 10m.
I use 16bit register and add some distance parameter on every interrupt, then increment 10m counter when 16bit(65536) number overflows.
The some distance paramter is 65536/25.48=2572.
I assign 18bits for the 10m counter, so the max trip distance is 2621.43 km.

- injector signal
There is a very good feature in the ATmega8(ATmega168 as well) called "input capture" using pin#14 and 16bit timer1.
The rising edge trigger is detected by INT0, then clear the timer1.
The timer1 is driven by 1/64 of clock (12.8MHz), so the unit is 5 usec.
As soon as the injector pulse goes low, the timer1 count is stored in a register.
There are some mechanical delay of injector, so I assume it is 500usec, then the pulse count - 100 becomes the effective pulse width for proportional to real fuel usage.
I would like to get 1 cc (milli-liter) count, so I set some fuel parameter for that.
After a lot of experiments, I found the accumulated timer1 value becomes 14052 (fuel parameter) Prius shows 1 cc usage.
I assign 16bit for the 1cc counter, so the max trip fuel usage is 65.535liter.

That's all as of today.

Regards,
Yoshi

Last edited by Yoshi; 05-19-2008 at 11:05 AM..
  Reply With Quote