Before beginning to program complex gaits and other movements, we need to set up the zero points of each servo. This gives the robot a reference point which it uses to perform various movements.

To avoid damages to the robot you can remove the servo horn links.

  1. Begin by cloning the micro quadruped program from the following GitHub repo:
  2. Uncomment the 8th line of the main.ino file and comment out the rest of the lines in the setup and loop
  3. Upload the file to the Arduino

This code places each of the servos at 90 degrees. Once the servos have reached the 90-degree position you can reattach the links such that the legs are perfectly straight and the servo attached to the body is perpendicular to the top panel of the quadruped.

At this point, because of the design of the servo horns, some of the joints may still not be perfectly straight. The solution to this is to adjust the zero_positions array found on the 13th line of the Quadruped.h file. Each number represents the zero position of the corresponding servo (the order is the same as the order in which you attached the servo to the Arduino). Tweak these values a bit till the legs are perfectly straight.

Note: Here are the values that I use although these values may not work for you:

int zero_positions[12] = {83, 89, 164, 85, 93, 3, 102, 90, 15, 90, 99, 175};

Also, note that this program can work with any quadruped that you build. Simply change the values in the constructor called on line 3 of main.ino. (More details can be found in the readme on the GitHub page)

Leave a Reply