Senior design project
gtchief
Posts: 7
Hello all,
I'm a student at PSU and am looking into using a BASIC stamp for the first time. Our project we're doing is a speedometer for an r/c car. I have an idea of what I want to do, but was hoping for assistance. We only have about 8 weeks·to build this whole thing so its kind of a pain. We're hooking a hall effect transistor up by the wheel and a magnet·on the wheel so each passing will drive the transistor output low. I want to record the time for each occurance and subtract successive times and compare times for the quickest. Once this is found it would all be a matter of calculations. We're going to display this on an LCD once the car has stopped. Our main thing now is what is the best way to get these time values? Thanks
I'm a student at PSU and am looking into using a BASIC stamp for the first time. Our project we're doing is a speedometer for an r/c car. I have an idea of what I want to do, but was hoping for assistance. We only have about 8 weeks·to build this whole thing so its kind of a pain. We're hooking a hall effect transistor up by the wheel and a magnet·on the wheel so each passing will drive the transistor output low. I want to record the time for each occurance and subtract successive times and compare times for the quickest. Once this is found it would all be a matter of calculations. We're going to display this on an LCD once the car has stopped. Our main thing now is what is the best way to get these time values? Thanks
Comments
It will 'count' the 0-1-0 or 1-0-1 transitions for a given duration (you decide) and then you can manipulate as you please.
Take the time to read through some of the 'FREE' documents that Parallax offers.· The "What's a Microcontroller" text is a good choice for beginners.
...and by recording "TIMES" you are interested in knowing the daily times of occurances...or how fast the wheel is turning.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
http://members.rogers.com/steve.brady
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
It's a steady pulse that clocks the chips for their operation.
The COUNT funciton basically will monitor the defined pin for the transitions over a defined duration.· This duration is taken from the clock speed of the stamp.· I BELIEVE, on the BS2 the duration is in increments of 2uS.· So if you define the count command to monitor for a duration of 10 (no units) and it returns a 100 as far as counts....then you have had 100 revolutions for 20uS (duration value X time increment; 10 X 2uS).
so you should be able to determine RPMs from that.· Then, if you know the circumference of your wheel, you'd be able to determine ground speed and distance traveled...etc...
But if you want to know that the car left the gate at 10:00.00 and arrived at the finish line at 10:01.00 (fast car) then you'd need a timer IC.
Parallax carry's them.http://www.parallax.com/detail.asp?product_id=604-00005·· Here's the link.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
http://members.rogers.com/steve.brady
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
So, you'd need to know how long it takes to issue a count command on it's own.·
Here's a link to a page (from someone on the boards here) that took the time to determine how long it takes to start a function.
http://www.emesystems.com/BS2speed.htm
With a few added components the stamp becomes quite versatile....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
http://members.rogers.com/steve.brady
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
You don't need to access the oscillator directly. With the COUNT command, you specify the time duration to sample, and the COUNT command basically "keeps an eye on the oscillator" for you, so to speak. If you have a count of 8 during a sample period of 250ms, then you're looking at 1920 RPM on the wheels. If you increase your sample duration, you get more resolution, but less samples/sec.
The best solution to get a good sample rate AND resolution is to place more magnets on the wheel (approximately equally spaced, but it doesn't have to be perfect).
Say if you have 4 magnets on the wheel, and you get a count of 21 for a sample period of 100ms, then that's 3150 RPM on the wheels. You have a resolution of 150RPM with 4 magnets and a sample period of 100ms. 5 magnets and 100ms gives a resolution of 120, and so on. If the speed isn't going to be varying greatly from one fraction of a second to the next, go with a higher sample period... 4 magnets and a 200 or 250ms sample period should probably give good results for an RC car.
Hope that helps,
Dave
gtchief,
You might consider 2 magnets opposite of each other to "balance" the wheel..... Otherwise I might consider
an optical approach.
There is a slight possibility you could detect the RPM of the motor by monitoring the voltage spikes from the
motor contacts as the motor rotates. This depends on the type of motor...
(quick test if you have access to a scope)... place a scope across the terminals of a running motor, if it's going to
work this way you should see definite "spikes" proportionally spaced apart depending on the motor speed.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe - Mask Designer III
National Semiconductor Corporation
(Communication Interface Division)
500 Pinnacle Court, Suite 525
Mail Stop GA1
Norcross,GA 30071
Dave
Why not pick a signal off of the ignition spark to get your motor RPM. Seems as though
there are several circuits on the web to do this. I would think you could use something
as simple as a short lead on the gate of a MPF102 transistor in proximity of the spark plug
wire. You shouldn't even need to touch the ignition wire at all to detect a signal.
MPF102 Datasheet
This is something like what I would have in mind...
Spark Detector
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe - Mask Designer III
National Semiconductor Corporation
(Communication Interface Division)
500 Pinnacle Court, Suite 525
Mail Stop GA1
Norcross,GA 30071
But, like those "Fox & Hound" (wire sniffing) units....it's basically a wound coil put close to the selected noise source.· You could probably get enough power to light a lamp (incandescent or LED--would need power massaging) but then you could use an opto to isolate the noise from your stamp setup.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
http://ca.geocities.com/steve.brady@rogers.com/index.html
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."