Converting period to Miles Per Hour


Results 1 to 15 of 15

Threaded View

  1. #14
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Converting period to Miles Per Hour

    I only suggested driving a mile with a counter to determine number of pulses per mile in the real world.
    Whatever you calculated the circumference of your inflated tyre.. it's incorrect on the road.
    You can take a GPS to measure distance, inflate rear tyre to pressure, and then ride several miles,
    divide the total pulses by the number of miles you rode, and that's your number of pulses per mile,
    divide that by five and check that against how many times you think the bolts are going to pass right now.

    Going back to your first post, you generally either time the interval between each pulse with an interrupt, and make the calculation each pulse,
    or you count the number of pulses over a fixed duration. The first option is faster updating, less annoying when you go to
    add to your PBP program... once it's working you can virtually forget about it.

    When I went to make a vehicle speedometer the second way, I found the vehicle provided such a low number of pulses per second,
    that there was no way for the speedo to tell the difference between say 66 and 67 KmPh.
    Say I got 8 pulses a second at 60Kmph, I might have taken 65Kmph to get nine pulses.
    So I did the speedo with interrupt, and the PBP program was fast enough to catch every tachometer pulse.

    Code:
    First of all, I don't want to tie up my processor while a count takes place.
    It's only the second method that potentially ties up the chip, and even then,
    that depends on how long the pulse is, as to whether or not you have to sit in a loop waiting for pulses.
    Last edited by Art; - 1st December 2013 at 12:44.

Similar Threads

  1. Measuring Period of a pulse
    By c_moore in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 17th February 2012, 05:15
  2. DS1307 12-hour mode with AM/PM divisor
    By JNOR07 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 30th August 2007, 13:26
  3. MILES TAG 2xx code problems
    By sphinxifm in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th June 2007, 15:22
  4. Time Period of Timer1
    By arnol34 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 4th May 2007, 00:31
  5. Hour and minutes
    By Leonardo in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 8th February 2007, 03:50

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts