Introduction: [DIY] Spider Robot(Quad Robot, Quadruped)

2017-03-26 update:
Share the MG90 servo version - http://www.thingiverse.com/thing:2204279

you can download it and build with MG90 servos.

2016-11-1 update:

The all new spider - https://youtu.be/bxJC_vvggIc

2016-04-01 Modify:

Correct the Battery model name and dimension.

2016-01-24 update:

Open the all of design that including the software, Sketchup, EaglePCB, https://github.com/regishsu/SpiderRobot

2015-10-11 upload the PCB layout image file.

2015-10-04 update:

Step 2: schematic pdf file - spider_2015-10-04-open-v2.pdf

Step 10: picture 1.

2015-11-19 update:

Upload the Arduino sketch file which is "special dance" included(step13). Someone who are asking about it, they are interested in it. :-)

-------------------------------------------------------------------------------------------------------------------------------------------------

This is my first project for the 4 legs robot and it took me about 1 year development.

It is a robot that relies on calculations to position servos and pre-programmed sequences of legs.

I'm doing this by handmade way is because of it could be fun and educational for 3D design/printing and robot control.

This is the fourth generation of my design, you can take a look here if you are interested the history.

http://regishsu.blogspot.tw/search/label/0.SpiderR...

2 more projects sharing -

Spider Robot simulator by vPython

https://www.instructables.com/id/vPython-Spider-Rob...

Remote control by bluetooth

https://www.instructables.com/id/DIY-Spider-Robot-P...

Building this project is fun, however, it should take you more time and patient to implement.

If it is a hard job to you, the product comes from Sunfounder might a good choice.

https://www.sunfounder.com/robotic-drone/quadruped/crawling-quadruped-robot-kit.html

Before going to next step, please aware that the soldering tools and 3D printer will be used in this project.

Let's get start and have fun!

Step 1: Electrics Parts Preparation

Here are the parts:

1x Arduino Pro Mini

1x DC-DC(12-5v/3A output)

1x HC-06 Bluetooth module(option)

12x SG90 servo(3DOF for 4 legs)

1x 3000mhA Li battery (DC12300, 90x43x17mm)

1x 12V Jack

1x 680 Ohm 1/4 watt 5% Resistor

1x 3mm Blue LED

1x Tactile Switch

1x 5x7cm perfboard

Some male and female pin headers

Small guage wire(Solid or Stranded)

I believe that these parts are most popular and not expensive. They are just cost me about 2,000 Taiwan dollar.

Step 2: Make the Main-board

2015-10-11

upload the PCB layout image file, you should download the zip file would be better.

You can come here for more information about PCB DIY. http://regishsu.blogspot.tw/search/label/0.SpiderR...

******************************************************************

Refer to the schematics file, and place all components like the pictures. you can make the board as small as passable.

The main-board that the last one picture is the newest version, just for you reference.

Here are some tips while you are going to building the PCB:

1. Be sure the output voltage of DC-DC module should be 5v before mount to the perfboard.

2. The servos consume a lot of power, almost 3A in full loading condition. Please use more thick wire for "power" and ground" traces.

3. Do the "open/short" test with the multi-meter for your PCB when you finish the soldering, that is the important process.

4. Using the female pin header instead of solder the modules(Arduino, DC-DC) on the perfboard directly

5. The LED will be on while the "Switch" turns off. Why I design this way is because I would like to check the power source is ok or not when I plug in the power source like battery or something else, it is a simple way for protection..

6. While you see the LED turns on after connect the 12v battery to the board, congratulation!

Step 3: Test the Main-board

Test process:

1. Don't plug the DC-DC and Arduino Pro Mini into the main-board

2. connect the battery to the 12v-Jack of main-board

3. Check the LED, if LED turns on, that is a good start.

4. Push the POWER-Switch, the LED should be off.

4. Using the multi-meter to check all of +5V and GND pins are correct

5. Push the POWER-Switch back to turn off the power, the LED turns on

