Pneumatic Sequencing

 

This page describes how to create pneumatic circuits that, over time, create repeated sequences of expansion and contraction.

 

Examples of pneumatic sequencers:

 

Pneumatic Engine

Pneuma-ped

Pedmatic

Inchworm

Quad242

 

The simplest pneumatic sequencer contains two pistons and two switches hooked together like this:

 

Piston A controls switch A.  Piston B controls switch B.  Piston B is controlled by switch A.  Piston A is controlled by switch B.  So, piston A controls piston B (via switch A), and piston B controls piston A (via switch B).  Switch A makes piston B mimic what piston A is doing, and Switch B makes piston A do the opposite of piston B.  The piston/switch pairs feed each other in a thing called a feedback loop.  Switch A feeds forward to piston B, and switch B feeds back to piston A.  The result is that pistons A and B take turns opening and closing over and over as shown by this movie.

 

Movie of oscillator goes here

 

As long you keep applying air pressure the pistons keep expanding and contracting in a repeating sequence.  You can use this pneumatic sequencer to create your own moving LEGO creations.  If you connect the pistons to a cam mechanism, you can create a pneumatic engine (movie of engine goes here).  The pistons go through four distinct states: A contracted/B contracted, A expanded (caused by switch B)/B contracted, A expanded/B expanded (caused by switch A), A contracted (caused by switch B)/B expanded, and A contracted/B contracted (caused by switch A).  After this the cycle just repeats.

 

The states of the pistons can be drawn graphically like this:

 

 

The graph shows the pistons expanded and contracted states over time.  The top line of the graph shows piston A over time, and the bottom line of the graph shows piston B over time.  The upwardly sloping diagonal lines represent pistons expanding.  The horizontal lines represent the pistons in steady state, either expanded or contracted.  The downwardly sloping lines represent pistons contracting.

 

When piston A completes expanding, it makes piston B start to expand.  When piston B completes expanding it makes piston A start to contract.  When piston A contracts completely it makes piston B start to contract.  When piston B contracts completely it makes piston A start to expand, making the cycle repeat.

 

Adding another piston

 

Lets say we want a second piston that does the same thing as piston B. Using pneumatic T’s and more hoses, we can hook up piston C the same way that piston B is hooked up. 

 

 

As can be seen by this movie of circuit 2, you can see that piston B and piston C don’t expand at the same rate.  This is because piston B has the load of switch B which slows down the expansion and contraction.  Even if we put a switch onto piston C so it has a similar load, piston B and piston C probably wouldn’t expand at exactly the same rate due to minor manufacturing differences in the pistons, switches T’s and hoses.

 

The timing diagram for circuit 2 looks like this::

 

 

Notice that piston C does not behave exactly the same as piston B.  If we’re trying to use piston B and piston C in a LEGO model, the two parts controlled by pistons B and C won’t behave exactly the same.  Clearly adding more pistons to the circuit this way will not have piston B and C behave exactly the same.

 

Synchronizing Two Pistons

 

We cannot make the two pistons expand or contract at exactly the same rate, but we can make sure that both pistons B and C expand completely and contract completely every time through the four step cycle. We do this by adding two switches to piston C as shown in circuit 3.

 

 

In circuit 3, we make piston C stay synchronized with piston B by running the each of the outputs of switch B into a switch controlled by piston C (switch C1 and switch C2).  The pressure out of switch B’s left port (makes piston A contract) goes into switch C1’s center port, and then out C1’s left port which is hooked to piston A’s contract port. Pressure cannot make it through switch B and switch C1 unless piston B and piston C are expanded.  Similarly the right port of switch B is hooked to the center port on switch C2, and the right port of switch C2 is hooked to piston A’s expand port.  In this case pressure cannot make it to piston A’s expand port unless both piston B and piston C are contracted.  We’ve now made piston B and C behave the same way, even if they expand or contract at different rates.  They are synchronized. Notice that the unused ports of switches C1 and C2 are plugged by small pieces of hose with mini-fig light sabers stuck in them.  If we don’t plug them, pressure will leak out these ports when pistons B and C are not both expanded or not both contracted.

 

As you can see from this movie, every time piston B expands completely, so does piston C.  Every time piston B contracts completely, so does piston C. Pistons B and C are synchronized. 

 

Boolean Algebra

 

