Capers II A Hexapod Robot
Capers II A Hexapod Robot
by Toglefritz
This Instructable will show you how to build your very The code that powers Capers II also allows for two
own hexapod robot, I call the design Capers II. modes in which the legs stay planted on the ground,
but the body is allowed to move through its entire
range of motion.
https://www.youtube.com/embed/WK9nbCEi-T0?
rel=0&showinfo=0
https://www.youtube.com/embed/oOGXDNOMRl0?
Robot Design rel=0&showinfo=0
A hexapod robot is a robot with six legs. Each leg is
actuated by three servos: one for forward/backward Robot Control
movement, one for up/down movement, and one to Capers II features wireless control using a Playstation
bend the leg in the middle. This gives the robot three 2 controller.
degrees of freedom, allowing it to move in any
direction.
Source
https://www.youtube.com/embed/SDMJ7NhmD30?
All of the code, design files, descriptions, and other
rel=0&showinfo=0 utilities needed to build, calibrate, and run the Capers
II hexapod can be found in a GitHub repository for the
Some hexapod robots are symmetrically designed,
project.
with the six legs equally spaced around a linearly
symmetrical body. Capers II, on the other hand, has a
slightly elongated body, giving the robot a more
natural appearance and the ability to use gaits
reminiscent of insects.
Motion
A six-legged robot has a great deal of flexibility in the
ways it is able to move. Capers II is able to use
several different gait patterns while walking.
https://www.youtube.com/embed/B186EfBtzvU?
rel=0&showinfo=0
You will need the parts below to build your hexapod robot.
Electronic Components
1 x Botboarduino
Arduino-compatible robot controller
1 x Wiring Harness
Battery wiring harness with switch
1 x PS2 Controller/Receiver
Wireless PS2 controller with receiver breakout
18 x Hitec HS-645MG*
High-torque analog servo
Hardware
36 x M2.2 x 5mm thread-forming screws
For attaching the servo horns
54 x M3 Nut
To put on the M3 screws
72 x 4-40 Nuts
To put on the 4-40 screws
6 x M3 x 50mm Standoffs
These hold the top and bottom body plates together
Frame
Hexapod frames are actually fairly easy to obtain. A simple search should yield several different sellers on different
platforms. I purchased my frame on eBay.
* It may be tempting to go with less expensive servos than the Hitec HS-645MGs used in this Instructable.
However, I would highly recommend getting the name brand. The robot requires quite a bit of strength from its
servos in order to work correctly.
Project Cost
The total cost at current prices is detailed in the table below.
Before we get to actually building the hexapod, it will assembly we will start building in the next step. The
be useful to establish a naming convention for the second leg segment is the femur. The third leg
different parts of the robot. The robot has three segment, the last one on each leg, is the tibia.
segments on each of its six legs and three servos for
the joints between the leg parts. The naming scheme The servos will be named according to the leg
we will use for the different parts of the legs will be segment they move. The servo that attaches to the
analogous to the arthropod leg. body of the hexapod is the coxa servo. The servo that
lifts and lowers each leg is the femur servo. The
servo that allows the legs to bend in the middle is the
tibia servo.
The leg segment closest to the body will be called the
coxa. In our build, the coxa is a servo bracket
It's time to start building. The first parts of the Capers attaching the ball bearings to the servo brackets is
II hexapod we will put together are the servo bracket that you do not want to tighten the screw so much
assemblies that will go on the base of each leg. We that the ball bearing can no longer move. Keep the
will build the servo bracket assemblies in pairs nut on the back side of the bracket slightly loose so
because, like many parts of the hexapod, we will that the ball bearing can spin freely. This is one
have three bracket assemblies on the left side of the reason to use thread locking compound on this nut,
robot, and three on the right. We will need to build our so that you can leave it a bit loose and still not worry
sub-assemblies in pairs that are mirror images of about the nut falling off.
each other.
https://www.youtube.com/embed/aeVGSRHiE4w?
rel=0&showinfo=0
1
1
1. The ball bearings mount on opposite sides of the servo brackets. 1. Make sure the screw on the ball bearing is not too tight. The bearing
needs to be able to move freely.
With the servo brackets built into pairs of mirrored side closest to the ball bearing. Attach the servos to
joints, we can now attach the servos themselves to the brackets using four 4-40 x 0.375" screws and 4-
the brackets. The orientation of the servos is not as 40 nuts for each servo. It is advisable to use some
difficult to figure out as the orientation of the brackets, thread lock on the screws so vibrations from the robot
but it can still be a touch confusing. do not loosen the servos.
1. The first servo should be mounted so that the motor shaft lines up with
the ball bearing.
1. The second servo should be mounted with the motor shaft closest to the
ball bearing.
1. You will end up with three pairs of opposing coxa joint assemblies.
Mounting servos to the tibia parts is a simple task. Attach the servos to the tibia parts with the motor
First, this is another step involving assembling parts shaft closer to the pointy end of each tibia. Like the
in mirrored pairs. We need three tibias for the right coxa and femur servos we assembled in the previous
side of the robot, and three more for the left. Start by step, the tibia servos connect using four 4-40 x 0.375"
arranging your tibia pieces in opposing directions so it screws and 4-40 nuts each.
is easier to keep track of which you've already
assembled.
Next we need to connect the servo horns to the femur Unlike every other part of the robot, we do not need to
so that, after the next step, we can assemble the worry about building the femurs in mirrored pairs
legs. The Hitec HS-645MG servos actually come with because they are symmetrical anyway.
a few different horns in the box. The ones we will use
on the Capers II robot are the white circular horns that Attach a servo horn onto each side of each femur
may have come pre-installed on your motors. using four M2.2 thread-forming screws on each servo
horn.
Each of the femur parts needs two servo horns.
1. The screws will tap into the plastic to create a secure connection.
In order for the code running on the Botboarduino to control Capers II, it is critically important that the controller
knows the orientation of each leg when the servos are centered. The code assumes that, when all the servos are
centered, the coxa faces directly away from the body, the femur is level with the ground, and the tibia is at an
angle of 75 degrees relative to the femur. In order to guarantee this position, we need to make sure all the servos
are centered before assembling the legs, which we will do in the next step.
We will use the Botboarduino to center the servos. The GitHub repository for this project contains a simple sketch
called servo_center.
Then, once the sketch is running on the Botboarduino, simply plug each servo into the servo header on pin 2.
https://www.youtube.com/embed/NF3fgosaa7k?rel=0&showinfo=0
With the coxa joint, the femur, and the tibia closest to the ball bearing on the coxa joint. Press the
individually assembled, they can all be put together to servo horn on the femur onto the motor shaft and
create the robot's legs. At this point, all of the servos secure it in place using one of the screws included
should be in their center position. Connecting the leg with the servo.
parts together in the correct orientation is integral to
the correct operation of the hexapod. The second step is to attach the tibia to the femur.
Start by lining up the tibia so that it is perpendicular
the femur. Then, rotate the tibia towards the coxa joint
https://www.youtube.com/embed/1YS_Pph9RZk?
slightly. As you rotate the part, you will feel the teeth
rel=0&showinfo=0
on the motor shaft engaging with the teeth on the
servo horn. Rotate the tibia in until you feel the part
"click" into place in its next position, which is 15
degrees from perpendicular.
The first step is attaching the femurs to the femur
servo/coxa joint. The femur attaches to the femur
servo so that the femur itself is perpendicular to the
servo. One side of the femur is flat, and the other side
is curved. The flat side faces down, which is the side
Now that the legs are all fully assembled, we will set thread-forming screws, attach six servo horns to the
them aside briefly while we turn our attention to the part.
hexapod's chassis. In this step, we will accomplish
two related tasks before we start working on the Second we will attach the six M3 x 50mm screws to
electronics. the upper chassis piece in preparation for mounting
the lower chassis towards the end of this Instructable.
First, six servo horns will mount onto the upper There will be one standoff mounted near each of the
chassis piece in the same way the servo horns were legs.
mounted onto the femurs. Using a pair of M2.2 x 5mm
The Capers II hexapod is designed so that the USB port on the Botboarduino will be accessible even after the
robot is fully assembled. This allows the robot to be reprogrammed without any disassembly. However, since the
Botboarduino is, at this point, not yet caged inside the robot chassis, we will program the board now and take
advantage of the convenience.
There is one preparatory step needed to program the Botboarduino. There are a number of jumpers on the board,
and we will take a closer look at those in the next step, but for now, find the solder jumper labeled USB/ext. This
jumper is used to select the power source for the board. Ultimately we will power the board from an external
source, but for now, move the jumper to the USB position.
With the jumper set, head over to the GitHub repository for this project and download the code. Then, open
Capers_II_PS2_SSC32.ino in the Arduino IDE. Uploading the sketch to the Botboarduino will follow the same
process we used earlier when centering the servos:
Uploading the sketch may take a little longer than your typical Arduino program. The Capers II code is quite large
for an Arduino, taking up about 75% of the Botboarduino's memory.
Another step we will perform prior to mounting the Moving further across the board, you will find a group
electronics inside the Capers II chassis, because the of four jumpers near the buttons and LEDs on the
electronics become much less accessible once inside Botboarduino. These jumpers will not really do
the robot's body, is configuring a series of jumpers on anything in the Capers II hexapod. They enable or
the Botboarduino and SSC-32 servo controller. Each disable the buttons, but we will not be using the
board has several jumpers used to select various buttons anyway. Just leave these jumpers installed.
settings. Many of these jumpers configure power
delivery options for the board and it is therefore vitally
important that they are set correctly.
Next, there are three jumpers next to three banks of
Botboarduino Jumpers pins on the side of the Botboarduino opposite the
The Botboarduino has a total of 13 jumpers placed screw terminal. These jumpers, control the voltage
around the board. First we have two jumpers near the delivered to those banks of pins between the VS
screw terminal. We've actually already played with voltage supplied to the screw terminal and 5V. We
the first jumper, the one used to select the power will be using those blocks of pins to connect the PS2
source for the Botboarduino, between USB and controller, and connect to the SSC-32. Therefore,
external power. For programming the Botboarduino make sure all three of these jumpers are set to 5V.
we need to power the board via USB. However, the
board will be powered by a battery in the robot, so we
will switch this jumper to the ext setting.
The jumper underneath the blocks of pins is labeled
similarly to those next to the blocks of pins above.
This jumper controls the same power deliver option
The jumper next to the power source selection is for the TX/RX pins. Set this jumper to 5V as well.
labeled VS=VL. There are two ways the
Botboarduino can be powered: first, separate power
sources can be used to power the logic components
of the board and the servo connectors, second, both SSC-32 Jumpers
systems can be powered from the same source. The SSC-32 servo controller has far fewer jumpers to
Since we will not be connecting servos directly to the configure. It only has two. On one side of the screw
Botboarduino, they connect to the SSC-32 instead, terminal there is a jumper labeled VS=VL. This
we will use a single power source for the entire jumper has the same function as the same-labeled
system. Therefore, install a jumper onto the VS=VL jumper on the Botboarduino. Since we will power the
pins. SSC-32 from a single power source (the battery), we
will install a jumper on these pins.
Getting all of the electronics and wiring to fit inside is mounting the Botboarduino onto the upper chassis
the robot's chassis is a little bit tricky. We will be plate. Start by installing four 6mm nylon standoffs
building a kind of stack of boards inside the robot's onto the holes in the upper chassis plate that line up
frame. All of the boards will hang upside-down from with the mounting holes on the Botboarduino (you
the upper chassis plate when the robot stands. may need to add some holes like I did). Then place
the Botboarduino onto the standoffs.
The first step to assembling the electronics package
1. Note that you should have the 50mm standoffs installed as well. After
assembling my first hexapod, I decided it was much easier to install the
standoffs first.
The next component to be added to the electronics stack is the controller. Before actually mounting the controller
on top of the Botboarduino, we need to connect the receiver electronically - and we will also be adding a few other
electrical connections as well.
With the electrical connections made, we can mount the controller receive on top of the Botboarduino. First, add a
nylon nut on top of the two nylon standoffs on the side of the Botboarduino with the screw terminal. On top of these
nuts, add two [add length]mm nylon standoffs. On the side of the Botboarduino opposite the screw terminal, add
two [add length]mm nylon standoffs. Place the controller receiver on the two standoffs on the screw terminal side
of the Botboarduino. The receiver should fit snugly into place with the end of the receive itself nestled next to the
wires we've already plugged in.
First, we will add the wires we will use later to connect the Botboarduino to the SSC-32. Three wires are used for
this. First, a black wire connects to the GND on pin 13. Next, connect a yellow cable to the signal on pin 13.
Finally, connect a red wire to the signal on pin 12. For now, these wires will just dangle free until we install the
SSC-32.
The final connection to make is the one that will deliver power to the Botboarduino later on. The battery will
connect directly to the SSC-32 and then the power will chain to the Botboarduino. There are two power
connections on the Botboarduino screw terminal. As a preparatory step, connect a + and - wire to the screw
terminal labeled VL.
1. Six wires connect the controller receive to the Botboarduino. 1. The controller receiver connects to the 6-9 block of pins with power and
ground connections as well.
2. These three wires will later be used to connect the SSC-32 to the
Botboarduino.
1. We will plug this connector into the SSC-32 later on. 1. First add nylon nuts to the standoffs next to the screw terminal.
1. On top of the nylon nuts, add two 12mm standoffs. 1. The controller receiver mounts on top of the nut/standoff stack.
1. The controller receiver should fit like a glove inside the footprint of the 1. The Botboarduino will receiver power from the SSC-32 later.
Botboarduino.
In a moment we will add the SSC-32U servo controller to the electronics stack inside the hexapod. First, however,
we need to take the preparatory step of setting the baud rate on the SSC-32U. The default baud rate of the SSC-
32U is 9600, however, the Capers II code we will be running on the Botboarduino uses a baud rate of 38400,
allowing significantly faster communication between the Botboarduino and the SSC-32U.
https://www.youtube.com/embed/b8oXd0Sa1zE?rel=0&showinfo=0
In order to set the SSC-32U baud rate, we will need to power on the board. To do this, simply plug your SSC-32U
into an available USB port on your computer. Then, on the SSC-32U, you will find a button labeled "baud." Next to
that button, there are two LEDs, one labeled "A" and one labeled "B."
Press and hold the baud button. At first, the LEDs illuminate to indicate the current baud rate setting. The default
of 9600 is indicated by a green LED. After two seconds, the LEDs will start to alternate, indicating that you can
now set a new baud rate. Release the button. Then, press the button to cycle through the baud rate settings:
1. 9600 - green
2. 38400-red
3. 115200-red and green
So, cycle through the LEDs until a red LED illuminates. Once the correct baud rate is selected, do nothing. After
five seconds, the new baud rate will be saved to the board's memory.
Our stack of electronics will be topped off by the the Botboarduino. We already have wires installed on
SSC-32 servo controller. The SSC-32 simply mounts the VL screw terminal on the Botboarduino. Attach
on top of the standoffs added to the stack on top of the other end of this wire to the VL screw terminals
the controller receiver. Orient the SSSC-32 so that on the SSC-32.
the screw terminal on the SSC-32 is on top of the
screw terminal on the Botboarduino, because we will Next we need to connect the Botboarduino and the
be connecting these screw terminals together. Fasten SSC-32 together so that they can communicate with
the SSC-32 in place using four nylon nuts. each other. We already have three wires installed on
the Botboarduino. These wires connect to the
With the SSC-32 in place, we will make a few RX/TX/GND pins in the middle of the SSC-32.
connections using the wires we installed on the
Botboarduino earlier. First, power from the battery will
be connected directly to the SSC-32 - we will do this
in the next step. Then, the SSC-32 delivers power to
1. The SSC-32 mounts on top of the standoffs. 1. The SSC-32 is held in place using four nylon nuts.
1. The SSC-32 connects to the Botboarduino via the TX/RX pins using
the wires we've already connected to the Botboarduino.
1. The washer on the switch has a small tab to keep the switch oriented
correctly.
Alright, we are now in the final stretch of the build must be assembled so that when the servos are
process for our hexapod robot. In this step we will centered, the robot is in a predetermined posture.
attach all of the previously-assembled legs to the
upper chassis plate (the one to which we attached all So, attach all six legs to the upper chassis plate.
the electronics). When attaching the coxa servos on Secure the servos using the screws included with the
the legs to the servo horns on the upper chassis servos. Be careful when picking up and moving the
plate, the servos must be oriented so that the leg robot at this point because we have the entire leg
faces directly away from the center point of the robot. assembly supported at a single point by the plastic
As we discussed when assembling the legs, in order servo horns.
for the robot firmware to operate correctly, the robot
1. The servo must be mounted so that the leg faces directly away from the
center of the robot.
1. For the front and back legs, the orientation should still be directly away
from the center of the robot. So, these legs will mount at an angle.
All 18 servos on the hexapod connect to the SSC-32 #define cRMCoxaPin 4 //Middle Right leg Hip Coxa
code.
#define cRFCoxaPin 8 //Front Right leg Hip Coxa
The SSC-32 has a row of servo connectors on each
side of the board. These servo connections are
#define cRFFemurPin 9 //Front Right leg Hip Femur
grouped in blocks of four rows each. Each leg
connects to a different block. The pin numbers for the
#define cRFTibiaPin 10 //Front Right leg Tibia
servo connections are defined in the code.
you are looking at the robot from the side with the
switch closest to you, the right servos will actually be #define cLRTibiaPin 18 //Rear Left leg Tibia
The final parts we have to install on the Capers II With the battery mounted onto the lower chassis
hexapod robot are the lower chassis plate and the plate, place the assembly on top of the robot, which
battery. First of all, we need to attach the battery to should still be upside down at this point, line up the
the lower chassis plate. When the robot stands, the ball bearings on all six legs with the holes in the lower
battery will hang under its body. chassis plate. This might be a little bit tricky to do.
The lower chassis plate should be oriented so that
Place the battery in the middle of the lower chassis the battery cable is on the opposite side of the robot
plate and, using two zip-ties, secure the battery in from the switch cable. Finally, secure the lower
place. In order to help the robot balance, try to center chassis plate in place using six M3 x 8mm screws
the battery as precisely as possible. into the standoffs.
Earlier, when we were assembling the legs and attaching the legs to the body, we discussed that the Capers II
code expects the robot to be in a particular posture when all of the servos are centered. The femurs should be at
right angles to the coxa servos. The tibias should face 15 degrees inward relative to the femurs. The legs should
face directly away from the center of the robot. However, even if you were very careful while assembling the robot,
when the robot turns on, you might find that the initial angles of the servos are somewhat off.
There is a utility in the Capers II code that allows you to adjust the initial servo angles of all 18 servos in order to
correct any small errors in alignment introduced during assembly.
https://www.youtube.com/embed/1pG9EarsN5Q?rel=0&showinfo=0
To use servo offset mode, first plug the Botboarduino into your computer via USB. The USB cord can reach the
port on the Botboarduino through the front two legs. With the robot connected to your computer, turn on the switch
and open Serial Monitor in the Arduino IDE. When the robot starts, you will be presented with some instructions in
Serial Monitor. To enter servo offset mode, send "O" to the hexapod.
Once servo offset mode starts, you will again be presented with some options. The first step is selecting a leg. All
six legs are designed by a number in the code:
1. Rear Right
2. Middle Right
3. Front Right
4. Rear Left
5. Middle Left
6. Front Left
To select a leg, send the leg number, along with servo designator over Serial. You can specify the coxa servo with
"C," the femur servo with "B," or the tibia servo with "C." Once you have a leg selected, send "+" or "-" over Serial
to increase or decrease the servo zero position.
Once you've configured all your servos, send "$" over Serial to exit servo offset mode. A prompt will ask you if you
want to save your configuration. Respond "Y" to save your offsets.
It has probably taken quite a bit of time, but your always face the same direction. The right stick turns
hexapod is now complete! All that remains to do is the robot.
turn on the robot, and the controller, and take Capers
II for a walk. It will be useful, of course, to know how
to control the hexapod. On the PS2 controller, you
have access to a set of "common controls" which are One of the other commonly used modes is single leg
almost always active, whatever mode the robot is control mode. As the name implies, this mode allows
currently in. individual control over the legs. You can also have
the robot hold its legs in a position you set.
Hey harkejuice, thanks very much for the suggestion. I added a section to the bottom of the
"Gather Your Parts" step that estimates the total cost of the project. The total cost is around $750.
Hi, I have one questions. How much power for 18 servos (current). I have a big problem with power
for them.
The Hitec HS-645MG servos used in this project have a no-load current consumption of 450mA at
6V (which is the voltage of the battery used in this Instructable). Fortunately, we should never be in
a situation where all eighteen of the servos are running at once. In fact, the code running on the
robot is specifically designed to avoid this scenario because if all the servos ran at the same time,
they would require over 7A of total current, and the battery can supply a maximum of 2.8A.
Typically, a maximum of three servos will be running at the same time, requiring around 2A. For
example, in a triangle gait, three femur motors will lift the legs, then three coxa motor will move the
legs forward, then three femur motors will lower the legs back down. These types of gait patterns
limit the number of servos running together, thus limiting the robot's total current draw.
Great Instructable, I mean it's scary as hell, it'll probably killl you whilst you sleep but still really
cool!! Great work!
Very cool!
Wow! This is all so perfectly put together. The set of instructions are so thorough. Thank you so
much for sharing. I am amazed! I now follow you. You are a genius!Do you have more genius
Capers II, a Hexapod Robot: Page 54
projects like these? Keep up the marvelous work! I can't wait to begin on this one! I am so excited!
Monalyssa
[email protected]
looks AWESOME!
Great tutorial!! It's so detailed that it's just beautiful! Can't wait to make one. thanks a lot.
Cheers :)