retrolefty:
I didn't mean to a servo's internal pot, just an external normal standard pot if I wanted to measure a rotational angle position. A servo has maybe 180 degree travel, a pot has 270 degrees or so. What does using a servo to read a mechanical angle position have over using a standard linear pot? Actually a optical quadrature encoder is my favorite device for measuring angle rotation.
Yes, using an external pot would probably be better, but if you're wanting a compact device (or lower weight), that may not be an option; using a "true digital" servo with a serial bus would be the best option, but those are rather expensive. This hack solves for both of those situations, without needing to open up the servo to access the internal pot (which is the "standard" hack).
As far as a quadrature encoder is concerned - I'm not sure how you get an angel out of a quadrature encoder (direction and pulses, yes - but an angle?).
retrolefty:
Well I suspect that using either a standard pot, or this method using analog readback of the current via a analog input pin will have simiar accuracy and resolution as the A/D converter would be the limiting factor. I suspect the simple standard pot would be much simpler to read and equal or better in accuracy.
If you can go with an external pot, probably; but this hack is nice in that it allows you to reduce the number wires from the servo (though I think more ports are involved on the microcontroller side - not sure?), and no need to alter the servo to get it to work. As far as accuracy is concerned, you may be correct (especially if using a precision potentiometer); the real question is what the difference in accuracy would be between this method, and splicing into the internal potentiometer of the servo...
retrolefty:
Yea, it's a cleaver hack, I haven't read the code. I just don't know what problem this solution is trying to solve. Cleaver, yes, useful, I don't think so.
No hacking of the servo required (for internal pot connections), fewer wires from the servo, a compact (and lightweight) setup (closer to a hacked pot servo). Imagine trying to build a bipedal robot using 18 standard servos (because you can't afford the fancy serial bus servos); you need and want servo position information (for posing the robot for "moves", for instance). You could a) Use a bunch of mechanical linkages and external pots, increasing the weight and mechanical complexity, decreasing the run time, and have a bunch of wires from the extra pots running everywhere, b) Hack each servo (18) and hope none of the them break (because you'll have to hack the new one); you'll still have a bunch of extra wires to take care of, or c) Use this method, which eliminates the extra wires, and doesn't add any extra weight or mechanical complexity.
It's only real drawbacks are speed of measuring (which the author already noted could be improved) and the extra circuitry needed for the measurement system. Depending on the needs of your system, the benefits can clearly outweigh the drawbacks. True it can only measure in the range of the servo, and it might not be as accurate; if those are necessary design needs, then use what's appropriate. I do think, though, that this current measurement technique is an interesting one that should be kept in the back of everyone's mind, as it may be the proper solution for a future problem (but certainly not every problem).