In 1854, a mathematician named George Boole published a paper called “An investigation into the Laws of Thought, on Which are founded the Mathematical Theories of Logic and Probabilitiesthat described a mathematical way of describing logical statements.  Boole’s algebra used variables that have value of true and false.  He also introduced three new mathematical operators:  and, or and not.  Over a hundred years later his algebra became the mathematical cornerstone of the digital computer era, using electronic versions of his algebraic functions called gates.

 

Pneumatic pistons are boolean devices in that they only have two stable states:  expanded or contracted.  I equate expanded piston as a boolean true, and contracted piston a boolean false. The remainder of this description always has a piston controlling a switch.  The piston switch pair is typically given a simple name like A, B or C.  Some pistons control two switches, and the switch names are the piston name and a single digit suffix (like switch C1 or switch C2). 

 

The piston’s pressure ports are inputs from some switch.  The expand pressure port of a piston is referred to its piston name followed by a lower case x, for expand.  For example piston A’s expand port is referred to as Ax.  The contract pressure port of a piston uses a similar suffix with the value of c, for contract.  Piston A’s contract port is referred to as Ac.

 

It is equally important that we have names for the ports of the switch.  When the switch handle is flipped to the right, pressure coming in the center port goes out the left port.  In all these examples this happens when the controlling piston is expanded.  For our examples the port closest to the piston is simply named the piston name. In this example the piston is called A, so the port closest to the piston is also called A.

 

 

When the switch handle is flipped to the left, pressure going into the center port goes out the right port.  In all these examples this happens when the controlling piston is contracted.  For our examples the port furthest from the piston is indicated by a tilde (~) followed by the piston name.  You can use the word “not” when reading ~.  For the example below, the piston is contracted, so pressure is coming out the “not A” port.

 

 

In normal algebra multiplication is very common and variable names are typically single letters.  Multiplication is so common that the multiplication operation can be implied by placing two variable names next to each other.  So the expression “a x b” can simply be rewritten “ab”.  In Boolean logic the and function is so common that it can be implied, so “a and b” is often written simply “ab”.

 

In the example below we combine piston/switch A and piston/switch B to create Boolean and gates.  Between the two pistons and the three switches, we get four possible and combinations.  When both pistons are expanded, pressure comes the blue hose.  Tracing the pressurized ports shows that port A and port B are both pressurized resulting in output pressure AB.

 

 

If we contract both pistons, the pressure comes out right hand ports resulting in ~A~B (not A and not B).

 

This leaves two combinations of one piston expanded and the other contracted.

 

 

and

 

 

Mathematical Description of Circuits

 

One of the best things about mathematics is it provides a very concise and succinct way of describing the relationships between things (one of the worst parts of mathematics is that its conciseness and succinctness make it hard to understand :^)  We will use the names we just defined to describe our pneumatic circuits.

Our language needs to describe how switch ports are hooked to pistons.  First we’ll use an equals sign (=) to mean switch port connected to piston port. 

 

For circuit 1, we can describe the connections from piston/switch A to piston B as:

 

Bx = A;

Bc = ~A;

 

The connections between piston/switch B to piston A are backwards so:

 

Ax = ~B;

Ac = B;

 

This terse format for circuit description will really help when describing complicated circuits.  We can describe circuit 3 like this:

 

Ax = ~B & ~C;

Ac = B & C;

 

Bx = A;

Bc = ~A;

 

Cx = A;

Cc = ~A;

 

The description is short and sweet, but easier to write than read for the uninitiated.

 

Circuit 4

 

What if we want to have piston C do the opposite as piston B, but at the same time as piston B?  Piston B’s description remains unchanged:

 

Bx = A;

Bc = ~A;

 

Piston C’s connections are described:

 

Cx = ~A;

Cc = A;

 

Piston A’s connections are different as well.  Piston A expands when piston B is contracted and piston C is expanded.

 

Ax = ~BC;

 

Piston A contracts when B is expanded and C is contracted.

 

Ac = B~C;

 

Here is an image of circuit 4.

 

 

Here is graph of circuit 4’s behavior over time.

Circuits 1, 2 3 and 4 all have four steps in their repeating sequence.  With three pistons, we can make longer sequences.

 

Three Pistons Three Switches

 

With three pistons and three switches, we can make a six step sequencer.  The circuit 5 looks like this:

 

 

Its mathematical description is:

 

Ax = ~C

Ac = C

 

Bx = A

Bc = ~A

 

Cx = B

Cc = ~B

 

Its waveform looks like this:

 

 

This circuit has a total of 6 steps. This circuit would be good for a three piston pneumatic engine.

 

Three Pistons Four Switches

 

