RobotGeek 101: Servo Centering

This lesson is part of the RobotGeek 101 Learning Series. If you haven't already, please download the example sketches, and follow through the Geekduino Getting Started Guide to handle the foundations of using the Arduino IDE in conjunction with the Geekduino.

Welcome to RobotGeek 101 : Servo Centering. This lesson will give you a brief overview of how servos are different from normal motors and how they work. This lesson will also show you how to center your 180 ° servos. The following video for this lesson will walk you through everything you need to do to center your RobotGeek Servos.

Setting up the Hardware

geekmount-pins-note.jpg

Servo motors act like robotic joints - you can set them to specific positions to move your robot to different positions. This means that the servo needs to be set to s specific position before assembling your robot, or it will not work correctly. We are going to 'center' the servos, setting them to halfway between their maximum and minimum position. To begin centering your servos, we're going to have to set up your test rig. This is incredibly easy to do with a RobotGeek Sensor Shield. Start by attaching your Sensor Shield to your Geekduino/Arduino Compatible board. Slot the bottom pins of the RobotGeek Sensor Shield into the terminals in the top of the Geekduino. Note how the boards seat evenly on top of each other, and the pins line up exactly. Be careful not to bend the pins.

Jumpers and Power

RobotGeek servos must be powered by an external power supply like the 6v2A or 7v5A power supply included with your kit. If you have servos plugged in to the shield and do not have the external power supply plugged into your Geekduino you will see erratic behavior.

You will also need to adjust your shield to make sure the power is getting to the servos correctly. Make sure that you have both of the jumpers on the Sensor Shield set to Voltage In (VIN) If you would like more information about this, check out the Jumpers/Power section of the RobotGeek 101: 1.3 RobotGeek Sensor Shield & Wiring Primer.

b_500_500_16777215_00__images_tutorials_rgSnapperArm_powerA.jpgsnapperArm-jumpers.jpg

Code

Click here to see the Code

Open the following sketch in your Arduino IDE

File > Sketchbook > RobotGeek sketches > Tools > centerServo

Upload the sketch onto your Geekduino. This sketch will move any servo attached on pins 3,5,6,9,10 or 11. First the servos will move to 45 degrees, then to 135 degrees, then they will move (and stay) at 90 degrees, their centered position. If you want to restart the sequence, press the reset button on your Geekduino, or unplug your USB cable and your external power supply, and then plug your power supply back into the Geekduino.

Your servo is now centered and ready for you to attach your horn. We recommend that you leave your Servo plugged into the Sensor Shield/Geekduino while you install the horn.

Installing Servo Horns on RobotGeek Servos

Once the RobotGeek Servos have stopped moving, they are centered and you can install the servo horn. To line up the horn, place it with the notch facing up. If it does not slide on easily, or it clicks into place with the holes not facing cardinal directions, ignore the notch, remove the horn, rotate it about 45 degrees and try again. Repeat until the top and bottom holes are aligned as close to exactly North and South of the center, as shown.

b_500_500_16777215_00__images_tutorials_rgServo_center3.jpg b_500_500_16777215_00__images_tutorials_rgServo_center4.jpg b_500_500_16777215_00__images_tutorials_rgServo_center5.jpg

Your servos don't need to be 'perfectly' aligned, but the closer you can get, the better the robot will operate. Once your horn is ready, use a black phillips bolt included with the horn to secure the horn to the servo.

Sometimes RobotGeek servos will also need idler horns. Your assembly guide will tell you if and how many servos need idler horns. Idler horns are passive horns on the opposite side of the main servo horn. The idler horn allows you to connect a hinge bracket to the servo.

To install the idler horn, fit it onto the back of the servo and secure it with the silver screw. Orientation on the idler horn does not matter.

b_500_500_16777215_00__images_tutorials_rgServo_idle1.jpg b_500_500_16777215_00__images_tutorials_rgServo_idle2.jpg b_500_500_16777215_00__images_tutorials_rgServo_idle3.jpg

Installing Servo Horns on 9G Servos

The horn you'll need and it's orientation will depend on your robot kit. See the 9g Servo Guide for more information.

Feedback Form


Search