Shop OBEX P1 Docs P2 Docs Learn Events
Encoder Help — Parallax Forums

Encoder Help

TCTC Posts: 1,019
edited 2006-01-20 01:50 in BASIC Stamp
Has anyone had any luck hooking up a BS2 to an encoder? I am working on a project for the basic stamp to tell me what angle my table saw is set to. I have ordered an US Digital T5 Incremental Inclinometer “http://www.usdigital.com/products/t5 ”. It works on an optical encoder I got the 720 CPR model to give me a .5 Deg accuracy. (At least I think it will I will find out when I get it.)
·
Also do you think I would be able to use a BS1 instead of a BS2? There will only be the encoder, a MAX7219 to drive the LED display, and one push button to set 0 deg.

thanks
TC

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-01-19 02:40
    If you use a BS1, you may not be able to read the encoder and update the display fast enough, especially if you need to bit-bang the data, since the BS1 does not have SHIFTIN/SHIFTOUT instructions.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2006-01-19 02:48
    Am I reading correctly that you say you have an optical encoder that does work with a BS2?

    I looked at the datasheet...

    # Near real-time response
    # Virtually free from linearity errors

    ...What's near real-time? ...and no virtual errors! I just had to chuckle.
    Usually you don't see that as a highlighted point of interest in a datasheet.


    ...Anyway, the output looks to be straight forward quadrature output. My concern would be
    if you moved the position of your table saw to quickly, that you would miss a count. I might be
    missing something, but the output does seem to be relative. This means that you must keep
    track of the position within the Stamp. If it were absolute, it would not matter, you just read
    the position. For this reason, it might be wise to use a quadrature decoder chip in-between the
    Stamp (BS1 or BS2) and your encoder.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • TCTC Posts: 1,019
    edited 2006-01-19 03:47
    Chris Savage said...
    If you use a BS1, you may not be able to read the encoder and update the display fast enough, especially if you need to bit-bang the data, since the BS1 does not have SHIFTIN/SHIFTOUT instructions.
    I thought that might give me a problem. I am looking for the lowest cost.
    Thanks.
    Beau Schwabe said...

    Am I reading correctly that you say you have an optical encoder that does work with a BS2?
    I bought it last night just waiting to receive it
    Beau Schwabe said...
    it might be wise to use a quadrature decoder chip in-between the
    Stamp (BS1 or BS2) and your encoder.
    Would you have any recommendations that might work I googled and found nothing that will work with wire wrap?

    I wish I had more knowledge about discreet components. Because I don’t think I need the BS for this. I just need to make a counter that will count from 0 to 500 (0.0 deg to 50.0 deg)

    Also is there a good way for a beginner to test discreet components on the computer. I cat afford to buy parts and burn them up or get it so wrong that I would have to start over again.

  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2006-01-19 05:44
    TC,

    The links below might be helpful... I have not used a single quadrature IC, but I have made one
    with a few discrete IC's. ...Also, I have modified a standard PC mouse to work as a decoder.
    Here you have the function of two quadrature decoders and at least two buttons with a standard
    RS232 output.

    www.fpga4fun.com/QuadratureDecoder.html

    http://forums.parallax.com/showthread.php?p=519683

    http://forums.parallax.com/showthread.php?p=515215

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • TCTC Posts: 1,019
    edited 2006-01-19 22:39
    Thanks Beau. The links helped. I did find this IC that might help others using encoders
    ·
    http://www.usdigital.com/products/ls7083-ls7084/
    ·
    It converts the encoder output to pulses that could be hooked to the BS2 easy.
  • hutdonhutdon Posts: 32
    edited 2006-01-19 23:07
    I have used two of the US Digital chips in a project at work and they worked great! I can't remember which two they were - when I get to the office tommorrow I'll check - but I tried to hook the encoder directly to the BS2 and have it read the encoder and do what was necessary with the output but the BS2 was just too slow to read the changes necessary. In my case I wasn't concerned with direction but only with the total travel in both directions. The US Digital chips do all the reading of the quad encoder with the one that I finally decided on using giving me a high pulse out for each increment. I still ran into the problem that the travel speed of the shaft was still occasionally too high for the BS2 to keep up. This problem was solved using one of Al Williams PAC chips. Again I can't remember which but I'll get that also - I think it may have been the PAC VI or VII. This gave me nearly 'real time' response as the shaft could spin as fast as this particular application would go, the USD chip would read all the transitions, the Al Williams chip would accumulate the total and finally the BS2 would query the Williams chip for the total and then reset it to zero to begin accumulating again. This cycle would be repeated no closer than about every 7 seconds which is an eternity for the BS2. - Don
  • stamptrolstamptrol Posts: 1,731
    edited 2006-01-20 01:10
    ·· Attached is a short program which will read quadrature encoder pulses quite nicely up to about 60 pulses per second on a BS2, if I remember correctly. Would work considerably faster with BS2sx.

    · Cheers,

    ·Tom

    ·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-01-20 01:27
    TC,

    ·· I can tell you that·I have successfully used a·Grayhill Rotary Encoder in several projects with the BS2.· Now, if you spin the shaft really fast with your fingers, the BS2 misses pulses, but on a shaft encoder with a table saw I cannot see that happening unless you really drop the angle quick.· Rotary Encoders are rated also by the number of pulses per revolution.· The ones I use are 16, which is relatively low.· As the pulses go up, so does the timing required to read them.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • TCTC Posts: 1,019
    edited 2006-01-20 01:50
    I understand that timing would be a problem. That is why I have chosen to ditch the BS2 idea and do it old school (I know that is Devil talk). What I am going to use is:
    ·
    ~ 3······ 74LS193········· DEC up/down counter w/ two clocks
    ~ 3······ 74LS247········· DEC to 7-segment driver
    ~ 1······ LS7183··········· Encoder to Counter Interface Chips (from US Digital)
    ·
    See I am not looking for any bells. I just needed when I move the saw the display will tell me my angle and have a zero button.
    ·
    So I would like to thank every one for trying to help me, and I could not find out about encoders with out all your help.
Sign In or Register to comment.