Scott's Bots

Lego Cam


Hardware

I have gone through a few different designs in constructing a robotic camera mount:

MARK I: This was my first attempt. I used my 3Com USB webcam, and built an assembly around it. I used the Lego Mindstorms RIS 1.0, the Ultimate Accessory Kit and an additional rotational sensor. The mount consisted of a complex gearing system for the pan and tilt functions. I revised this model several times, adding additional cross beams for support as it was prone to break. I found that strain produced by the USB cable would cause the unit to bend, and sometimes break.

MARK II: After purchasing the Vision Command set, I constructed a new mount. Basically, the main camera system is the "power stand" as shown in the Vision Command constructopedia. The back has been modified to allow the addition of both rotational sensors in order to provide better control over camera positioning. I also constructed a custom "cam rack" fixed to the RCX in order to attach the "power stand" to it. The Lego Cam was much lighter, but what I gained in ease of assembly and durability, I lost in image quality. I found that the strain of the USB cable still caused the unit to bend, though it didn't have the breakage problem.

MARK III: After purchasing the Robo Sports set, I constructed a new mount using elements from the first two attempts. I went back to the 3Com USB camera. I constructed a more durable base, as well as used a simpler, more powerful gearing system. One motor is used to control camera pan and the other for tilt. Both motors use a worm gear and 24 tooth gear. In addition, each worm gear is turned by a belt drive in order to protect the gears from breaking. The end result yields a slow moving pan and tilt assembly which has more power to move the motors, Lego frame and camera.

Software

I had several issues to deal with in figuring out how to program the LEGO RCX brick, as well as make it controllable via a web interface. I decided to use the NQC software to program the brick. It basically accepts a simple IR command and runs the appropriate program and task. Each task activates the appropriate motor in the desired direction.

To make the device controllable via the web, I decided to write a visual basic program called WebRCX. This program runs on my Windows XP pc. The program basically listens on a specific port of the controlling computer for an appropriate query. If a valid query is sent, it will send that message via the IR tower to the LEGO RCX brick.

As I do not have statically assigned IP numbers from my ISP, I had to contend with the issue of how to allow remote users to access my home equipment. My ISP allows the use of dynamic html (a.k.a. shtml). This allows me to create a static page on the web server (who's address is fixed) and include a file at the appropriate spots with the current IP address.

WebRCX also determines what IP address to use and provides an option to ftp this data in a file to the server. The end result is that after I ftp my current IP address to the server, it is automatically inserted into the appropriate webpage when viewed.

On the web server, I use a combination of shtml, java and javascript to handle streaming the video as well as send messages to control the RCX. On my pc, I use Inetcam's iVISTA software to stream the image.

I make no guarantee's as to the stability of this software with your system. While it should work with most current web browsers, it may or may not work with older ones. You have been warned!