How can I use more than three motors with one NXT brick? I'm building Caterpillar Excavator with my NXT, and at the moment I'm trying to control 4 points of motion:


2 Caterpillar Tracks - These should be controlled independently to allow for cornering, etc.
Rotation of the cab/arm
Extension of the arm - Ideally I'd use more than on motor here, as I'd like to be able to move the bucket and segments of the arm independently, however I've got a mechanism that works to "extend and dig" in one motion.


Obviously as it stands, the NXT can only control 3 separate motors - so I'm not necessarily wedded to LEGO only solutions.
There are electrical multiplexers as mentioned, however there are also many types of mechanical multiplexers. The idea behind this is to use fever motors to do more.
The advantage is the reduced weight and the disadvantage is the increased complexity and lower flexibility.

For example, you can control both tracks with one motor. However instead of one motor making the threads more forwards and backwards, you remove the 'backwards' function and replace it with 'right-turn'. So when the motor drives forward, the bot moves forward, when the motor drives backwards, it turns right. You can't drive backwards or turn left however. A simple (but poor) implementation can be found in the R.I.S. 2.0 instructions.

While this is restrictive, you can do other similar tasks without loosing important functionality. Another old trick is the 'grab and lift' mechanism which both grabs and lifts an object in one movement. When you lower it again and it reaches the bottom, the grabber opens up. While you can't open the grabber while it is lifted, it normally isn't important.
See The snatcher by Laurens as an example, which keeps two motors for the threads, but uses this technique to only use one motor for the arm.

Another prime example is with pneumatics, using a single motor to both pump and control a switch. See DiMastero's differential solution. It will pump no matter which direction the motor is turning, however turning it one way will push the switch in one direction, and the other when turning it the other way.
(It will pump while the switch is switched from one position to another, but again, this is a minor drawback considering the gains.)

While the previous examples are solutions to specific problems, they highlight the ideas:


Do different tasks under different situations. (Drive on clockwise, turn on counter-clockwise.)
Chain several tasks together. (First grip, then lift.)
Do several things at once. (Pump, while controlling the switch.)


The first point on the list, doing different tasks under different situations, is the most easy one to make a general implementation. You can split up the clockwise and counter-clockwise direction of the motors, to control two different tasks. While a bit restrictive, it is useful it certain situations.

A less restrictive solution is the 2 to n multiplexer. One motor gives the power, while another motor controls which task to transfer the power to. ('n' can be quite large, however something like 3 or 4 is more realistic in moc's.) I have come up with a few other versions, including some which allows controlling multiple motors at once (limited to same direction and speed).

Example to your specific problem

Use a 2 to 3 multiplexer. Output 1 and 2 controls the rotation and arm respectively. The threads are done using an adder/subtracter mechanism, use the last free motor to drive it and output 3 from the multiplexer to steer.

I would position the multiplexer above the turntable so that you just need to transfer the adder/subtracter axle through it.



Some more examples as requested.

Here is a more advanced version of driving and turning with tracks using one motor:

When the motor is turning counter-clockwise the mechanism will work like normal, driving both tracks forward. However when it turns clockwise, the yellow knob gear prevents one of the axles from moving, causing the last differential to stop and this causes both tracks to move in the opposite direction of each other, making it turn on the spot.

The knob gear is the crucial part, as it prevents action depending on the rotation direction. Here is a more generic version:

Depending on the direction of the input, only one axle will turn.

Moving on to the actual multiplexers, here is a mock-up of a 2 to n multiplexer:

Notice that the black gear can slide on the two axles, so that it can connect to both the light-gray and the dark-gray gear, depending on the position. You could have as many gears/outputs as you want in theory.
I used this to create a pneumatic control station, which had 4 outputs, each controlling one pneumatic switch.

Here is a 3 to 4 multiplexer which uses transmission parts:

The dark-gray axle is the input, and the 4 light-gray axles are the output. Depending on the position of the red sliders, a different output is chosen. The interesting aspect of this one is that you can have two outputs active at one time, which is not possible with the 2 to n multiplexer.



As a final note I would like to point out that I have used all of these methods in actual RCX/NXT projects in order to do more than what I could otherwise have done with just 3 motors. They are not just theoretical solutions.

I do not see the maximum of 3 motors as a disadvantage, but as a limitation which challenges me to find other solutions to the problem so it can be done with just 3 motors.