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

TLC5940 + Servos in microseconds control ???

Discussion in 'Arduino' started by ecaits, Aug 18, 2015.

  1. ecaits

    ecaits New Member

    Joined:
    Aug 25, 2014
    Messages:
    10
    Likes:
    0
    I have started to work on TLC5940NT to control the multiple servos through arduino uno.
    Generally we are providing rotation of angle by below given program line.

    tlc_setServo(SERVO_CHANNEL, angle);

    But I want to provide command in form of ServoWriteMicroseconds to measure the exact rotation of angle.

    But in TLC library, there is no such a command.

    So how can control the TLC servo by microseconds???
    [​IMG]
     
  2. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,331
    Likes:
    653
    Location:
    Derbyshire, UK
    ONLINE
    Write your own library (modify the existing one?), however, is a servo likely to give any worthwhile accuracy to uS timing?.
     
  3. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    I don't understand this!!

    The command is " Move the servo to X position" what has this to do with micro seconds??

    Some servos will take longer than others.... Are you talking about stepper motors rather than servo?
     
  4. dave

    Dave New Member

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


     
  5. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    6,074
    Likes:
    524
    Location:
    Cleveland, OH, USA

    I think the OP is referring to the pulse width of the control signal as explained here: https://www.servocity.com/html/how_do_servos_work_.html#.VdMetvlVhBc

    It is common for a pulse width of 1.5 ms (corrected, see post#6 below) to cause the servo to center and a deviation +/- 500 us to either side of that to cause full swing. However, he should know that both the centering width and +/- change may need to be adjusted for each servo. Cheaper servos are usually worse than more expensive ones in terms of adherence to those general specifications. There are also some specialized servos for helicopters (sometimes called tail-rotor servos) that are substantially different from the most common servos one sees.

    John
     
    Last edited: Aug 18, 2015
  6. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    Oh I see.....

    Then he'll need a wrapper function to turn the Set_servo() back to the original pulse length call!!

    EDIT.. I thought it was 1.5mS with a swing of .5mS each way!!
     
  7. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    6,074
    Likes:
    524
    Location:
    Cleveland, OH, USA
    I mis-wrote. Center is 1.5 ms. Original post is corrected.

    John
     
  8. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    I wasn't being awkward... I forget things easy these days...

    I actually prefer to work in pulse width rather than angle!!!
     
  9. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
    That library was made for leds more then servo I think servo was after thought. It works great with leds fading. Here the best info on it
    http://forum.arduino.cc/index.php?topic=37963.0 the reference link is broke. I think the guy that wrote it may of gotting out of collage by now..
    http://alex.kathack.com/codes/tlc5940arduino/html_r014/ good link tells how to add function to it that may fix the op up.

    Read the files that came with it there really helpful
    #define SERVO_MIN_WIDTH 204
    The 1ms pulse width for zero degrees (0 - 4095).
     
    Last edited: Aug 18, 2015

Share This Page