Testing and Calibration


If you are building a Hack-E-Bot from scratch, keep in mind that your electronics should be tested and the servos will likely have to be calibrated.

 

Calibrating the Servos

Calibrating the Servos

Servos use a potentiometer to determine what position the motor shaft is in at any given moment. Every servo has a little screw, usually on the bottom, to let you change the position of the potentiometer. Calibrating the servo is done by telling the servo to move to a particular spot, then turning the potentiometer screw until it gets there. In the case of a full rotation servo, we will be telling the servo to stop moving (zero degrees clockwise and counter clockwise). To do this, we will program the Arduino to tell the servo to turn 90 degrees. This should be at the center of movement and the servo should not spin.

1
Load the following code onto your Arduino micro controller.   //Center Servos #include Servo servo; void setup() { servo.attach(11); } void loop() { servo.write(90); }
2
Connect one of the servos to the Arduino with the Red wire plugged into VCC or 5V, the Brown wire connected to G or GND, and the Orange wire connected to PIN 11.
3
Attach one of the servo horns to the servo, so you can see it move easely, then apply power to the Arduino and see what the servo dose.
4
If the servo starts spinning, turn the potentiometer screw in one direction or the other until it stops spinning.   If the servo dose nothing, try to move the potentiometer screw just to be sure that the servo moves at all. It should start to move faster in one direction or the other the more you turn the screw. If nothing happens, check to make sure that the code was successfully loaded onto the Arduino with no errors and that all 3 of your wires are connected properly.
5
Now move to the next servo and do the same thing.