16F877A and Gyro algorithm question


Closed Thread
Results 1 to 4 of 4
  1. #1

    Default 16F877A and Gyro algorithm question

    Hello,

    Is it possible to use a gyro to determine angular displacement? think of a clock face, I want to rotate an object from rest 12 o'clock to say 9 o'clock. Then I want to stop and rotate it the opposite direction and stop back at my starting position 12 o'clock.

    Nick

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: 16F877A and Gyro algorithm question

    A gyro does a good job of measuring the change of angles if it's "Integrated" in the math.
    But by itself, it will drift because it has no point of reference.

    Adding a 2-axis accelerometer can give it a reference point (the gravity vector).
    But that assumes it's stationary in the 3rd axis (like a clock on the wall).
    And it has to be totally stationary often enogh to maintain the reference point to gravity.

    With a 3-axis accelerometer you can get a "Tilt Sensor".
    http://www.picbasic.co.uk/forum/cont...-axis-g-sensor
    But constant rotations would cause it to drift as well.

    It would be more accurate, and a lot less hassle, to put an encoder on whatever is turning.
    DT

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: 16F877A and Gyro algorithm question

    DT, thanks for the confirmation. I never used it as an absolute position sensor, always relative.

    Best Regards,
    Nick

  4. #4
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: 16F877A and Gyro algorithm question

    Doesn't really answer your question about a gyro but I do agree with Darrel in that gyros drift. They also are extremely difficult to compensate accurately.

    If it didn't need to be a full 360 degrees you could use a linear potentiometer hooked to the shaft? Supply 5V to one the other to ground with the wiper as the output. You'd have to do a one time calibration to determine angular position vs output and then it could be fed into an ADC to discern the output. This way it wouldn't be susceptible to gravity through tilting or installation errors. Would probably be the cheapest way also.

    If 360 degrees is required you could use a synchro or resolver, depending on accuracy needed, but it gets a little more complicated with either of these devices. They do require AC excitation of the rotor and has three, synchro, or four, resolver, legs for the output. I'm sure someone has coupled one of these to a PIC already. It wouldn't be susceptible to off-axis tilting either and I don't THINK the math would be as complicated as the link above.

    Most digital inclinometers have an RS232 output and some have USB but would probably prove as the most expensive option. Also, if you wanted 360 degree operation you'd have to come with a slipring so the cord wouldn't get wound up.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts