KiwiDrive HouseBot

From Forskningsavdelningen Wiki
Jump to: navigation, search


[2011-11-15] Update: the robot is now online and we did the first test-run over the internet just two days ago. The battery solution is not completed though so the robot is still tethered. This is now the only reason why we cannot allow public access to the robot at this time. Other minor things: SPI interface is glitchy, needs replacement cables and controller. Need to construct SPI board for battery measurements, ambient light detection and headlights control. Needed when Fabriken is dark at night.

[2011-10-12] Update: we now have an internet connection but we are lazy. Getting there though! Battery and charging is a problem. Also, turns out my camera didn't get stolen. I was drunk and hid it under the drivers seat of my sweethearts car. Oops. On an unrelated note my eeepc netbook DID get stolen. It was sharing internet at STPLN. Thanks mr. someone for showing me that being nice and providing free WiFi access for y'all is something I should never do. I'm sure that piece of crap computer will give you heaps of joy at the expense of everyone that was relying on it in Fabriken.

[2011-07-05] New section, quick update: this project is NOT dead. The robot IS working. It CAN be controlled over the Internet. The user queueing system IS in place. All IS well. BUT - we don't have an internet connection because the the fibre installation was delayed... significantly. Once that is up, motivation WILL return. We are also waiting for awesome 8Ah batteries after which we will build a docking (or rather loading/unloading/charger) station. THEN my good friends, you will be driving this 'lil guy around (for 5 minutes at a time). Also, my camera got stolen - hence the lack of pictures.


  • STG (Design, most parts, construction, streaming server/client)
  • Linde (Motion code, construction)
  • Jimbo (Motors, construction)
  • Phrst (Drivers, wlan, construction, cross-platform compatibility)
  • Omni (Linux system setup, construction)
  • Moza (Helping hands, laser cutting)
  • tilljoel (Web-based video streaming)
  • qzio (Master of Interwebs)
  • Quinn (Helping hands)
  • JonasB (Helping hands)
  • virtuald (Helping hands)


  • Olleolleolle (Second build of system, update: perhaps not?)
  • mansadler, stg (KiwiRay GameBot system)


As we move to a new location, what better way to celebrate/mourn than to take on a new project?

We're building a housebot!

Once the project began design stage we realized that focusing on making it easy for others to reproduce was a good idea. Therefore we choose to use nothing but standard components. Nema 23 stepper motors and drivers are standard, cheap and common due to the increase in DIY CNC and Reprap manufacturing. The Arduino Uno is available across the world. We also only use metric standard components (sorry about that US) such as M5 threaded rods and M4, M3 screws for the smaller components.

Omnidirection wheels however are not exactly standard components, but given the simplicity of the drive mechanism it would be very easy to adapt the design for other wheels and shafts of a similar size. We have also made sure it is easy to re-design the drawings to account for other types of motors and bearings and we've left significant space (length-wise) for larger motors and gearboxes.

Although we did run into a few bumps during the first build (all of which have been solved) I believe we have managed to prove that this project can very well be completed over a dedicated weekend, given that parts have been pre-purchased.

As soon as the first trial build KiwiRay1 is completed, all plans and code will go open source, so check back here until then!

Let's go online![edit]


One of the main objectives from the start is wa make the robot publically available on the internet. This means that anyone will eventually be able to log onto the robot and control it by remote. This required some specialized software and after surfing the interwaves for a good while we realized that to be able to do what we want, with the latency we need, we would have to go for technologies simalar to those used in gaming as opposed to traditional streaming technologies. In fact, some of the methods we use are similar to the dark magic that recently begun to allow players to play high-resolution games being run on a remote server instead of the local machine - although we do it on a much, much smaller scale.

After reading the "Diary Of An x264 Developer" article on "The best low-latency video streaming platform in the world" we started implementing a streaming/control server using the x264 library and settings discussed in this article. To enable very low latency streaming, several x264 technologies needed to be implemented:

  • Slice-based threading - allows multithreaded encoding of a single frame without any frame buffering. The normal threading model introduces one frame of latency per thread.
  • Single-frame VBV support - allows us to cap the size of each outgoing packet (frame) to a specific size. Artifacts introduced by capping are corrected in subsequent frames. Capping I-frames like this would destroy the stream, but...
  • Periodic Intra-Refresh - removes all I-frames in favour of refreshing only small portions of the frame by means of sliding a "refresh-column" across the image in periodic intervals.
