Week 14. Networking and communications

Goal

The mission this week is to build a wired or wireless network with at least two nodes.

Last week MIT lecture review

I saw pretty nice projects last week in the assignments review. I especially remember Pablo's speaker project. I would love to do something like this with piezos for my final project.

Well last week I thought that I had seen everything but then networking appeared, which is something wonderful. You can simplify a complex circuit by dividing it into basic ones and making the processors talk to each other. This suits to a tee for my final project since I will have several subsystems.

Wired network. Hardware

What I made for this assignment (several weeks after it was due) is a wired network of 6 nodes for my final project based on Neil's boards. My final project is a 4 degrees of freedom robotic arm controlled in real time with serial commands and is composed of 4 stepper boards and a RGB LED.

The nodes

Node 1. The bridge

The first node of the network is the bridge board. The bridge interfaces the computer with the rest of the nodes. Truth be told, this node is optional. You can add the FTDI connector to any of the nodes. But I milled Neil's bridge board because I like the modularity of the solution. This helped me later when I broke some boards and I could continue working with the rest of the nodes. I did not made any modification to Neil's board. Here is .cad code for kokopelli 0.05.

Nodes 2,3,4 and 5. Stepper nodes

The second, third, fourth and fifth nodes are modified Neil's bipolar stepper boards. Two of the free pins are used for the serial bus and an LED is attached to a third unused pin. I found the LED of great utility because it helped me a lot when debugging. I also soldered a 20 Mhz clock to the board because at the beginning I wanted to precisely control time in the steppers. Here is .cad code for kokopelli 0.05.

Node 6. RGB LED

The last node is the RGB board. Actually it is a bus node modified to have an RGB LED instead of the green one. Here is .cad code for kokopelli 0.05.

Wired network. Software

Here it comes what has been the hardest and the most rewarding part for me: Programming the boards to work. It has been an uphill struggle. Most of the time I thought I wasn't going to make it, but thanks to the fab academy mailing list, I asked for help and a couple of great guys (Maurice Op de Beek and Chris Carter) gave me very useful hints in order to have the system working.

How the system works

The network is a real time virtual control, so my computer (virtual control) is connected to the nodes and sends characters over the serial bus in real time. Every node of the network is listening to the serial line. If the correct character is received, the board executes an instruction.

Node 1. The bridge

I did a little modification to the software of this board. What the C program does is flashing the LED every time a character is sent though the serial bus. Code here: C and makefile.

Nodes 2,3,4 and 5. Stepper boards

Each of these boards are listening and waiting to receive any of 2 specific characters. One is for making a step clockwise, and the other is for making a step counterclockwise. What I am going to say now is not very scientific, but what I did is grabbing the hello.bipolar.stepper.c and the hello.bus.node.c and just mixed them. And then with some minor debugging it worked. Here is the final C code and makefile.

Node 6. RGB LED

This board is also listening for 4 specific characters for turning on the Red, Green and Blue LEDS and for turning all of them off. Here is the C code and makefile.

The computer side

In the computer side the serial commands (characters) can be sent sent using the Arduino IDE serial monitor or a terminal emulator.

The result

Here you can see what happens in full manual mode. As I press keystrokes (sending characters though the serial connection), the boards respond accordingly. Here's footage:


What I learned

Networking. The whole is greater than the sum of its parts (Aristotle, Methaphysica). A multiprocessing system is better than having a single powerful processor. I know this very well because we are four brothers in my family, and no matter what prank anyone in the neighbor could imagine, when we were kids we always beat that with our four little brains working together in parallel processing. And it happens the same with Fablabs, it is not the machines, or the processes, the most powerful feature of a Fablab is the network of Fablabs.