Newbie needs help with What's a Microcontroller question ---servos
skewedToTheLeft
Posts: 9
I'm brand new to electronics and the Basic Stamp. I do, however, have experience programming in Visual Basic.
Here is a block of code from the "What's a Microcontroller Book" :
DEBUG "Counterclockwise 10 o'clock", CR
FOR counter = 1 TO 150
· PULSOUT 14, 1000
· PAUSE 20
NEXT
DEBUG "Clockwise 2 o'clock", CR
FOR counter = 1 TO 150
· PULSOUT 14, 500
· PAUSE 20
NEXT
DEBUG "Center 12 o'clock", CR
FOR counter = 1 TO 150
· PULSOUT 14, 750
· PAUSE 20
NEXT
I'm having a problem understanding how the servo works I guess. In the For/next loop the pulsout 14 command sends a burst of electricity out on pin 14 right? And this pulse lasts·X amount of time based on the duration. It seems to me that the more repetitions of the loop would drive the servo further, but the book says that the repetitions cause the wait time between movements to increase. If I have a regular DC motor and have a switch that is cut on and off real fast this would make the motor turn further the more times I pulse it off and on, but this is not how the servo works. Also, what controls the direction of the motor? I have figured out that the motor only turns about 180 degress by observation. The book does not mention this.
If someone could explain how servos work in simple ordinary English or·simple analogies,·I would greatly appreciate it greatly.
Thanks,
·
Here is a block of code from the "What's a Microcontroller Book" :
DEBUG "Counterclockwise 10 o'clock", CR
FOR counter = 1 TO 150
· PULSOUT 14, 1000
· PAUSE 20
NEXT
DEBUG "Clockwise 2 o'clock", CR
FOR counter = 1 TO 150
· PULSOUT 14, 500
· PAUSE 20
NEXT
DEBUG "Center 12 o'clock", CR
FOR counter = 1 TO 150
· PULSOUT 14, 750
· PAUSE 20
NEXT
I'm having a problem understanding how the servo works I guess. In the For/next loop the pulsout 14 command sends a burst of electricity out on pin 14 right? And this pulse lasts·X amount of time based on the duration. It seems to me that the more repetitions of the loop would drive the servo further, but the book says that the repetitions cause the wait time between movements to increase. If I have a regular DC motor and have a switch that is cut on and off real fast this would make the motor turn further the more times I pulse it off and on, but this is not how the servo works. Also, what controls the direction of the motor? I have figured out that the motor only turns about 180 degress by observation. The book does not mention this.
If someone could explain how servos work in simple ordinary English or·simple analogies,·I would greatly appreciate it greatly.
Thanks,
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I am 1010, so be surprised!
Post Edited (tpw_man) : 2/10/2008 7:18:22 PM GMT
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I am 1010, so be surprised!
For your particular servo, you'll have to find a datasheet or try it out. Generally, the servo will hit a mechanical stop if the pulse width range is too large.