Motor Calibration

Table of Contents

Calibration:

Prior to beginning assembly of the FlashBob, you will need to calibrate the servo motors. 

You’ll need an Arduino nano, Arduino nano expansion shield, Servo motors, Arduino IDE and a permanent marker pen

Step 1: Download and install Arduino IDE

Step 2: Download and open the calibration code


include //Add servo library #

// Create four servo objects for four motors
Servo leftLeg;
Servo rightLeg;
Servo leftFoot;
Servo rightFoot;

// Define the left, right and center position of the servos
int leftPosition = 0;
int rightPosition = 180;
int center = 90;

void setup() {
// Attach servo motors to arduino digital pins
leftLeg.attach(3);
rightLeg.attach(5);
leftFoot.attach(6);
rightFoot.attach(9);

// Move the motors to the left
leftLeg.write(leftPosition);
rightLeg.write(leftPosition);
leftFoot.write(leftPosition);
rightFoot.write(leftPosition);

//wait for a second
delay(1000);

// Move the motors to the right
leftLeg.write(rightPosition);
rightLeg.write(rightPosition);
leftFoot.write(rightPosition);
rightFoot.write(rightPosition);
}

void loop() {
// Move the motors to the center
leftLeg.write(center);
rightLeg.write(center);
leftFoot.write(center);
rightFoot.write(center);
}

Step 3: Connect Arduino board to the arduino shield


Step 4: Connect Arduino nano to the computer using mini USB cable

Step 5: Go to Tools → Boards → Arduino nano


Step 6: Go to Tools → Ports → Select port number (COMXX on Windows, usbserial on mac)


Step 7: Connect Servo motors to Arduino Digital pins 3, 5, 6, 9

Step 8: Upload the program. you should see the motors move to a set position.

Step 9: Take your permanent marker pen and draw a line across the servo motor body and the motor spindle. This line serves as a calibration line in case the motors get moved during assembly.

Warning: Don’t be tempted to turn these by hand, the torque provided by your mighty strength could strip the servo gears.

Powered by BetterDocs