Shop OBEX P1 Docs P2 Docs Learn Events
Project Idea and questions about what product to possibly use in this idea.. — Parallax Forums

Project Idea and questions about what product to possibly use in this idea..

LikWidChzLikWidChz Posts: 4
edited 2008-04-26 13:12 in BASIC Stamp
Hi people,

So this is my basic idea, Id like to assemble something with 8 servos 2 on each leg and I would want to use a basic stamp "not sure which one" along with a 4 channel airplane transmitter to controll the thing.

the idea would be to use something like 4 channels to control 8 servos.

I wasn't sure if you could use the output of the receiver to the input of the basic stamp "run some code" and then go back out to 2 servos running the "walk code"

So my question is this, what would you guys recommend for a 8 servo output stamp to control a 4 legged walking robot with the ability to control the servo's based on 4 inputs from a rc receiver?

--Aaron

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-23 03:35
    8 servos are too many for a Stamp to control unaided. At the very least, you would need some kind of servo controller. The ServoPAL would help although you'd need 4 of them. Better would be something like a Parallax Servo Controller (PSC) which can handle up to 16 servos. A Stamp is not going to be able to handle a 4 channel R/C link. One Stamp can only do one thing at once and, depending on the inter-channel timing, may not be able to do the timing to decode more than one channel. At the very least, I'd suggest a BS2 for the R/C decoding, a PSC for the servos, and another Stamp, maybe a BS2p, for overall control.
  • stamptrolstamptrol Posts: 1,731
    edited 2008-04-23 12:00
    Aaron,

    ···· Attached is a program I wrote a while back to use a 6-channel R/C controller with a smal research barge.

    ···· As previously pointed out, the Stamp can only do one thing at a time so you have to write your program to minimize the chance of missing some important command. In my program that was by reading all input channels, then carrying out the output functions, then re-reading all the input functions, doing the output, etc.

    ·· You will notice that for some operations, the main propulsion motors had to be off. This let the update time in that part of the program be even quicker.

    ·· There's a bit more information in the Completed Projects section. Just search for "Research Catarmaran".

    ·Cheers,





    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
  • LikWidChzLikWidChz Posts: 4
    edited 2008-04-23 23:40
    Well good advice/ideas

    I guess it looks like the fastest processor is 19k instructions a second... looking at the code involved I highly doubt id need 19k lines of code for this whole project ... although I could be wrong

    since it appears both of you have quite a few posts, how difficult would it be to simply write a program to take the input of a rc channel though the bs2px module into the psc and simply move the servo into the same position as if it were connected directly to the rc receiver?

    I guess the idea would be to take 2 channels of the transmitter lets say the left side of the remote and have it control 4 servos "the left side of the robot" and have the thing loop walk code "code is to be written from scratch by me ...somehow [noparse]:)[/noparse]"


    so since from your previous post it sounds like the thing cant be too complicated as it cant monitor inputs from other channels ie only do 1 thing at a time... I guess 19k instructions a second seem like quite a bit to me speaking basic computer language here, I guess am I going to loose speed from this serial servo controller?

    I Wasn't sure if anyone had built a RC robot here using a basic stamp and an actual RC receiver rather then PC or some sorta AI control

    Looking at the electronics of the whole thing this BS2PX module has 12 IO would I simply use a 1 or 2 IO lines for this serial? seems kinda a waste... There isn't a way to directly interface 1 servo to 1 IO line?
    last time I checked a servo was controlled with Pulse Width Modulation along with +- 5 volts or whatever the things run on...

    Forgive me If I sound vague/blunt I have never programmed with a basic stamp only Visual Basic here... and never done any hardware interfacing like this.


    On a side note -- Can either of you recommend a like Blank body? to toss 8 servos on with some legs ... I remember seeing some parallax robots a while ago that were like Yellow plastic pieces with servos and stamps and all that stuff included with it do those still exist?

    anyway forgive this non formatting of wordage its all just ideas that are coming out faster then I can type.

    --Aaron
  • LikWidChzLikWidChz Posts: 4
    edited 2008-04-25 23:31
    anyone??
  • stamptrolstamptrol Posts: 1,731
    edited 2008-04-26 00:05
    Aaron,

    The bs2px has 16 i/0. you'd assign one signal line to each servo. The servos are controlled with the PULSOUT command, not PWM.

    It would not be hard to read the signal in from the radio receiver and then send that same signal out on another pin to a servo. As long as each servo gets updated about every 20 msec, everthing will be fine.

    The idea of the servo controller is that you can set a bunch of servos by sending it a serial message, then let the main processor go and do something else before having to talk to the servos again.

    In all seriousness, get a Stamp and a servo and set it up on the bench and begin programming. The investment will be well worth it and its the only way to learn the hardware side.

    Cheers

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • LikWidChzLikWidChz Posts: 4
    edited 2008-04-26 06:36
    Good deal,
    Stamptrol

    I guess my main concern is is there a nice quad shell with 8 servos I can put this thing in? like the quad crawler shell? any older ones? it appears the newer ones look quite a bit better, I remember these yellow looking ones with black feet "not sure if those are still avail or just old technology"

    I guess my idea to what id want all 8 servos to do with an input from the receiver seems semi complicated although the programming for multiple servos would be pretty much the same, Id reference some code but start from scratch and build upon that, seems pretty straight forward...

    I suppose I can see the benefits of having this serial servo controller,
    1) does this mean you would be only using 1 data line for the 8 servos I would be controlling?
    2) I have not looked into this servo controller yet, although would it be beneficial to use? eaysier to tell a servo to do something?
    3) Would I be able to tell a servo 1 to go to a position and then as servo 1 is moving tell servo 2 to go to another position?

    I guess technically speed of this thing is something like 19k instructions per second seems like an awful lot, I don't want this robot of mine to be sluggish and unresponsive which is why im trying to figure out which is the best/method to go and what to spend my clams on.

    So the bs2px seems to be the best out there now as far as i know..I guess it comes down to "should I get the servo controller? or simply code with pulseout via each dataline? it would be cheeper although would it be hard to loop through all these servoes telling them to move every which way... "I also doubt I would have over 19k lines of code for it even looping once around every second..."

    anyway... any technical details would be great!


    as for the robot shell anyone recommend anything?? I really dont want to build something as the ones that are pre made seem to be pretty close to what id want.... anyway tossing that out there, let me know what you all think [noparse]:)[/noparse]

    thanks in advance.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-26 13:12
    One thing you're missing is that the Stamps are "single threaded". They do only one thing at a time. When they're outputting a pulse to a servo, they're doing nothing else. When they're sending a series of characters to a servo controller, they're doing nothing else. When they're timing an R/C control pulse, they're doing nothing else. In controlling 8 servos, the longest control pulse can be at least 2.0ms, sometimes longer. 8 of these would be 16ms. The servo pulses have to be repeated roughly every 20ms. That leaves no more than 4ms to do other things. There has to be a little bit of time between servo pulses. You might be able to accomplish something useful in these 500us intervals, but you certainly wouldn't be able to time input R/C pulses which also can be up to 2ms in length and come at unpredictable times that you have to wait for. I don't care how fast the BS2px is. Most of its time will be spent waiting to finish an operation with this scheme and it still won't be fast enough to accomplish anything else.

    Yes, you would need only one data line to control up to 16 servos (with one controller ... or 32 servos with two daisy chained controllers)

    Yes, once you've instructed the controller to reposition a servo, you can send another command to reposition another servo. The 1st servo may still be moving to its new position when the 2nd servo begins to move.

    READ THE DOCUMENTATION! READ THE TUTORIALS (like Robotics for the BoeBot). Most of the technical details are already well documented, explained very well ... with examples.
Sign In or Register to comment.