Let's Make Robots!

Continuously Rotating Servos

I have a pair of servos that were modded to rotate continuously about a year ago. I've been trying to make them rotate with the command:

servo 0, 1 : servo 1, 1

but I find that this does nothing but make the servos twitch. However, when I use:

servo 0, 1 : servo 1, 1

wait 2

the servos rotate clockwise for two seconds. Furthermore, when I use:

servo 0, 2 : servo 1, 2

wait 2

they rotate counter-clockwise. My questions are, why do I have to apply the 'wait 2' command to get them to rotate and if 1 is clockwise and 2 is counter-clockwise which degree value is stop?

 

Comment viewing options

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

While I wasn't able to get the servo to stop on it's own, I was able to get it to stop while under a load. Thanks for the help!

birdmun's picture

where you loop from 0 to 255 on a servo?

After looking at manual 2 again it says servo pin,pulse . So, the program would be something like:

main:
   for b0 = 0 to 255
      servo 0, b0
      wait 2
   next b0
end

Raeven's picture

Running your code and with a debug thrown into it I was able to find the center of servo 1, but on servo 2 at position 126 the servo is moving very slowly clockwise in position 127 it is moving very slowly counter clockwise. Why does it not have a center

6677's picture

2 reasons i can think of. pot was damaged when modding to read only one value. Or the resistors soldered in place of the pot if you did it that way are of the wrong value

ignoblegnome's picture

Well, all servos are a little different, and as I said in another comment, they are typically not linear.

If your servo is under load, is the weight of your robot enough to make it stop moving?

ignoblegnome's picture

DON'T DO THAT!

Read the Picaxe Manual 2 entry for the Servo command.

SERVO pin,pulse

- Pin is a variable/constant which specifies the i/o pin to use.

- Pulse is variable/constant (75-225) which specifies the servo position

The pulse parameter should NEVER be less than 75 or higher than 255. This would destroy a normal servo, because you are asking it to go to a position beyond it's mechanical stops. With a continuous servo, it may not be dangerous, but it won't be effective.

The correct method is to find the center postion (should be about 150), and use that as the command to stop the servo. This number may vary a bit by servo, and may vary with temperature as well.

If you set the pulse parameter less than center, it will turn one way. Set it above center and it will turn the other. The closer you set it to the two end points (75 and 225) the faster it will go.

birdmun's picture

that they were continuous rotation. I would not have suggested 0 to 255. I will admit that 0 to 255 is really excessive, but, it shouldn't harm anything as the servo will rotate without harm.

I will admit I don't have any hands on experience and could be completely and utterly wrong.

Raeven's picture

Why is the pulse command a value from 75-255 (a distance of 150) when there are servos with more than 150 degrees?

 

ignoblegnome's picture

Once again, be careful. The servo range is from 75 to 225, not 255. I've busted servos with that mistake.

Some servos can turn a full 180 degrees, some a bit less or a bit more.

Also, you'll see that some (perhaps most) servos are not completely linear. So changing the command from servo 0, 150 to servo 0, 151 is not going to move it by exactly 1 degree.

Raeven's picture

Thanks. I'm using picaxe basic. If setting the servo to position 1 rotates it clockwise and position 2 rotates counter-clockwise which position stops the servo?