Shop OBEX P1 Docs P2 Docs Learn Events
Slow accurate rotation — Parallax Forums

Slow accurate rotation

David BetzDavid Betz Posts: 14,516
edited 2011-12-21 07:40 in Propeller 1
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:
#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

  • RaymanRayman Posts: 14,849
    edited 2011-12-20 10:11
    I'm curious about your problem... Is it jerky? Is that the problem?

    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 Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-12-20 10:19
    If you're directly driving the axis of the platform, the jerkiness could be a result of a large angular moment of inertia, coupled with a weak driving force. For the smoothest motion, use a heavy, balanced platform (e.g. old phonograph turntable), and drive it nearer the edge with gear of belt reduction or with a rubber capstan. That way, your motor will be running faster in its best torque range, and the platform will act as a flywheel to smooth out the motion.

    -Phil
  • David BetzDavid Betz Posts: 14,516
    edited 2011-12-20 11:10
    If you're directly driving the axis of the platform, the jerkiness could be a result of a large angular moment of inertia, coupled with a weak driving force. For the smoothest motion, use a heavy, balanced platform (e.g. old phonograph turntable), and drive it nearer the edge with gear of belt reduction or with a rubber capstan. That way, your motor will be running faster in its best torque range, and the platform will act as a flywheel to smooth out the motion.

    -Phil
    I was observing jerkiness just driving the servo without attempting to drive any kind of platform. Maybe that's because I was running it without any load. Is a servo really the best solution for this kind of application or would a PWM motor be better?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-12-20 11:21
    David,

    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
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2011-12-20 11:52
    A stepper motor followed by a gearbox of some form with a decent ratio would be ideal for this sort of application. You could just use a DC motor and drive with PWM (again through a gearbox) indeed this is pretty much all the servo is doing.

    I agree with Phil that more gear reduction would be a good start.

    Graham
  • David BetzDavid Betz Posts: 14,516
    edited 2011-12-20 12:24
    Thanks everyone for your comments. I guess gear reduction is probably the best approach to slow smooth motion. Can anyone suggest a source of appropriate gears? I checked a local surplus place near me but wasn't able to assemble a complete set of parts.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-12-20 12:42
    What does your platform look like? How big is it? Can you post a photo?

    -Phil
  • RaymanRayman Posts: 14,849
    edited 2011-12-20 12:52
    The servo already has a great deal of gear reduction.
    I haven't tried it yet, but I think driving the motor of servo in a PWM way should produce very smooth movement.
  • David BetzDavid Betz Posts: 14,516
    edited 2011-12-20 12:56
    What does your platform look like? How big is it? Can you post a photo?

    -Phil
    Ummmm... I hate to say this but I don't have a platform yet. So far I've just been playing with the servo on its own. The platform has to have a camera mount that can accept a Canon 7D DSLR.
  • 4x5n4x5n Posts: 745
    edited 2011-12-20 13:03
    David Betz wrote: »
    I was observing jerkiness just driving the servo without attempting to drive any kind of platform. Maybe that's because I was running it without any load. Is a servo really the best solution for this kind of application or would a PWM motor be better?

    I was thinking a stepper would be best. minor changes in load won't effect the rotational speed.
  • RaymanRayman Posts: 14,849
    edited 2011-12-20 13:09
    A stepper might be too jerky too. But, a reduction gear on a stepper might be a great solution. That would also give you precise control without feedback.
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2011-12-20 13:17
    You might want to take a look at some of the reduction adapters from Servo City:

    http://www.servocity.com/html/robotzone_servos.html
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-12-20 13:19
    David,

    Is your servo one of the Parallax standard-sized Futaba continuous-rotation units?

    -Phil
  • David BetzDavid Betz Posts: 14,516
    edited 2011-12-20 13:49
    David,

    Is your servo one of the Parallax standard-sized Futaba continuous-rotation units?

    -Phil
    Yes, that's the one.
  • ChrisGaddChrisGadd Posts: 310
    edited 2011-12-20 14:05
    For my kite-aerial-photography camera rig I used a continuous rotation servo and a couple gears from Jameco, controlled by an SX-28. Worked quite nicely.
  • pedwardpedward Posts: 1,642
    edited 2011-12-20 14:56
    There was an article recently on Hack A Day about using egg timers as rotation platforms for time lapse photography. The short of it is that you put a nut in the bottom and a stick on mount or stud in the top, wind it up and let it go. As it unwinds the camera moves slowly.

    Also, consider using a clock motor. They are 1 rotation per minute.
  • idbruceidbruce Posts: 6,197
    edited 2011-12-20 16:16
    David

    I agree with Phil:
    For the smoothest motion, use a heavy, balanced platform (e.g. old phonograph turntable), and drive it nearer the edge with gear of belt reduction or with a rubber capstan.

    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.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-12-20 21:14
    I understand helical gears provide a smoother power transmission than normal gears.

    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.
  • David BetzDavid Betz Posts: 14,516
    edited 2011-12-21 07:40
    Thanks everyone for all of your advice. I'm going to look into gear reduction to achieve smoother slow speed operation. I'll post again once I have something working.
Sign In or Register to comment.