Introduction: Fenrir: an Open Source Dog Robot
Stationary Leg Movement
Rotation Transform
Walking Demo
The User Interface
Step 1: Download Section
Attachments
Step 2: Materials
Electronics
**1x Raspberry Pi 2 $37
*1x Raspberry pi Camera Module $25
1x Mini Maestro Pololu Servo Driver $30
1x Turnigy Receiver Pack 2300mAh 6.0v NiMH $16
12x HobbyKing™ HK15138 Standard Analog Servo $40
1x Anker Battery $15
Total Electronic Cost : $158
Mechanical
Printed Part $10
Phillips Head Tapping Screws $6 (Use to secure servo horn to printed parts)
1/2-Inch Button Socket Cap Screw (Find 30 screws and bolts similar to this size. No need to be the exact size. Use to secure the servo to the servo bracket)
Standoff (Find four piece around this size)
Total Mechanical Coast: $17
Total : $180
A note on the screws : You don't need to buy the listed types of screws specifically. Just get something similar to that size and it should be good enough.
* Optional part : Include these if you want more functionality.
** You can replace the Rapsberry Pi 2 with a Raspberry Pi 3. They cost the same !!! I use the Pi 2 because I already own it.
Step 3: Printed Part List
Here is a list of all the parts that need to be printed :
- 2x Spine
- 1x Spine Connector
- 2x Front
- 4x Socket
- 4x Twist
- 4x Femur
- 4x Femur_Back
- 4x Thight_Socket
- 4x Feet
- 2x Rod
- 3x Rod_2
- 1x Head
- 1x Tail
All of these parts are in the cad files that I posted in the download section. I would recommend to print the part as in order describe above, so that you can build the robot while the parts is being printed. All parts were printed with medium infill and low resolution setting on the M3D.
Step 4: Building the Body
The robot body consist of : 1 Spine Connector, 2 Spine, 4 servos.
- First, connect the Spines Connector to the first Spines piece. There should be holes that allow the two piece to click right in
- Then connect the the second Spine piece to the other side of the Spine Connector.
- Make sure everything is secure. Add superglue if you feel that is necessary.
- Finally, Put the four servo into the big opening on the Spine piece with servo head facing upward. Secure the servos with screws .
Grats, you have finish the first section of your robot. Time to put the leg socket on your robot.
Step 5: Building the Leg Socket
The Leg Socket is the the portion of the robot that connect the body to the leg, the front, and the back. The Leg Socket section contain : 4 Socket, 4 Twist, 4 servos, and 4 servos horn.
- First, attach the star shaped servo horn to the Socket piece using the Philip screw.
- Next, insert the recently attached servo horn into one of the four servos that is on the Body Section. Make sure that the maximum the servo can turn is flat horizontal as show in Picture 3.
- Then, attach the Twist piece on the other side of the Socket piece.
- Repeat this step until you have build 4 leg sockets as show in Picture 4.
Step 6: Attaching the Leg
The Leg section consist of : 4 Femur, 4 Femur_Back, 4 Thigh Socket, 4 Feet, 8 servo horn, 8 servo.
- Take 2 star shaped servo horns and attach them on the Femur as show in the Picture 1 and Picture 2. Remember that the screw head is on the side that do not show the servo horn. In addition, the connection between the servo horn and the servo is facing out.
- Next, put the a servo inside the Thigh Socket with the servo head facing the side that don't have an extruding cylinder. Look at Picture 3 for reference.
- If you look at the Femur , there is a longer side and shorter side. They are separate by a small dent. Put the longer side on the Leg Socket and shorter side on the Thigh Socket.
- Secure the servo horn on the servo with screws that come with the servo.
- Finally, attach the Femur_Back to the Leg Socket and Thigh Socket. Remember, long side on the Leg Socket and short side on the Thigh Socket. Secure the Femur_Back to the sockets with screw.If you are confuse, look at Picture 5 for reference.
Step 7: Adding Front and Back
Now we are going to add the front and back of the robot. The front is where the camera going to be place and the back is where the servo controller going to be secure. It can also be used for additional components in the future. This section consist of the following pieces : 1 Head, 1 Tail, 2 Front, 2 Rod, 1 Camera Module.
- First, attach the camera into the head.
- Next put the Front pieces on the 2 twist pieces as show in Picture 2 . Do the same for the other side.
- Take a Rod piece and insert it into the hole on the Front piece, keep pushing it until it reach the hole on the Spine piece. Secure the rod in place with superglue. Do the same for the other side.
- Place the Head piece on the side that you want to designate as the front and place Tail piece on the other side.
The robot is almost finish, we still need to add the foots and few more rod to secure the robot's frame.
Step 8: Final Touch
This section consist of adding the feet and make sure that the robot is strong and secure. The following pieces is required : 4 Feet , 3 Rod_2.
- Find some rubber piece and put on the base of the feet. You don't need to find a piece exactly like mine. Just make sure that the feet base have some kind of friction and not slipping around.
- Next, attach the feet piece into the leg piece. It should fit right in
- To make sure that the body of the robot is stable. Add three Rod_2 piece across the middle as show in Picture 3.
The frame of the the robot is finally done !!! Next we going to put on the electronics component that going to make the robot move.
Step 9: Putting on the Electronics
This part i will show you how to put all the electronics that needed on the robot in a neat and easy to maintain manner.
- Place the Standoff pieces on the four hole in the Spine Connector. Then place the Anker battery inside the space of the four Standoff as show in Picture 1.
- Next, place the Raspberry Pi 2 on to of the four Standoff. Use more Standoff or some screws to secure the Raspberry Pi in place. This will also make the Anker battery fight tight and should not slide around.
- Next, screw down the Mini-maestro on the tail as show in Picture 3.
- Finally, Put the Turnigy battery vertically under the body section of the robot. The 3 rod across the middle will prevent the Turnigy battery from falling out.
The construction of Fenrir is now 100% finish. Up next, I'm going to show you how to connect all electronics together and start loading in the code to make it move.
Step 10: Connecting Electrical Components Together
The electrical wiring and connection is fairly simple and straightforward. Every thing is plug-in ready so there is no need for any soldering tools.
- Connect the Pi Camera to the Raspberry Pi in the Camera port as show in Picture 1 and Picture 2.
- Connect all the servos to the Mini-Maestro, the ground pin is the outermost pin and the signal pin is the innermost pin a.k.a black facing out . Look at Picture 3 for pinout reference of the Mini-Maestro.
- Plug in the Turnigy 2300mAh Battery in to the Mini-Maestro. GND is the outer outlet and VCC is the inner outlet.
- Make the connection between the Raspberry Pi and Mini Maestro by using a USB to Micro-USB Cable
- Finally, use another USB to Micro-USB Cable (should come with the Anker Battery) to connect the Anker battery to the Raspberry Pi .
If everything was connect correctly, the raspberry pi and the Mini Maestro should light up to indicate that they are power and ready for use. For now , you can just turn off the power to the Mini Maestro band load up all the software onto the Pi first then power up the Mini Maestro again and test out the robot.
Step 11: Setting Up Raspberry Pi 2
Getting The Raspberry Pi 2 Ready
- First, you need to have a Micro SD card and load the Raspian Wheezy Operating System(OS) in to the card. Here is an Instructables that I used to install the OS.
- Once you have inserted the Micro SD card into the slot on the Raspberry Pi 2. You have 2 option to start using the Raspberry Pi 2.
- Option 1 :
- SSH into the Raspberry Pi 2. This option doesn't require a keyboard and a monitor, but you must have an Ethernet cables . Follow this guide on how to do this.
- Option 2 :
- Plug your Raspberry Pi 2 into a monitor and connect a keyboard into the Raspberry Pi 2 USB port.
- Started your Raspberry and enter pi for username and raspberry for password. Now you should have access to your Raspberry Pi
- Option 1 :
- Once you have access to the Raspberry Pi, you need to enable the wifi to get thing rolling. Enter :
- sudo nano /etc/network/interfaces
- Enter the following text into the space :
auto lo iface lo inet loopback iface eth0 inet dhcp allow-hotplug wlan0 auto wlan0 iface wlan0 inet dhcp wpa-ssid "ssid" wpa-psk "password"
- ssid is the name of your network. password is the password of your network
- press Ctrl+X to exit and save.
- Restart your Raspberry Pi and Wifi should be working.
- Type in : sudo apt-get update ( to update your system)
- If the update failed due to no connection. Try some other tutorial like SETTING WIFI UP VIA THE COMMAND LINE.
- If update was successful. Type in : sudo apt-get upgrade (this installed the new updated packet)
Step 12: Dowloading Node.js and Source Code
Do the following step. Note, all the bold text are command line.
- Getting Node.js . Type in the following command
- curl -sLS https://apt.adafruit.com/add | sudo bash
- sudo apt-get install node
- node -v ( check node version, make sure that it is 0.12)
- Next we going to get the necessary Node.js library. Type in these command in your Raspberry Pi 2
- npm install serialport
- npm install socket.io
- npm install winston
- npm install express
- cd node_module
- Now, we going to get the streaming software
- sudo apt-get update
- raspi-config
- Choose Enabled Camera. It is Option 5
- sudo apt-get install uv4l uv4l-raspicam
- sudo apt-get install uv4l-webrtc
uv4l --driver raspicam --auto-video_nr --width 640 --height 480 --encoding h264 --framerate 20 --vflip yes --hflip yes (command to run the streaming software. Type in http://raspberrypi:8080/stream on your browser to test if the stream is working )
- Loading the robot code from github.
- git clone https://github.com/HackHusky/Fenrir.git
- cd Fenrir
Now you should have everything that allow you to run the Fenrir software on Rapsberry Pi 2. To start the software do this :
- ./start.sh
Then put Raspberrypi.local:5000 on your browser to start control your robot.
Step 13: Servo Control
I am going to talk briefly about how to control the servo for testing and creating leg movement here in case you want to create your own movement algorithm . There two main ways to test out and model the servos movement before you fully implement it.
The first method to is to connect the Mini Maestro Servo Controller directly to the your computer and use the Maestro Control Center Software to create leg movement. This is the easier method out of the two.
The second method is control the servo via Node.js in the Rapsberry Pi 2. In essence, the Raspberry Pi 2 use a maestro library ( https://github.com/omcaree/node-pololumaestro.git) created by omcaree to communicate with the Mini Maestro Servo Controller. You must have all the necessary Node.js library that i mention in Getting the Raspberry Pi 2 Ready in order for this to work. Below is an example javascript code using Node.js to control the servo.
//Example code on how to user Node.js Mini Maestro Servo Controller library //This code move the servo back and forth indefinitely var PololuMaestro = require("node-pololumaestro");// needed to use servo library var maestro = new PololuMaestro("/dev/ttyACM0");// input your USB port name here maestro.on("ready", function() { //initiate communication with the Servo Controller console.log("connection made"); maestro.setSpeed(0, 100);// set servo at pin 0 to speed 100. }); var Delay = 500; // our delay timer var Multiplier = 0; //delay multiplier while(1==1){ //loop setTimeout(function(){ // simulate delay maestro.setTarget(0, 800);// move servo at pin 0 clockwise }, Delay*Multiplier);// will execute maestro.setTarget(0, 800); after 500 ms Multiplier++; // increment multiplier so next delay will be 1000ms setTimeout(function(){ maestro.setTarget(0,2300); // move servo at pin 0 counter clockwise }, Delay*Multiplier);//will execute maestro.setTarget(0, 2300); after 1000 ms Multiplier++;// increment multiplier again so next delay will be 1500ms }
What I usually do is simulate the leg movement in the computer first. This will give you a sequence of servo positions in microsecond. From there i look at all the number and see if i can com up with an algorithm to implement it in Node.js.
Step 14: Software Description
Wolf main software is similar to Husky , but with an upgraded User Interface(UI). In this section, I'm going to digress on some important files of the software. Wolf wireless control is design around using Wifi. Inside the robot software, there is a file called app.js. This is Wolf's webserver that uses your home Wifi and broadcast the signal throughout the entire network. After you started the robot and run the software, open up a browser and typed in raspberrypi.local:5000 and you should see a fully working UI with video streaming. The reason I use Wifi as opposed to Bluetooth or Radio Control(RC) control is because it had an easy way to integrate video streaming.
Folder Structure
The below diagram is a presentation of the files structure in the main software. The two important files in the software folder is the app.js and client.js . I will digress more on these two files in the next section.
Main Folder
app.js (server side )
start.sh (bash script to run node and camera progarm)
Public (web interfaces folder)
index.html
js (javascript folder for the web interface)
client.js (client side)
socket.io.js (websocket libary)
Servo.js
LIDAR.js
MPU9250.js
dist(resource for webpages)
build(boostrap file)
Step 15: Software: App.js
App.js is a local server written in javascript and it used websocket to communicate with other device through wifi.
The following code create an object to use function from within the socket.io library and then tell the app to listen to port 5000.
var app = require('http'); createServer(handler); io = require('socket.io').listen(app); url= require('url'); fs = require('fs'); app.listen(5000);
The next part of the code is simply forwarding the content in public through the wifi so that you can communicate with it via ip address.
// Http handler function function handler (req, res) { // Using URL to parse the requested URL var path = url.parse(req.url).pathname; // Managing the root route if (path == '/') { index = fs.readFile(__dirname+'/public/index.html', function(error,data) { if (error) { res.writeHead(500); return res.end("Error: unable to load index.html"); } res.writeHead(200,{'Content-Type': 'text/html'}); res.end(data); }); // Managing the route for the javascript files } else if( /\.(js)$/.test(path) ) { index = fs.readFile(__dirname+'/public'+path, function(error,data) { if (error) { res.writeHead(500); return res.end("Error: unable to load " + path); } res.writeHead(200,{'Content-Type': 'text/plain'}); res.end(data); }); } else { res.writeHead(404); res.end("Error: 404 - File not found."); } }
In addition we also put the code to control the servo inside app.js. First , you need to create an object for the mini-maestro library like socket.io.
var PololuMaestro = require("pololu-maestro"); var maestro = new PololuMaestro("/dev/ttyACM0");
Then you can use the function inside the mini-maestro library as follow.
// Initiate communication with the servo controller maestro.on("ready", function() { console.log("connection made");} //Set the speed of servo at pin 0 to 60 maestro.setSpeed(0, 60); // Set the angle ( you write in PWM value) at pin 0 maestro.setTarget(0, 1200); //Example function function LiftForward(){ maestro.setTarget(12, 600); }
Next we need to include a portion of code to call these function when we get the data from the communication side that they want to run a certain function.
// Check for signal being sent io.sockets.on('connection', function (socket) { //If signal is CR, then run CameraRight(); socket.on('LF', function(data) { console.log("LegForward"); LiftForward(); }); }
Step 16: Software: Client.js
client.js handle all the input that the user do in the web intertfaces and send it back to the app.js so it interpret those command and execute the proper function. Here is a simple example of the code that need to in client.js
//Check to see if the keyboard is press $(document).keypress(function(e){ //If the letter K was press, send the string LF back to the server if(e.keyCode == 107){ socket.emit('LF'); } }
There are a lot more in the client.js ,but all other command was just simply reuse the above template to interact with other keyboard stroke to send different command.

First Prize in the
Make it Move Contest 2016

Runner Up in the
3D Printing Contest 2016

First Prize in the
Robotics Contest 2016
38 Comments
Question 3 years ago
Can you please help me out in building the circuit diagram for my robo dog project....... I need a reference..... So can you please help me out of it by fenrir robo dog circuit
Answer 3 years ago
Hey there, let me know if you got this circuit diagram, i'd love to get a reference so i can get my dog working too,
thanks allot!
Cheers,
Brett
Question 3 years ago
Hey there, great project!
I have started going through all the software, to try to the get it to work on a newer Pi distro like Buster lite, i'm getting there and almost have it done, has anyone else got a newer/working copy of the software? this would help allot, i'm not a coder, but i've managed to get it almost working now i think... will build the actual robot over the next couple of days.
Iv'e also started to teach myself Webots and am trying to port the cad files into this, as i feel then the robot can be easily programmed and simulated and this would open up the project allot!
Let me know guys, i'm no pro though, just trying to get this puppy moving
Cheers,
Brett
3 years ago
Congrats! Instructables staff featured this project on our social media for #OpenSourceSaturday!
You can see the posts here:
https://twitter.com/instructables/status/116031756...
https://www.instagram.com/p/B1AMkxwj4OI/
We’d also like to send you a prize, so be sure to check your PMs. :)
5 years ago
hello you could make me have the correct connection of the servo on the mini-master card thank you very much
5 years ago
awesome project, but is it possible to make the walking more fluid/lifelike. I also noticed that the orientation of the knee joints is opposite of some of the other robot dogs for example Boston dynamics spot mini. is this intentional, does it have advantages
5 years ago
Building now; GREAT project!
Printer files for spine pieces do not seem to have servo mounting screw holes.
Is this intentional?
6 years ago
Can you link me a good tutorial about using the raspy?im not used to use the pi.
6 years ago
well done.You succesfully beaten DARPA
6 years ago
Very DARPA-like. Nice work!
6 years ago
Awesome project! Voted for you in the contest, good luck! :-)
6 years ago
This is awesome. A couple friends and I are actually trying to build a robot dog ourselves. This gives us a lot of inspiration. Thanks!
7 years ago
looks like darpas pet,call it darpa
7 years ago
Congrats on being a finalist!!
Reply 7 years ago
Thanks
Reply 7 years ago
Yeah! This is very cool.
7 years ago
Hello Sir,
Can you pls explain how you have placed the Raspberry pi in Solidworks... Also, Please provide the torrent link from where i could download the Solidworks or other 3D software which you have used to create the Model.
Reply 7 years ago
In Solidworks, I used the mate feature to attached the Raspberry Pi bottom surface top surface of the Spine Connector.All the files is in the Download Section or do u want a torrent link specifically ?
7 years ago
isn't fenrir the name of a werewolf in harry potter?
Reply 7 years ago
It's a wolf, son of Loki in Norse mythology.