To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
To LUGNET News Traffic PageSign In (Members)
 Owen Dive / Decimator

The problem

There is a puzzle. A partial solution to said puzzle involves a mixed alphabet.

Mixed Alphabet
A string of 26 characters such that each letter is represented once and once only.

While this mixed alphabet you have is not necessarily the one you want, you do know that it is a decimation of the correct mixed alphabet.

nth Decimation of a mixed alphabet
A specific permutation of the mixed alphabet created by taking every nth
letter. For example, the 3rd decimation of the alphabet as it is traditionally
arranged would begin ADGJ...

Now, you don’t know exactly which decimation you need, but there are certain characteristics that you can look for to determine if any particular decimation is the right one, so what you do is you compute them all, and check each one to see if it’s the one you want.

That’s not entirely true - there are some decimations that you don’t need to check. For example, consider the second decimation of the ‘normal’ alphabet. You start with ACEG etc, but you soon come to ...UWY, and you’re forced to go back to A again, when you’ve only got a string of 13 characters - you get another string of 13 characters starting at B. In fact, you’ll get two strings of 13 characters with any even decimation. You also don’t want the 13th decimation, because then you’ll end up with 13 two-character strings, which is even worse than two 13-character strings!

So, we want a way to generate the 3rd, 5th, 7th, 9th, 11th, 15th, 17th, 19th, 21st, 23rd and 25th decimations of any given mixed alphabet, with the 1st decimation being just the mixed alphabet you had to begin with (in fact, if you were doing it by hand, you’d only need the first half of these, because the 3rd decimation is just the 23rd decimation written backwards, similarly with the 5th and 21st decimations, and all the others in pairs).

One potential solution

Any half-competent computer programmer would take approximately 5 minutes to hack together a program to do this for you electronically, and another 10 minutes to make said program rank the resulting mixed alphabets in order of likelihood of being the one you want.

However, as anyone who has constructed a decimation by hand will know, it is a very mechanical process (move along 3 characters, write the letter down, rinse and repeat), so there ought to be a mechanical solution, right?

Presenting... A mechanical solution



This is actually only a half-sized prototype, able to compute decimations of a 13-long ‘alphabet’. However, in order to work with 26-letter sequences, all you need to do is make The Device twice as long - none of the mechanism need to be changed.

Vital Statistics

Length
   Width
   Height
 
57 cm
   22 cm (at widest)
   23 cm (at tallest)

Part Count

862 parts (193 bricks, 182 pins, 174 plates, 60 gears, 51 axles and 202 misc. other bits)

Looks funky. How does it work?

The key to understanding how this device can produce all the required decimations is to understand how the aforementioned computer programmer would go about the task. He would create an array with indices 0 to 25 for the original mixed alphabet, then for each element of a new array, he’d multiply the index of that element by the decimation number (modulo 26), and insert the letter from that index of the original array. I realise I’ve described that poorly, but the take-home message is that letter positions are multiplied by the decimation number.

So, what happens if we decimate a mixed alphabet by 3 (say), and then decimate the resulting mixed alphabet by 3? Well, because multiplication is associative, the result is the same as if you had decimated the original mixed alphabet by 9!

Why is this important? Because with one operation (decimation by 3), you can recover two of the decimations you need (you can’t continue this further, because a third decimation by 3 would result in a decimation by 27 from the original mixed alphabet, which, since it’s all done modulo 26, is the same as a decimation of 1, which is just the alphabet you started with).

Now, it just so happens that a repeated decimation by 7 will, eventually, give us exactly the decimations we need (there’s a very good reason why this is so, having to do with primitives and groups - ask your local number theorist for details). If you consider a machine built to mechanically perform these decimations by 7, you can imagine something that cycles through 7 letters, and spends an additional cycle ‘selecting’ the ‘current’ (these terms will be made clear later) letter. This means that the whole thing will repeat after 8 cycles, and 8 is a very convenient number when it comes to building this thing out of LEGO - for example all the old-school gears have integer multiples of 8 teeth, so gearing the appropriate bits to be in the correct synchronisation with each other is much easier than if working on a repeating length of, say, 6 or 10 cycles.

It was only after I realised these things that I began to seriously think that it might actually be possible to build this!

