New Parallax 360 Feedback Servo

123457»

Comments

  • tomcrawfordtomcrawford Posts: 774
    edited November 30 Vote Up0Vote Down
    twm47099 wrote: »
    Is there a way to get the actual rpm from the pasm so it could be printed or transmitted as data to a control program (using an XBee for example).
    Tom M.

    Here is a version that returns the measured velocity ONLY WHEN IN CONSTANT VELOCITY MODE.
    GetVelocity(serv0)
    
    Since spin is best at returning a single value, CCW velocity is returned as negative. I am still thinkin' how best to make it more general.

    I do not know for sure that my conversion from RPM to clicks/tic is correct and so I don't if the velocity is actually what is programmed. I can just sort of
    eyeball it and say "one-mississippi two-mississippi" and it looks right, but...

    I don't have any way to easily install mount an encoder to actually measure the rpm. If you have encoders on your activitybot and wanted to temporarily spend
    a cog to independently measure velocity, that would be way cool.


    Found a way to mount an encoder and will write code to compare claimed RPM to actual RPM.


    Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.
    Cool, CA, USA 95614
  • Here is the latest (and I hope final) PASM driver for the Feedback Servo. It includes methods for ConstantPulseWidth, SetPosition, SetVelocity, GetPosition, and GetVelocity. A demonstration program is included. There is a little bit of engineering code in the driver but it is commented out.

    Tom, I believe the driver is strictly compatible with the previous version posted in the previous comment. I made it possible to read the velocity in ConstantPulseWidth and generally cleaned things up in the PASM (comments, VariableNames).

    There is also an object that displays the current velocity according to a ActivityBot encoder on servo 2.

    Finally, I append a couple of pictures of my test rig as well as a picture of what is left of my cannabalized Bot.

    I would like to suggest the Blockly guys have a look at this. Four servos in one cog is more better than one servo in two cogs
    Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.
    Cool, CA, USA 95614
  • Tom,
    Thanks. This looks interesting. I tried the previous version last night and had a problem running the SPIN program - I would get text printed out but the servos did not turn. I finally realized that I had not set the pins for servo3 to zero (I only have 3 servos). Then it worked. But since it was about 2AM when I started to port the code I took that as an omen that I wasn't thinking clearly enough to continue. Glad I waited. I hope to work on it this evening.

    How did your rpm measurements compare with the encoder values?

    Tom M.
  • Yup. If the PASM part tries to measure feedback from a servo that doesn't exist, it dies a horrible death.

    I think it actually runs about 5% fast. That is, the encoder returns a value about 5% faster than what is commanded or sensed. I do not know why. I'm trying to decide if I think that is close enough.
    Perhaps you can have a look at VelocityTest.spin and see if you see anything obvious.
    The good news is that the velocity is just about completely independent of load. Plenty of gear noise, though.

    Thanks,
    Tom C
    Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.
    Cool, CA, USA 95614
  • I did some "AfterTheFact" flowcharts of the guts of the driver I wrote.

    It turns out to be straightforward.
    2550 x 3550 - 1M
    2550 x 3550 - 1M
    2550 x 3550 - 767K
    Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.
    Cool, CA, USA 95614
  • Thanks for the code, Tom!

    Kenichi
Sign In or Register to comment.