Shop OBEX P1 Docs P2 Docs Learn Events
rotary position sensor — Parallax Forums

rotary position sensor

glider_markglider_mark Posts: 3
edited 2008-11-19 20:01 in BASIC Stamp
I am looking for a rotational position sensor to use with a BS2 stamp.· Any recommendations?

Comments

  • SRLMSRLM Posts: 5,045
    edited 2008-11-15 06:44
    Like a gyroscope or a compass? Parallax sells a nice little compass, sparkfun sells gyroscopes, and RC helicopter suppliers sell specialized gyro. Some more information would be good: what is your application? What sort of rotation? How accurate does it have to be?
  • glider_markglider_mark Posts: 3
    edited 2008-11-15 16:47
    SRLM, Thank you for the reply. I am looking for angular position for a pendulum project I am working on. I want to record the angular position of the pendulum with time. 1 degree precision would be acceptable, but 0.1 would be great!
  • SRLMSRLM Posts: 5,045
    edited 2008-11-15 18:14
    I'm guessing that this is for a physics project, so you can't use the pendulum/harmonic motion equations to tell you where it is...


    I think the simplest method would be to have to pendulum break an IR beam. Unfortunately, you wouldn't be able to determine how high it is swinging, since a pendulum is always swinging at the same rate (for a given COM). So, the gyroscope option would be the easiest/best if you have the money for it. Otherwise, on to other solutions. You might be able to set up some sort of distance measuring device that is on the same axis that the pendulum swings on. Then, measure the distance to the pendulum, and do some trig to figure out where it is. Unfortunately, this would require a very accurate sensor. You might be able to get by with something like a Ping))), but you'll probably have to do all sorts of tricks to make the data right.


    Thought: you could use an accelerometer. Then, simply measure the change in acceleration. There is a thread ( I think it's in the Stamps in Class forum) that uses a BS2 to measure tilt. A gyroscope would be good for short term measurements, and an acceleromete woudl be better for long term (days?).

    Why is it I always forget the simple solutions? [noparse]:)[/noparse]
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2008-11-15 18:37
    Have you seen the Melexis hall-effect sensors? These can measure angular rotation along with many other parameters. Really easy to implement if you can put a magnet in the right spot.

    Ken Gracey
  • SRLMSRLM Posts: 5,045
    edited 2008-11-15 19:32
    Don't those sensors sense if the magnet is close, then infers rotation by the number of times the magnet passes? So, it would be effectively the same as having IR, and both require physics equations to determine current position when the pendulum is away from the sensor. I suppose that the hall effect sensor would work if you found a large gear with lots of teeth (360 or 720) and iron. Then the sensor would work for sensing the tooth.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-11-15 20:34
    SRLM said...
    Don't those sensors sense if the magnet is close, then infers rotation by the number of times the magnet passes?
    No, they measure the orientation a radially-polarized magnet makes with the sensor, returning an absolute rotation angle. See a description here.

    -Phil
  • glider_markglider_mark Posts: 3
    edited 2008-11-15 22:38
    I did a little more looking at the sensors in the catalog and it looks like I can get exactly what I want using a Memsic 2125 Dual-Axis Accelerometer. I found an activity in the "Smart Sensors & Applications" training manual that calculates rotational angle of the sensor from horizontal. I'm going to give it a try!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-11-17 17:36
    Hello,

    This sensor question is being moved to the BASIC Stamp forum. Sorry for any inconvenience this has cause. The sensors forum is being removed. Please see announcements for further details. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • TWRackersTWRackers Posts: 33
    edited 2008-11-17 18:51
    glider_mark said...
    I did a little more looking at the sensors in the catalog and it looks like I can get exactly what I want using a Memsic 2125 Dual-Axis Accelerometer. I found an activity in the "Smart Sensors & Applications" training manual that calculates rotational angle of the sensor from horizontal. I'm going to give it a try!
    Keep in mind that if the Memsic chip is at the pivot point, you can measure the tilt angle with time.· If however it's at the end that's swinging, it will also be measuring the centrifugal force produced from swinging around the pivot point.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-11-17 19:07
    Also keep in mind that any wires connecting to the Memsic chip have to be brought out to the stationary platform, which may affect the pendulum's motion. That may be one reason to favor the Melexis Hall-effect sensor, since it would be mounted to the stationary platform and not on the pendulum itself.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Just a few PropSTICK Kit bare PCBs left!
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-19 01:20
    If you can stand a little friction, a rotary potentiometer would work as well as anything else. Turn the shaft, and the resistance changes.

    If you can't stand any friction, you could use a lamp, two polarizers, and a light detector such as a photocell or photoresistor. Turn one polarizer with the pendulum, hold the other stationary, and the light going through the two polarizers is attenuated. The transmission through both polarizers will be most intense when they're aligned, and least intense when they're at right angles. It will vary as the cosine of the angle. Since the sensors may not be very linear, you ought to run a calibration curve for each 0.1 degree. Also, make sure your light source doesn't vary (an LED with a resistor, fed by a regulated source, ought to be steady enough).

    As you will no doubt infer, sensitivity will be greatest (most change per degree rotation) when the sensors are nearly 90 degrees apart.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i

    Post Edited (Carl Hayes) : 11/19/2008 2:02:57 AM GMT
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-19 01:41
    Actually I meant to say sensitivity will be greatest (most change per degree rotation) when the POLARIZERS (not the sensors) are nearly 90 degrees apart.

    Senility is a lot like being drunk, as Larry Niven once wrote.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-19 01:50
    SRLM said...
    I'm guessing that this is for a physics project, so you can't use the pendulum/harmonic motion equations to tell you where it is...
    Couldn't anyway.· The motion of a pendulum is not harmonic.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i
  • SRLMSRLM Posts: 5,045
    edited 2008-11-19 02:32
    @Carl

    Take a look in wikipedia under Harmonic Oscillator and this site under pendulum motion.
  • $WMc%$WMc% Posts: 1,884
    edited 2008-11-19 02:40
    glider_mark

    The "PING" is just another thought to Your project...
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-11-19 04:02
    SRLM,

    Take Carl at his word. There are non-harmonic pendulums. Compound pendulums are a prime example.

    -Phil
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-19 05:23
    All simple pendulums (a simple pendulum is one with a string of negligible mass and constant length) are non-harmonic.· Harmonic motion requires that the restoring force be proportional to the displacement.· This is not true in pendulums.· In a simple pendulum, the restoring force is proportional to the sine of the displacement.

    For very small angles, sin Θ is approximately equal to Θ itself.· Thus, swinging through angles less than, say, 1/2 degree, a simple pendulum will exhibit motion that is very nearly harmonic.· For larger angles, the error that results·from treating the pendulum as a harmonic oscillator becomes progressively larger, and for angles more than a few degrees the error is rather great.

    The original poster mentioned that accuracy of one degree could be lived with, although he would like 1/10 degree (6 minutes) much better.· If one-degree accuracy could be lived with, his pendulum must be swinging through at least several degrees, and so the approximation of harmonic motion would be a very poor approximation.

    The article on pendulums, to which you give a link, is simply wrong.· Its saving grace is that in its first paragraph it does say that it is talking about approximate solution.· Since you like Wikipedia, you might check there under pendulum, where you will find [noparse]/noparse]under [i]pendulum (mathematics)[/i·there is an article that avoids the errors that seem to have persuaded you that you might reasonably give instruction.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i

    Post Edited (Carl Hayes) : 11/19/2008 5:34:28 AM GMT
  • SRLMSRLM Posts: 5,045
    edited 2008-11-19 05:36
    Instruction? No at all. Direction? possibly...

    I apologize for any misunderstandings or misuse of the phrase "pendulum/harmonic motion equations". I write what is to the best of my knowledge, and unfortunately, I am not an expert at physics (or electronics for that matter). If I can provide any sort of help, then great, and if I lead in the wrong direction, then, again, I am sorry.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-11-19 06:01
    Carl hayes said...
    All simple pendulums (a simple pendulum is one with a string of negligible mass and constant length) are non-harmonic.
    Right! Thanks for clarifying that there are non-harmonic systems that are also non-chaotic, as my extreme example failed to emphasize.

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 11/19/2008 6:16:34 AM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-11-19 06:13
    SRLM,

    No need to apologize. We all make mistakes here and learn from each other. Your generous contributions and youthful exuberance have been an asset to these forums since you first joined. To the extent that it doesn't interfere with your studies or an active social life, I hope to see it continue.

    -Phil
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-19 14:05
    Anyway, I would be interested to know what result might proceed from my suggestion of crossed polarizers to measure angles. I think a small light source and polarizer could be placed in the pendulum bob (the weight at the end of the string) and made to shine on a detector equipped with the other polarizer.

    Another way would be to use a non-metallic reflector on the bob to polarize the light by reflecting it at the appropriate angle. Of course a little brainstorming will yield many alternate approaches not nvolving polarized light at all. Sonar? Interferometry, either with light or with sound? The possibilities are endless.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i

    Post Edited (Carl Hayes) : 11/19/2008 3:04:19 PM GMT
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-19 17:42
    Phil Pilgrim (PhiPi) said... Right! Thanks for clarifying that there are non-harmonic systems that are also non-chaotic, as my extreme example failed to emphasize.

    -Phil
    A surprising majority of cyclic systems are non-harmonic.· Nearly all, in fact.· One of the hardest things to do is to generate pure harmonic motion -- that is, a pure sinusoid.· Any distortion in the waveform is a deviation from pure harmonicity.

    The terminology is confusing, at best.· Most distortions produce harmonics of the fundamental frequency -- and the production of harmonics makes the vibration non-harmonic in the sense that it is no longer a purely harmonic (i.e. sinusoidal) vibration.

    Piano strings are worse.· The distortion products in a piano string are not exact multiples of the fundamental frequency!· They are a little higher, which is what gives the piano its unique timbre, and which is also what makes piano tuning an art instead of a science.· You'd think that a piano string resonant at, say, 440 Hz (the tone A), would also resonate at the third harmonic, 1320 Hz.· Nope -- because of the effects of wire stiffness at the ends where it is constrained by the bridges, the third resonance is actually just a bit higher than 1320 -- and that's about all I know about that.

    Returning to pendulums, centuries of clockmakers worked to try to make a harmonic pendulum.· They needed one, because a simple pendulum's period depends upon the angle through which it swings.· The higher it swings, the slower a pendulum clock will run.· Many schemes, some simple, some fancy, were devised to make the period vary less with differences in amplitude.· Eventually someone invented the oscillating balance-wheel movement, which is inherently a harmonic oscillator if the springs are linear enough.· Then all they had to do was reduce the distortion.· After that invention, pendulum clocks were seldom made (except for nostalgic reasons).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i

    Post Edited (Carl Hayes) : 11/19/2008 5:47:21 PM GMT
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-11-19 18:20
    Well, actually, a pendulum's period is ONLY determined by the length of the pendulum, not the angle through which it swings. The "elegance" applied to the pendulum clock was various methods to account for differences in temperature, which would extend (when hot) or shorten (when cold) the pendulum length.

    Also, where you REALLY needed an accurate clock was in ship navigation. And the motion of a ship made a pendulum useless. Thus the need for a spring-driven "balance wheel" movement, and lots of research into bi-metallic spring materials to make THEIR force consistent over different temperatures.

    After that, the next big advance in time making occurred around rail-roads, which resulted in fixed "time-zones".
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-19 19:17
    allanlane5 said...
    Well, actually, a pendulum's period is ONLY determined by the length of the pendulum, not the angle through which it swings. The "elegance" applied to the pendulum clock was various methods to account for differences in temperature, which would extend (when hot) or shorten (when cold) the pendulum length.

    Also, where you REALLY needed an accurate clock was in ship navigation. And the motion of a ship made a pendulum useless. Thus the need for a spring-driven "balance wheel" movement, and lots of research into bi-metallic spring materials to make THEIR force consistent over different temperatures.

    After that, the next big advance in time making occurred around rail-roads, which resulted in fixed "time-zones".
    Actually, Allan, what you say is a common misperception, but no less wrong for being common.· See the attachment.· The chart at upper right in the attachment describes exactly how much the period varies as one varies the angle through which it swings.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i
    843 x 744 - 123K
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-19 20:01
    Of course, there's always the scientific method.· I just ran an experiment with a plumb-bob on a string.· I held the string about 18" (very approximate) from the bob, and swung the thing through a small angle (moving about 2" each side of center).· I got 24 full swings (cycles)·in 30 seconds.· Then I swung it through nearly 90 degrees each side of center, and got 21 swings in 30 seconds.· This is pretty consistent with the graph's (and therefore the formula's) prediction of 17% greater period when swinging through 180 degrees (90 degrees each side of center).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i
Sign In or Register to comment.