View Single Post
Old 02-25-2009, 03:02 PM   #856 (permalink)
rmccomiskie
EcoModding Lurker
 
Join Date: Aug 2008
Location: Massachusetts USA
Posts: 84

Ziggy - '95 Audi S6 Sedan

Manfred - '97 Audi A6 Quattro Sedan
90 day: 20.61 mpg (US)

Clarabell - '03 Audi A4 Quattro Avant

Sherman - '98 Audi A6 Quattro Avant

Cab - '96 Audi Cabriolet
Thanks: 0
Thanked 2 Times in 2 Posts
I found this calculation of HP:

1/2 * [veh_weight_lbs] / 32 * (5280 / 3600)^2 * (curr_speed_mph^2 - initial_speed_mph^2) / time / 550

1/2 and 32 adjust for acceleration
5280 adjusts miles to feet
3600 adjusts hours to seconds
550 adjusts to HP

The total weight is the car + fuel (@6lbs per gal) + driver + misc stuff. My car with 1/2 tank of gas is 3837 + 60 + 170 + 30 = 4097lbs.

I set up an array as a ring buffer in loop() that captures mph values over the last few loops. The oldest value is overwritten by the current value each time through loop(). For example, current MPH might be 50mph and 4 loops ago it was 30mph. 4 loops is about 2 seconds. So, currentmph & initialmph, time and weight are known. Plug them into the formula and calc away.

I've tried this in the car once but I' don't think what I'm seeing is correct. All the constants can be factored into a single constant but it will be a fraction so float types will be needed. Working on it.
  Reply With Quote