Shop OBEX P1 Docs P2 Docs Learn Events
Boe Shield-Bot Left Servo problem — Parallax Forums

Boe Shield-Bot Left Servo problem

hungryTechiehungryTechie Posts: 14
edited 2014-07-11 16:15 in Learn with BlocklyProp
Hi there,

I work on the Robotics with the Board of Education Shield for Arduino and follow the pdf tutorials posted on the website. Everything works fine but there's a small problem with the left servo and I notice the problem happens on two occasions:

1. whenever I click the upload button from the Arduino software, the left servo moves the bot slightly to the right BEFORE performing the code written for the bot
2. the same slight turn happens when I click the RESET button on the shield; after that the code is run and the robot follows the code well

Any suggestions on how to fix this annoying problem with the left servo?

Not sure if this helps but to center the left servo I used the software with the following code:

servoLeft.writeMicroseconds(1490);

Thank you

Comments

  • GenetixGenetix Posts: 1,742
    edited 2014-07-10 00:03
    Double-check your wiring. Make sure all the cables and connectors are on securely and in the right place.
    Did you center your servos using the Potentiometer built into their base?
    Check your batteries also since servos use a lot of current.
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2014-07-10 08:47
    Hi there,

    I work on the Robotics with the Board of Education Shield for Arduino and follow the pdf tutorials posted on the website. Everything works fine but there's a small problem with the left servo and I notice the problem happens on two occasions:

    1. whenever I click the upload button from the Arduino software, the left servo moves the bot slightly to the right BEFORE performing the code written for the bot
    2. the same slight turn happens when I click the RESET button on the shield; after that the code is run and the robot follows the code well

    Any suggestions on how to fix this annoying problem with the left servo?

    Not sure if this helps but to center the left servo I used the software with the following code:

    servoLeft.writeMicroseconds(1490);

    Thank you

    This is actually an artifact from the way the Arduino behaves on start-up; it toggles that pin. In most applications where you are navigating with sensors, the small twitch does not affect performance at all, since the program's sensor input states take over right away.

    Notice that the example programs start with a 3-second beep. If you have a situation where you want the robot to drive straight forward from its starting position, put the 3-position switch (0-1-2) in Position 1, and then hit Reset. When you hear the beep, slide the switch to position 2. When the switch is in Position 1, power goes to the breadboard connections but not the servo headers, so the Arduino reset cannot make the left servo twitch.

    You can also keep the 3-position switch in Position 1 for programming, and of course you would not see the servo twitch. This is recommended, to keep the robot from rolling off the table while you are programming it!

    I hope this helps!
  • hungryTechiehungryTechie Posts: 14
    edited 2014-07-10 19:56
    Thanks for the suggestions. I will definitely give them a try and post the results here.

    I was wondering if this is something that happens only to my Boe Bot or is it a sort of default behavior, as Steph suggests. It seems a sort of a minor but annoying bug.
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2014-07-11 08:58
    As I mentioned, it is part of the way the Arduino module toggles certain pins on start-up, so it is not just your particular Shield-Bot.

    If you want to use different I/O pins for the servo connections you may, but that would require modifying the code for all of the example programs. Your choice.
  • hungryTechiehungryTechie Posts: 14
    edited 2014-07-11 16:06
    Thanks

    your initial suggestion works. Using different I/O pins for the servo connections is something I will consider for the future.

    Do you know where I should click to mark this as resolved?
  • Courtney JacobsCourtney Jacobs Posts: 903
    edited 2014-07-11 16:15
    Go to your first post, click "Edit Post" and then click on "Go Advanced" to see additional edit options.

    You'll see a drop down menu, and from it you can select it to show "Solved" instead of "Unsolved".
  • TepidTepid Posts: 1
    edited 2020-12-27 03:30
    Removed sarcasm

    PIN 13 is used by the bootloader on Arduino's that flashes the LED on boot
    This is not an artifact, it is by design. Very few people use PIN 13, unless they have to.
    Then it's a matter of working around it.
    If you are so deep into it that you must use PIN 13, you will know how to work around it.
    My only question is, why did parallax dev a board based around using PIN 13 when there was zero reason to do so?

    There are several ways around it, but the easiest way is to not use the header on the "Board of Education Shield" for PIN 13
    In most everything you will do with the any Arduino, you will probably never have to use PIN 13. The use case is rare at best.

    Use a 3 pin header on the breadboard
    Hook GND = Black , Red = 5V , White = PIN 10 or other pin that is not pulled High at bootup

    You will have to change servoLeft.attach(13); to servoLeft.attach(10);
    or wherever PIN 13 is called on

    This will resolve this issue.

    And then don't use PIN 13 in future projects.


Sign In or Register to comment.