Today the Lantronix WiPort wifi module on the Dynamixel Robotics Controller board was successfully tested!

Initially I had quite a time getting the wifi module going - mainly due to confusion regarding the two serial ports (3.3V logic level) the WiPort provides. On the controller board I had designed port 0 to run directly into the main AtMega2560 micro, and the secondary port 1 to run through a RS232 level converter IC and to a DB9 serial connector on board. This port was intended to be used as a serial configuration port only, a means to initially configure the wifi module, and to act as a fall back connection for fault diagnosis if the wifi link was not working for any reason.

Unfortunately the Lantronix documentation for the module, although it mentions both serial ports, doesn't really draw any distinction between the operation of them - as I read the documents, either port could support their serial configuration console.

So, when I fired up the board and tried to enter the 'xxx' required to drop the module into console mode from the DB9 connector - nothing. I went through all sorts of debugging steps because I didn't know whether module, my pcb or the RS232 level converter circuitry was at fault, all to no avail. I did think that perhaps the serial configuration console feature was only available through port 0 (which is connected to my Atmel micro, which currently has no firmware in it to speak of...), however this was harder to test.

I resolved to write some firmware to just pass through a connection from the FTDI USB chip on board to the WiPort module transparently. This way I could use hyperterminal to talk to Port 0 of the WiPort as if I was connected directly to it. I then ran into more difficulties - the USB port was not working - not even getting recognised on the PC at all!

Eventually I found an incorrectly loaded resistor (wrong value...) in the USB circuitry that was preventing the FTDI chip from functioning correctly. Once that was fixed, the USB sprang into life, and I could open Hyperterminal connected to com4 (assigned to the USB serial). Wrote some quick firmware for the transparent link from USB to the WiPort - basically any characters received from either port are passed across to the other. Turned it all on, entered the 'xxx' to jump to the WiPort console, and voila! Success. I could access the menu setting up all the parameters in the WiPort. Next came some rapid learning about AdHoc and Infrastructure modes in wifi networks. I had initially wanted to use an adhoc connection between my laptop and the robotics controller so the whole setup would be portable outside my house, however I couldn't get this to coexist with the infrastructure mode I use at home with my wireless router. Basically I would have to reconfigure my laptop wifi everytime I wanted to use the robot... not very satisfactory. So I ended up just configuring it to use the home network router, which I suppose I will have to take with me if I want to demonstrate the robot elsewhere.

Now I had the WiFi module basically going, I thought of the next test... Since I had firmware in the Atmel to pass through comms from USB<-->WiPort I could telnet from my notebook using hyperterminal to the WiPort Port 0, which would get passed through to usb, which I had open again in hyperterminal on the laptop. This worked! I effectively had an elaborate loopback between hyperterminal windows, and could type in either window and see the results in the other. I then wanted to see whether the WiPort would support simultaneous connections to Port 1 at the same time as port 0, so hooked up a serial cable from the laptop to the DB9 connector on the board, another hyperterminal on com1, and a fourth hyperterminal window telneting to the WiPort Port1. Amazingly, all this worked as well! The image above has this crazy scheme illustrated, two simultaneous telnet sessions, one looped back through an FTDI usb serial connection, the other looped back through the DB9 connector onboard the controller to the laptop com1 serial port!

So now I have tested some large slabs of the Dynamixel Controller, it is time to get it to actually do something halfway useful. I think the next step is to write firmware to link to the Robotis Dynamixel AX-12+ servo network, and then get some software on the laptop to move a servo over the wifi (or even the usb) link. When that happens I am sure I will have to post an blog entry (even though others may not be as excited about the event as I am...).

The last of the parts have been loaded onto the Dynamixel Controller board now, and suddenly the Quadruped4 robot design takes one more step closer to realisation.

Here is an image of the loaded board, with the various main functions described;

The first power on for the board required me to hold my breath a bit, some of the parts are quite expensive (and I don't have spares) so any smoke could have been disasterous...

The WiFi module (a Lantronix WiPort) is able to be removed from its PCB connector, and I haven't soldered in the tabs, so I removed this expensive module in order to check that the 3.3V rail was ok first. The board draw no current to begin with, which is ok since the soft power on/off circuitry would be off unless the push button is held down. Once the micros are programmed with firmware, the system will latch power on after the button is pressed so the button can be released, but for the time being you have to hold the button down. Holding the on button down, the circuit drew only a small amount of current which is a good sign! I checked the two power rails, 5V and 3.3V were both ok. Next trick was to use the two ISP (in system programming) connectors and AVR studio to read and write the fuse bits of the AVR AtMega128 and the AtMega2560 on board. I was able to talk to the AtMega2560 ok, but the AtMega128 was unresponsive. A short time later I discovered the first pcb error... not too bad, cutting two tracks and two small wire mods later I was able to communicate with the AtMega 128 processor.

Once I was sure I wasn't going to blow anything up, I powered up the system with the WiFi module on board as well. The wifi activity led flashes a few times as the module boots up, then the current draw (at the 12V supply to the board) goes up to a significant 300mA or so. I haven't yet tried to configure the module with the RS232 config port yet, so that might be the next step.

I have a lot of firmware already written for an earlier board (the PWM Servo Robotics Controller, see description on the Earlier Work page), so hopefully it won't take to long to cobble together a basic framework from that earlier code to allow me to test the various communications options into the board, such as the USB connection and the WiFi link. I hope the next post here will be able to report that the WiFi link is functional! Following that the real work of designing a suitable protocol and writing code to buffer the serial streams to/from the servo networks and the serial cameras etc. will begin, before the more exciting step of plugging in actual servos, and getting real robot hardware to move!