Servo Question

alpacaman

Member
Let me first say that this is not my first project using servos. I'm using seperate power supplies and capacitors across the power pins of the picaxe. I know that those are common problems and I don't want anyone wasting there time by responding with those common responses.

I have a multiplexed output that is constantly being updated with a short loop routine. Once a minute I need to reposition one or possibly two servos.

As per the manual I'm using the servo command to initiate the servos and the servopos command to reposition them. However, the servos have a lot of jitter in them. I think that the jitter is because the picaxe is trying to output the timing for the servos while also looping through the program updateing the display - it's having a hard time doing both.

Here is my question. Is there a way to turn off the servo timing between uses - without the servo moving. I tried setting the output that the servos are on either high or low - which does turn the servo timing off - but the servos move.

I'm thinking about using the 2 outputs I'm using for the servos as inputs to a 08m which would then handle the servos.
 

SD2100

New Member
I think the SERVO command runs continuously in the background once you start it and stays the same until another SERVO command changes it. You can use the SERVO OFF command to stop the output, also try the PULSOUT command, this isn't continuous like the servo command.
 

Wrenow

Senior Member
One of your problems may be running the display. Is it a serial display? The serial command can screw up the servo timing. Also, I assume you are inserting the appropriate pauses so that the servo is not hiccuping on the updates?

Servos will stay where they are last positioned, assuming no outside force is acting on them. However, if an outside force is acting, they will need to be continuously be receiveing the position signal (about every 10-20ms) to hold position.

A simple solution might be the little serial servo controller boards that are available. One I partixularly like (though, frankly, I have never used it, I have a couple in the box for future projects) is the tiny 8 servo controller board from Pololu.com. About $25, as I recall. Pretty flexible, it seems, and less than 1" square. As I recall, you send the servo positions serially, and only send updates as necessary/desired, and it goes to / holds the set position. Rev-Ed also sells a spectacular 21 servo controller board, but it is a quite a bit larger (yes, I have one of those in my box for a major project I have planned).

Kind of reading between the lines as to the direction I think you are heading, and my crystal ball may well have an astigmatism, but an avenue you might want to consider.

Cheers,

Wreno
 

BeanieBots

Moderator
I'll second Wrenow's comments, in particular about other commands which require specific timing (eg serial) interfering with the servo pulses.
However, with careful coding, it is possible to eliminate the problem with the pulsout command. It is only the +ve part of the pulse which is critical. The 20mS frame rate can anywhere between a few mS and about 30mS before any real problems arise. Thus, if you need to use serout, then opt for pulsout for controlling servos. Interlace your code with calls to a subroutine which sends the pulses.
For a rough idea, have a look at my Hexapod example in the Robots section. That was written before the recently introduced servopos command and suffered from frequent writes to servo which gave rise to jitter so I eliminated the use of servo altogether. Might do a re-write with the new command now it's available.
 

Wrenow

Senior Member
Doing great. Been swamped on ship refits. Had a battle yesterday, and my liberty ship (unarmed = target) went really well until I lost propulsion. ;-( A little more engineering, and it should be grand. Both the North American Open and the World Championships at my place this summer. Lots to prep for...

Thus, been doing more lurking trying to learn stuff I don't know. Still here to pass on what little I do know, though, when it seems I can be useful. Thanks for asking.

Cheers,

Wreno

How's life Wrenow? havent seen you around so much....
 

Wrenow

Senior Member
I have been considering trying that new servopos command, too, but haven't gotten 'round to it. Looks to be very helpful if works as expected in some of my situations.

Cheers,

Wreno
 

alpacaman

Member
Thanks everyone.

I kept getting a syntax error every time I tried using the servo off command - never got it to work - downloaded the latest programming software last week - so it's not that.

I ended up using pulsout - works well for my application.
 

Tom2000

Senior Member
A simple solution might be the little serial servo controller boards that are available. One I partixularly like (though, frankly, I have never used it, I have a couple in the box for future projects) is the tiny 8 servo controller board from Pololu.com. About $25, as I recall. Pretty flexible, it seems, and less than 1" square. As I recall, you send the servo positions serially, and only send updates as necessary/desired, and it goes to / holds the set position. Rev-Ed also sells a spectacular 21 servo controller board, but it is a quite a bit larger (yes, I have one of those in my box for a major project I have planned).
Wreno, your post (and many of your past posts concerning your hobby and club) gave me an idea.

It sounds like you folks could use all sorts of custom electronic gadgets. I've seen you write about motor controllers, fire directors, servo controllers, and who knows what else that's available for your ships.

How often do you see a need that isn't filled by commercial products?

If the more technical members of your group swapped ideas, I'll bet that you'd find a number of projects you, as a club, might pursue.

And projects that might not be worth the effort for a one-off design and implementation might make a lot more sense if you were building a batch of them for your club. (I'm thinking mostly of nice, commercial PCBs here. Too expensive, usually, for one project, but when you amortize setup and shipping over a large order, PCBs are much more attractive.)

I know you have lots of skills, and I'll bet you're not the only one in your club who could conceive and design something unique and cool.

And who knows? If your gizmos pass your sea trials, the other clubs worldwide could be a nice captive market for you folks.

Just an idea...

Tom
 

Wrenow

Senior Member
Tom,

Actually, I am working on the low-hanging fruit. I am one of the least talented/experienced in our club. One guy designs circuits/boards for a living, another is putting the final touches on the software and hardware for a revolutionary automated mudlogging gas chromatograph (based partly on the Picaxe and using Xbee communication). We have several systems engineers as well. This hobby kind of appeals to/draws engineering types. One of the reasons I jumped into the Picaxe is that I do not have an engineering/electronics background (though I am a tinkerer).

The problem with going commercial with our hobby is that there are only about 500 practitioners worldwide. Thus it is hard for a vendor to make much of a profit (if any). Add to that that about 1/2 of the ships (small-gun variety) usually have fixed guns, and probably close to 1/2 of the remainder have digital aiming without positioning rather than analog, proportional, control, and the demand for fire control systems drops to a pretty small number. Basically it is done out of love of the hobby or self interest at this point.

The antweight robotics guys and others have made tremendous contributions that are applicable to us. And, the little Picaxe 3 servo controller board is pretty easy to press into service for my uses - all the design work being already done.

Now, if there were a servo controller board based on the 20M......

Hmmm. If you built a 20M servo module, you could also plug a 14M or 08M in and use just some of the pins, could you not?

Cheers,

Wreno
 

Tom2000

Senior Member
Hmmm.... 500. Worldwide. Well, that market certainly won't pay your retirement. :)

I think it's wonderful that you have all that talent in your club. Man, what an opportunity to learn!

Have fun, Wreno, and thanks!

Tom
 

Wrenow

Senior Member
Thanks, Tom,

I am learning all the time. I love the cross-pollination aspect of the multiple disciplines necessary for the warship hobby (electrical/electronics, mechanical, pneumatic, hydrodynamic, tactics, strategy, history, ballistics, RF, manufacturing and materials techniques, and now microprocessors). It is what brought me to Picaxe in the first place. It is what took one guy from doing IT support for a clothing manufacturer to designing and building gas chromatographs and writing software for the oil patch (with literally thousands of buyers, he stands to make some cash).

Cheers,

Wreno
 
Top