Shop OBEX P1 Docs P2 Docs Learn Events
BSIISX - Connecting Servo''s Correctly — Parallax Forums

BSIISX - Connecting Servo''s Correctly

ArchiverArchiver Posts: 46,084
edited 2000-10-23 20:37 in General Discussion
Al Williams (and others)
It did grind the gears. But I got it figured out (I think) tell me
if I'm wrong in my thinking. . .

The variable specified in b2 is a byte variable, right?

Ok, the number is bigger than 255 which makes it out of range for a
number bigger than 255, right?

So, I tried using w2 instead and POW it worked! My practical range
on the servo for smooth control is fron 900 all the way to 2750,
which all fits into the word variable w2.

Included is the code for a servo tester that will continuously sweep
a servo from one side to the other at whatever rate specified by the
"step" value, with the pulsout set to yhe pin you want to connect the
servo to.

The code follows:

start:
for w1=900 to 2750 step 25
pulsout 4,w1
pause 20
next
for w1=2750 to 900 step 25
pulsout 4,w1
pause 20
next
goto start

Hope this helps other, too!

Thanks,

Doug


> To: <basicstamps@egroups.com>
> From: "Al Williams" <alw@a...>
> Date: Mon, 23 Oct 2000 18:14:22 -0500
> Reply-to: basicstamps@egroups.com
> Subject: RE: [noparse][[/noparse]basicstamps] BSIISX - Connecting Servo's Correctly

> Well, I didn't write the original code, but it looks fine to me. Did it
> grind out your gears? Otherwise, I don't know how you would ruin the servos
> no matter what pulse widths you sent it. Maybe someone else has experience
> with that? I have blown servos by shorting my power and ground (I'm clumsy).
> In fact, I have one crippled BOE Bot right now because I don't have any more
> servos.
>
> The idea is to send a pulse to the servo to position it. 1500uS should
> center the servo. So try this (maybe even on one of the ruined servos?):
>
> LOW 0
> PULSOUT 0,XXX
>
> where XXX is whatever results in 1500uS for your type of Stamp (150 for
> Stamp I, 750 for Stamp II, and 1875 for the BS2SX). That should center it.
> Then change XXX to XXX+25 and see if the servo will step a bit over. Don't
> put any load on the servo, and it should stay put after the program runs
> (although it won't)
>
> All the servos I'm aware of have a stop to keep you from going too far, and
> the only thing I could imagine you could do would be grind against the stop
> hard enough to strip the nylon gears? I've never seen that though. Anyone
> else?
>
> Regards,
>
> Al Williams
> AWC
> * Connect a PS/2 keyboard to your Stamp project (or any microcontroller):
> http://www.al-williams.com/awce/pak6.htm
>
>
> > > > > > > > >'PROGRAM "SRVOTST1.BAS" 10/4/00
> > > > > > > > >'TO TEST RC SERVOS
> > > > > > > > >LOW 0
> > > > > > > > >AGAIN:
> > > > > > > > >FOR B2=100 TO 200 STEP 2
> > > > > > > > > PULSOUT 0,B2
> > > > > > > > > PAUSE 15
> > > > > > > > >NEXT
> > > > > > > > >FOR B2=200 TO 100 STEP -2
> > > > > > > > > PULSOUT 0,B2
> > > > > > > > > PAUSE 15
> > > > > > > > > NEXT
> > > > > > > > >'DEBUG "AGAIN"
> > > > > > > > >PAUSE 1000
> > > > > > > > >GOTO AGAIN
> > > > > >
Original Message
> > > > > > From: Ray McArthur <rjmca@u...>
> > > > > > To: <basicstamps@egroups.com>
> > > > > > Sent: Saturday, October 21, 2000 1:38 AM
> > > > > > Subject: Re: [noparse][[/noparse]basicstamps] BSIISX - Connecting Servo's Correctly
> > > > > >
> > > > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
>
>
>
>
>
Sign In or Register to comment.