With three pistons and four switches, we can make a sequencer that has five steps.

 

Circuit 6:

 

The formulas describing circuit 6 are:

 

Ax = ~B~C

Ac = B

 

Bx = A

Bc = ~AC

 

Cx = B

Cc = ~B

 

The waveform:

 

 

This waveform looks a lot like the waveform for circuit 5, but circuit 5 has the pistons expanded half the time.  In circuit 6, the pistons are expanded two of the five steps in the cycle.

 

Three pistons Five switches

 

I wanted to build a four legged pneumatic walker (Quad242) to show off a creation of mine, a pneumatic polarity reverser.  I thought the reverser was the fancy part, but in fact making the walker walk the way I wanted was the hard part.  I learned much of what I know about pneumatic sequencers making Quad 242 walk.

 

Quad242 has four feet split up into two synchronized pairs.  The front left and back right feet do the same thing, and the front right and back left feet do the same thing.  Quad242 walks by driving its feet back, lifting them off the ground, bringing them forward and dropping them on the ground, over and over.  I wanted to make Quad242 put the up feet down, before it moved the down feet up, so it would have two feet down, then four feet down, and then two feet down (thus the name Quad242).  To make this happen I needed a pneumatic circuit that created this waveform.

 

Piston A represent the front left and back right vertical leg movement (expanded pistons are on the ground).  Piston B represents the front right and back left vertical leg movement.  Notice that in the first step both pistons A and B are expanded.  Piston A then contracts and expands leaving both piston A and B expanded.  Piston B then contracts and expands leaving both piston A and B expanded and the cycle repeats.  Piston C is used to control both piston A and piston B.

 

Circuit Analysis and Derivation

 

First pass analysis of the waveform indicates that at time 1, piston B has just expanded, which makes piston A contract.  This gives us the formula:

Ac = B

 

At time 2, piston A just contracted which makes piston C expand.  This gives us:

 

Cx = ~A

 

At time 3, piston C completes expanding which makes piston A expand, so:

 

Ax = C

 

At time 4, piston A completes expanding, which makes piston B contract:

 

Bc = A

 

At time 5, piston B completes contracting, which makes piston C contracts so:

 

Cc = ~B

 

At time 6, piston C completes contracting, which makes piston B expands, so:

 

Bx = ~C

 

Now we need to examine piston A’s formulas for pressurization.

 

Ax = C

Ac = B

 

If you pressurize both ports of a pneumatic piston at the same time, the piston’s behavior is unpredictable.  Your pneumatic sequencer will probably lock up and stop sequencing.  To make sure that this won’t happen in our circuit, we need to examine the inputs to each piston over time.  This timing diagram represents the pressures going into piston A from switch ports B and C over time.

 

 

Notice that B and C are both providing pressure to piston A in time 3 (indicated by red hose).  To avoid this we need to modify one of the two formulas.  C starts providing pressure into Ax at the right time, and B starts providing pressure into Ac at the right time, but the pressure from B stays on and overlaps the pressure from C. We can modify the pressure into Ac using an and gate by adding another switch to piston B.  Since Ax’s pressure is behaving correctly and Ac’s pressure is behaving incorrectly, we need to modify Ac’s formula.  If we and ~C (because Ax = C) with B, by running B through the new switch on piston C, we get a new Ac that does not overlap with Ax and still contracts piston A at the right time. 

 

This analysis leads to these formulas for piston A:

 

Ax = C

Ac = B~C

 

Note that at time 6, piston A is depressurized indicated by the yellow hose.

 

Piston B’s initial expansion and contraction formulas are:

 

Bx = ~C

Bc = A

Examining Piston B’s pressure ports graphically reveals another double pressure point in the cycle in time 6, and time 1.  Bc’s pressure stays on too long, so we need to modify Bc’s formula.  We can resolve piston B’s double pressure problem by adding another switch to piston C, and run A through it creating the formula Bc = AC.  AC pressurizes piston B at the right time, but does not overlap with ~C.  Notice that piston B is not pressurized on either port during time 3.

 

Piston B’s final formulas are:

 

Bx = ~C

Bc = AC

 

Piston C is expanded by ~A and contracted by ~B.  Studying these waveforms show that piston C has no pressure conflicts, so the initial formulas remain unchanged.  Note that piston C is depressurized at two points in the cycle.

 

After simultaneous pressure analysis and avoidance, we end up with these equations describing out circuit:

 

Ax = C

Ac = B~C

 

Bx = ~C

Bc = AC

 

Cx = ~A