RoboCortex Client screenshot. Wired power supply, reflection showing KiwiRay "headlights"

These technologies, in combination with lossy UDP datagram communications, allows us to fetch an image, encode it, receive it on the other end and finally decode it without any latency other than the CPU time required for the process and the network latency, both of which we can't really do anything about. In practice we get below 100mS on a good connection, most of which is internal latency in the webcam we are using (read: better webcam, lower latency).

On the receiving end we use FFMPEG H.264 decoding to produce the final image, which is rendered by SDL.

The streaming solution was dubbed RoboCortex and is today completely abstracted from KiwiRay and our choice of communications. KiwiRay and IPv4 UDP is implemented under RoboCortex using plugins.

This means that RoboCortex can now be easily adapted for any kind of video feedback remote control applications such as omnidirectional robots, cars, helicopters, etc. provided they are capable of encoding and transferring video at the desired bitrate and resolution. A variety of multi-user multi-protocol implementations, as well as single-user direct connections can be easily developed using the new plugin interface.

RoboCortex is open-source and cross-platform for Windows and Linux.

Source code[edit]

  • RoboCortex
    RoboCortex is slowly developing into a generalised robot control application, and now has a plugin system that abstracts KiwiRay from RoboCortex.
    The repository also contains the kiwi-drive + I²C expansion bus sketch for the Arduino (Uno), used on the KiwiRay.

Project status[edit]

Project is currently in deployment stage (we are waiting for a stable internet connection)

Coverage (videos, pictures, articles)[edit]


Current Designs[edit]

This is the kiwiray platform - a NEMA23 kiwidrive designed by Forskningsavdelningen to be printed in any 4mm material using laser, water, plasma, cnc-routing or lots of patience and manual labor. It will be the base for our KiwiRay1 house-bot and it has mounts for a charging dock+webcam(+gripper?) module as well as a top platform that (in our case) will house the brains - a micro itx pc. It is powered by three NEMA23 motors and the electronics consist of three general purpose stepper drivers, and an Arduino Uno to coordinate motion and provide an I²C-based expansion bus.

Kiwiray alpha5.jpg
Alpha Five
To get an idea what it will look like fully loaded.
Used for KiwiRay Beta One - our first build.

Alpha Seven
Uses laser-cut snap-lock parts to replace many components.
Axles moved down for better ground clearance.
Note: tried it (plexi&wood) - no good. Requires mechanically tolerant materials.

Parts (Alpha Five)[edit]

Kiwidrive platform parts[edit]
Front module parts[edit]
  • 1x TowerPro SG90 servo
  • 1x Any orb-style webcam
  • 2x M2 8mm screws
  • 2x M2 nuts
  • 4x M4 16mm screws
  • 4x M4 nuts
Shared parts[edit]
  • 1x Plexiglass parts kit
  • 4m M5 threaded rod, cut as follows:
    • 12x 86mm
    • 12x 76mm
    • 12x 96mm
    • 1x 110mm
    • 3x 20mm
  • 89x M5 nuts
  • 89x M5 washers
Computer platform[edit]

Previous Designs[edit]

Kiwiray alpha.jpg

Kiwiray alpha2.jpg

Kiwiray alpha3.jpg

Alpha One
First iteration

Alpha Two
Improvements to rigidity

Alpha Three
Improvements to assembly
Measurements (still valid)

Kiwiray alpha4.jpg

Alpha Four
Webcam module, axles+adapters


4m M5 threaded rod SEK  79,60
100x M5 nut SEK  39,90
100x M5 washer SEK  24,90
4x Omni-directional wheel USD  49,98
12" 1/8" Square axle USD   8,96
8x Ball bearings SEK  71,68
10x Axle stoppers SEK  74,00
3x Stepper motor drivers EUR  54,93
3x Stepper motors SEK 787,50
1x Servo USD   4,73
1x Arduino Uno SEK 259,00