Shop OBEX P1 Docs P2 Docs Learn Events
speed from ping — Parallax Forums

speed from ping

James SchallJames Schall Posts: 7
edited 2008-08-04 01:33 in BASIC Stamp
smhair.gif
New Stamper, First post
Hardware:
BS2, Ping, 2hz clock @ P0, LCD appmod
Application:
I am attempting to build an ultrasonic rate meter for detecting the velocity of a slow moving object.
I've had some experience with a string pot over an encoder shaft with good results but want to go non-contact.
I currently have the distance in inches and millimeters displayed on the LCD.
The results have been good, but with some quirks in the aiming and signal strength of the ping status led.
My 4060 2hz clock worked at first attempt!
I am suffering from paralysis by analysis on my code.
I have read about most of the stamp 16 bit math issues (great wealth of knowledge out there).
I intend to average out the change in distance over time to stabilize the display.
Thanks to all of the very helpful forum members who have provided me with hours of lessons in what not to do.
Anyone have any ideas?

Thank you in advance for your response,
Sincerely,
Jimmy

Comments

  • SRLMSRLM Posts: 5,045
    edited 2008-08-01 16:30
    You should check out a recursive method to use for smoothing out your data. Something like a Kalman Filter would work with a bit of time and modification, but there are several other types of filters that are simpler and more suited to a BS2. Just look on Wikipedia and use the links until you find something that you like. Also, be sure to account for the doppler effect. Since the ultrasonic pulse can be relatively slow, you may want to use a velocity type adjustment for your project.
  • James SchallJames Schall Posts: 7
    edited 2008-08-01 17:20
    Thanks for your input.
    Will check it out.
    Jimmy
  • James SchallJames Schall Posts: 7
    edited 2008-08-04 01:33
    No substitute for hours of reading and exhausting trial and error with this programming.

    Work through the problems one by one.
Sign In or Register to comment.