View Full Version : Unsolved Get Positon Pulse Width of Servo in Real Time With PSC
08-16-2011, 05:17 AM
I'm now using PSCU1.0.I have known there is a instruction“!SCRSP**” which is to get a servo's pulse width of positon single. However, its principle is to send back the last single received to the MCU, which means that what we get is just the data stored in the memory, but not the real time data of a servo. So , I wonder to know if there is anyway to get the servo's real time position pulse by PSC .And if not, I wonder to know whether we can get the servo's position by MCU or anyway else.
Waiting for your reply. Thank you very much.
08-16-2011, 05:23 AM
@thinkpading, standard hobby servos do not report the current position. The communication is one way.
Look into using an external encoder.
08-16-2011, 05:35 AM
There was a thread some time ago that described a scheme to get the actual servo position. It requires additional hardware. Basically, the power to the servo is restricted so that there's only enough power available for the servo's electronics to work. There's insufficient current for the motor to move and the servo controller has to be able to measure the current drawn. The controller sweeps the control pulse width through the range of pulse widths, measuring the current at each point. When the current drain peaks, the control pulse width indicates the actual servo position.
This could be done by the PSC but would require the additional hardware for each servo involved and the PSC firmware would have to be rewritten to work with the additional hardware and to perform this measurement. It's easier, faster, and probably cheaper to use an external encoder as Mike G suggested.
08-16-2011, 05:42 AM
I doubt it's what you were hoping for, but it can be done.
Here a link (http://forums.parallax.com/showthread.php?84991-Propeller-Application-Proportional-feedback-from-a-Standard-Hobby-Servo-(Upda&highlight=read+analog+servo)to the method Beau came up with.
Dynamixel AX-12s can report their position. They don't use the same kind of control signals as a hobby servo and they cost a lot more than a hobby servo.
BTW, Welcome to the forum.
08-16-2011, 07:40 PM
I think you are getting the same response as this poor fellow did.
I love Beau's analog servo read method. Gotta try that soon!
09-03-2011, 06:07 AM
Thanks for all your attention.
I have read Beau's schematic about "Proportional feedback from a Standard Hobby Servo ".But some little hard to me to understand that all.
Now , I'm doing some subject . I need to get the servo's pulse width value in real time knowing the robot's gesture.Beau said that could be done by detecting the current or voltage drop supplied to servo, and someone advised to add an external encoder.However, I still can'tget the principle of these idears, so can I get some sugestion about how to connect the external encoder for my work.
Thank you !
09-03-2011, 06:51 AM
I'm not aware of a step by step guide to add an encoder to a standard hobby servo.
There is lots of information about encoders on the forums and internet. Adding an encoder to a servo is not a trivial task. It would probably be much easier to use a robot servo with position feedback such as a Dynamixel AX-12A.
Here's a couple of links to stores that sell them.
I've purchased the older AX-12+ servos from both of these stores. I think they are both good sources for these robot servos.
The AX-12A actuators (they aren't really servos) use a different communication protocol than normal hobby servos. The AX-12As will report a lot of different information including position. These actuators are more expensive than many hobby servos but it is probably the easiest way to do what you want.
The alternative is to start reading about encoders. Quadrature encoders will keep track of position even if the direction of movement is reversed. JonnyMac wrote a great article about encoders in one of his Spin Zone columns for Nuts & Volts (these can be found in the Propeller download section of Parallax's website).
Tap into the servo's internal feedback pot and read that voltage using an ADC.