stamp stripping out servo gears, BS2
nickm304
Posts: 4
Ok so I have successfully hooked up a larger JR servo and it does exactly what I would like it to do, when I swap it out with the mini servo i NEED to use (hitech HS-81) It spins furiously and strips out the gears. I am using a a 6v (4 AA in series) power supply, any ideas what is wrong? I have one set of gears left. I am running stamp BS2
servo CON 15
LOW servo
FOR i = 150 TO 1000 STEP 10
PULSOUT servo,i
PAUSE 20
NEXT
PAUSE 1000
FOR i = 1000 TO 150 STEP 10
PULSOUT servo,i
PAUSE 20
NEXT
END
servo CON 15
LOW servo
FOR i = 150 TO 1000 STEP 10
PULSOUT servo,i
PAUSE 20
NEXT
PAUSE 1000
FOR i = 1000 TO 150 STEP 10
PULSOUT servo,i
PAUSE 20
NEXT
END
Comments
Just out of curiosity, how do you have "i" defined?
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When all else fails, try inserting a new battery.
i VAR Word
perhaps it should be byte?
Its just weird because it worked on a regular sized servo, then when hooked up to a mini servo, it went crazy.
Change your range for i to 500 to 1000 and see how that works.
any idea what the range on the hs-81 is? it appears i can turn it almost 180 degrees by hand, but i saw someone online say it is only supposed to be 90? I will give 500 to 1000 a shot, thanks!
Neutral = 750 on bs2.
First check do 700 to 800 and see how it moves then keep expanding the range to get the degree of movement you require.
thanks MSDTech, this code appears to be working now, do you suggest any other changes?
thanks for the help guys!!
servo CON 15
i VAR Word
LOW servo
FOR i = 500 TO 1000 STEP 10
PULSOUT servo,i
PAUSE 20
NEXT
PAUSE 2000
FOR i = 1000 TO 500 STEP 10
PULSOUT servo,i
PAUSE 20
NEXT
END
Post Edited (nickm304) : 12/2/2008 11:48:19 PM GMT
That said, I strongly encourage you to read up on the PULSOUT command in the Pbasic Manual. 500-1000 = 1ms-2ms but *only on a BS2* -- all Stamps are different. Why? Because the actual "unit" used in a PULSOUT command varies from Stamp to Stamp. On a BS2 the "unit" is 2us, which is why 500 "units" = 1000us = 1ms. But on a Stamp BS2p, the "unit" is .8us.
The "easy" way to deal with this is define a scaling constant in your program -- this constant can be changed depending on the Stamp. This lets you write your PULSOUT statements so you are always working (and thinking) in microseconds for servos, e.g.
Better yet, wrap it all in a sub so you only have to set it up once...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
Post Edited (Zoot) : 12/3/2008 12:00:25 AM GMT