Shop OBEX P1 Docs P2 Docs Learn Events
detecting rotation — Parallax Forums

detecting rotation

MatthewMatthew Posts: 200
edited 2004-12-19 01:17 in General Discussion
Hello,

How would I mount Parallax's tilt sensor if I wanted it to detect rotation on a wheel? If I placed it on the wheel, with the wires going to the Stamp, wouldn't it tangle all of the wires?

Also, can Parallax's tilt sensor detect which way it is rotating? As in clock-wise or counter-clock-wise?

Thanks,
Matthew

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-12-13 05:36
    Only if the wheel is mounted vertically, like the wheel on a car. In this mode angular position can be sensed by combining the X and Y axis -- there is code for this on our documentation.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-12-13 21:40
    If you're talking about mounting the sensor to a contiuously rotating wheel, then yes, you would have a problem with wires getting tangled.· Just out of curiosity, why would you want to mount it on the wheel?



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    Designs Page:··· http://www.lightlink.com/dream/designs
    ·
  • MatthewMatthew Posts: 200
    edited 2004-12-13 21:46
    Chris,

    The Stamp needs to know if a single wheel is turning or not. And if so, in what direction. Although RPM does not matter (as it will be almost constant), it will be in the range of 1600 RPM. Any ideas?

    I know Lego makes a rotational sensor for their Mindstorms line, would I be able to to find out what kind of outputs it gives off and use that?

    Thanks.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-12-13 21:57
    Typically this is done using an optical encoder of some sort...An encoder can be the type that is attached directly to the shaft and spins with it, OR it could be like the one Parallax uses for the BOE-Bot (I have this), which bounces IR light off the wheel, and detects the holes/gaps in the wheel to detect motion, although you cannot detect direction using this particular setup.· An optical shaft encoder should be able to give direction as well as speed.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    Designs Page:··· http://www.lightlink.com/dream/designs
    ·
  • MatthewMatthew Posts: 200
    edited 2004-12-15 05:26
    Okay thanks Chris. What exactly is an optical shaft encoder?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-12-15 15:17
    Most are quadrature encoders (See Jon Williams post in the SX Forums) like what's inside older Computer Mice.· When the shaft spins, and disc attached to it will spin.· An IR LED shines light through holes in the disc.· Sensors (Photo detectors) pick up the pulses which, depending on the direction of the wheel, will be around 90 degrees out of phase with each other (There are 2 outputs: A & B) the phase differential determines which direction the wheel is turning.

    As I said, these can be mechanically coupled to a shaft for continuous rotation in your applcation without tangled wires.· If you just need speed/motion, you can use the other method, which involves bouncing an IR beam off the wheel, which may or may not need a reflective tape or something to bounce the IR light back.· The Parallax Optical Encoders do not require this if you're using the right wheels.

    Hope this helps...If you need more information on encoders, you can also do a Google search.

    BTW, here is the link to the Encoder Project Jon Williams did:

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



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    Designs Page:··· http://www.lightlink.com/dream/designs
    ·
  • MatthewMatthew Posts: 200
    edited 2004-12-16 06:04
    Thanks Chris for all of your help. I'll be sure to look into it once I'm done with my tests tomorrow!
  • MatthewMatthew Posts: 200
    edited 2004-12-18 03:13
    How about...

    The wheel is controlled by a BS2. When the wheel spins one way, one LED turns on, when it spins the other way, a different LED turns. Each LED has its own photoresistor, which is connected to a BS1. Depending on which LED is on, the BS1 will know which way the wheel is spinning.

    How does that sound?

    Two Stamps will be needed anyways.
  • steve_bsteve_b Posts: 1,563
    edited 2004-12-18 21:05
    Well, then you're only monitoring what the 'control' equipment is supposed to be doing...you're not actually monitoring the wheel.

    I work on weather radars, and we use synchro's to determine rotation.· (A synchro is basically 2 motors connected together....maybe that's too symplistic....but there are 3 main coils in a synchro.· When we put 120Vac, as a reference, we get a magnetic field set up....now when the shaft rotates it affects the magnetic field in a certain way (more voltage across combinations of the coils).· We monitoring these voltages with some A/D circuitry which then does all the math itself.)

    Anyhow, these synchro's are connected to the main gearing of the radar with tiny gears and shafts.· I've seen one of these shafts snap which stops giving feedback to the control system.· The control system is tell the dish to turn at X speed in Z direction.· Since it has no feedback, it assumes the dish isn't rotating, so it applies more power to the motors....now the dish is flying around at stupid speeds.· Our system has a "no response" timeout...but during testing we had this option turned off and you probably could've put a propellor on the dish and flew to the moon!· Scary really!

    So, I guess my long winded story is telling you to figure out a way to monitor the wheel instead of the control circuitry.· If connection to the motor fails (or the motor itself fails) you're LED's will still light, but the wheel wouldn't turn.

    If you just want to no that it's rotating, then use a magnet on the wheel and a reed switch to give switch closures to the stamp.· If you want rotation....well....you COULD try a certain combination of magnets on the wheel, that would give a distinct closure pattern to say it's rotating CW or CCW.

    Like, 2magnets 2" apart, then the next magnet 4" further down the line with the last magnet 8" along.· If you set this up this way, you'll know by the increase/decrease in closures of the direction of travel....and speed too if you measure the timing and the spacing properly.· Just an idea....not sure if it's practical.

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

    Steve
    http://members.rogers.com/steve.brady
    http://www.geocities.com/paulsopenstage

    "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."

  • stamptrolstamptrol Posts: 1,731
    edited 2004-12-19 01:17
    ·· Hi,

    ·· If you decide to go the quadrature encoder route ( or even use the magnet idea from the previous post), you may be interested in a neat bit of code I adapted from an old book by J. D. Nicoud.

    · It will generate a direction indicator ( Forward or Reverse for instance ) and also do a great job of counting at pretty respectable speeds because the code is so small.

    · I've attached the sample code for you to play with.

    ·Cheers,

    · Tom
Sign In or Register to comment.