Archy: a multi-legged robot

This is a simulation of a walking robot whose control architecture is based on Perceptual Control Theory. The simulation is an applet that you can find farther down this page, after the instructions on how to use it.

Skip directly to the applet.
Description of the control systems.

Before you begin

1. This applet does not work with Netscape, at least up to Netscape version 4.7. As far as I know, this is due to an incompatibility between Netscape and the Java AWT 1.1, so there is nothing I can do about this. It does work in the Internet Explorer and in applet runners included with Java development environments.

2. Although the overall shape is modelled on the stick insect, the robot is on a much larger scale. The body is one metre long and weighs 20kg. Each upper and lower leg is 40cm long.

Quick demo

These are just a few notes to get you started. The applet is mainly written as a research tool for myself, and I have not documented the numerous controls.

Click "Run". Not a great deal will seem to happen, but if you watch closely at the animation as you click "Run", you will see some coloured lines suddenly appear at various places on the robot and then shrink back to almost nothing. The robot is just standing up, supporting its own weight against gravity.

Now click the radio button called "Navigation". This causes a new set of controls to appear in the lower part of the applet. Towards the right there is a column of two checkboxes called "Enabled", both of them blank. Click on both of them. The robot will now begin walking towards the black blobs, which represent food. When it gets close enough to one, it eats it and a new blob is created at a random location.

You will see various coloured lines waving madly around the robot. These are a visual indication of the forces operating on it. You will get a clearer view of the robot if you turn them off, and the simulation will also run faster. Turn off the checkbox "Show forces".

Now you can give it some uneven terrain to walk over. Click the "Terrain" radio button. You get a new set of controls that let you select flat ground, uneven grouns, or a staircase. Click the radio button called "Random". The terrain changes to random uneven ground. Experiment with the scroll bars called "Smoothness" and "Amplitude" to vary the type of unevenness. (If, below the word "Smoothness" you see only a number, not a scrollbar, click the "Terrain" radio button again and the scrollbars should appear. This is due to some initialisation problem in my code. It only shows up in recent versions of Internet Explorer and Java.)

You can see the path the robot has taken by turning on the "Show trail" checkbox. It drops one blue blob every second of simulated time.

The "Big" checkbox changes the layout to give most of the space to the animation.

On a PC with a 500 MHz Celeron the simulation runs at around 150-300 frames/second. With the default simulation time-step, this is approximately real time. Performance depends not only on the processor speed, but also on the Java virtual machine you have installed.

General layout

        |                   | column  |                      |
        |                   |         |         Messages     |
        |   Animation       |   of    |           from       |
        |                   |         |          applet      |
        |                   | buttons |                      |
        | block of buttons, |                                |
        |  checkboxes, and  |       five scrollbars          |
        |    text items.    |                                |
        |                                                    |
        |           four rows of radio buttons               |
        |                                                    |
        |                                                    |
        |   Each of the above buttons selects a different    |
        |   panel of controls shown here                     |
        |                                                    |

The applet

If you resize your browser window, the applet will adjust itself to fit.

Versions of Archy are available with four, eight, or twenty legs. The code of the applet is identical in all cases; the number of legs is a parameter supplied when the applet starts.

About the control systems of the robot

A paper describing this robot is available in PDF format. In brief, there is a PID controller for each joint which senses the rate of change of joint angle and outputs a signal to the actuator for that joint. A second layer of PID controllers sense the attitude of the robot's body and output reference signals to the joint controllers. Another pair of controllers sense the sum and difference of signals received by two antennae (not visually depicted in the animation) which correspond to distance and direction of food particles, and select from a fixed set of gaits to walk forward, left, or right, or stand still.

The robot can do the following:

As interesting as what it does, is what it does not need to do to achieve these things.

The robot's only perceptions are these:

About the implementation

The applet is written in Java, using the AWT 1.1 for all the controls. Besides the couple of thousand lines it takes to set up all those controls, there is another couple of thousand concerned with simulating the motion of a rigid body by iterative solution of the differential equations. The code for the actual control systems of the robot is a tiny fraction of the whole, and is the only code that would be required in a physical construction. In fact, the controllers are all P-I-D, for which integrated circuits can be obtained off the shelf, so a construction containing no software at all would be possible (although for reasons of flexibility it would not necessarily be desirable).

The physical simulation is rather incomplete, in that the legs are not modelled dynamically, but assumed to have negligible mass and moment, and to instantly take up whatever conformation is dictated by the position and orientation of the body and the position of the foot on the ground. This conformation is unique, because each leg has three degrees of freedom. The problem thus reduces to determining the path of a single rigid body acted on by forces and torques. The legs lose contact with the ground when the contact force goes negative, but when they are in contact, the transverse frictional force is unlimited. Legs which are lifted off the ground for the purpose of walking are simply placed in the desired position instead of modelling their movement under the action of forces.

Being dissatisfied with these short-cuts, I began work on simulating articulated rigid bodies more accurately (using Featherstone's algorithm), in order to model the dynamics of the legs. While I was doing so, a free library for just this task became available from MathEngine and I switched development to C++. This means that subsequent versions of the simulation are not available over the web.

About the name

Archy is a cockroach who appears in the works of Don Marquis.

Richard Kennaway,
Last revised 24 October 2000.