Shop OBEX P1 Docs P2 Docs Learn Events
Concern with not being able to use all 16 servos on the PSC board — Parallax Forums

Concern with not being able to use all 16 servos on the PSC board

kingspudkingspud Posts: 128
edited 2005-05-31 20:51 in Robotics
I noticed that even though you can connect 16 servos to the PSC board while using a BS2px chip you are limited to the amount of word memory you can use.

I tried a program with 16 servos and set a Word variable to each servo and I ran out of space!· Since you need numbers in the range of 250 to 1200 how are you suppost to do this?

How do you set variables in the WORD range·and get·use·of all 16 servos when you are limited in·memory usage.

How do you get around this problem?

Thanks in advance!

Joe··

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-05-25 22:23
    Hello,

    ·· This has been addressed several times in the past, and it all boils down to not needing a different variable for each servo.· In fact it is possible to use one variable for all 16 servos.· It really depends on how you go about it.· If you need the positions of all the servos in RAM for each servo you could also use the BS2px ScratchPad RAM.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • kingspudkingspud Posts: 128
    edited 2005-05-26 05:24
    Would you happen to have a small program that could explain what you mean???
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-05-26 15:42
    Hello,

    ·· I don't have any pre-existing code as an example, since I have never had to control quite that many servos, but I can certainly elaborate on what I mean.· The closest thing I can compare to would be the Hex Crawler, which, by default has 12 servos and 14 with the Pan/Tilt assembly.

    ·· In this situation each leg is really only going to have a fixed set of paths for the motions it will use when walking (gait).· These can be set as constants, and then the data sent, one byte at a time to the PSC using the same Work variable.· This is commonly done when more than one servo uses the same basic motions.· Each leg is updated based on the current direction of the leg.· You would need one or two more variables for this routine for tracking which servo was being updated and possibly for speed or offset changes, but you don't need 12 Word variables.· I hope this information helps.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-05-26 16:05
    I don't have a full-blown program either, but it's not too tough to use the Scratchpad, especially now that PBASIC 2.5 allows PUT and GET to work with Word variables.· To save a servo value to the Scratchpad·you would do this:

    · PUT (servoChan * 2), Word servoPos

    And to retrieve it:

    · GET (servoChan * 2), Word servoPos

    In your program then, you'd have two working variables: servoChan (a Nib), and servoPos (a Word).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • kingspudkingspud Posts: 128
    edited 2005-05-26 16:34
    But what is all 16 servos could or need to be in motion at one time, doing something completely separate from the others? Is this possible with the PSC board?
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-05-26 17:12
    Yes, you can have all 16 servos in motion at once, and using the Ramp value can control the speed at which a servo moves from one position to another. The purpose for the Ramp value was to unload the host processor (BASIC Stamp in this case) of sending intermediate position data in order to control the speed a servo moves.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • eflyefly Posts: 34
    edited 2005-05-30 18:18
    Hi, the following discussion board may be help for your reference:

    http://forums.parallax.com/forums/default.aspx?f=10&m=67901
  • CJCJ Posts: 470
    edited 2005-05-31 20:36
    If precision isn't critical, couldn't you use byte variables and just multiply by 10 when you send the value to the servo? I mean the servo moves just a hair for any position change less than 10, would that tiny lack of precision cause problems in your project?
  • kingspudkingspud Posts: 128
    edited 2005-05-31 20:51
    Interesting.....· I have to think about this one!
Sign In or Register to comment.