My servo not centered

i have buyed unbranded servo.. my servo is not in center.. if i set it to 150, it turns to one side...that is to 180degree. so i can't rotate it on both side.. can anyone help me to sotout this problem...!

centre for servos is usually

centre for servos is usually 1500us

What microcontroller are you using?

What library are you trying to use?

You really haven’t given enough information to do more than make blind guesses.

about microcontroller info

im using picaxe 28x1… i dont knw much about servo, but i think my servo is not in center… when i set it to center that is 150degree… it moves totally to one side, near to 180 degree…is this is center position in picaxe board…?

   because i want my servo to move both side so i can install my sensor on it… which can rotate both side to detect obstacle…!

i have programed my servo(using tutorial ) to rotate 75-225 degree but it only rotate very little from center that is 150… 

if i change to 15- 35 degree it rotate to other end…! 

Those are not degrees

Those numbers are not degrees, they are simply a range of numbers used within the code. Did the servo go from one side to the other when using 75 and 225?

no it do not go one side to

no it do not go one side to other, it only moves to one side…from 150 center…! is the 150 range is middle of servo? 

when i put it to 150, it goes to one side. near were servo locks the rotation… and when i apply the 75-225 range it only rotate within the servo rotation lock area… which deos not show much rotation…!

Re: tutorial

What tutorial did you use? You copied the code exactly as it was written, correct?

about tutorial

no sir! i used different variables but its not working…!  i not copied exactly what they given… i experimented with the ranges…!

but nothing happening it goes to 150…! and 150 is near to servo rotation lock …

 

How about you post the code?

Either attach it as a file or post it in the responses.

codes

servo 0,150 wait 2( for center)

servo 0,15 wait 2(to turn left)

servo 0,225 wait 2(to turn right)

servo 0,150 wait 2( for center)

by using this code it rotate left side, and stop to right side…

but by using below code it does not rotate to left side…

servo 0,150 wait 2

servo 0,75 wait 2 (turns right)

servo 0,225 wait 2

servo 0,150 wait 2

wht can i do? plzz help me…

is servo defect piece… or im not using correct code…!

 

 

 

Trial and Error

Well, if you don’t have any documentation on the servo, you’ll have to use trial and error to determine the value range that will give you the rotation range you’re looking for. If you’re using a library like Arduino, the 0 would be full left, 90 would be center and 180 would be full right. Apparently PicAxe uses .75 to 2.25 milliseconds or 75 to 225 in terms of 10 microsecond pulse width, so if that range is not working you may have some other timer issues. Make sure you’re not using any TIMER, PWMOUT, or HPWM functions elsewhere in your code.

Just to throw this out there…

Is there any chance the servo was not centered when you first installed the servo horn? Try this:

Remove the servo horn, center the servo at 150 then reinstal the servo horn perfectly centered. Then retry your 75 and 225.

The only thing I can suggest now is

to download and check the servo and servopos commands in the PICAXE manual 2. In the copy I have, those two commands start on page 204. The manual even includes sample code that ‘should’ work.

servo horn

no no i try all, i done evry posible thing…but not solved the problem…

nop! im not using any TIMER

nop! im not using any TIMER or any other funtion… it is simple picaxe 28x1 board…

OK … i will try it…THNX!

OK … i will try it…THNX!