So, here’s how it works. The ‘alphabet’ is represented by the black 1x4 beams sitting in the blue tray on the left hand side of The Device. Each beam has on its four studs a pattern of 1x1 square and round plates that is unique to that beam, even under rotation. These serve no particular purpose other than to identify each beam as distinct from each of the others. I could have written the letters A to M on pieces of paper and taped them to the side of the beams, for all it matters. These beams will hereafter be referred to as letters.

The tray with the letters on it moves left and right along the front of The Device. Its movement is controlled by the Rube Goldberg-esque mechanisms at the right hand rear. The regulation of the whole Device is done by the mechanism at the left hand rear. I will go into more detail about these parts later.

The structure in the centre of The Device, opposite the exit chute, is responsible for pushing a letter out of the tray into the exit chute. I will call it ‘the pusher’. The operator takes the letter out of the chute, writes it down, and puts it into a second tray (not shown here). Meanwhile, the tray is moved across the face of the pusher until the 6 letters have passed the pusher. As the 7th letter comes to the pusher, the tray stops and the pusher pushes another letter into the exit chute (this is what I mean about selecting the current letter, above), the operator writes that letter down and places it in the second tray, and the process continues. When the tray on The Device is empty, the second tray is full, and the operator has the 7-decimation of the mixed alphabet that was in the first tray.

The operator then removes the empty tray from The Device, replaces it with the full tray, and the whole sequence begins again. In this manner you get each of the decimations you want.

The really amazing thing about The Device is not so much what it can do, but rather what it uses to do it. It has one 9v motor, one pole-reverser switch, one battery box, and the wires required to connect them all to each other. Every other piece is standard LEGO Technic (with the exception of a bit of counterweight that is non-LEGO and a few pieces that are standard LEGO System - plates, slope bricks etc).

Limitations of construction

I set out to build this using only mechanical or, at the outside, electro-mechanical technology. I could, for example, have used a touch sensor at each end of the tray’s track and an RCX to control the movement, but that would be almost no better than writing a computer program to do it! In fact, if I ever build a full-size version (not likely, I’m afraid), I will do away with the electrical components, and instead make a large crank handle to provide the power, and have a mechanical switch to change between two outputs.

I also wanted to use only one motor, if I could. There were two reasons for this: I only had one motor handy (I would have had to disassemble a different model to get more motors), but also I suspected that synchronising movement from two different motors and keep everything in phase with each other for long periods of time was going to be tough.


How it works - the details

Below you’ll find a description, in painstaking detail, of how The Device works. If, when studying literature at school, you were one of those people who would just watch the movie, you can do that here.

Moving the tray forwards

The tray containing the mixed alphabet can slide freely along its track. Along the bottom of the track are a series of short liftarms, mounted on axles perpendicular to the direction of travel of the tray. They are all driven by the same long axle that runs along the back of the track, and they are spaced such that the tray is always above at least two liftarms.

When the liftarms rotate, they come up against the underside of the tray, then lift the tray as they continue rotating, moving the tray exactly two studs along the track, before disengaging from the bottom of the tray, and rotating under the tray to come up again.



It is important (and surprisingly difficult) to ensure that the liftarms are all exactly in phase. A slip of one tooth means that one liftarm will be 360/24 = 15 degrees in front of or behind the rest, which means that the tray is lifted at one end before the other, tipping and wobbling the letters about.

When the tray is as far fowards as it can go

Eventually, the tray will move the last letter past the pusher. When that happens we need it to come back to the starting position so that the pusher can have a shot at all the letters it missed on previous passes. The long axle at the back of the track that drives the liftarms that move the tray forward also drives, via a differential gear, a longer liftarm at the end of the track.

Differential Gears
The standard way to use a differential gear assembly is to use the casing
as an input, and the axles as the two outputs. Alternatively, you could use
the two axles as inputs, with the casing as the output. For both differential
gears used in The Device, I use one axle for input, and the two outputs are
the casing and the other axle. In both instances, one output is either blocked
by something, or free to turn which, because the output of a differential
goes to the path of least resistance, means that the other output is either
turning or not, respectively. It's a mechanical switch!

