Hi guys! Here's a spider robot that we had made for the 2016 science fair which was held at our school. Well, you can't technically call it a "spider robot" as spiders have 8 legs, but we atleast tried to make it look like a spider (or maybe spider like) . Our robot has four legs, so the correct term would be a quadruped. Well guys say hello to "Quattro", a non lethal, arduino quadruped!
Here is an instructable on how we made her, taking you through the building process, getting to the programming and finally admiring the robot come to life once its finally done :) . Watch the video to get an idea of what it will finally look like, the problems we encountered and how we solved it and improved it.
Before going to the next step please note that a laser cutter has been used in the making of this robot. A laser cutter can be avoided if you are very skillful with your hands, as precision is key to completing the project!
PLEASE VOTE FOR US IN THE CONTESTS, AND FOLLOW US ON YOUTUBE AND INSTRUCTABLES!
thanks for your support.
Step 1: How It Works?
The robot has 4 legs, with 3 servo motors in each leg, which give the legs a freedom of three degrees. We use a simple gait to get the robot to walk which is known as the creep gait .
We used a creep gait as its one of the simplest, slowest and yet smoothest of all gaits. At first we just get the robot to walk forward, back, left, and right and then we add cooler features such as obstacle avoiding and Bluetooth control to take it to the next level.
Step 2: Parts Needed...
- 2 mm thick clear acrylic
Bare minimum electronics:
- 12 servo motors (quite a lot )
- arduino nano (any other will do as well)
- a servo shield will surely help (we made one ourselves with some pcb and pin-headers, will explain the process of building the shield in a later step)
- a power supply (5v at 4a will work great, that's what worked for us) we used a simple wall adapter
- ultrasonic sensor (for obstacle avoiding)
- hc 05 bluetooth module (for smartphone control)
For the shield:
- pcb (preferably the ones with common lines for ground and power)
- female headers
- male headers
- laser cutter (or skilled hands)
- hot glue
Step 3: Laser Cutting the Parts
Using a graphic design software (inkscape, link to this free software below) we designed the parts we would need to make the robot's legs and body.
Then we took the design to a nearby workshop to get the parts laser cut. Attachment below for the designs. After laser cutting be sure to have 30 individual pieces.
Link to download inkscape: link to download inkscape
Step 4: Assembling Quattro
The first thing you need to do after laser cutting is actually the hardest and most time taking thing to do: peeling the paper covering off the acrylic, painfully one by one. At this point I would advise you to catch a friend and ask him/her to help you out. My mom helped me here.
Next assemble the legs. The slots are already made and all you have to do is fit them together. The joints are tight but just for safety you could put a drop of superglue or acrylic glue to really join them together.
To be able to proceed to the next step you need to modify your motors a bit. Glue a bolt symmetrically opposite to the motor's shaft. This gives your motor a dual axis pivot, which helps in making the robot more stable (have a look at the picture above).
Please note you need to do this with just 8 motors, as four will be attached directly to the body.
Next attach the servo motors!Finally attach the legs to the center link joint (the curved piece) and attach the link to the servo on the body (keep referring to the picture on top as the servo orientation will make a difference).
Step 5: Making the Shield
To make the shield for all the servo connections you'll need:
- some pcb(preferably the ones with common lines for ground and power)
- female headers (30 no.)
- male headers (36 no.)
- some wire
Making the board is quite straightforward follow the picture above to make your shield. Or you could just buy one...
We will be making a separate instructables to show you how its made in detail, please share any doubts or questions in the comments section down below
Step 6: Electronics
Now its time to attach all the servo pins onto the arduino. Connecting them using jumper cables would be really messy and confusing, so use the diy shield, which we made in the previous step . The servo wires need to be connected in the right sequence, this is key to make it work!
Carefully follow the picture.
Step 7: Programming
Now this is the time when your robot comes alive. First upload the legs_init program and make sure the robot is at a position similar to the first picture above. Next upload the quattro_test.ino to check whether your robot is managing to do the basic movements such as walking forward, back, left and right.
IMPORTANT: You need to add an extra library to your arduino IDE now. Link to this library below :
If you don't know how to install libraries to your arduino ide here is a good tutorial on how to do so:
Now she should go forward 5 steps, back 5 steps, turn left 90 degrees then turn right 90 degrees. If she's doing everything right you're on the right track. If not, there might be several reasons it's not working out, explaining all of them here wouldn't make sense, so i'd suggest you drop a comment down below mentioning your problem.
P.S: put a cup as a stand to start with so that Quattro doesn't go all over the place. Once tested and working fine, you could proceed to leave her on the ground.
Step 8: Inverse Kinematics
Inverse kinematics is what's actually driving her. ( if you are not interested in the math behind this project and you are hurrying to finish this project you could actually skip this step, but knowing what's happening "behind the robot" is always helpful.)
In simple words inverse kinematics, for short ik, is a bunch of trigonometric equations that determine the position of the tip of the leg, the angle of each motor, and other values when given a couple of presets that you need to determine. For example, the length of each step that you want your robot to take and the height at which you want your robots body to be at. Using this pre-determined (data) it will derive how much it should move each servo to be able to manage to perform the given task.
The picture above shows the trigonometric equations, developed by a friend of ours in the college, Suman Pal ,who then transferred the mathematics into a program.
The code attached bellow is just the raw formulas that you could fiddle around with to experiment upon, improve and try out better methods.
Step 9: Getting Fancy
Once you see that your robot is managing all the basic movements, you can start to make it fancy. We decided to add an ultrasonic sensor so that it can avoid obstacles on its way. You can also try Bluetooth control or voice control. To do the movements you need to just call a function.
The following list says what function you need to call for what movement :
- to move forward - step_forward()
- to move backward - step_back()
- to turn left - turn_left()
- to turn right - turn_right()
- to stand - stand()
- to sit - sit()
In the brackets you can put an integer value to define the number of steps that you want the robot to move by.
With this added feature Quattro will never touch anything if left in a room. Almost as though she has a mind of her own! Please do share if you add any other interesting features...
Step 10: QUATTRO IS COMPLETE!
And there you have it your very own robot companion! This project gave us a lot of experience and we developed several skills. We would encourage you to make one as its easy to make yet very impressive. The future looks towards robotics and we with quattro have taken our first steps!
We hope you enjoyed this instructables, do leave a comment below!
lastly, we would be grateful if you could vote for quattro in the contest and subscribe to our channel both on instructables and youtube. Thank you for your support!