Finding the extreme position of servo motor
kah yee
Posts: 2
Dear all,
I am using BS2 microcontroller with the PBasic language.
Does anyone know how to find the extreme position (i.e., 0 degree and 180 degree) of a standard servo motor?
Is there a formula in doing so?
I have both Parallax and GWservo standard servo.
I went to Parallax website and found the document 'What's a controller - Chap 4: Controlling motion' which describes the pulses that make the servo rotates, however, the pulses only rotates between 2 o'clock (1ms), 10 o'clock(2ms), and 12 o'clock(1.5ms).
I changed the pulses from (1ms) to (0.8ms), and from (2ms) to (2.2ms), and that has further the range. But i need a formula that can find a prefered position.
Also, would it be harmful to the servos for the pulses that i have used (that i modified) and is it recommended to position it at its extreme (i.e., 0 and 180 degree) ?
Do i really need to make guess in order to find the position/range of the stepper motor? What is the normal range that won't harm a servo?
Thanks
I am using BS2 microcontroller with the PBasic language.
Does anyone know how to find the extreme position (i.e., 0 degree and 180 degree) of a standard servo motor?
Is there a formula in doing so?
I have both Parallax and GWservo standard servo.
I went to Parallax website and found the document 'What's a controller - Chap 4: Controlling motion' which describes the pulses that make the servo rotates, however, the pulses only rotates between 2 o'clock (1ms), 10 o'clock(2ms), and 12 o'clock(1.5ms).
I changed the pulses from (1ms) to (0.8ms), and from (2ms) to (2.2ms), and that has further the range. But i need a formula that can find a prefered position.
Also, would it be harmful to the servos for the pulses that i have used (that i modified) and is it recommended to position it at its extreme (i.e., 0 and 180 degree) ?
Do i really need to make guess in order to find the position/range of the stepper motor? What is the normal range that won't harm a servo?
Thanks
Comments
2. No, you really shouldn't command a servo beyond its extremes. I think this will tend to wear out the motor, or the gears. Doing it a few times in experimentation should not cause any damage.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
·· I threw this little piece of code together to help you find the extreme positions on a servo.· It's designed for the BASIC Stamp 2, but the bonus to that is that the values displayed can be used with any BASIC Stamp when you're using our PSC, since it uses BS2 compatible pulse values.· I hope you find this useful.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Let me just emphasize, clarify, or reinforce something that Chris already said. Here is what he said:
"Since the two of the same servo model can have slightly different values for their ranges you will have to experiment for a particular servo to get the PULSOUT values that give you complete range."
EACH servo. although they are the same make and model, MAY have slightly different "extremes". Thus, it is important to test EACH R/C servo on an individual basis, if you want a firm setting for each R/C servo motor.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Very helpful comments!!
Kah Yee
' {$STAMP BS2}
' {$PBASIC 2.5}
'just trying to get the servo to go to mid position
'
[noparse][[/noparse] I/O Definitions ]
Servo·········· PIN···· 7·············· ' Servo I/O Pin
pulseWidth····· CON···· 750··········· 'set pulsewidth at 750 which is hopefully mid-position
Main:
· DO
··· PULSOUT Servo, pulseWidth
··· PAUSE 20
· LOOP
· ' i have a 9V connected to my stamp and the red wire from the servo goes to a 5V DC supply and the black wire goes to ground and the white wire is
· ' plugged into P7.
' no matter what pulseWidth i use, be it 500, 750, 1000, or 1 it alway rotates maximally clockwise and sticks and strains. Please show me the error of my ways
What is your BS2 plugged into (e.g., Parallax board [noparse][[/noparse]which model/version]; homemade board)?
(What is the specific wiring of the BS2 and servo to the two power supplies? A diagram would be useful.)
Depending on your answer, ...
Check/change your battery (are you getting enough voltage to the BS2, or is it resetting?).
Is your servo's DC supply really putting out 5V?
Check your wiring (is the servo _really_ plugged into port 7?)
Try another servo (maybe the one you're using is defective?)
PAR
·
The parallax board has a port that a 9V battery plugs directly into.
My 5 V power supply is wired positive directly to red wire of servo
Ground directly to black wire of servo
this board: http://www.parallax.com/images/prod_jpg/27120.jpg·(Rev. D, 2004 ?), schematic at http://www.parallax.com/dl/docs/prod/boards/BS2CarrierBdSchem.pdf,
and this BS2: http://www.parallax.com/images/prod_jpg/bs2-ic.jpg·(Rev. G ?),
plus a 9-volt battery (is it a fresh battery?) to power to BS2-IC,
and some kind of 5-volt power supply (unregulated wall wart?, or an voltage regulator IC driven off of the (same)·9-volt battery, or ...?)·for the servo power?
Are the BS2 supply·battery·and servo·5-volt supply·grounds connected in common? (Earlier you said about the servo, "...and the black [noparse][[/noparse]servo]·wire goes to ground" Above you state that it's connected to the 5-volt supply ground. So it's a bit unclear how the two grounds are (or are not) connected in common.
What brand/model of servo?
Add this PBasic statement just above the "Main:" statement in your test program:
DEBUG "Starting",CR
Download/Run the program while the carrier board is connected to your computer/PBasic Editor Debug window to see if you see "Starting" once, or many times (should be once if your BS2 9-volt supply is ok).
PAR
·