Shop OBEX P1 Docs P2 Docs Learn Events
360 degrees around a pole — Parallax Forums

360 degrees around a pole

396driver396driver Posts: 4
edited 2005-10-14 13:10 in BASIC Stamp
Ok, I don't even know how to search for this (and I tried, but I'm using the wrong keywords or something). And I've only completed one parallax project, so I'm kinda of a newbie.

What I'm basically trying to do is have a wheel go 360 degrees (around and around) around a pole, and have the parallax tell me what degree in the rotation around the pole I'm at (from 0 to 360). (this is really a wheel and a real pole - not virtual)

Could someone tell me how or point me in the right direction?

Thanks
Darryl

Comments

  • steve_bsteve_b Posts: 1,563
    edited 2005-10-05 03:25
    You could use an encoder (digital type) that would give you a byte word back that you'd interpret as a given angle....or you could attach a potentiometer to the wheel so that one revolution of the wheel would equal one revolution of the pot and then use RCtime to read in the pot value (if not an A/D converter).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "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."
  • metron9metron9 Posts: 1,100
    edited 2005-10-05 05:31
    you could use a photo diode, make a fade from black to white around the edge of the wheel, using a white LED read the reflective surface as stated above using RCtime

    or

    Punch slots in the edge of the wheel and use a few IR collectors to read the rotation.

    the 1,2 and 3 are collectors as the slot moves over them tey give a logic low on pin 1, then pin 2 then pin 3 going one way . In reverse they would read 3, 2 , 1 so with a bit of programming and cutting 120 slots. Logic would be poll all pins for a logic low, wait for the next pin to go low,
    i
    Logic truth table
    Pin1=low, next pin to go low is 2, wheel has moved clockwise 1 degree
    pin1=low, next pin to go low is 3, wheel has moved counter clockwise 1 degree
    pin2=low, next pin to go low is 3, ehrrl has moved clockwise 1 degree
    etc.....


    2 Slots with three collectors shown the "||||" is the section that blocks the light from the collectors that gives the signal.
    .....
    1 2 3 ||||
    .....

    At one point all three are high, and your logic is waiting for the first pin to show a low, in that case the first pin to go low shows the direction 1=clockwise and 3=counterclockwise.

    Hey this is pretty cool I just thought it up while I was responding to this post. I may have to use it for something.
  • 396driver396driver Posts: 4
    edited 2005-10-05 05:34
    Not sure what you just said, but thanks, and I'll research your suggestions.
  • LarryLarry Posts: 212
    edited 2005-10-05 05:40
    While you are looking, research "gray code encoder"
    Its a type of encoder used for position control.

    Here's a place to start- http://www.mcmanis.com/chuck/robotics/projects/encoders/enc_gray.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-10-05 06:26
    Darryl -

    I suppose there are dozens of ways to accomplish what you're trying to do, finding where you are radially, relative to one central location. For my money the cheapest, easiest, and fastest way to do it is to use an electronic·compass, similar to that's offered by Parallax here:
    ··· http://www.parallax.com/detail.asp?product_id=29123

    Here is the short and sweet version of the proposed program. Once the program is started, during the program initialization phase, you field the present heading from the electronic compass, and store that initial or starting position. Presently this is your "true" heading, but this will later become your "offset" to calculate relative position. Once you take the first "official" reading (past initialization), you take that new heading, compare it in magnitude·to the stored heading, subtract the smaller from the larger, and you now have your relative position around the pole. Continue that same process as often as may be necessary. What could be simpler?

    I suspect the electronic compass documentation, which can be found at the location above, will address the·issues of accuracy and resolution, if that's important to you. In less than 20 minutes and about $30.00 US you should be good to go! Just be·remember to mount the electronic compass as far away as you can from anything containing ferrous metal, and anything with magnetic coils.

    Regards,

    Bruce Bates
  • steve_bsteve_b Posts: 1,563
    edited 2005-10-05 13:06
    How does teh compass appmod do when near metal? If anything like real 'analog?' compasses they'd be inaccurate in a metallic/noisy environment.

    You could use a hall affect sensor and put magnets on it at certain intervals and count them.....bah, to be honest...a $5 pot and $5 gear (or some way to attach the pot to the shaft/wheel) would probably be just as easy (knock on wood).

    There's some real easy/basic ways to do this...then there are more creative ways to do this as well!

    You could mount a laser to the wheel and have it pointing straight up/out and then have a whole bunch of phototransistors in it's arc/path.

    A pot or encoder would be the way to go....unless you have lots of these other surplus items kicking about!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "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."
  • NewzedNewzed Posts: 2,503
    edited 2005-10-14 13:10
    Mark, did you get my PM?

    Sid
Sign In or Register to comment.