Arduino + Motor Driver problem.

I’m having some trouble with a project I am working on. It seems that when I only attach one motor to the driver (http://www.sparkfun.com/products/9670), it will go forwards or backwards, but when I connect both, they will only spin in one direction, or not move at all. Sometimes they will reverse the first time.

Here is a quick sketch of how I have things hooked up:

[

Uploaded with [ImageShack.us

I’m currently using power window motors. I’m wondering if maybe they are drawing more power than the motor driver can push. If so, I may need to get another one.

It says in the specs that the driver can be used in a bridged mode. Would that be as simple as connecting both sets of outputs to a single motor, and connecting the appropriate inputs as well?

Thanks for any help!](http://imageshack.us)](ImageShack - Best place for all of your image hosting and image sharing needs)

What is the voltage from the battery at the motor drive board when one or two motors are running?

What battery are you using?

I’ll guess that motors are rated for 12V (automotive system), how much current do they draw when directly connected to the battery?

Sorry about the poor labling, it’s a 12V battery.

Ammeter reads 1.6 amps. So, two would be a little over 3A, which should be alright.

When you say it draws 1.6 amps, that is with the motor turning freely right?

I’m no expert so take this with a grain of salt but I think that the starting current is higher than 1.6A and that trying to draw too much current is your problem.

blakeateit:
it’s a 12V battery.

That’s not an answer to waltr’s question. :frowning: What matters is: What is the voltage at the motor when the motor is trying to run? If you have a fully-charged, high-current “12 V battery” and low impedance, both inside the battery and in the power circuit, the actual voltage could be above the nominal voltage. Contrarily, the battery charge state, battery internal impedance, or power circuit impedance could (particularly when the motor is trying to start or is under substantial mechanical load) cause the actual voltage to be much less than the nominal voltage.

blakeateit:
Ammeter reads 1.6 amps. So, two would be a little over 3A, which should be alright.

On what did you base that conclusion? What you’re doing does seem to be within the specified performance of the motor driver, but we don’t yet know if the battery you’re using is sufficient.

Eric

growler:
When you say it draws 1.6 amps, that is with the motor turning freely right?

I’m no expert so take this with a grain of salt but I think that the starting current is higher than 1.6A and that trying to draw too much current is your problem.

Hard to say exactly with a $5 multimeter, but the starting current seems to peak somewhere around 1.9 amps.

Also, the motors both turn fine when connected to the motor driver, the problem is that they do not reverse.

esklar81:
On what did you base that conclusion? What you’re doing does seem to be within the specified performance of the motor driver, but we don’t yet know if the battery you’re using is sufficient.

Based on the actual current draw being less than the rated amount for the motor driver. This margin gets closer at motor start up, but both motors do turn. Unfortunately only in one direction.

esklar81:
What matters is: What is the voltage at the motor when the motor is trying to run? If you have a fully-charged, high-current “12 V battery” and low impedance, both inside the battery and in the power circuit, the actual voltage could be above the nominal voltage. Contrarily, the battery charge state, battery internal impedance, or power circuit impedance could (particularly when the motor is trying to start or is under substantial mechanical load) cause the actual voltage to be much less than the nominal voltage.

I don't have the driver handy at the moment, but with both motors connected to the battery in parallel, voltmeter reads 8.9V .

Would an inadequate battery cause the mono-directionality?

blakeateit:
I don’t have the driver handy at the moment, but with both motors connected to the battery in parallel, voltmeter reads 8.9V . Would an inadequate battery cause the mono-directionality?

Indirectly, it could. How are you providing logic power (5 Vdc) to the motor driver board and the microcontroller?

The [motor driver board manual describes two options:

a) Use the on-board 5 V regulator to provide logic power for the motor driver board and (optionally) for an external device, such as a microcontroller. (This is convenient, as you don’t need to provide a separate logic power supply.)

b) Use an external source of 5 V for the motor driver board’s logic. (This protects the logic from noise and dips in the motor power.)

A jumper is used to select the option.

Your sketch does not show a source of 5 Vdc, nor does it show the 5 Vdc output from the motor driver board being connected to your microcontroller. Which configuration are you using? If you are using the 5 Vdc regulator on the motor driver board for the motor driver board’s logic or for your microcontroller, the drop in the input voltage when the motors try to start may be enough to cause the regulator’s output to fall far enough below 5 V to cause the logic of either the microcontroller or the motor driver board to fail.

We can estimate the input voltage to the motor driver board at startup this way:

You reported 8.9 V and 3.2 A when both motors are running freely connected in parallel to the battery.

You did not, however, report what the voltage is with the battery disconnected, so I’ll assume it’s the nominal value, 12 V.

Using [Thevenin’s theorem:

Vout = Vth -(I * Rth)

Rearranging get us:

Rth = (Vth - Vout)/I = (12 V -8.9 V)/3.2 A = 0.97 Ω

Your reported value of 1.9 A as a starting current is, frankly, far too low to be credible. (It’s not that I don’t believe that’s what you saw on your meter, it’s that I doubt your meter is fast enough to measure the peak, and, unless it has a peak hold function, I doubt the human eye is fast enough, even if the meter were.) A typical value for starting current is 5 X running current, in your case, 16 A.

Applying Thevenin’s theorem to the estimated starting conditions:

Vout = Vth - (I * Rth) = 12 V - (16 A * 0.97 Ω) = - 3.52 V

This indicates two things:

a) There are limits to how far Thevenin’s theorem will work for us, as the voltage is not going to reverse. (It can, however, get arbitrarily close to zero.)

b) Your motors appear to be able to provide enough load to drop the voltage being fed to the regulator well below what it needs to get to provide 5 Vdc for the logic.

For a single motor, the estimated Vout is:

Vout = Vth - (I * Rth) = 12 V - (8 A * 0.97 Ω) = 4.24 V

which might be enough to avoid the logic failures you appear to be getting.

If you don’t have a faster ammeter, you can approximate the inrush current by measuring the resistance of the motor coil and applying Ohm’s law:

Iinrush ~ Vin/Rmotor

I suggest you do the following:

  • - Check and report the logic power jumper setting on the motor driver board.
  • - If the jumper is set to use the on-board regulator, move it to the external 5 Vdc position, provide 5 Vdc for the motor driver board logic from a separate source. (I don't know how much logic current the motor driver board requires, but it may be possible to provide that from a 5 Vdc output from your microcontroller. However, the input power to the microcontroller must be independent of the battery you're using for the motors, or the same problem will occur in the microcontroller's power circuit.)
  • - If the jumper is set to use an external source of 5 Vdc, measure the voltage at that point when you try to start and run the motors. My expectation is that the voltage will, if you are getting that 5 Vdc by regulating the output from the same battery, dip far below 5 V during startup. (You may not be able to see the dip with your meter, though.) Try an independent 5 Vdc supply for the logic. (If you are getting the 5 Vdc from the microcontroller board, provide that board with a power source independent of the motor battery.)
  • - Test your circuit with small light bulbs, instead of motors. Light bulbs are resistive loads, so they don't exhibit the inrush current that motors do. A tail light bulb (1157) is probably the right size. (To avoid overloading the motor driver board, make sure the resistance of the bulb is at least

    R = V / I = 12 V / 2 A = 6 Ω.)

  • If my theory is correct, you may be able to get your system to work from a single battery by using a much larger battery or by using capacitance to maintain adequate voltage for the logic while starting the motors.

    Good Luck,

    Eric

    ](Thévenin's theorem - Wikipedia)](http://www.canakit.com/Media/Manuals/UK1122.pdf)