Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: gamefreak on April 02, 2007, 09:13:13 AM

Title: Servos
Post by: gamefreak on April 02, 2007, 09:13:13 AM
i've always used continous rotation servos, so im wondering how to control a normal servo, can anyone help explain it to me?
Title: Re: Servos
Post by: Somchaya on April 02, 2007, 10:04:33 AM
So, admin has a really good page that describes how servos work: http://www.societyofrobots.com/actuators_servos.shtml (http://www.societyofrobots.com/actuators_servos.shtml)

But in a nutshell, the width of your pulse determines the angle that the servo turns to. So if you give it a short pulse, it might turn to the left, and if you give a long pulse, it might turn to the right.
Title: Re: Servos
Post by: 555 timer chip guy on April 02, 2007, 10:30:07 AM
they are controlled the same way as continues servo, when you increase or decrees the speed of a continues servo you are increasing or decreasing the angle of a normal servo and the neutral point is the same.
Title: Re: Servos
Post by: gamefreak on April 02, 2007, 10:40:52 AM
with my continuos servos i do say:
do
 pulsout 12,750
pause 20
 loop

if i try that with the normal servo it hits its max rotation and then resets the code
Title: Re: Servos
Post by: dunk on April 02, 2007, 12:06:52 PM
sounds like you are trying to turn to a point outside the servo's range.
as for reseting your microcontroller, probably the servo drawing too much power as it struggles against it's end point and using too much power, causing your microcontroler to reset as the voltage drops too low.

try playing with your timing loop to find a point inside the servo's range.

dunk.
Title: Re: Servos
Post by: gamefreak on April 02, 2007, 02:48:52 PM
but do i still use the same pulsout? i already figure the fact im tryign to go out of the boundries, but how do i know what to type in for the boundries?

i've figured that this gives me 90 degree rotation
do
pulsout 12,750
pause 20
loop
and this gives me 0
do
pulsout 12,300
pause 20
loop
and this is 180
do
pulsout 12,1250
pause 20
loop

now im confused, the magic number seems to be 450, but to get 180 its 500, why is this?
or is the magic number just 475 and to get 90 i want 775?

Title: Re: Servos
Post by: Somchaya on April 02, 2007, 04:38:09 PM
So, for a servo, the 0 position is the center, and it usually goes from -90 to 90 degrees. So, from your example above, I think 300 = -90 deg, 750 = 0 deg, 1250 = 90 deg.

The best way to know what values to use for the pulsout would be to check the specs for the servo itself. Usually it has a datasheet or something like that that'll tell you the zero position and the max width.
Title: Re: Servos
Post by: gamefreak on April 02, 2007, 05:32:43 PM
lol is that a bat in you picture?

Alright thanks, i think i finally got it working(sorta)
Title: Re: Servos
Post by: Somchaya on April 02, 2007, 08:04:14 PM
lol is that a bat in you picture?

Alright thanks, i think i finally got it working(sorta)

It's a hedgehog. But no it's not mine :( It looks really cute though!