Our team needs to be able to control a REV Smart Servo. It needs to be able to rotate 672 degrees. Because it seems the REV Smart Servo is limited to 180 degrees in position mode, I have to use the continuous mode. I was going to use a simple P-Loop to control the position. How do I control the speed of the servo? I’ve looked at some of the methods and am not sure which method is correct. setSpeed says it is for a speed controller, and setRaw says its range is 0-255, but the REV documentation says that the PWM range is 500 to 2500 micro-seconds. What method should I use and how?
I’m not familiar with the REV smart in particular, but every servo I’m familiar with which can be converted to continuous rotation loses the ability to “drive to an angle” when this is done. When converted to continuous rotation, the servo essentially becomes a motor controller with a really small motor; the PWM cycle determines speed and direction, not a specific angle.
If you need this capability, you may want to try an AndyMark NeveRest or PG motor, either of which includes an integrated encoder and is capable of multiple rotations. 3946 used a NeveRest for the “scoosh” for STEAMworks in 2017. While it was only used for about 135 degrees of travel, the system we used is scalable. I’ll post a link to the code in a moment - note that it is Java, command-based.
The subsystem is “Scoosh”, and the commands which use it are CalibrateScoosh(), HangGear(), and LoadHoldGear(). I can likely help you with your questions, and if not, @ExploitSage certainly can.
You can use the setBounds()
method to setup the mappings from the pulses to the speed -1.0-1.0 or raw 0-255. However, @GeeTwo is correct that when in continuous mode a servo is basically the same as a small motor.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.