Skip to main content

Software Developers Experience building a robot Part 1(Legs)

Introduction

This will be part one in a series where I ( A software developer ) share my experiences in an attempt to build a fully wireless robot. This series will be targeted at other software developers wanting to do the same , who can hopefully learn from my mistakes , and electronics engineers who would like a good laugh.

The software:
As this is aimed at software people we will start by talking about the software, before delving into the unknown and getting electrocuted. Before I even started buying parts, I had decided to go with the following "stack":
  • Raspberry Pi with wifi dongle
  • Arduino microcontroller
  • Firmata
  • Johnny-five

As you can tell from the need for johnny-five this is indeed a JavaScript robot. The Idea is to run the JS on the Pi and have it control the Arduino and in turn control the robot.

One thing to note on this is that the Pi's default package manager does not load the latest version of node.js so you are going to have to compile a newer version if you want it. As the hardware isn't as beefy as what you are used to compiling node on , it can come as a lovely 3 hour surprise. If you are going to watch this baby compile you are going to sit for a long time so rather leave it in a safe place and go watch your favourite LOTR movie.



Compiling node on a Raspberry Pi is exactly like this gif posted by +Max Ogden  on nodejsreactions.


Going kit-less 

I started my bot making small purchases of parts I thought would be "roboty". My first robot was merely a breadboard and +Arduino taped to 4 servos , making a knee-less quadruped. The thing took ages to move and with no knees the weight of the USB cable seemed to be the only thing that gave it a sense of direction, slipping as it slowly walked.


It had become quickly apparent that this thing needed some knees, so I obtained 4 more servos and clobbered them together at the horns. I had to upgrade to using a Mega instead of an UNO in order to acquire more PWM pins, I also needed a larger platform. I opted to use just a larger breadboard and still use the built in two sided tape to attach the servos. This iteration of my robot started to show the early signs of my two biggest problems later on:

  1. Weight
  2. Power
With 8 servos running , the project was drawing way too much power for the single USB to handle. A second power source was needed; this was overcome using a 9v power cable during debugging and a 9v battery(also taped to the bottom) during operation, to keep it to only one cable for less restrictive movement.



There was also way to much force on the 2 sided tape joins and legs would often fall off under the weight of the bot. I decided that I needed a proper structure to support the robot.

I settled on a design of layering prototype boards as I thought I would also need to solder on some custom circuitry later on. I bolted on some plastic brackets I picked up from a local hardware store to make it easy to mount the servos and in the end I had pretty much the same thing I had to begin with but on a much sturdier platform.

This new design also provided some modularity. Because I had attached different parts to the different boards , it allowed me to make modifications to a single layer without affecting the the way the whole robot was designed. This became very handy later on and I still use some of the parts from this bot in a completely different design because of that modularity.


Now that the bot wasn't losing legs I decided to tackle the problem of the USB Cable. I wanted my robot to be wireless, and I also wanted it to be smarter than the typical Arduino bot, I wanted my JavaScript running on my robot.

My solution was to mount a Raspberry-Pi on the bot , I also went for a more servo oriented micro-controller to make it as easy as plug n play when attaching servos, It didn't hurt that the spider controller also fits perfectly above the Raspberry-Pi on its copper standoffs.


This was the point when both weight and power haunted me , too much of one and too little of the other. When the bot powered down, it immediately collapsed under its own weight. This also meant that the servos had to keep fighting gravity and that needed power. The Pi was also a power hungry little beast that rebooted every time too many servos moved, even 2 LiPo batteries were no match for this power sucking beast. This iteration was going nowhere, it was time for a radical change.

At the end of the day, I decided that legs use way too many power hungry servos and that I never wanted weight to be a problem again.

It was then that I put my experimentations with limbs to an end and decided on something simple , yet extremely effective... Tank Treads!


Popular posts from this blog

Running Node.js alongside IIS on Windows

Most of the time when you are looking for a way to run Node.js as a production server on Windows you will just run into IISNode , now IISNode is a great thing ,but I'm a fan of choice and most importantly , not a fan of XML web config files.

I wanted to run my node server on what ever port I wished,or maybe even a different server and just have IIS reroute the traffic from a particular URL to the node process(so a proxy), this allows you to still manage your own load balancing and possibly scale up from that point without having to bother with IIS again.

So first things first you will want to download and install the URL Rewrite and ARR modules for IIS

ARR (Application Request Routing)URL Rewrite Once thats done lets crack open IIS and open up Application Request Routing, then navigate to Server Proxy Settings and Check Enable Proxy and Apply.







Now lets create an an application on our Default Website that will link our url to the node process, here im directing it to an empty direc…

Half-Life 2 for OSX , how well does it run?

Earlier this week Valve advertised Half-Life 2 for the Mac with the best advert I have ever seen. They took the old 1984 Mac advert and re-created it using the source engine and characters from the game. As if the awesome(albeit 35 second) entertainment wasn't enough they offered the game at $3.40 for a limited period. It was not shortly afterwards that I made my first ever purchase on Steam(its kind of strange buying a game and not getting a box with it).




The game purchase actually allows you to download the OSX or Windows version of the game , depending on the platform you are logged in to .This is great , because I have a PC with some decent gaming power and my Mac Mini (which I naturally wanted to test on) and wow ,the OSX version runs pretty darn well,especially considering that my mac mini is running only an intel HD3000.



Performance
I was surprised how well the game performed on high settings , the gameplay was smooth with the default high settings , reaching frame-rates up …

Controlling an LED on an Arduino over HTTP

Prerequisites
You will need node.js and npm installed , and should have at least some knowledge when it comes to node, if you do not , I suggest you try some example code in node before diving into controlling hardware with it. You must have the Arduino IDE installed on your machineYou must know how to get an LED working on pin 13 of an Arduino
Set up the Arduino
Wire up an LED to the Arduino on pin 13 and plug it into your development machine. Now we need to get it ready to talk to johnny-five. To do this simply follow the instructions under johnny-five's readme
Set up the project 

Create a folder on your development machine for the project , in this folder create the server.js and index.html files. Copy the code from the files in this gist to the respective files.

Loading ....
We aren't done yet , we need johnny-five and the narf for this to work. In your project directory run the following command:

npm install narf johnny-five

If that succeeded we now have the johnny-five libra…