Have you ever built a motorised robot with one motor per side (like several of the examples in the Mindstorms instructions) and found that it goes in circles? If you have, then read on...
The problem is caused by slight differences in the motors, connectors, and even the output stages of the RCX (or whatever you use to control them). To alleviate this problem, you have a couple of choices:
- Experiment to find the power settings that cause it to go in a straight line. This is OK, but it means if you use any other power settings in your program, you'll have to apply the ratio every time. Also, as batteries run down, this may affect each motor differently, requiring another "measurement".
- Build an Adder / Subtractor! You won't need to do the "trial & error" measurement, and programming is a lot easier!
The priciple is to use two differentials to provide a gearbox with 2 inputs & 2 outputs. The outputs 1 & 2 are geared to provide the sum & difference of the inputs A & B, ie: 1 = A + B, 2 = A - B. In this configuration, applying power to A will cause 1 & 2 to turn in the same direction, providing forward / backward movement, while power at B will turn them in opposite directions, providing turning ability. And because the two can be added, you can get both results simultaneously.
The way this is generally implemented is using 2 differentials. Diffs intrinsically provide 1 output which is the sum of two inputs. (Yes I know cars get 2 outputs from 1 input, but that requires a "feedback" between the two outputs.) So all you need to do is feed input A into diff 1 & 2, while feeding B into diff 1, and inverted (reversed) into diff 2, providing the requisite outputs 1 & 2.
And if you study the logic, you'll quickly see that reversing either of the outputs reverses the function of the inputs. eg Reversing output 2 makes it 2 = B - A, and now B produces forward / backward movement, and A rotates.
So much for the (brief) theory. The challenge is to implement this in as little space, and with as much strength as possible. Here's my two versions:
Well, it works, but looks like a pig. This is the first attempt, and was inspired by <http://carol.wins.uva.nl/~leo/lego/diff.html Leo's design>, but modified a bit. It requires a 90 degree conversion from the outputs to the wheels, which increases the overall size, and getting power to the inputs was also not optimal. These problems led to my second design.
Actually, after I started my second design, I re-thought version 1, and came up with a much nicer variation. So much nicer, in fact, that I wont even bother showing you the first variation. Below are some pictures:
A little clarification may be in order. Looking at the detail shot (left), you can see that the outer casing of the 2 diffs are meshed, using the 24 tooth wheels. This means turning either one will result in the other turning the same speed in the opposite direction, and if the other input (16 tooth gear far left) is held stationary, both driving wheels (right, top & bottom) turn in the same direction, twice as fast as you drive the diffs.
Holding the diffs stationary while driving the "difference" input (16 tooth, left) results in both diff pinions being driven in the same direction, resulting in the driving wheels turning in opposite directions. Because the input is reduced by 2:1, they will turn half the speed of the input, or 1/4 the speed they would turn if driven by the "common" input at the same speed.
The final chassis has the "common" input reduced by 3:1, and the "difference" input by a further 2:1. This means the common input has "more effect" on the output than the difference input, meaning you can drive it faster than you can turn it (I call this a safety feature!!)
Stefano Prosseda has done a smaller version here.
As you can see, the 2 diffs are now end-to-end across the vehicle. This reduces the size considerably, and in my opinion, just [looks nicer]. It's also a bit stronger, and as you can see, the whole thing is more symmetrical, and the motors don't waste as much space. The major problem is the extra width.
OK, so you can't see it. It looked really nice on paper, but because of some unforseen problems, and the 'enhanced version 1' turning out so well, I kinda just gave up on this. So there'll probably never be any pictures. Sorry if I got your hopes up!!