# Speedometer Question

Discussion in 'Math' started by Art, Jan 25, 2012.

1. ### Art Thread Starter Distinguished Member

Sep 10, 2007
785
61
Hi Guys,
I expect this to be considered lame....

My car's ECU transmits a certain number of pulses per kilometer traveled for the speedometer to work out the speed. It should be the same number for every kilometer.
Say I know this figure...

What is the formula for Kilometers per hour if I give you
the number of pulses counted over one second duration?

2. ### hgmjr Moderator

Jan 28, 2005
9,030
214
$\frac{kilometers}{pulse}\ *\ \frac{pulses}{second}\ *\ \frac{seconds}{hour}\ =\ \frac{kilometers}{hour}$

pulses cancel and seconds cancel.

hgmjr

3. ### Art Thread Starter Distinguished Member

Sep 10, 2007
785
61
What does that mean in English for an uneducated git?

4. ### hgmjr Moderator

Jan 28, 2005
9,030
214

You have given the following:

- Pulses per kilometer which is equal to$\ \ \ \frac{1}{\frac{kilometers}{pulse}}$

- Pulses per second

You know that there are 3600 seconds per hour. That means you have everything you need to calculate kilometers per hour.

hgmjr

5. ### Art Thread Starter Distinguished Member

Sep 10, 2007
785
61
Sorry, I understand & the result seems correct, thx

6. ### Art Thread Starter Distinguished Member

Sep 10, 2007
785
61
As a programmer, by English, I meant something like this:
(Pulses counted in a second X 3600) / constant pulses per km.
which I *think* is correct.

7. ### hgmjr Moderator

Jan 28, 2005
9,030
214
But you asked for kilometers per hour. That means you will need to multiply by the number of seconds in an hour.

hgmjr

8. ### Art Thread Starter Distinguished Member

Sep 10, 2007
785
61
Sorry, you're right of course. The result has to be multiplied by 3600.
Now it seems there's one more instruction than there has to be!

((Pulses counted in a second X 3600) / constant pulses per km) X 3600

I warned you it was lame

9. ### hgmjr Moderator

Jan 28, 2005
9,030
214
The question was a legitimate one.

hgmjr

10. ### Wendy Moderator

Mar 24, 2008
20,764
2,534
And hgmjr got there first.

11. ### Art Thread Starter Distinguished Member

Sep 10, 2007
785
61
No worries, I might need more of this type of help very soon (like in a small number of seconds)
So if you're keen, watch this space. Thanks.
I can think procedurally and logically, but the maths behind it is not my forte. I hope you have faith that I "kind of" know what I'm doing and you're not completely wasting your time

12. ### Art Thread Starter Distinguished Member

Sep 10, 2007
785
61
I could go out right now and fill in the blank (constant pulses per km),
but am already aware that the figure is much smaller than I want it to be.
Maybe through some error of mine, but the result pulse count per second is linear as speed increases, and quite precisely repeatable which is good news.

The number of pulses I can count in one second is 7 pulses
when traveling at 99Kmph as unbelievable as it is.
This is the most accurate relationship I've measured.
The 6 pulses counted in one second clicks to 7 just as the GPS speedo clicks to 99Kmph every time.

I can measure the real time between each pulse for a different approach,
and work out kmph from that, but guess what? I'm stuck with the math!

I can also go out and measure (not quite as precisely),
How many pulses occur per kilometer, but I don't think that information is needed other than to see it is repeatable for each kilometer.

13. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,357
718
Why not just look at your GPS $\reflectbox{?}$

14. ### Art Thread Starter Distinguished Member

Sep 10, 2007
785
61
I found the error that was causing my count to appear so low
so it appears I can work out pulses per kilometer and use the first formula.
A computer has to know the speed so it can take action based on that, not to tell me what the speed is.

15. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,357
718
Using GPS, why not measure the number of pulses per second when going 90km/h?

That would make it a simple frequency problem without much math to work out.

16. ### Art Thread Starter Distinguished Member

Sep 10, 2007
785
61
I can do that later tonight.

EDIT,, there's 63 pulses per second @ 99Kmph speed measured by GPS.

Last edited: Jan 27, 2012
17. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,357
718
Ok, drop it to 70 km/h, then 40 km/h and finally 30 km/h, measuring pulses per second at each speed.

You should end up with a linear fit function for frequency at any speed if you plug the two numbers in to Excel and do a curve fit.

18. ### Art Thread Starter Distinguished Member

Sep 10, 2007
785
61
I am going to have to look at pulse width instead of counting pulses per second eventually.
If there are less pulses counted in a second than the number of
kmph which is to be printed to the display, there won't be a formula that will display every increment from 0-100.

Works though

19. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,357
718
Pretty cool display! I love VFDs if I can find one that has all the stuff I want on it.

It looks like you don't spend much of any time in the 0-10 km/h range anyway.

20. ### Art Thread Starter Distinguished Member

Sep 10, 2007
785
61
And it can talk using Roman Blacks btc algorithm!
I know the forum's stance on auto projects,
but I won't detail it here, or ask electronics or programming questions.
Just here for math.

At the moment I'm testing it speaking the top speed every time it is bumped up