View Full Version : hello, just need some information on pbasic stamp exercise im doing.
hello, i just wanted some information for a pbasic stamp
does any one know how i can work out time, useing the count statement ?
any one know how i can measure and display inear speeds on cm/s for p basic stamp, useing a encoder and a wheel, im kind of new to p basic, i would·apprciate it if someone can give me some pointers, thanks.
one of the questions asked me to decide upon a methood that will allow speed and distance to be simultaneously measured,
this is the equation i have used to measure distance,
DISTANCE = COUNT X LINEAR REVOLUTION
·············· = NUMBER OF PULSES X 160 RPM
SPEED = (REV/MIN)· n = 60 COUNT/ NUMBER OF TEETH X TIME
now i need a count statement to work out time.
01-22-2007, 01:44 AM
The count command is related to time, if you need to know a speed you have to know how long (linear distance) your encoder moves for a certain number of pulses, once thats figured out, you gonna have a ditance on period of time (pulses counted on count command in Period that you set). and distace on period of time is speed.
now simultaneously mesure, if you are mesuring distance and speed, once they are related you can figure out how. Again you have to know how many pulses your encoder generate for a linear distace, then you will have pulses in time , witch brings you the hole solution .
hope to have helped you ... anything else , I'll be glad to try to help
thanks allot Amaral for replying , i really apprecite it, i already know the linear resolution, which is 360/4···· 4 pulses per second,
im not sure how i can·come up with ·a methood· that will allow speed and distance to be measured simaulltaneously,
for this exercise im useing a basic stamp board, lcd display , wheel and encoder
what my task is to write a program to enable distance and average speed to be measured useing freely rotating wheel and simple encoder, the final program must allow distance to be measured up to 5km with a resolution of 10 cm and speeds to be measured from 0 to 50 dm/s (0 to 5 m/s)
we have written a program that counts pulses from the encoder and displays the reult in LCD, we have determined the linear reolution, what we are trying to do right now is extend ouir current program to measure and display linear speed in cm/s and to test the program at varous speeds , basicly were really struggling, is it possible i can e mail u my prgram? or i could possible post my program here , if you want to see it. once again thanks for helping out.
01-22-2007, 03:22 AM
Hi ggh, I'm not good with math but if you know the number of pulses in a given time and you know the circumference of the encoder it should be possible to work out all the values you need, possibly using
distance = pulsecount/numberofteeth *circumference
not sure how accurate that would work out for your app though.