In my previous post, I simulated some mechanical logic gates using a novel 3-bar linkage.

The dimensions of the linkage are critical to achieving correct operation;

Inputs , , must all produce the same output position.

For the simulations, an empirical approach was used. (fiddle with the values until it looks right)

This time, I’m going to attempt to find the **exact** values to use for a given stroke, separation distance and output position.

Here, you can see the linkage layout for and

# Mathematics

Ahead lurks tough mathematics (which may be unsuitable for liberal-arts majors)

If it’s hard to read, then sorry! It was hard to write!

## Parameters

- Separation between inputs
- Stroke length
- Input link length
- Output link length

## Geometry

- is the input position when
- is the input position when
- is the input position (The system is symmetric, does not need to be tested.)
- is the middle position when
- is the middle position when
- is the output position. ( for the gate to function correctly.

## Solving

### Finding :

### Finding :

### Finding :

- is the midpoint of
- is the length of the line
- is the length of the line

Using this, we can calculate M’:

### Finding :

## And then:

Now that and are found, and we know …

### Finding the equation in terms of :

### Substituting back into the equation:

Ugly, but workable?

# Example:

- Separation between inputs
- Stroke length
- Input link length
- Output link length
- Desired output position

Pushed through Wolfram Alpha…

# Summary:

Phew!

Thusly, one can calculate the input and output linkage lengths for any logic gate.

These dimensions will work for an OR gate too, as the linkages are just reversed.

It’s irksome that I couldn’t work out a symbolic solution for the last equations, especially since in the example came out to such a neat value.

I might revisit this further in the future, and it’ll definitely come in handy when building something with these gates.