6. Plug the DC-DC and Arduino Pro Mini into the main-board

7. Push the POWER-Switch, the LED turns off, but the LED of Arduino Pro Mini turns on

Then power off, and connect a servo to the first row of Leg1 connectors of main-board(pin2 of Arduino)

upload the "servo_test" code to Arduino and you will see the servo sweeps from 0 - 180 degree.

If you are here without any problem, that is a great progress!

servo_test source code:

Step 4: Building the Mechanical Parts - Download 3D STL Files

This step is going to build the robot mechanical parts, you can print the parts by yourself or ask someone who has 3D printer to help you.

I also open the 3D model design which is design by Sketchup Make version and you can modify it with your great idea.

Download the STL file from http://www.thingiverse.com/thing:1009659

Print parts list:
1x body_d.stl

1x body_u.stl

2x coxa_l.stl

2x coxa_r.stl

2x tibia_l.stl

2x tibia_r.stl

4x femur_1.stl

8x s_hold.stl

Step 5: 3D Objects Printing

And print them out by your 3D printer.

Please check the configuration of 3D printer before start to print because of it will take a long time about 7~8 hours to print them all. Be patient~~~~

There are my print setting:

- The fill density - 15%

- Nozzle - 0.3mm

- Print speed - 65

you can print these parts separate by color group.

Step 6: Preparing to Assemable

tear down the parts and check the objects printing quality, and using the sandpaper to polish the surface to make it looks good.

Refer to here to get more information: http://regishsu.blogspot.tw/2015/07/robot-quadruped-robot-re-design-3-round.html

Step 7: Assemble the Body

Put the battery between the upper body case and lower body case with 4 screws(M3x25mm)

Step 8: Assemble the Leg

And, install all of servos with legs parts, one leg comes with 3 servos and 4 screws(M1.6x3mm, or glue it anyway)

Notes: 1. Connect to all parts with screws and servos, but do not install the servo rocker arm in this step 2. Be sure the leg direction, refer to the picture 1 Refer to here to get more information:http://regishsu.blogspot.tw/2015/07/robot-quadrupe...

Step 9: Integrate 4 Legs to Body

connect all of legs to the body, and check all servos and joints are move smoothly.

Step 10: Connect Servos to the Main-board

2015-10-04

update the picture1 which is wrong pin assignment.

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Place the main-board onto the body-case and use the polymer clay to fix it.

And then, refer to the picture, follow the pin number which mark by pink color to connect all servo wire to the main-board, and green color is present the signal direction of servo wire, yellow connect to "S", red to "+", brown to "-".

Be sure the servo of legs should match the pin number of main-board and leg direction, otherwise, the legs will get crazy...

Step 11: Locate the Initial Position for Legs

This is an important procedure, the install procedure:

1. upload the "legs_init" code to Arduino to activate the servos

2. place the legs as the position shows the picture 1, and install the servo rocker arm with screws.

3. tighten all of the screw

legs_init source code:

Step 12: Organize the Wires

Then, organize the wires of the servos to make it great looking.

Now, all of hardware installation was finished.

Step 13: It Is Showtime!!

It is excited to go this step.

Let's upload the "spider_open_v1" code to Arduino to make it moves!

Please download and install the lib FlexiTimer2 first before do compile the code, http://playground.arduino.cc/Main/FlexiTimer2

you will see the action as following

1. stand up, wait 2 sec

2. step forward 5 steps, wait 2 sec

3. backward 5 steps, wait 2 sec

4. turn right, wait 2 sec

5. turn left, wait 2 sec

6. wave the hand,, wait 2 sec

7. shake the hand, wait 2 sec

8. sit down, wait 2 sec

9. back to 1

Enjoy!

PS. the spider_open_v3 is add an interesting movement of "body dancing"

spider_open_v1 source code:

Step 14: Do Something Special

you can add more special feature like change the move speed dynamically with remote control, that will let your robot more attractive.

Welcome to share the funny gaits or movement.

