Shop OBEX P1 Docs P2 Docs Learn Events
Absolute encoder for servos — Parallax Forums

Absolute encoder for servos

viperfan7viperfan7 Posts: 10
edited 2015-03-02 10:26 in Robotics
Anyone know of any absolute encoders for RC servos, that are I2C capable, that can be bolted onto the servo itself?

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-02-23 14:08
    viperfan7 wrote: »
    Anyone know of any absolute encoders for RC servos, that are I2C capable, that can be bolted onto the servo itself?

    What do you mean by "bolted onto the servo itself"? Where do you see it being attached?

    One of my robotic goals is to come up with a good inside the servo encoder which doesn't rely on a potentiometer and which will allow the servo to be used both in its normal mode or in a continuous rotation mode.

    I tried using an optical encoder inside a servo.

    attachment.php?attachmentid=105438&d=1386432536

    I could get 378 transitions per revolution. This resolution is a bit better than one degree resolution but I'd really like to find a more precise solution.

    In another experiment, I used an AS5055 magnetic encoder.

    attachment.php?attachmentid=103008&d=1374727215

    This didn't work very well. I'm not sure if the problems were caused by the lack of precision when I installed the encoder PCB or if the magnetic field from the motor interfered with the sensor.

    I'm inclined to think some sort of optical encoder would work better than a magnetic encoder.

    The magnetic encoder's precision is dependent on the quality of the field produced by the magnet. It's unlikely each increment in the value read from a magnetic encoder will correspond to an equal change in the angular position of the magnet.

    Earlier today (while working on my hexapod) I was thinking it would be really useful to have some way of precisely measuring the angle of servos. I think it would be very useful for calibrating robots.
  • John AbshierJohn Abshier Posts: 1,116
    edited 2015-02-23 15:44
    I have no experience with US Digital absolute encoders, but have had no problems with incremental encoders.

    http://www.usdigital.com/products/encoders/absolute

    John Abshier
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-02-23 15:58
    I have no experience with US Digital absolute encoders, but have had no problems with incremental encoders.

    John,

    Do you have any favorite incremental encoders? Have you used any encoder you think could be used with a servo?

    I think incremental encoders would be useful with servos if there was a way to detect a "home" position.
  • viperfan7viperfan7 Posts: 10
    edited 2015-02-24 10:50
    I mean non internal, meant to allow the external shaft of the servo to pass though it, so bolted onto the face of it eg.

    ww01-kit_lg.jpg

    although I'd have no trouble using an internal encoder, but I suspect with something like this external would just be plain simpler as I'm not worried about clearance, although, I''d be fine with modifying it and using the pot to pull the position, pass it to the A/D input on the board
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2015-02-24 13:27
    Servos have a kind of absolute encoder already in them: the potentiometer. There are some plans about the Web to tap into the pot, without loading it down, and read it while still having it used for its intended purpose.

    You don't mention if your use is for standard or continuous rotation servos. If the later, the Wheel Watcher (which you show) could be used as an absolute encoder if you trust your input electronics to not miss a pulse. Or, you can add an extra index stripe to the wheel, and provide some optics for reading when that stripe goes by.

    If you are using a Wheel Watcher with a standard (non CR) servo, all you need to do is home the servo to one far extent, then start counting. It's absolute encoding by definition.

    Servo City and its offshoot business Actobotics has all sorts of servo-related accessories, such as shafts and external gearboxes. I don't know if they sell any external encoders, but with an external shaft extension and a US Digital encoder you could certainly work up something.

    Here's an example of an Actobotics shaft extension, and some of the things you can attach to it. It's .250", so it'll work with several of the cheaper US Digital encoders.

    https://www.servocity.com/html/servo_shaft_attachment___250__.html#.VOztnHzF-YE

    The electronics is up to you. Personally I'd use one of US Digital's IC-based quadrature decoders, which turns the quad signal into a pulse count/direction. You could then use that directly with most MCU; the Propeller could easily handle multiple inputs. If you need a finished I2C product, you could program a PIC or AVR as a quad counter I2C master.
  • John AbshierJohn Abshier Posts: 1,116
    edited 2015-02-25 08:44
    Duane,

    I have mostly used the E4Ps. I don't know of any that would directly work with a servo. Perhaps servo--connects to driven item--connects to encoder. Gordon shows one way. Some of the encoders have an index signal, once per revolution, that could be used to detect a home position.

    John Abshier
  • viperfan7viperfan7 Posts: 10
    edited 2015-03-02 08:57
    Standard servo, probably will hunt down how to pull from the pot, although once again, that comes with inaccuracies you wouldn't get with an encoder, I'm trying to avoid using the pot as using the servo library, setting it to 90 degrees, well, its most definitely not 90 degrees, looks like its actually 85 degrees, 180 seems right , but 0 seems to be 1.5 degrees. although putting it like that makes me think its an issue with the servo library that wouldn't be hard to fix
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2015-03-02 10:26
    viperfan7 wrote: »
    Standard servo, probably will hunt down how to pull from the pot, although once again, that comes with inaccuracies you wouldn't get with an encoder,

    Most standard RC servos have a 4-10 usec deadband, so the limiting factor is the internal feedback electronics. You can't count on resolution better than the deadband. Added to that, most servos still use analog components (resistors, capacitors), and these drift with temperature. Digital servos can have a more narrow deadband, and less drift, so they can be an option, depending on your use case.

    If you're needing more resolution, you might need to go with a different type of motor -- stepper or true servo. With some work, you could convert an RC servo to a DC servomotor by adding the encoder, and connecting the motor to an H-bridge, bypassing the RC servo's internal electronics. You'd control the motor via some PID loop running on your microcontroller.

    The variance from 90 degrees you are seeing is the result of an inexact motor designed for something other than what you are using it for. In RC applications, transmitters include a mechanical "trim" function to set the real center of the servo. You cannot count on 1500 usec actually being the middle of travel. Life isn't that easy.
Sign In or Register to comment.