View Single Post
Old 05-19-2008, 08:10 PM   #98 (permalink)
needs more cowbell
dcb's Avatar
Join Date: Feb 2008
Posts: 5,038

pimp mobile - '81 suzuki gs 250 t
90 day: 96.29 mpg (US)

schnitzel - '01 Volkswagen Golf TDI
90 day: 53.56 mpg (US)
Thanks: 158
Thanked 269 Times in 212 Posts
Originally Posted by Yoshi View Post
Hello from Japan,
Hi Yoshi!! Glad for the input, Let me just go point by point here with the current state of the mpguino project in case anyone is wondering.

Originally Posted by Yoshi View Post
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.
Ditto for mpguino, except it should be a little easier to maintain because it uses C++, and hopefully more people will be more willing to work on it as a result.

Originally Posted by Yoshi View Post
However, you can dis-assemble my binary (intel hex file), then you'll be able create the assembler source.
Uh, I'll get back to you on that The mpguino is already functional, we are getting resonable instant MPG and Speed readings (I need to get the latest code published, I know)

Originally Posted by Yoshi View Post
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.
Yup, dieseljohn mentioned something to that effect, like put the 100k resistor by the signal source. I haven't done that yet, but so noted. (Edit, oops, looks like you guys are saying different things here)

Originally Posted by Yoshi View Post
- VSS signal
I use INT1 falling edge interrupt.
We are using a "change" interrupt on pin 14, we have to double the vsspulses/mile figure but it seems accurate.

Originally Posted by Yoshi View Post
Prius, Honda and others, VSS specification is 637*4=2548 pulses per km, or 4100 pulses per mile.
I list 4000 pulses/mile for all post 96 toyota/honda. hmm...

Originally Posted by Yoshi View Post
I assign 18bits for the 10m counter, so the max trip distance is 2621.43 km.
A mpguino trip will overflow on distance at about 0.5 million miles.

Originally Posted by Yoshi View Post
- injector signal
There is a very good feature in the ATmega8(ATmega168 as well) called "input capture" using pin#14 and 16bit timer1.
That is a nice feature . I was a little intimidated by the timers at first, so avoided the issue completely by:
1. creating a microSeconds(void) function based on the system clock.
2. creating an elapsedMicroSeconds(unsigned long startMicroseconds) function.
At the start of an event, you save a copy of microSeconds(), at the end you call elapsedMicroSeconds(start) to see how long the event was.

Originally Posted by Yoshi View Post
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.
We could reclaim a valuable edge triggerable pin with this "input capture" feature (but not version one). Right now we are using falling on INT0 and a rising on INT1 with both pins tied together to get the pulse width.

Originally Posted by Yoshi View Post
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 wondered about the mechanical delay. We have not yet accounted for it, I was kind of hoping the delay would affect the opening AND the closing of the injector and thus cancel itself out

Originally Posted by Yoshi View Post
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.
We are using a microSecondsPerGallon parameter currently. The data model is good for 1.2 million hours worth of fuel flow.

Originally Posted by Yoshi View Post
That's all as of today.

Thanks again. If you are interested, the mpguino source code and schematic are at the top of this thread:

P.S. what inspired the tachometer signal on the supermid?

Last edited by dcb; 05-19-2008 at 09:45 PM..
  Reply With Quote