Cc = ~B

 

Here is a diagram of circuit 7:

 

Outside Forces

 

Circuit 7 is the base circuit used in my four legged walker named Quad 242.   As you can see in this movie, Quad242 pairs diagonal feet and makes them go up and down together.  One pair of feet is controlled by piston A, and the other by piston B.  Piston C controls when the legs go forward and backward.

 

When I first designed Quad242, I used circuit 7 to control it. I added synchronized twin pistons for piston A and piston B, so that there were four vertical pistons, one for each leg.  I also added three more copies of piston C (one for each leg), that were synchronized with piston C.  The circuit did not function as desired, because pistons A and pistons B are depressurized during the six step sequence.  This made Quad242’s body drop to the floor twice per cycle due to gravity pulling the body downward. I tried many ways to make piston A be pressurized at every point in the sequence, with each attempt ending in failure.

 

Finally I decided that piston A could not be weight bearing.  I realized that I could create an always pressurized copy of A and an always pressurized copy of B by making these simple additions to the circuit.

 

The wave form for the new circuit looks like this:

 

Piston A’ (pronounced A prime) is driven by piston A’s switch, so A’ does what A does, except delayed in time.  Piston B’ is driven by piston B’s switch, so B’ does what A does, except delayed in time. The output from piston A’ is used to control the other pistons, instead of A, and likewise for B’ and B.  This means that A’ and B’ are synchronized with the circuit, but are always pressurized (which means they can be weight bearing.)

 

The formulas that describe circuit 8 are:

 

Ax = C

Ac = B’~C

 

A’x = A

A’c = ~A

 

Bx = ~C

Bc = A’C

 

B’x = B

B’c = ~B

 

Cx = ~A’

Cc = ~B’

 

This gives us this circuit diagram:

 

Piston C is not a weight bearing piston, so we do not need to add an extra always pressurized version of piston C.

 

Unachievable sequences

 

One of my next projects is a four legged walker that always has at least three feet down.  When transferring weight it would have all four feet down.  It will probably be named Quad343.  I tried to create this sequence for Quad343.

 

 

That’s a lot of sequence!

 

I started to do analysis for piston A which contracts when D expands, and expands when E expands, giving this pressure diagram:

 

The first problem is that D and E are both pressurizing A at the same time.  When trying the standard trick of and-ing the one that is on too long with the not of the one that is being trashed, it doesn’t work.  The last row of the diagram shows the result.  The problem is that D~E pressurizes A at two different points in the cycle.  Not good because piston A will expand/contract twice in the same cycle violating the original goal for A. The result is that we cannot create a circuit to generate the wave form as proposed.  I’ll have to come up with a different sequence for Quad343 (I’ve already got that one figured out :^)

 

Stopping and Starting

 

It is possible to make your sequencer stop and start under external control.  If you disconnect a pressure port to a piston, run the pressure through a stand alone switch, and hook the output of the switch back to the piston, you can make it start and stop.  By preventing the pressure from hitting the piston, you prevent it from expanding or contracting (depending on the port you modify). Preventing the piston from changing prevents the circuit from making forward process.  This is circuit 8 with a switch that can freeze the sequencer at the beginning of the sequence.

If your sequencer is part of a carnival ride that changes shape over time, you might want to stop and start the ride so your mini-figs can get on and off.  Stopping the sequencer at the end of the ride could be controlled by an RCX that controls a motorized pneumatic switch.

 

Your complete model could very well contain two sequencers that interact and stay coordinated by controlling each other’s forward progress.

 

You can put more than one stopping point switch into your sequencer so you can stop at multiple points in the cycle.

 

Each of the stopping point switches acts as an and gate that controls forward progress.

 

Where to go from here

 

There are any number of possible places to use complex pneumatic sequences:

  Animated creatures walking, or moving appendages

  Carnival rides that change shape over time

  Simulation of manufacturing processes (a common use of pneumatics in real life)

  Pneumatic computing devices

 

Summary

 

This web page explained how to create pneumatic circuits that go through repeating sequences of pneumatic piston expansion and contraction.    It explained how to make multiple pistons be coordinated (synchronized) even though the pistons themselves expand or contract at different rates.  It explained how to start from a description of the desired sequence and see if a circuit can be created for it.  This chapter introduced the concepts of boolean logic, how it is implemented in LEGO pneumatics, and how it can be used to create pneumatic sequencers.

 

Pneumatic sequencers can be used to create complicated and advanced self actuated LEGO models that require no motors or RCX.