The remote control

https://www.instructables.com/id/DIY-Spider-Robot-P...

Here are some idea share with you in my blog.

http://regishsu.blogspot.tw/2015/09/robot-quadrupe...

or

Add the IR-detector to detect the obstacle.

http://regishsu.blogspot.tw/2015/08/robot-quadrupe...

or

handmade the PCB

http://regishsu.blogspot.tw/2015/09/robot-quadrupe...

http://regishsu.blogspot.tw/2015/09/robot-quadrupe...

Comments

author
shooter9988 made it!(author)2017-07-13

Hi, i have all the parts now and i am trying to get the code onto the arduino pro mini. i have bought the arduino usb 2 seria converter but it isnt working, how did you program it?

author
RegisHsu made it!(author)2017-07-13

TX(USB) -> RX(mini)

RX(USB) -> TX(mini)

GND(USB) -> GND(mini)

while you want to upload the sketch, do remember that push the reset button of mini.

by the way, google is a good friend....

author
JohnT4 made it!(author)2017-07-10

This is a great project Regis, Thank you so much for sharing..

May I ask you, how is the LI battery protected from overcharging without a dedicated circuit to protect it?

author
RegisHsu made it!(author)2017-07-10

The battery has its own charger when you buy it from the store.
This charger has charger-IC inside.

author
MahmoudS42 made it!(author)2017-07-07

Please , Can you upload sourcr code v1 again because it cannot open

author
JohnT4 made it!(author)2017-07-10

the ino file opens fine for me, just tried it now. Try it again after updating your arduino IDE and report back if you have any more problems?

author
TaiL10 made it!(author)2017-06-25

Hi, everyone
Can I use 12V/10A voltage source ? It's difficult to find 12V/3A voltage source.

Thanks you !!!

author
RegisHsu made it!(author)2017-06-25

it is good to use 12v/10a battery.
however, I am curious about this battery, can you show the picture?

author
TaiL10 made it!(author)2017-06-25

Below pictures. I think that DC-DC module's failed if output current of battery's 10A.

battery_1.jpgbattery_2.jpg
author
RegisHsu made it!(author)2017-06-25

it looks great and heavy...

author
DariusF4 made it!(author)2017-06-14

modified body

20170614_215641[1].jpg
author
LanceF12 made it!(author)2017-06-17

DariusF4, Can your share the modified body for Arduino uno?

How did you connect bluetooth?

thanks

author
DariusF4 made it!(author)2017-06-14

i managed to make in a much simpler way using an arduino uno and v5 shield

author
LanceF12 made it!(author)2017-06-08

Hi,

Thank you for sharing this project and supporting it. I am having a problem

inserting the servos into the slots because the servos fit perfectly in the

slots, but the wires that comes out of the side of the servo prevents it from

moving into the slot, see photo. Maybe I am doing something wrong? How

does everyone else do this?

Thank you

servo_wont_fit.jpg
author
RegisHsu made it!(author)2017-06-08

you can cut the edge as the picture 2 of step 8, that will easy to install the servos.

IMG_20150726_090712.jpg
author
LanceF12 made it!(author)2017-06-11

thank you,

I am reading:

http://regishsu.blogspot.tw/2015/07/robot-quadrupe...

but it is in Chinese and the Google translation to English is bad. There is a section on connecting the s-hold and applying some kind of lubricant I think, what is this lubricant? Also, I want to use an Arduino Uno with an Adafruit PWM/Servo Shield instead of the custom PCB board. I may need to make the body (body_d.stl, body_u.stl) slightly wider, will I need to change anything else to accomodate this?

author
RegisHsu made it!(author)2017-06-12

it is Silicone Paste and it can make the movement more smoothly.

you can do some modify the body more wider to fit your PCB board. However, you may change the stand position of source code if the robot move isn't stable.

author
GentarS made it!(author)2017-05-14

Hi teacher Regis.
The existence of this very project cleaner I can RegisHsu more teachers learn more.
I compiled this with each leg robot slowly and meticulously follow the step.

