Servo Motor Help

My team is new to using servos and I wanted to start testing with them. I got the motor to move, but it can onyl move in a ~160 degree range and only with Servo.set() or Servo.setAngle(). If I try Servo.setSpeed(), It just moves it to a single position. Any Ideas?

2 Likes

I think there are two kinds of servos: 180-degree servos and continuous rotation servos. Both are controlled through PWM pulsewidth signals. So, if you try to do setSpeed() for a 180-degree servo, the RoboRIO will send the pulse width signal that should make a continuous rotation servo spin. But once the 180-degree servo receives that signal, it points in one direction because that’s all it can do.

How do I know if it’s a 180 degree servo? I can move it manually 360 degrees. Also, the range looks like less than 180 degrees, probably somewhere around 160.

As far a hobby/RC PWM servos go, there are 2 types:
“standard servos” (90, 180, 270, or 360 degrees are common)
or “continuous servos” (acts more like a motor than a servo)

Some “smart servos” can be changed from one mode to the other, and/or have their angle range adjusted by using an external programmer.

It sounds like you have a standard 180 degree servo that is operating normally (although the PWM range might need calibration to get the full 180). If you need a servo that rotates continuously you will probably have to buy a new one, but will be giving up angular control.

There is the function that works for both types of servos, just do

servo.set(1)

and see if the servo moves continuously or points at one direction, that tells you which type of servo it is.

Can you check the pulse width range and angle range of your servo?

WPILib assumes that your servo:

The RoboRio does not know what kind of servo you have; it just spits out a PWM signal from about 800 to 2,200 milli second on time. 1,500 is the zero/center point. You need to take care of understanding what the actual servo motion is: various angles and forward/reverse speed control.

I’m really trying to get my team to consider servos as a valid tool :wink:

What is the part number of the servo?