More Lego Rod Logic

After the easiness with which Lego rod logic gates could be created, I decided to go for a more complex logic circuit: a finite state machine (FSM).

After seeing that some people have managed to build complex logic circuits using rod logic (for example this one), I thought it would be trivial to create a simple finite state machine. However, the task was not that easy. Let me just say that all previous projects I've seen with rod logic involve only combinatorial circuits (i.e. circuits that do not have internal state), whereas the FSM requires internal state, and that makes this project slightly harder. But I'm getting ahead of myself, let me show you what I build.

I tried to create a very simple FSM with 4 states. The initial state is 0, if the input is 0, the FSM stays in the same state, if the input is 1, the FSM moves to the next stat, from 0 to 1, 1 to 2, 2 to 3 and from 3 it goes back to 0. All in all, quite simple. It's basically a 2bit counter.

It all seemed simple, and I created this:

It looks quite complicated, but it's actually very simple, as illustrated by the next picture:

The state of the FSM is kept in the two "STATE" rods (up is 0, down is 1 for each one of the STATE rods). The input is set with a separate INPUT rod. Once the INPUT and STATE are set, then all PHASE 1 rods are pushed right, which perform some basic logical computations, then all PHASE 2 rods are pushed up. Finally, all the PHASE 3 rods are pushed right, and this closes the circle. The INPUT is reset, and the STATE rods are reset, and pushed down again. Depending on the PHASE 3 rod state, the STATE rods will now contain the new state.

This seems all good. But it does not work. The problem is that the STATE rods cannot be reset unless the PHASE 1 rods are reset (since the lock themselves), but the PHASE 1 rods cannot be reset unless the PHASE 2 rods are reset, etc. Therefore, I have been unable to create a closed circuit (i.e. a circuit with memory) using rod logic. Notice that the PHASE 3 rods are split in two (this is done so I could reset the whole machine). But even with this "trick", there are some situations in which I cannot reset the machine.

When the machine is controlled by hand, this is no issue, since it's always possible to "figure out" a way to reset the rods by trial and error. But I wanted the machine to be powered automatically, and thus, everything should work fine in a predefined set of phases, with no interlocking amongst the rods.

A second problem I found, is that when using rod logic, ones and zeroes are encoded depending on whether rods can move or not. This is a problem when trying to automatically power a machine, since if a rod doesn't move, one needs to resort to strings or springs that apply some strength to rods, but do not get stalled in case a rod cannot move. The picture below shows my attempt at combining the mechanical sequencer I built some weeks ago with the FSM to power the rods of PHASE 1:

In this detail, you can see how I used elastic rubber bands in order to power the rods. In case a rod cannot move, the band just gets stretched, but the mechanical sequencer continues functioning:

However, the rubber bands force the mechanical sequencer to be very strong, since, in case all rods cannot move, it must be strong enough to stretch all the rubber bands. Unfortunately, my lego construction was barely strong enough to support two of these rubber bands, and it would stall if I installed a third. Thus, this solution does not work.

I'm sure it can be solved, but visiting a computer history museum, I recently saw how this problem was solved in early mechanical computers. Konrad Zuse found a very smart alternative to rod logic: instead of representing ones and zeroes by rods either moving or not moving, he split each rod in two parts, in a way that rods are ALWAYS free to move. However, depending on their configuration, they would transfer their movement to the next rod or not. But all rods can always freely move, thus, making automatic powering of logic gates very easy. I reconstructed two simple logic gates following Zuse's principle using Lego, as can be seen here, and next intend to try again to create this same FSM using Zuse's idea instead of using rod logic (which I just finished, as you can see here)