distance speed time


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Feb 2010
    Posts
    11

    Default distance speed time

    good afternoon.

    i have a question i would like to pose.

    lets say for example i have a circle with circumference of 10 cm.

    i want to work out lets say the speed.

    eg
    in this circle is a thin wire attached to a pin.so if lets say a shaft is spinning in this circle,also with a metal wire which will pass past the other metal wire and thus make contact with the pin.

    is there a formula to calculate how long it takes for the metal strips to cross or would it be better to manipulate the time and then just try determine how many times te two metal pieces have crossed(touched )

    if a)the two mtal strips pass each other(pin high)and inside chip starts counting.
    b)if metal strips pass each other again ( 1 revolution)

    i am battling to get (within that revolution) the chip to count (seconds)
    thus having the time taken.

    please note that i havent actually programmed this,but it the point of departure-the starting point of the programming this that boggles my mind.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Not sure I understand the question.
    Is the RPM of the rotating pin fixed or variable?
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hello BrianD,
    Setup a timer to overflow at a rate you can use to determine seconds easily and track those overflows in a count variable. have switch, reset the timer and counter and send data to your display by using an interrupt routine. Assuming you are talking about a Slow RPM.
    So let's say timer overflows every 10 ms, then 100 overflows = 1 second, so if interrupt occurs after 250 overflows you know it went 2.5 seconds, so you have data to cypher out the rate of travel. Clear as mud?
    Probably 10ms is a bit far fetched but the numbers were easy.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  4. #4
    Join Date
    Feb 2010
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    the outer disc is fixed.the rpm of the inner pin,spiining is variable.

    i was thinking of using the count function,but if the osc is 20,then the pin would count the high every 4us.what if the rotation is 5us.

    joe.
    i will try your suggestion.

    however! i would fancy only one rotation,and be able to work out te time taken for that rotation.

    mackrackit.

    what i am trying to do is to determine wind speed.hence the shaft spinning in the wind (hopefully),which will be the spindle in the bigger disc.

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Really you have to work out sensible limits and then choose the kind of methodology you are going to use...

    If your mechanical shaft/disc is spinning every 5uS it has a rotational speed of 12,000,000 (twelve MILLION) rpm! This I would like to see... (I'd stand there with a stopwatch and measure the length of time until your mechanical contacts disintegrate and bearings turn to dust!). If you are measuring Wind-Speed, there is a direct correlation between the wind pushing the Cup, the Diameter of the Vane and the shaft rotation. Assuming a total vane diameter of 200mm, a single pulse per rotation every 5uS (and not taking any friction into account) a bit of math calculates a wind speed of 281,100 mph (two-hundred and eighty-one THOUSAND)... methinks a pitot tube would struggle with that one!!!!

    Now, you really only have two choices - and each has it's limitations...

    (a) You COUNT the number of PULSES in a given set time... this method is good for FAST Data, but falls apart for slow Data (eg you're counting one second but it takes 17 days for the shaft to rotate!).

    (b) You COUNT TIME between the start of one Pulse and the start of the next... this method is good for SLOW Data, but falls apart for fast Data because of the speed limitation of the PICs.

  7. #7
    Join Date
    Feb 2010
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    thanks melanie for your comments,but it was not what i actually meant.
    obviously the shaft won't turn that fast.

    i get where you are going with this,but all i was looking for was a sensible formula within the chip.everything else was hypothetical.



    thank you for the link mackrackit

Similar Threads

  1. NEWB Help HPWM coding
    By Seafurymike in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 1st January 2008, 21:52
  2. Count pulses between VARIABLE TIME
    By RodSTAR in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th October 2007, 12:44
  3. Replies: 14
    Last Post: - 26th September 2007, 05:41
  4. Speed of USB EasyHID and Time problem
    By sjohansson in forum USB
    Replies: 10
    Last Post: - 18th January 2007, 22:21
  5. Serout2/serin2 Pbp Problem
    By SOMRU in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th December 2006, 19:55

Members who have read this thread : 0

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

Posting Permissions

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