1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Rotation angle of Servo???

Discussion in 'Robotics & Mechatronics' started by ecaits, Aug 13, 2015.

  1. ecaits

    ecaits New Member

    Joined:
    Aug 25, 2014
    Messages:
    10
    Likes:
    0
    I am working on Arduino Uno based project to control the multiple servos.

    I am using Vigor VS 2 servo. As per data sheet, its output angle is >=170 degree and pulse traveling 800 to 2200 μsec.

    When I give command of 90 degree to rotate, it rotate slightly more than 90 degree but when I give command of 85 degree then it is looking like exact 90 degree.

    I have written simple program as written below.

    Servo myservo;
    int pos = 0;
    void setup()
    {
    myservo.attach(9);
    }
    void loop()
    {
    myservo.write(85);
    }

    What I require to modify to get the exact angle as per program code.

    Thank You,

    Regards,
    Nirav
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,170
    Likes:
    910
    Location:
    Rochdale UK
    ONLINE
    Servo's are not all EXACLTY the same so you would need a calibration map or a 180 digit lookup table..

    if you calibrated 0 position by turning the servo to suit the 0 position, then give the "myservo.write(85);" then measure the actual angle you then can map the real value to the desired angle..

    Most servo's do not have the complete 180 degree operation 165~170 at best!!
     
  3. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    5,904
    Likes:
    502
    Location:
    Cleveland, OH, USA
    That is an analog, low cost ($5.35 at HobbyKing) servo. Its deadband specification is 5 uS, which is probably a bit optimistic. It has a conventional brushed motor and uses a standard carbon potentiometer for feedback. There is also slop in the gears.

    Calibration is certainly an issue as 5° out of 90° is not much more than 5%. Once calibrated, if the reproducibility is not adequate for your needs, consider a digital servo with a better motor.

    John
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,259
    Likes:
    1,218
    Location:
    Cardiff, Wales

    As for a code mod, just try subtracting 5 from the angle parameter. So 80 in code should give roughly 90° angle in practice.
     
    • Like Like x 1
  6. Colin

    Colin Member

    Joined:
    Sep 25, 2003
    Messages:
    374
    Likes:
    22
    Location:
    Australia
    85 degrees is pretty good for a $2.00 servo that would cost you $25.00 to make yourself.
     
  7. JonSea

    JonSea Well-Known Member

    Joined:
    Oct 1, 2012
    Messages:
    1,119
    Likes:
    90
    Location:
    Seattle, WA
    A few years back, I created A Clock for Geeks. I used a 4310 Futaba servo, which is known for its linearity. The accuracy across the scale was good enough for the task.

    When I recreated the clock, I used a no-name cheap servo. The accuracy wasn't so good, with approximately 20 minute errors in the indicated time across the scale. I had to use a lookup table with the cheap servo. Servo Clock Calibration.

    image.jpg
     
  8. Colin

    Colin Member

    Joined:
    Sep 25, 2003
    Messages:
    374
    Likes:
    22
    Location:
    Australia
    "There is also slop in the gears." Slop does not come into it.
     
  9. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    5,904
    Likes:
    502
    Location:
    Cleveland, OH, USA
    Despite that comment being six months late, it is not accurate.

    The TS is asking about accurate positioning. Gear slop is a little like backlash in a machine tool's positioning controls, like in a vertical mill. Backlash can be compensated for to an extent by always approaching the final position from the same direction, for example, pulling the table toward you or pushing to the right, but that does not completely remove its effect. That type of compensation is rarely, if ever, done with these light-weight, inexpensive servos. Yet it is certainly a concern when accurate positioning is needed. Also, the potential for the orientation of the servo relative to gravity or other forces (e.g., aerodynamic forces on a control surface) can change, which adds slop-related error that cannot be compensated for in the manner described for machine tools. Any movement due to such slop is not detected by the feedback.

    John
     
  10. Colin

    Colin Member

    Joined:
    Sep 25, 2003
    Messages:
    374
    Likes:
    22
    Location:
    Australia
    "Despite that comment being six months late, it is not accurate. "

    The pot is connected directly to the output shaft. Slop does not come into it.
     
  11. Mikebits

    Mikebits Well-Known Member

    Joined:
    May 24, 2008
    Messages:
    6,214
    Likes:
    174
    Location:
    San Diego, Ca
    Not trying to start anything, you all just got me to wondering, how does the pot connect to the shaft? I never pulled a servo apart as they use to cost a lot of money back when I played with RC cars.

    [​IMG]
     

Share This Page