Building a motor control feedback loop

My current project consists of a Rover 5, an Android phone and a bluetooth transceiver. My goal is to control the rover via bluetooth, from my phone. I'm using the Amarino toolkit, which really is great.

I have come as far as to being able to control the speed on the motors (there are 4 of them) independently. My problem comes forth when I try to run them together. The rover has belts that physically connects two motors together, and when I realized that the motors run at different speeds when I supply them with the same voltage (It's measured), I had a problem.

I've googled my problem, and it seems everyone is using engine controllers to counter this problem, but I want to build this by myself. If possible..

Each motor has a rotary encoder(quadrature), which produces a frequency (actually two, 90 degrees out of phase) based on it's speed. My idea is to compare two frequencies (from the two motors at the same side). Then I want that difference to either increase or decrease one of the two motors' voltage, so that two and two motors run at the exact same speed.

I am now using the PWM output of the Arduino to control the voltage of the motors.

I can't seem to put this idea into programming language(or electronic components), and I'm not even sure it is doable. Maybe I'm thinking too complicated, and there is another much easier way to counter this problem?

My mind is open for suggestions!

reliassen:
My mind is open for suggestions!

Rather than run the motors independently, or dual motors on each side in parallel, have you tried to run the motors on each side in -series-?

That is, for each track's set of motors:

Motor Driver A ------- Motor 1 -------- Motor 2 -------- Motor Driver B

What this should do is balance the current between the motors, in effect giving you a form of "electrical differential"; the differences in speed should cancel each other out, and your tracks should stay on.

It's worth a try at least, if you haven't already tried it...

That is a good idea, but when I tried it, it didn't work as expected. I really thought it would work, but now one motor runs at full speed and the other runs at a very low speed. I don't understand why, since in theory the same current should flow through them..

The attachment shows how I connected the motors.

Serial.jpg

reliassen:
That is a good idea, but when I tried it, it didn't work as expected. I really thought it would work, but now one motor runs at full speed and the other runs at a very low speed. I don't understand why, since in theory the same current should flow through them..

The attachment shows how I connected the motors.

Are they both turning in the same direction (on the same side)? It should work; it is a fundamental method of how the 12 volt DC dual-motor PowerWheels cars are wired for high and low speeds; when the selector "shift" switch is in one position, the motors are wired in series, and when in the other position, they are wired in parallel.

Then again, that is without any form of PWM or transistor doing the switching; what happens if you take the Arduino/PWM/transistor of the equation and just hook the battery directly to the motors?

They are both turning in the same direction yes. I noticed that the drawing is incorrect, the bottom motor polarities are reversed. Is it possible that the impedance of the motors are different (not accurate enough), and that is why they run at different speeds with, in theory, equal current flowing through them?

I will try to hook them up directly to the battery, and see what happens then.