585,660 active members*
3,258 visitors online*
Register for free
Login

Thread: Tachometer

Results 1 to 14 of 14
  1. #1
    Join Date
    Jan 2010
    Posts
    20

    Tachometer

    Recently I purchaced a BasicStamp2 Microcontroller to build a tachometer for my lathe. Well, it was taking so long to figure out the programs for the microcontroller, I just pruchaced a simple tachometer for more money than it was worth yet still it is working great. The problem I am having is the syntax with the program that I happened on for the tachometer circuit that I have built. So, does anyone know BasicStamp programming by any chance?:drowning:

  2. #2
    Join Date
    Mar 2007
    Posts
    4

    Smile yes, but....

    See that: Digital Laser Photo Tachometer Non Contact Tach - eBay (item 390238842077 end time May-11-11 02:00:23 PDT)
    Me too I wanted to do so like you, but for GBP 3.13 and with GBP 5.02 Standard Int'l Shipping I have the same result ,without building anything!
    Anyway, I wish you good luck:drowning:
    Costas

  3. #3
    Join Date
    Jan 2010
    Posts
    20
    Cvlac, I found a nice tachometer, uses a photoelectric sensor to detect the spindle rpm on my lathe .. works well it was just a little expensive but I was ill so didn't care at the time... LOL wanted to same some money on the next project and have a multi use instrument to boot. Just did not turn out that way ... yet.

  4. #4
    Join Date
    Sep 2010
    Posts
    1765
    maybe.... what stamp: Parallax Home ?

    if so, want to send your program? what is the problem?

    they have some really smart guys on their forum just waiting to help you too - maybe that is where to try?

  5. #5
    Join Date
    Jan 2010
    Posts
    20
    Thanks Mike. The Stamp I have is the BS2-IC. It is the beginner one I believe. I have done just about everything I can think of to get the program to work that was supose to work just can't get it to pass syntax. It is always some variable or some symbol or something everytime I try to run it. I will have to try the site you recomended, did not think of that actually. First place came to mind was here, since I have had a lot of good advice from here.

  6. #6
    Join Date
    Jan 2010
    Posts
    20
    Here is the program that I have been working on.
    ' ------------------------------------------------------------------------------------------------
    '
    ' File...... ModelEngineRPM.BS2
    ' Purpose... To measure the RPM of model engine using stamp2
    ' MicroController
    ' Author.... Kamran Nili
    ' E-mail.... [email protected]
    ' Started... Nov 06, 2005
    ' Updated... Nov 06, 2005
    '
    ' -----------------------------------------------------------------------------------------------

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    ' -----[ I/O Definitions ]-------------------------------------------------

    Clock PIN 0 ' shift clock (MC14489 pin 11)
    SerData PIN 1 ' serial data (MC14489 pin 12)
    Enable PIN 2 ' enable (MC14489 pin 10)
    SpeedIn PIN 15 ' Receive Input from Hall Sensor
    pulses VAR Word ' input pulses from Engine

    ' -----[ Constants ]-------------------------------------------------------

    Blank CON $0 ' Special Decode characters for MC14489

    Capture CON 1000 ' Num of msec to listen for inpput

    ' -----[ Variables ]-------------------------------------------------------
    config VAR Byte ' decode configuration for MC14489
    dpCtrl VAR Nib ' decimal point control for MC14489
    digit5 VAR Nib ' segs - digit 5 (this one is not used)
    digit4 VAR Nib
    digit3 VAR Nib
    digit2 VAR Nib
    digit1 VAR Nib ' segs - digit 1
    rpm VAR Word ' value to hold the RPM of the engine
    value VAR Word
    LookDownResult VAR Word ' Index value
    counter VAR Word

    ' -----[ Initialization ]--------------------------------------------------

    Reset:
    HIGH Enable ' disable MC14489
    rpm = 0
    digit1 = 0
    digit2 = 0
    digit3 = 0
    digit4 = 0
    digit5 = 0 ' Always 0 (not used)

    config = Blank
    GOSUB Update_Cfg
    config = %1 ' To setup for digits only (see
    ' MC14489 documentation
    dpCtrl = %1000 ' Set the display to bright
    ResetEnd:
    pulses = 0
    counter = 0
    DO

    COUNT SpeedIn, Capture, Pulses
    rpm = (Pulses * 60)
    digit1 = 0
    digit2 = 0
    digit3 = 0
    digit4 = 0
    digit5 = 0

    DO
    IF rpm = 0 THEN EXIT
    LOOKDOWN rpm, >=[1000, 100, 10, 1], LookDownResult
    IF (LookDownResult = 0) THEN
    value = rpm /1000
    rpm = rpm - (value * 1000)
    Digit1 = value
    ELSEIF (LookDownResult = 1) THEN
    value = rpm /100
    rpm = rpm - (value * 100)
    Digit2 = value
    ELSEIF (LookDownResult = 2) THEN
    value = rpm /10
    rpm = rpm - (value * 10)
    Digit3 = value
    ELSEIF (LookDownResult = 3) THEN
    value = rpm
    rpm = rpm - value
    Digit4 = value
    ENDIF
    IF (LookDownResult = 3) THEN EXIT
    LOOP

    GOSUB Update_Segs ' show message
    GOSUB Update_Cfg ' display on

    LOOP

    ' Update MC14489 configuration register
    Update_Cfg:
    LOW Enable ' enable MC14489
    SHIFTOUT SerData, Clock, MSBFIRST, [config] ' send config register
    HIGH Enable ' disable MC14489
    RETURN


    ' Update MC14489 segments registers

    Update_Segs:
    LOW Enable
    SHIFTOUT SerData, Clock, MSBFIRST, [dpCtrl\4,
    digit5\4, digit4\4, digit3\4, digit2\4, digit1\4]
    HIGH Enable
    RETURN

    Gesse I hope that is not too much to post.... LOL.

  7. #7
    Join Date
    Sep 2010
    Posts
    1765
    Quote Originally Posted by Sixgun View Post
    Recently I purchaced a BasicStamp2 Microcontroller ............The problem I am having is the syntax...........just can't get it to pass syntax. It is always some variable or some symbol or something everytime I try to run it.
    to someone readily familiar with this syntax, they prob can look at your code for 2 min and point out the problem. so the stamp forums sound like a good place to try.

    If it were me, I would take your program and delete all but the first 10 lines. try to compile it. get syntax fixed on those few lines. then add 5 more. then 5 more. etc. right now it is so big it probably seems unmanagable. maybe just a program with the definitions at the top and the program just a 3 line for next loop to blink a lite. then expand from there. about all the advice I got in my today! good luck.

  8. #8
    Join Date
    Jan 2010
    Posts
    20
    I just figured I would give a try here first. Seems you are correct with the advice on the forums.

  9. #9
    Join Date
    Feb 2011
    Posts
    0
    have a look at Kamran Nili home page
    There he explains how it is done.

  10. #10
    Join Date
    Jan 2010
    Posts
    20
    Yes, that is where I got the programs for the circuit I have built. The problem is the last two programs will not pass syntax, and contacting "The Man" is not seeming to be an option as he will not reply to my email. WHATEVER.

  11. #11
    Join Date
    Sep 2010
    Posts
    1765
    Sixgun, did you try the parallax forums? Get any bites there?

    Are you using the LATEST 2.5.2 stamp editor? I recall earlier versions were more criptic and harder to tell what the syntax error was?

    I just downloaded this one and will try to copy paste ur program into it and see what happens - maybe it will not give syntax errors here in Dayton....

  12. #12
    Join Date
    Sep 2010
    Posts
    1765
    Sixgun, I just copied and pasted your program into Basic Stamp Editor 2.5.2 and ran "check syntax:" it passed with flying colors - no problem. I then put a typo in a line and it found that for me.

    So why do you get syntax errors? Did you try this latest editor?

  13. #13
    Join Date
    Sep 2010
    Posts
    1765
    sixgun,

    whats happening?

  14. #14
    Join Date
    Sep 2023
    Posts
    1

    Re: Tachometer

    I'm also having the same problem, does anyone have the same problem? I hope someone knows how I can fix it

Similar Threads

  1. Tachometer on top of resolver?
    By Dustin L in forum Fanuc
    Replies: 6
    Last Post: 09-16-2010, 04:49 PM
  2. Tachometer feedback???
    By motter71 in forum MetalWork Discussion
    Replies: 0
    Last Post: 08-21-2009, 10:27 PM
  3. 120,000rpm tachometer help
    By Smurf208 in forum Hobby Discussion
    Replies: 76
    Last Post: 06-08-2008, 05:09 PM
  4. Tachometer?
    By John3 in forum Gecko Drives
    Replies: 4
    Last Post: 09-25-2007, 04:57 AM
  5. How can I check a tachometer?
    By asantos in forum Servo Motors / Drives
    Replies: 6
    Last Post: 02-20-2007, 12:46 AM

Posting Permissions

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