So I was wondering if putting a capacitor on a brushed DC motor (like the micrometal motors from pololu) would cause them to even out (make them run at the same speed) because right now, one of the motors seems to always be moving faster than the other, but not always exactly as fast, so trying to get them to move at the same rate is becoming a big problem.
The thing I’m trying to get at is, when both motors at set at 100 (as in 100/255) the robot curves. So if I added something like a capacitor, or a resistor, which would give the motors a regulated voltage, would that help control the motor’s RPM/speed, if the speed is always set at 255/255?
You wont be able to do anything with a capacitor, but a resistor can slow the faster one down. You could try a 1 ohm resistor, but make sure it is at least 1/4W. This isn’t a very good solution though, as resistors and capacitors do not regulate voltage.
The best solution is to have encoders on each motor, and adjust the speeds in software using that as a reference. If encoders aren’t practical, then you can try simply using different speed values (100 and 99 for example). If the difference is less than one speed unit, what you can do is “nudge” the robot every couple seconds in software.
As Darth Maker says, the best solution is to use encoders. In general, you should not expect two same-model motors to move at exactly the same speed when supplied the same voltage, because there are minute differences between motors that result in some speed variance. Making a robot drive straight is a fairly complicated task that typically requires some sort of closed-loop feedback (e.g. how well do you think you could get your car to follow a straight line if you were driving blindfolded?)