Continuous rotaing servos

DanoNJ

New Member
First post - complete newbie.

I am completly new to not only this forum, but to the world of Picaxe. I have really very, very expience in coding, but have been reading up.
I need some help with how to write the code to have a servo run continuous in one direction. I have attempted a search, but unfortunatly could not find what I am looking for.

What I have is a hacked servo modified to run continuouly in one direction. I have used some code where the servo is set to the center position then moved to a certian other limit, such as 150 as a center and move to say 75.
What I am asking is what number would you use to keep it going?
Thanks in advance for what is probably an offten asked question.

Dan
 

eggdweather

Senior Member
Continuous Rotating Servos where the position feedback elements are removed don’t provide for angular control. When movement is initiated, they will rotate in either direction and you then get speed and direction control.
Use the same PWM settings as a normal servo (I.e.1.0 to 2.0ms and 1.5mS = stop). If you move the PWM to 1.5mS the servo will stop, move it to 1.6mS it will start to rotate say CW slowly, move it to 1.8mS it will rotate even faster and so on until; the 2.0mS limit is reached. Changing the PWM value to 1.4mS will reverse the direction of rotation and it will speed up CCW until you reach 1.0mS and maximum CCW speed.

So use a PWM frequency of 50Hz typically and vary PWM from 1.0mS to 2.0mS, does that help?
Code:
init: servo 4,150 ; initialise servo to stop
main: servopos 4,100 ; rotate CCW at maximum speed
pause 2000 ; wait 2 seconds
servopos 4,150 ; stop the servo
pause 2000 ; wait 2 seconds
servopos 4,200 ; rotate CW at maximum speed
pause 2000 ; wait 2 seconds
goto main ; loop back to start
If it's not rotating when you send 75 then your servo is not a rotating type, any difference away from 150 (stop) will create continuous rotation, the extent of deviation = speed of rotation
 

DanoNJ

New Member
I may actually be leaning something. Thanks. Will try this code later and change some of the values and see what happens. I'm sure I'll be back.

Thank you.
 
Top