Shop OBEX P1 Docs P2 Docs Learn Events
Driving a Servo — Parallax Forums

Driving a Servo

T ChapT Chap Posts: 4,223
edited 2009-08-25 16:44 in Propeller 1
I need to start working out some ideas for driving a single servo from 600uS to 2400uS. The motor arrives tomorrow but I wanted a head start, this is a first trying to position a motor over 180 degrees. I need to be able to update it's position in degrees.

Is this just as simple as running PWMASM obj and setting period to 20ms, and adjusting the duty from 600uS to 2400uS as needed to set angle?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-24 23:10
    Servos are not accurate. You know that the midpoint position is at 1500us pulse width, but only thing you know about other positions is that you should limit the pulse widths to the range 1000us to 2000us until you know what mechanical positions correspond to that pulse width range. Start with PWMASM with a repetition period set to 20ms and the duty set to 1000us to 2000us, then record several servo positions in that range. The relationship between pulse width and servo position should be close to linear.
  • LeonLeon Posts: 7,620
    edited 2009-08-25 14:32
    Model control servos aren't accurate, but fast, high accuracy servos are available. They cost a lost more, of course.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • T ChapT Chap Posts: 4,223
    edited 2009-08-25 16:19
    Thanks Mike and Leon.

    I will test this system coming in this afternoon. If it isn't accurate enough, I'll look up the high accuracy version. This is a first trying out a servo, and I had no idea these were available in some of the holding torques I have seen.

    Leon, where would you find a high accuracy that would fit this gear and mounting apparatus?

    I needed 270 degrees, so this will be geared 3:2, in other words the 180 output of motor travel is converted to 270 actual output, but the load is nil, the motor is a 'high torque digital'. Depending on the cost of a high accuracy, it may be just as easy to add an encoder to this one, and run the servo in closed loop.
    376 x 247 - 24K
  • LeonLeon Posts: 7,620
    edited 2009-08-25 16:44
    I'd probably use one of these:

    www.mclennan.co.uk/datasheets/european/dcservo/p5gearedmotor.pdf

    They can be supplied with pots.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
Sign In or Register to comment.