This post I will explain the workings of a special NXT motorized gearbox. The gearbox is unique because it uses two NXT motors both for driving the output and for shifting gears. As such the full power of the two motors is available for propelling a device while there is no need for a dedicated motor for shifting.
For its inner workings the gearbox uses differentials. Therefore it is good to understand how a differential works. A differential can be used in two ways. In most cases a differential is used to distribute the power of one motor evenly over two wheels. A setup like this isfound in cars for example. A differential can also be used to combine two power of two motors into one output shaft. When used this way the output shaft will have the combined power (torque) of the two motors and the average speed of the two motors. A setup like this is used when the exact speeds of the two motors might be slightly different.
This gearbox uses one differential to combine the output of the two motors. The output shaft of the differential is connected to a simple gearbox having two shifts, the low gear has a ratio of 1:1, the high gear has a 1:3 ratio. The gear shifter is controlled by the motors via a second differential. But this time the direction of one of the motors is reversed before going into the differential. Also this differential outputs the mean speed of the two motors. But as one of the motors is reversed this means that when to motors are turning at the same speed that the output shaft of this differential will not move at all. Also the gear shifter, that is connected to the second differential, will be at rest. If however both motors rotate at different speeds, then the output of this differential will be rotating and also the gear shifter will move. Changing the gearbox to another gear. So gears can be changed by speed differences between the two motors.
Of course you will need to control the speed of the motors exactly for this gearbox to function properly. Luckily the NXT motors have tachometers and can be controlled precisely.
In this example I used speed differences to control a gearbox. The same technique can also be used to drive a steering mechanism for example. Then one would just need two motors both to drive and steer a robot whilst having the full power of both NXT motors available for propulsion. As the NXT only has three motor ports, this can be a good way to free one motor for other purposes, like grabbing, lifting or scanning.
This video shows how the gearbox is working.
this video shows the gearbox in action.
And here are some detailed pictures: