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?
You have given the following: - Pulses per kilometer which is equal to - 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
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.
But you asked for kilometers per hour. That means you will need to multiply by the number of seconds in an hour. hgmjr
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
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
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.
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.
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.
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.
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 http://www.youtube.com/watch?v=GAGYGAh5l9o
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.
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