Shop OBEX P1 Docs P2 Docs Learn Events
Get Positon Pulse Width of Servo in Real Time With PSC — Parallax Forums

Get Positon Pulse Width of Servo in Real Time With PSC

thinkpadingthinkpading Posts: 4
edited 2011-09-02 23:18 in General Discussion
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.

Comments

  • Mike GMike G Posts: 2,702
    edited 2011-08-15 21:23
    @thinkpading, standard hobby servos do not report the current position. The communication is one way.

    Look into using an external encoder.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-08-15 21:35
    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.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-08-15 21:42
    I doubt it's what you were hoping for, but it can be done.

    Here a link 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.

    Duane
  • PropabilityPropability Posts: 142
    edited 2011-08-16 11:40
  • ercoerco Posts: 20,259
    edited 2011-08-16 13:28
    I love Beau's analog servo read method. Gotta try that soon!
  • thinkpadingthinkpading Posts: 4
    edited 2011-09-02 22:07
    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 !
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-09-02 22:51
    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.

    http://www.trossenrobotics.com/dynamixel-ax-12-robot-actuator.aspx

    http://www.crustcrawler.com/motors/AX12/index.php

    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).

    Duane
  • ercoerco Posts: 20,259
    edited 2011-09-02 23:18
    Tap into the servo's internal feedback pot and read that voltage using an ADC.

    Done.
Sign In or Register to comment.