When the tray is not at the end of its travel, the path of least resistance is that liftarm, which spins around without a care in the world. As the tray comes forward, though, it moves into the path of the liftarm. The liftarm stops rotating, and the motion is transferred to the differential gear casing. This motion is conveyed via a series of gears and levers to a pole-reverser switch, which reverses the direction of the driving motor.



This might seem like an overly complex way to flip a pole-reverser switch, but because the switches are forward-off-reverse, anything that just pushes the switch directly hits the dead-zone at the top of the switch, and the motor stops. You need some way of carrying the switch past the dead-zone, else all you have is a machine that turns itself off!

Also, the way I’m moving the tray means that there is no point having the tray push a lever directly because there is just not enough torque available - the tray would just stop and the liftarms under the tray would just scrape along the bottom of the tray.

Moving the tray backwards

The motor is connected directly to one of these, which sends the motor’s output to one shaft when it’s driving forwards, and a different shaft when it’s in reverse. When the tray has got to its forward limit of travel and the pole-reverser switch is flipped, the motor’s output is directed to the winch on the far left hand side of The Device, which, with the help of a piece of (genuine LEGO Technic) string tied to the tray carriage, reels the tray back to the starting position. In this case, it is important to note that while the tray is being pulled back, nothing else is moving. The reason this is important will become apparent later.

Now, as the tray moves forward, there is enough force to unwind the string from its spool, but not enough force to back-drive the winch mechanism. Probably my favourite part of The Device is the bit that allows the winch to engage and disengage the spool as required.

The winch mechanism consists of two axles, the bottom axle that’s driven by the motor, and the top axle that drives the spool. On the bottom axle is a 16-tooth gear, and directly behind that gear is a short beam. The beam is free to rotate relative to the axle, but it supports another 16-tooth gear that meshes with the one on the bottom axle. This second gear is mounted on a friction axle pin, which means that it can rotate, but not freely.



When the winch needs to engage, the bottom axle is rotated. Because of the resistance from the friction pin, instead of just rotating the gears, it rotates the beam, bringing it up such that the second gear is able to mesh with a gear on the top axle. Since the beam can’t rotate any further, the gears will start to rotate, winding the spool. When the motor changes direction again, an elastic band (not seen in the above render) helps gravity to pull the beam away from the top axle, and the spool is free to unwind offering a minimum of resistance. It really is quite pretty to watch.

When the tray is back to where it started

The piece of string that is tied to the tray carriage also extends below the tray and into the back of The Device, where it supports a metal hook. There’s nothing special about the hook - it simply provides a little weight to keep the string taut. At this point I should note that my description is going to stray from the photograph above - that picture shows the state of The Device after what I’m about to describe has happened.

So, the tray is being winched back towards the starting position, and the hook on the string is being lifted up. Just before the tray gets to its stop (causing the winch to bind and nasty things to happen), the axle that holds the hook comes into contact with the axle that’s positioned horizontally across the hook’s path. This horizontal axle extends from the connector that acts as a ratchet on a 24-tooth gear. With the lifting of the ratchet, this 24-tooth gear is now free to rotate, and so is the 40-tooth gear that meshes with it. On the same axle as the 40-tooth gear is a 24-tooth clutch gear (I’ll come back to that later) and a liftarm with a weight brick attached to it. The weight brick, which is just past its high point, falls down, pushing the spring-loaded lever referred to in When the tray is as far fowards as it can go above back into its previous position. This reverses the motor’s direction again, disengaging the winch, and allowing the tray to plod forward, two studs at a time.



As you can see in the picture above, the 40-tooth gear is mounted such that the axle does not pass through its centre. This allows the resetting of the weight brick back to the top to occur without having to change the direction of movement of the weight brick - the gear is free of the ratchet any time the weight brick is not at or near the top of its travel.

During the course of the tray moving forwards, it is necessary to bring the weight brick back to the top, so that it can fall down and flip the switch again. The same axle that drives the liftarms that propel the tray forwards also turns a vertical axle with a worm gear on it. That worm gear engages the clutch gear mentioned above, and drives the weight brick back to the top. I used a clutch gear because that way there’s no need to tinker with the timing - if the weight brick got to the top, but the tray was still moving forward, the ratcheted gear would stop everything, and something would break. With a clutch gear there, the worm gear can continue to turn without putting undue stress on the rest of The Device (this is, after all, the purpose of the clutch gear!).

