Slow accurate rotation
David Betz
Posts: 14,516
I bought a Parallax Continuous Rotation Servo with the idea of using it to make a slow-rotating platform that my son could use to take videos. He wanted to be able to rotate through 360 degrees smoothly. The servo seems to work with the Propeller Servo Controller USB board that I bought to control it but the motion doesn't seem to be particularly smooth. Should I just be using a PWM motor instead of a servo? I'm new to servo/motor programming so I'm not sure which is appropriate for this application. The rotation speed should be about one RPM but it needs to be very smooth. What is the best way to achieve this?
The parts I'm currently using are:
http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/servo/List/0/SortField/4/ProductID/102/Default.aspx
http://www.parallax.com/Store/Microcontrollers/PropellerDevelopmentBoards/tabid/514/CategoryID/73/List/0/SortField/0/catpageindex/2/Level/a/ProductID/595/Default.aspx
Here is the code I'm running on the controller board:
The parts I'm currently using are:
http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/servo/List/0/SortField/4/ProductID/102/Default.aspx
http://www.parallax.com/Store/Microcontrollers/PropellerDevelopmentBoards/tabid/514/CategoryID/73/List/0/SortField/0/catpageindex/2/Level/a/ProductID/595/Default.aspx
Here is the code I'm running on the controller board:
#include <propeller.h> #define SERVOPIN 0 #define SERVOPINMASK (1 << SERVOPIN) #define CTRMODE_NCO_1 0x04 #define CTRMODE_SHIFT 26 void main (int argc, char* argv[]) { unsigned int nextcnt, wait_time, us_ticks, cycle_time, center_width, delta; wait_time = _CLKFREQ >> 1; _CTRA = (CTRMODE_NCO_1 << CTRMODE_SHIFT) | SERVOPIN; _FRQA = 1; _DIRA = SERVOPINMASK; // get number of ticks in one microsecond us_ticks = _CLKFREQ / 1000000; // total cycle time (21.5 milliseconds) cycle_time = 21500 * us_ticks; // pulse width for centering the servo center_width = 1500 * us_ticks; delta = 5 * us_ticks; nextcnt = _CNT; for (;;) { _PHSA = -(center_width + delta); nextcnt += cycle_time - delta; __builtin_propeller_waitcnt(nextcnt, 0); } }
Comments
I'm about to try something for a robot that I call "LoboServo". Going to rip out the circuit board of a continous rotation servo and control it with a motor controller and Propeller instead.
For your application, could it rotate a little and then stop for each photo?
-Phil
At one RPM, I doubt that you will get smooth motion from a continuous-rotation servo. You could try adding a frictional or viscous load, but you're still not operating at the servo's best speed. I think you have a chance of getting it to work with a servo if you use some kind of reduction so you can run the servo faster.
-Phil
I agree with Phil that more gear reduction would be a good start.
Graham
-Phil
I haven't tried it yet, but I think driving the motor of servo in a PWM way should produce very smooth movement.
I was thinking a stepper would be best. minor changes in load won't effect the rotational speed.
http://www.servocity.com/html/robotzone_servos.html
Is your servo one of the Parallax standard-sized Futaba continuous-rotation units?
-Phil
Also, consider using a clock motor. They are 1 rotation per minute.
I agree with Phil:
Have the center rotate around a pivot point or radial bearing, but drive the the outer edge.
Bruce
Edit: In fact, an old turntable should be perfect for this project, being dependant upon size of course. You would just have to rearrange it all to your like liking. Utilize the existing gearing and motor, and I would imagine you could achieve your goal of 1 rpm by controling the speed of the motor. If necessary, modify the motor to utilize dc current.
I have a couple of sets of these helical gears (listed below) for a helicopter, I intended to use with a camera mount. In my case, the reduction of speed was too great to be useful, but they might work for you.
Here's the set.
main gear:
http://www.newegg.com/Product/Product.aspx?Item=9SIA0R00668156&nm_mc=OTC-Froogle3&cm_mmc=OTC-Froogle3-_-Toys+-+Remote+++Radio+Controlled-_-ALIGN-_-9SIA0R00668156
and pinion:
http://www.newegg.com/Product/Product.aspx?Item=9SIA0R00668485&nm_mc=OTC-Froogle3&cm_mmc=OTC-Froogle3-_-Toys+-+Remote+++Radio+Controlled-_-ALIGN-_-9SIA0R00668485
JR metal geared servos use a 3M machine screw to hold the servo horn in place. I used a longer 3m screw to connect the pinion to the servo.
Helical gears do come with there own set of problems though.
Just another idea.