Let's Make Robots!

continuous servos

For all you guys who have bought or modified a continuous 360 servo, how does it work?

 I want to be able to have a very controllable motor that I can tell to make specific number of turns and stop.  Would that be a way the continuous servo could work?

 I mean, for other servos, sending different square waves gives different angles, but if the servo goes all the way around and again...  how do you tell it what you want?

 (just want to know if it is feasible and a general sense of how it works before I buy one and try it)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

still have problems moving my continuous servo motor in "background" (without using loops that is). I've read the manual again and again, and by what i've understood, the "servo" command sends pulses to the motor every 20ms, but still if i only use that my motors won't turn (so far i've only managed to make them turn using a loop, which is annoying if you also want the brain to do other things).

Could you help me understand how it works? Frits suggested pwm pins, i haven't tried them yet to be honest, but i'd prefer not to use them (need them for IR modulation) and since i know some of you have managed to make them run without them i'd like to know how :) 


I bought a standard servo and its all working. My robot is alive!:) next the YDM.

i'm just gonna get a 180 servo...that's much simpler and anyways i guess i'll use some 360 servos for my next bot (instead of geared motors).

and as to your code (vince) if you want to try out the "timed turning" you have to change the lines where the "servo" command is used (as i wrote before).


Symbol dangerlevel = 70' how far away should thing be, before we react?

symbol turn = 300' this sets how much should be turned

symbol servo_turn = 20' This sets for how long time we should wait for the servo to turn (depending on it´s speed) before we measure distance

main: ' the main loop

readadc 1, b1 ' read how much distance ahead

if b1 < dangerlevel then

gosub nodanger ' if nothing ahead, drive forward


gosub whichway ' if obstacle ahead then decide which way is better

end if

goto main ' this ends the loop, the rest are only sub-routines


nodanger:' this should be your combination to make the robot drive forward, these you most likely need to adjust to fit the way you have wired your robots motors

high 5 : high 7 : low 4 : low 6




gosub totalhalt ' first stop!

'Look one way:

gosub lturn ' look to one side

pause servo_turn ' wait for the servo to be finished turning

gosub totalhalt

servo 1, b1

'Look the other way:

gosub rturn ' look to another side

pause servo_turn ' wait for the servo to be finished turning

gosub totalhalt

servo 1, b2

' Decide which is the better way:

if b1<b2 then

gosub body_lturn


gosub body_rturn

end if





high 7 : low 5 : low 6 : high 4 ' this should be your combination that turns the robot one way

pause turn : gosub totalhalt



high 4 : low 7 : low 4 : high 6 ' this should be your combination that turns the robot the other way

pause turn : gosub totalhalt


servo 0,95' look to one side

wait 1



servo 0, 160 ' look to the other side

wait 5



low 4 : low 5 : low 7 : low 6' low on all 4 halts the robot!

Servo 1,75' face forward

wait 1 ' freeze all for one second


You might get help if you say what the robot is doing and post pictures of the robot. The problem might not be with the code but how the wiring is done.

Okay I'll try to post the picture later I just having a hard time getting a close up. The problem with the code I have posted is that the robot do like 3 circle to the right and the same back the other way. I have a PARALLAX (continuous rotaion) servo. So far I understand most of the code from the first robot but I don't get why my servo is not working right.

Can you please give me the whole programming code? I still have trouble getting it to work?
I bought a handful of rotary encoders from Farnell. They're not exaclty what I thought they were, but they are great for direction and speed sensing.

There is a company called Nubotics that makes something called a Wheelwatcher.



Basically it is an encoder wheel attached to the output of a servo (or other motors too) that is aligned to a PCB attached to the servo. The PCB has the photo interupters to read the quadrature postion, so that your microcontroller can keep track of where the shaft has rotated. I think Acroname and a couple other robot places carries them. Adds about $26 to the price of the servo though.

In some servo mods for continuous rotation, the pot can be left intact, but centered, so that a center point can be adjusted later. ( For changing a stop value, or whatever else. )



 First of all, the "wait" command need to go bye-bye. Use "pause" instead. You can get down to milliseconds with pause i.e. pause 1000 is just one second and you now you can break up that second into 1000 tiny, tiny parts -much more accurate. However, all I can imagine is one missed or screwed up code and the next thing you know you have wrapped the sonar leads around the sensor about 3 times before it breaks the board in half. You know, a servo is only 10 bucks and can be stopped at very precise stops. Using a "timed" stop, is going to get funny as your batts get low and the servo moves slower. If nothing else, use some solid stops and/or a couple little buttons to tell the pic that the servo has gotten to where you told it to go. -Just a thought.


www.rocketbrandcustom.com baby!!