I still wanted to make the robot school.

But how come everytime I change the coding robots walk so messed up, that I was originally using a coding legs_init after that I change into a coding URspider_open_v1.ino foot robot so messed up and running is not perfect.

Maybe that's the problem I face please help and explanation

Thank you very much.

1494803153845-732773822.jpg
author
Alexander+heron+the+inventor made it!(author)2017-04-10

Almost done.i chose to use a powrbank with 2.1 ampere output(2 slots) and i attach 3 servo to each and it seems to work fine XD

1491830692158.jpg
author
VishalK57 made it!(author)2017-03-16

can you pls tell me how to calibrate the legs and which lines should i uncomment in the code

author
HariFun made it!(author)2017-03-20

Vishal, at the end of Step 11 there is a leg_init sketch. Just upload that before you mount the servo horns to match the picture on that step.

author
VishalK57 made it!(author)2017-04-07

U said to me and i did the same but my bot 3 legs work properly and 1 leg works wiredly what can i do pls give me suggestions

author
HariFun made it!(author)2017-04-07

I would double-check the servos for that leg. There is a diagram showing the servo numbers on step 10.

author
VishalK57 made it!(author)2017-04-07

Can u pls share ur simple schematic design

author
HariFun made it!(author)2017-03-20

Hi Regis! Thanks for sharing your awesome design!
It is AWESOME!!!

Thumb Raw 20170319_081828.jpg
author
U+NayH made it!(author)2017-02-26

should I need to use capacitors to avoid glitch of servo motion. In the picture of circuit diagrams, capacitors are used but you haven't say about the capacitors.

author
sethicusprime made it!(author)2017-02-23

Why did you take the leg calibration parts of code out?

It is impossible to have the servos be perfectly aligned and the legs perfectly straight.

How is this part done?

author
RegisHsu made it!(author)2017-02-23

actually the legs need a calibration function, however I didn't put it into the code because of this project isn't a commercial product. You can refer to original design here (https://www.sunfounder.com/robotic-drone/quadruped/crawling-quadruped-robot-kit.html) to put it back.

author
bratan made it!(author)2016-11-27

Fantastic project!!! Thanks for sharing all the details!

I've made my own laser cut quadruped robot and trying to adapt your code.

Only difference is that I'm using Adafruit's 16 channel controller board instead of arduino PWM pins. Your code mentions "adjustment" routines, but they are missing. Would you mind sharing those as well? :)

I got everything moving but because I'm wired different and have different frame, leg positions is incorrect (i.e. leg #4 is not doing mouch for some reason). I think I just need to calibrate it...
I wrote small function to emulate "servo" command with PWM controller:

void moveServo(char chan, float deg) {
int pulselength;
if ( (deg >= 0 ) && (deg <= 180 )) {
pulselength = map(deg, 0, 180, SERVOMIN, SERVOMAX);
pwm.setPWM(chan,0,pulselength);
} else Serial.println ("Invalid degree specified!");
}

File Nov 27, 09 52 35.jpeg
author
bratan made it!(author)2016-11-28

You can disregard my question. I just found original Soundfounder's code :) Looks like you removed parts of it, that's what confused me. There's also a nice guide explaining how code works.

author
tknight20 made it!(author)2017-02-17

Can you tell me the link to the code you found, i am also having a slight problem...

author
MuhammadY70 made it!(author)2016-09-09

HI Regishsu..

First I want to thank you for sharing this cool project.

Me and my son realy exited building this project.

I use Arduino Nano with expantion shield.

For power I use two 18650 battery. (from inside used laptop battery, to get cheap one).

But we stil have any problem. Everytime this robot walk or turn, it only take one or two step and than stop and restart itself. But when I hold it in the air and make it walk. It can walk a couples step and then it stop and restart it self (more step than when it on ground).

Is it a power matters ?

thanks

cupi

P_20160910_005507.jpg
author
NewtonO made it!(author)2017-02-12

