Motors cause erratic arduino behaviour

I have a dual MC33926 shield on an Arduino uno.
I have 2 12V windscreen wiper motors connected to the shield
I have 2 12V batteries, one to power the ardiuno, the other to Power the shield
When I run the arduino and shield without the motors connected all appears correct (leds on shield light up for correct direction etc.)
When I connect motors, all runs ok for maybe one or 2 cycles and then erratic behaviour - one motor just keeps running, or none run when they should etc.
Previous posts and googling suggests noise suppression capacitors (I have installed 3 per motor)
Also I have seen suggestions for inline diode on arduino power line and a cap across vin and gnd on Arduino which I have done
I have also separated the power sources for the Arduino and the Shield.
still the erratic behaviour persists
I have also swapped out the shield for another I have - same behaviour
Has anyone got any further suggestions ?

I have also measured the current drawn as the motors run and it looks like the current peaks at around 5.8 to 5.9 A

Hello.

It sounds like you might have a power issue. Could you tell me more about your batteries (e.g. their capacities) and your motors (e.g. their stall currents)? Are the batteries freshly charged? If you have access to an oscilloscope, could you take a look at the supply voltage when the erratic behavior occurs? Can you post the simplest program that demonstrates the issue along with a clear description of what you expect to happen and what actually happens when the program runs? Pictures and a schematic of your setup would be helpful.

Also, how did you measure the motor current? If you’re seeing that with a multimeter, I am concerned that it is actually peaking much higher for a short period of time, and that is getting to be well past what the MC33926 is rated for.

- Jeremy

Greetings
See images of battery type and motor
I have also pasted in the sketch below.
If it is indeed the case that the driver cannot handle the current load, what options are there to place something that can handle the current between the motor and the motor driver shield?

#include “DualMC33926MotorShield.h”

DualMC33926MotorShield md;

void stopIfFault()
{
if (md.getFault())
{
Serial.println(“fault”);
while(1);
}
}

void setup()
{
Serial.begin(9600);
Serial.println(“Dual MC33926 Motor Shield”);
md.init();
}

void loop()
{
md.setM1Speed(400);
stopIfFault();
Serial.print("M1 current: ");
Serial.println(md.getM1CurrentMilliamps());
delay(2000);
md.setM1Speed(0);
md.setM2Speed(400);
stopIfFault();
Serial.print("M2 current: ");
Serial.println(md.getM2CurrentMilliamps());
delay(2000);
md.setM2Speed(0);
md.setM1Speed(-400);
stopIfFault();
delay(2000);
md.setM1Speed(0);
md.setM2Speed(-400);
stopIfFault();

delay(2000);

md.setM2Speed(0);
}

Hello.

We cannot tell from the picture what kind of current the motor draws. If it draws more than the MC33926 can handle, you will need a more powerful motor driver. Without knowing the current draw of the motor, we cannot recommend a driver.

-Derrill

Greetings
JeremyT in his earlier post mentioned that the current readings from my multimeter could be misleading.
So what is the best method to read the true current consumption of the motor?
Also, assuming that the current drawn by motor is in excess of what the driver shield can deliver, is there a way of adding something between the MC33926 shield and the motor to beef up the current supply, or must I replace the current shield with something with a greater current rating?
Regards
Dimitri

In JeremyT’s earlier post he was referring to quick current spikes that might occur when the motor is spinning but would be too fast for the multimeter to detect. However, you should be able to use a multimeter to determine the approximate stall current of your motor by powering it with a low voltage power supply (such as a two-cell battery pack) and holding it in a stalled state while measuring the current. The current will vary linearly with the voltage, so you should be able to extrapolate from the low voltage measurement what it would be at 24V.

It is not practical to further amplify the output of the MC33926 shield (the motor driver is already acting as an amplifier); you would need to get a more powerful motor driver.

-Derrill

Thank you for your advice. I shall perform the requisite measurements and obtain a suitable motor driver