PDA

View Full Version : Continuous Servo



jillmobley
11-19-2013, 07:07 PM
Can someone point me to a tutorial on how to program the continuous servos in RobotC?

FTC Ringer
11-19-2013, 07:54 PM
Can someone point me to a tutorial on how to program the continuous servos in RobotC?

It's actually quite simple. You set the power level of the servo using the same command you would to set the position on a standard servo:

servo[servoNameHere] = powerLevel;

Values of 0-126 make it spin in reverse, with 0 being full speed in reverse. A value of 127 makes the servo sit still. Finally, values of 128-255 make it rotate forward, with 255 being full speed ahead.

Ernest314
11-19-2013, 08:59 PM
Do keep in mind that the standard Tetrix continuous rotation servos are designed with a "large deadband", which means a couple numbers around 127 won't make the servo move.

FTC7171
11-24-2013, 03:51 PM
A followup question - Can number of rotations or degrees be specified while moving a continuous motor similar to encoders in DC motors? For example, move only 270 deg/ .75 rotation?

FTC Ringer
11-24-2013, 04:05 PM
A followup question - Can number of rotations or degrees be specified while moving a continuous motor similar to encoders in DC motors? For example, move only 270 deg/ .75 rotation?

No. The way continuous rotation servos work is the potentiometer that provides feedback inside the servo is disconnected. As such, the servo is always seeking its position, which is why it can rotate continuously. Unfortunately, this also means that there is no position feedback from the servo, so you can't make it rotate a set amount except for estimating based on time.

Ernest314
11-24-2013, 04:20 PM
So essentially, a continuous rotation servo is a motor with a gearbox and speed control. If you want to set position, you'll have to attach encoders and write your own PID control loop.

jillmobley
11-30-2013, 09:51 PM
Thank you for your help with this.