Shop OBEX P1 Docs P2 Docs Learn Events
Basic Stamp for a Tachometer — Parallax Forums

Basic Stamp for a Tachometer

JackGJackG Posts: 3
edited 2010-08-10 09:18 in BASIC Stamp
I need to build a tachometer for my lathe, and I’m considering using a Basic Stamp processor (I’m a software developer, so I’m comfortable coding, but know little to nothing about the Basic Stamp).· My though it to use an encoder·disk with several black and white areas (probably 8) mounted on the spindle and then use a light sensor of some sort so sense the speed.· The output would be a four digit seven segment display of some sort.· The speed range is 0 to around 3000 rpm. Nothing fancy.
My initial questions are:
1)····· Does the Basic Stamp have the processor speed for this task?· (8 x 3000 RPM·= about 400 pulses per second).· I would assume so, but need to ask the question.
2)····· Does it have enough program space (EEPROM) for this (count revolutions and drive a four digit seven segment display)?· The spec sheet for the BS2 says it'll handle about 500 instructions, but I have no feeling for how much can be done in 500 instructions.
3)····· What other questions should I be asling?
·Thanks,
·Jack

Comments

  • kf4ixmkf4ixm Posts: 529
    edited 2010-05-28 13:21
    the bs2 can do about 3000 instructions per second so it should be plenty fast enough for your application. if you run into problems with missed pulses, you could go with a hall effect sensor near the shaft. get you one of those screwdriver magnetizers/demagnetizers, and if you have a keyed shaft, remove the key and run it through the magnetizers a few time and replace it. then you can mount the hall effect sensor close to read the key as it passes.

    here is a link about bs2 instruction speed...

    http://www.emesystems.com/BS2speed.htm
  • FranklinFranklin Posts: 4,747
    edited 2010-05-28 15:07
    I agree with kf4ixm on the hall sensor since you don't need to have 1/8 revolution accuracy. do some research on hall sensors and you will find there is a way to put the magnet behind the sensor and measure non magnetized steel or iron.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Alan BradfordAlan Bradford Posts: 172
    edited 2010-05-29 10:52
    Hi,
    At 50 Hz you have to spend lots of time waiting for a pulse, as there is no Interupt with the Stamp.
    If the Stamp is doing something else·when a pulse happens then you·may miss it.· This will throw your count off.

    You might want to set up a counter circuit, and then check it 10 times a second, and reset it.
    A second counter, counting the AC line would make a good clock for this application.

    This way you have time to do do whatever house keeping, read switches, update displays, and not miss any RPM Pulses.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Alan Bradford ·N1YMQ

    Plasma Technologies
    Canaan NH 03741
    www.plasmatechnologies.com
  • JackGJackG Posts: 3
    edited 2010-05-30 13:20
    Thanks for the info.· I don’t think I need to worry too much about missed pulses because it is just a tachometer for my lathe (I don’t need precision to be the exact number or RPM.· Probably +/- one or two percent RPM would be sufficient).
    Looking at other posts, I think that there’s built in function called Count (or something like that).· I have not read any specific documentation (is it available online?), but I assume that it’s a synchronous function that is passed a time span (I second).· It then counts pulses for a second then returns.· My thought was to call Count, when it returns, display the RPM, and then call it again, and so on.
    How much code (approximately) does it take to drive a four digit seven segment display?· Less than 500 instructions?
  • hover1hover1 Posts: 1,929
    edited 2010-05-30 13:33
    This project may give you some ideas: attachment.php?attachmentid=74131

    ·http://www.parallax.com/Default.aspx?tabid=420

    Jim
    756 x 90 - 2K
  • theruss007theruss007 Posts: 7
    edited 2010-06-01 22:46
    I am planning on building something similiar to this except of using led diplays I am going to use the debug. The main part of it is a computer mouse. Is ther eany way to count pulse per any thing so I couls calculate the rpm.
  • ercoerco Posts: 20,256
    edited 2010-06-02 04:31
    I had a BS2 accurately counting 394 pulses per second at
    http://forums.parallax.com/showthread.php?p=893416·so it can keep up with the count. You should have no trouble taking an encoder sample (either using a software loop or the count command) then output that value to a display. Alternating these two will provide you with a very useable, apparently seamless·tach display.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • JackGJackG Posts: 3
    edited 2010-08-09 13:40
    Just a quick update. Built it and it works great. I ended up using a hall-effect sensor because I couldn’t get the IR sensor to work reliably. I attached an aluminum disk with two magnets on the spindle, and the hall-effect sensor mounted on a small ‘proto board’ by the motor.
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-08-10 09:18
    That's fantastic! good job..... and thank for coming back and giving the update.
Sign In or Register to comment.