Same here
I used atx power supply to make sure the current is sufficient. But the spider keep restarting.

author
colzilla090 made it!(author)2016-09-11

More thwn likely a power issue, double check for any shorts and if possible use a external supply to eliminate power issues 12v 2amp wall plug make sure center of plugs dc jack is positive thought.

author
NewtonO made it!(author)2017-02-11

Hello
Nice project you have.

I decided to make one, with arduino i made by myself (not uno or mini). When I uploaded legs init, it's still working perfectly, but when I uploaded demo sketch, the robot just stand-forward and repeat.

https://drive.google.com/file/d/0Bws6H47Gp4hZQ0FoaV8weXBXbmM/view?usp=drivesdk

Can anyone help me?
I guess its not power issue since I tried with battery and power supply (40A max)

author
awangtpr made it!(author)2017-02-02

here some upgrade comman you can download,

some improvements i make it using bluetooth module;-

-folding

-Head up

-Head down

-Body dance

-adjust high but cant walk

https://drive.google.com/open?id=0B6o0nhlQqriqT0Jv...

[d

author
RegisHsu made it!(author)2017-02-03

how about share the video?

author
awangtpr made it!(author)2017-02-04

this video for folding

20161004_184105.mp4
author
sethicusprime made it!(author)2017-01-12

Dear author, would you be able to print parts for me? Id be happy to pay! I cannot afford a printer and cant find someone to do it!

author
awangtpr made it!(author)2017-02-02
author
awangtpr made it!(author)2017-02-02
author
paperranger made it!(author)2016-12-29

this is auto? ^.^ i want to control it. can you tell me how to do that ?

author
Alexander+heron+the+inventor made it!(author)2016-12-19

hey dude,i found a battery online its the same brand as you recommend but im curious with the size,it always vary from one shop to another.

this is the closest spec i found:Size: Approx. 90*45*18mm (L*W*H)

author
paperranger made it!(author)2016-12-17

this code is wrong..can you fix it ?

author
RegisHsu made it!(author)2016-12-17

I don't know what are you talking about which code, however, the code is correct and all of people are made it already.

author
bwantha made it!(author)2016-12-16

thankz for you super

author
spc2199 made it!(author)2016-07-28

Hello,

Great tutorial, I am nearing the end of my spider.

I would like to add the infrared remote and IR detector.

I did look for these in github but was not able to find.

Would you be able to provide me with schematics and code for infrared remote and IR detector please?

Please send the schematics and code to the following email: spittingcobra9921@gmail.com

Also I would like some advice, I brought the DC 12300 but it was faulty, would you be able to recommend me an alternative and also if I choose not to buy a battery, will this robot work with AA batteries in series?

Sorry, for the long comment, waiting to hear from you.

Thankyou

author
freff made it!(author)2016-08-04

Hi

I have been struggling to get a suitable battery. In the mean time I put together a battery case to take 8 x AAA rechargeable batteries so I can carry out testing. It lasts about 10mins which is more than enough for the purpose. Hope this is helpful.

20160804_112725.jpg20160804_112755.jpg20160804_113550.jpg
author
HamzaB40 made it!(author)2016-11-25

is it on serial or paralle?

author
RegisHsu made it!(author)2016-07-31

You can use two 18650 (3.7v+3.7v=7.4v) instead of DC12300. However, you need to modify the part of body_d.

for the IR detector, my orignal code seems gone. here is a brief FYI.

the feedback pin is connected to Arduino A0(14).

void loop()

{

SCmd.readSerial();

if (!digitalRead(14))

{

step_back(1);

}

}

About This Instructable

137,977views

755favorites

License:

Bio: My Chinese name is 許英豪. My background is Electronic and software engineering. I have over 30 design experience years on the SmartPhone, Tablet and Digital ... More »
More by RegisHsu:How to Make a Complex Shape 3D Model by SketchUpHandy Power Supply[vPython] Spider Robot simulator
Add instructable to: