Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 33

Thread: Controlling servo speed with Arduino

  1. #11
    Resident 100HP water-cannon operator SXRguyinMA's Avatar
    Join Date
    Jun 2008
    Location
    MA
    Posts
    5,865

    Default Re: Controlling servo speed with Arduino

    tried both, neither worked lol

  2. #12
    Resident 100HP water-cannon operator SXRguyinMA's Avatar
    Join Date
    Jun 2008
    Location
    MA
    Posts
    5,865

    Default Re: Controlling servo speed with Arduino


  3. #13
    Will YOU be ready when the zombies rise? x88x's Avatar
    Join Date
    Oct 2008
    Location
    MD, USA
    Posts
    6,334

    Default Re: Controlling servo speed with Arduino

    You want to change the 'delay(100)' in the 'while' loop. What did you change it to? Try upping it to a few hundred and see if you see a difference...this is milliseconds we're dealing with here, you're not gonna notice any difference if you only change it by a few.
    That we enjoy great advantages from the inventions of others, we should be glad of an opportunity to serve others by any invention of ours, and this we should do freely and generously.
    --Benjamin Franklin
    TBCS 5TB Club :: coilgun :: bench PSU :: mightyMite :: Zeus :: E15 Magna EV

  4. #14
    Resident 100HP water-cannon operator SXRguyinMA's Avatar
    Join Date
    Jun 2008
    Location
    MA
    Posts
    5,865

    Default Re: Controlling servo speed with Arduino

    I changed it to 500 and it didn't change a thing, I'll try higher

  5. #15
    Resident 100HP water-cannon operator SXRguyinMA's Avatar
    Join Date
    Jun 2008
    Location
    MA
    Posts
    5,865

    Default Re: Controlling servo speed with Arduino

    tried it @ 1000 and 5000, nothing changed lol

  6. #16
    Resident 100HP water-cannon operator SXRguyinMA's Avatar
    Join Date
    Jun 2008
    Location
    MA
    Posts
    5,865

    Default Re: Controlling servo speed with Arduino

    found this over on the Arduino forum:

    Code:
    const int angleIncrement = 1;
    const int incrementDelay = 10;
    for (int angle = 0; angle < 180; angle += angleIncrement) { // single "degree" increments
      myServo.write (angle);
      delay (incrementDelay); // so we'll take 10 * 180 milliseconds = 1.8 seconds for the traverse.
    }
    now how would I work it into my sketch?

  7. #17
    Fox Furry crenn's Avatar
    Join Date
    Apr 2005
    Location
    In the shadows behind you
    Posts
    4,067

    Default Re: Controlling servo speed with Arduino

    What that's doing is pretty much what I'm doing with my code. Are you sure the code is uploading?

    EDIT: Just a note. When you want to increase the delay, update the lines with
    Code:
    myservo.write(val);
    delay(100);
    Increasing the delay at the end won't slow down the servo much.
    Antec Sonata II | Pioneer DVR-212
    Good news! You can follow my website or follow me on twitter!

  8. #18
    Resident 100HP water-cannon operator SXRguyinMA's Avatar
    Join Date
    Jun 2008
    Location
    MA
    Posts
    5,865

    Default Re: Controlling servo speed with Arduino

    yes it's uploading, the board it resetting and everything. I'm changing the control pin from 7 to 5 to test it so I don't actually have to shut down the computer, and it doesn't seem to be slowing at all. I've changed that value to 500, 1000 and 5000 with no change in speed

  9. #19
    Will YOU be ready when the zombies rise? x88x's Avatar
    Join Date
    Oct 2008
    Location
    MD, USA
    Posts
    6,334

    Default Re: Controlling servo speed with Arduino

    Hmmm, there's definitely something wrong here...at 5000 it should take it 15 minutes to close all the way (180 degrees)....

    EDIT:
    Just to make sure, this is the place where you're changing the delay time right?
    Code:
    else {
        while(val<OFF_POSITION){
          val++;
          myservo.write(val);
          delay(100);
        }
        myservo.write(OFF_POSITION);                           // sets servo position to 180 if above statment is false
      }
    That we enjoy great advantages from the inventions of others, we should be glad of an opportunity to serve others by any invention of ours, and this we should do freely and generously.
    --Benjamin Franklin
    TBCS 5TB Club :: coilgun :: bench PSU :: mightyMite :: Zeus :: E15 Magna EV

  10. #20
    Resident 100HP water-cannon operator SXRguyinMA's Avatar
    Join Date
    Jun 2008
    Location
    MA
    Posts
    5,865

    Default Re: Controlling servo speed with Arduino

    that's the one. FYI from full open to full close it's only moving ~70º or so, but still, it's just as snappy, takes .5 sec or less, just like in the vid

    a guy over on the Arduino forums said he's adding something to the servo library and to look for it later today. I just looked and nothing yet.

    http://www.arduino.cc/cgi-bin/yabb2/...num=1276899740

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •