Shop OBEX P1 Docs P2 Docs Learn Events
Digital Encoder Interfacing — Parallax Forums

Digital Encoder Interfacing

blittledblittled Posts: 681
edited 2009-06-29 16:08 in Propeller 1
I'm setting up a Boe-Bot with a protoboard and was wondering if there was an object that interfaces with the Boe-Bot Digital Encoder. If not, is there a way to use CTRA/CTRB to count both the positive and negative edges of a pulse? That way I can get 16 counts per revolution. Thanks!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
What electronics need - MORE POWER!!!!!!!

Comments

  • MagIO2MagIO2 Posts: 2,243
    edited 2009-06-29 12:06
    I don't know the specs of the Boe-Bot encoders, but shouldn't this driver do the job?

    http://obex.parallax.com/objects/24/

    Besides that -·how would counting the edges work?
    First of all you have as many positive edges as negative edges (plus/minus 1) by nature of digital signals. But what about the direction? That's where counters can't help you i guess. You really have to analyse the signals for detecting the direction the encoder has been turned in.
    I think there exist at least two types of encoders. The one type I found in a mouse I dissassembled (the mouse wheel) gives two signals where both change within one step but with a little timeshift. The encoder I bougth only changes one signal with one step. But for both the signal sequence·looks the same:

    turn in one direction                      turn in the other direction
    00                                         00
    01                                         10
    11                                         11
    10                                         01
    00                                         00
    
    



    Post Edited (MagIO2) : 6/29/2009 12:22:29 PM GMT
  • agfaagfa Posts: 295
    edited 2009-06-29 13:30
    you could use two counters per wheel and set one to count pos edges and another to count neg edges and total them. you could also create a simple routine in spin ,or PASM if speed is an issue, to do the same with out the counters. if your refering to these encoders http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/encoders/List/0/SortField/4/ProductID/80/Default.aspx i don't think they have a quadrature output.· determining direction wouldn't be needed since the direction you are driving the wheels is known.

    agfa
  • MagIO2MagIO2 Posts: 2,243
    edited 2009-06-29 13:50
    That's what wikipedia says about the boe-bot device:
    "Rotary sensors with a single output are not encoders and cannot sense direction, but can sense RPM. They are thus called tachometer sensors."
    And that's how I understood the word encoder. Ok ... boe-bot is only using a tacho and that can be done by a counter of course. At least one for the right wheel and one for the left. Counting positive AND negative edges increases accuracy. You can have a look at the Propeller App Notes AN001 - it shows how to set up the counters for edge count. Find it in the download section or the sticky.
  • blittledblittled Posts: 681
    edited 2009-06-29 16:08
    Thanks for all your input. MagIO2, you are right they are tachometers and I already know the direction of rotation. I read ANN-001 and it mentions that the counters can count on negative or positive going edges but not on both. Since the tachometers moves slow enough a simple spin program that checks the state of each tach and increment a variable when there is a change of state should work. I just thought there may be an object since I saw a thread mention a rotary encoder object but I couldn't find it in obex.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    What electronics need - MORE POWER!!!!!!!
Sign In or Register to comment.