November 22, 2024, 06:23:16 AM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


simple question

Started by stiltbeast, March 30, 2008, 10:41:56 PM

Previous topic - Next topic

stiltbeast

Hi all, I've seen several references to prop-1s not playing well with servos, should all servo operating be run through a prop 2?
that would significantly alter the cost of most props, so getting the prop-1 to work would be great. Is there a servo limit, like only two servos or is there a guideline you can follow when using them?
thank you,
Allen

JonnyMac

The Prop-1 can run servos just fine.  Keep in mind, though, that servos need updating every 20 milliseconds and this is what causes some folks to have problems -- it can be tricky, and this issue is the same for the Prop-1 and Prop-2.  This is the reason that dedicated servo controllers have become so popular: they take the burden off of the programmer for servo refreshing.

In my book, the Prop-SX is the *best* of our line for dealing with servos because one can write code that virtualizes a servo controller instead of connecting an external one.  That said, this is tricky code and not everyone is ready for that, either.

If you have  specific idea that you want to do with servos you should define it and then we can talk about your options.
Jon McPhalen
EFX-TEK Hollywood Office

steveo

Jon,
I wrote some code last week that uses the programming concepts illustrated in the "Blending Servos" thread. It's controlling 3 servos simultaneously on a Prop2 very nicely. I added some variables that allow  me to play with the loop padding so I can control the servo movement speed to an extent, and also (mainly for giggles) I used the Ping))) to give the servos two different routines based on distance from the sensor. All of this is running great on Prop2.

stiltbeast

Im building the rig now, its a dragon half out of a cave, the servo will run one eye opening and shutting, and another servo will make his tail tap on the ground. I figure I need to build the rig so I know what torque servos to get, the eye will be about 2 inches across and the tail weight has yet to be determined. but the rig will be done by next week.
   It seems like the tricky part is the coding. You mentioned dedicated servo controllers, forgive my ignorance but I don't know what they are, are they used instead of a prop-1 type controller or as a middleman between the prop one and the servos?
Allen

JonnyMac

Servo controllers are in fact "middle-men" between a host controller and the actual servos.  The host sends position data to the servo controller and the servo controller provides the correct PPM (pulse position modulation) output to the servos -- 50 times per second.  You can "blend" servos together using tricky coding -- I've done it with the Prop-1 and Prop-2.  Do a forum search on "servo blending" and you'll find the listings.

Parallax makes a popular servo controller called the PSC that works well with the Prop-1 and can handle up to 16 servos.  It's got advanced features (like ramping) that are good for robotics, features that might work with your animatronic.  Once you get the servos figured out, let's see if we can use my servo-blending code with just a Prop-1.  Running two servos isn't that stressful.
Jon McPhalen
EFX-TEK Hollywood Office

Raisin-Toe

I've got a PSC, and want to learn how to control it using the Prop-1. But where can I learn more about sending information through serial. I don't quite understand how to program serial comunication.

JonnyMac

Unfortunately, Parallax tends to favor the BS2 and don't provide an PSC documentation or examples for the BS1.  While I can't go into huge details (the PSC is not an EFX-TEK products) I can show you a couple things that you can run with that should get you going.

First; define an IO pin for the PSC.  Note that you need to remove the ULN influence from any serial pin.  You can either change the ULN2803 for a ULN2003, or clip off pin 1 of the ULN2803.  Here's how I define my serial pin.

SYMBOL  Sio             = 7                     ' no SETUP; no ULN

Now define a baud rate and mode for that pin that is compatible with the PSC:

SYMBOL  Baud            = OT2400

Now you can send commands to the PSC, like this:

Update_Servo:
  SEROUT Sio, Baud, ("!SC", ch, ramp, posLo, posHi, CR)
  RETURN


Where ch is a variable (Bx) that holds the channel number, ramp is a variable (Bx) that holds the ramp speed, and posLo and posHi are bytes (Bx) within a word variable (Wx).  You might define the PSC variables like this:

SYMBOL  ch              = B6
SYMBOL  ramp            = B7
SYMBOL  pos             = W4
SYMBOL   posLo          =  B8                   ' low byte of W4
SYMBOL   posHi          =  B9                   ' high byte of W4


Here's the thing with the PSC (which is a great product): it was designed primarily for use with the BS2 which has loads more RAM (variable space) than the BS1.  This means you're going to have to be very careful and, perhaps, limit some of the features you use.
Jon McPhalen
EFX-TEK Hollywood Office

Raisin-Toe

Thank you, I'll play around with it and see what I can do 8).