As it happens, the time it takes the weight brick to go from the bottom of its path to the top is almost exactly the same as the time it takes the tray to travel the length of its track, so the clutch gear is not necessary for this prototype, but if it were to be extended to deal with a full 26-letter alphabet, then the clutch gear would be a necessity. One downside with the clutch gear though, is that it can’t support the weight brick on the way up. It’d get half way to the top, then the clutch would give way and it’d fall back down. I got around this by adding some counterweight. This counterweight is the only non-LEGO part in the whole Device.

As anyone who has built with worm gears knows, they can’t be back-driven, but they can easily slide along their axles. When lifting the weight brick, the tendency to back-drive pushes the worm gear downwards onto its supports. However, when the ratchet is released and the weight brick falls, the worm gear is dragged upwards (where it has plenty of room) until it disengages from the clutch gear. The momentum of the weight brick carries it a little past the bottom of its travel, at which point is begins to swing backwards, catching the worm gear and bringing it back down to its supports. This has the added side-effect that the weight is stopped from oscillating back and forth as its energy is dissipated.



Again, this seems like a lot of effort to go to just to flip a switch, but while the mechanism at this end doesn’t have the problem of a shortage of torque, it needs to pull against the spring-loaded lever, and it still needs to avoid the ‘turning itself off’ phenomenon.

Selecting every 7th letter

So far I have described those parts of The Device that move each letter in turn in front of the pusher, and when it gets to the last letter, everything is put on hold while the tray is being brought back to the start. This is equivalent to having a circular tray, with the first letter immediately after the last (In fact, I briefly considered a circular tray, but baulked at the thought of dividing it into 13 (or even 26) equal portions using standard LEGO). All we need now is a mechanism to interrupt the tray after every 7th letter.

Placed between the motor and the long axle at the back of the tray’s track is just such a mechanism. Once the motor is geared down appropriately, one of the axles bears a worm gear, which drives an 8-tooth gear connected to a disc of tiles. The axle also drives, via a differential and a lot of 16-tooth gears, the long axle that moves the tray. This disc makes one revolution for every 8 turns of the long axle that drives the tray. Now, one output of the differential goes to two places - an axle sitting just above the disc, and to the pusher (which will be described below), and the other output goes to the long axle that drives the tray. The axle that’s just above the disc has a cross-piece which hits the disc and stops the axle from rotating (though the disc can still rotate under the cross-piece. This is why there are tiles on the top surface of the disc - we don’t want the cross-piece to catch on the studs) - thus, the path of least resistance is the long axle. However, the disc has a gap in it. When the gap passes under the cross-piece, the cross-piece can pass through. The path of least resistance then includes the pusher, so the pusher pushes whichever letter is in front of it. When the cross-piece comes into contact with the disc again, the tray continues on its merry way.


   

The pusher itself is quite simple. It’s just a long liftarm on an axle. When the axle is rotated, it swings down and knocks the letter from its position on the tray into a chute. The operator needs to pick it up and put into the second tray. I initially had visions of the second tray mounted in The Device itself such that a letter would be pushed from wherever it happened to be in the first tray into the next position of the second tray. The last action of the pusher mechanism would then be to move the second tray along one position. However, The Device struggles to accurately drop the letters into the chute - the accuracy needed for what I had in mind was just not going to be there.

More Information

YouTube video here.

More pictures here.

The following thread has some discussion relating to The Device.
  Some help or advice requested
 
Hi all. I am currently working on a project (to be revealed in due course!) and I've come across something of a stumbling block. I have a tray that is constrained to move in one dimension, and a series of short liftarms under the tray, all rotating (...) (14 years ago, 19-Jan-10, to lugnet.technic)

Final Thoughts

I am actually really pleased with the way it has turned out. I think this proves that I’m either a madman or a genius, but I’m not sure which. Certainly everyone who has seen it in action has been impressed, despite the fact that it’s only built for 13 letters. I do note that this method of decimating alphabets is more time-consuming, more labour-intensive and more error-prone than doing it by hand, but that’s not really the point, is it? :-)
Primary content in this document is © Owen Dive. All other text, images, or trademarks in this document are the intellectual property of their respective owners.


©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR