Page 1 of 1

10A Motor Shield Restart Problem

PostPosted: Sat Jul 22, 2017 4:22 pm
by germ
I have a 10A Motor Shield (SHIELD-MD10). I am using it to drive a windshield wiper motor. I've discovered that when changing speed from high to a low speed (or changing direction) dramatically, the board appears to power down and then restart. Is this normal? Is there something I can do to avoid this (like, for example, a feedback diode)?

Here is a sketch that can duplicate the problem with my motor.

CODE: SELECT_ALL_CODE
const static int MOTOR_DIR_PIN = 8;
const static int MOTOR_PWM_PIN = 9;

void setup() {
  Serial.begin(9600);
  pinMode(MOTOR_PWM_PIN, OUTPUT);
  pinMode(MOTOR_DIR_PIN, OUTPUT);
  digitalWrite(MOTOR_DIR_PIN, LOW);
}

void loop() {
  Serial.println("Setting motor high speed... This does not cause a restart of the board.");
  analogWrite(MOTOR_PWM_PIN, 255);
  delay(10000);
  Serial.println("Setting motor low speed... This causes a restart of the board.");
  analogWrite(MOTOR_PWM_PIN, 100);
  delay(5000);
}

Re: 10A Motor Shield Restart Problem

PostPosted: Mon Jul 24, 2017 11:18 am
by waiweng83
Are you using a power supply for the motor power?
When the motor is being slowed down, the motor will become a generator and generate some current.
Normally this current will flow back to the battery to charge the battery.
However, if the power source is a power supply, this current has nowhere to go and cause a voltage spike and consequently reset your board.

Please try it with a battery instead and see whether this still happen.

Re: 10A Motor Shield Restart Problem

PostPosted: Fri Sep 08, 2017 2:19 pm
by germ
I actually don't have a battery for this. Is there some way to prevent the back flow with a power supply? I've seen suggestions that a diode can act as a bridge, but I'm not much for electronics myself so I'm not sure what sort of diode would be appropriate here.

Thanks!

Re: 10A Motor Shield Restart Problem

PostPosted: Sat Sep 09, 2017 6:12 am
by ober
germ WROTE:I actually don't have a battery for this. Is there some way to prevent the back flow with a power supply? I've seen suggestions that a diode can act as a bridge, but I'm not much for electronics myself so I'm not sure what sort of diode would be appropriate here.

Thanks!

At least we know the reason now. Mind sharing some actual hardware photos?
Diode does not help in this case, as it will still require battery to work.
A few parallel huge electrolytic capacitor might help, but that is might :)
Show us some photos as it will help us to recommend how to make it.

Re: 10A Motor Shield Restart Problem

PostPosted: Mon Sep 11, 2017 4:56 am
by germ
ober WROTE:At least we know the reason now. Mind sharing some actual hardware photos?
Diode does not help in this case, as it will still require battery to work.
A few parallel huge electrolytic capacitor might help, but that is might :)
Show us some photos as it will help us to recommend how to make it.


Not sure what photos would be helpful. I'm using the 10A motor shield, on an Uno. The motor is a windshield wiper motor. The power supply I'm using is a 5A, 12V switching supply, which also seems to periodically switch itself off when this occurs.

I've written code to try and control the speed at which the motor spools down, but it doesn't seem to have much effect.

Re: 10A Motor Shield Restart Problem

PostPosted: Tue Sep 12, 2017 10:39 am
by ober
Well, the advise is still to use battery.
Since there is no battery, you will need to use huge electrolytic capacitor and parallel with the power supply, with the hope the capacitor can adsorb the fly back voltage generated when the motor is slowing down.

And how is your UNO is being powered? Using the same power supply as the motor driver shield?

Re: 10A Motor Shield Restart Problem

PostPosted: Tue Sep 12, 2017 1:27 pm
by germ
ober WROTE:Well, the advise is still to use battery.


Yeah unfortunately a battery just isn't going to work for me. If that's really the solution I can always try a different motor shield. That would be unfortunate.

ober WROTE:Since there is no battery, you will need to use huge electrolytic capacitor and parallel with the power supply, with the hope the capacitor can adsorb the fly back voltage generated when the motor is slowing down.


How big of a capacitor are we talking here? I'm just fine with math and such, but I'm not familiar with any sort of equations that would suggest how much flyback voltage is being generated, etc.

I guess I'm also still a little confused on why a flyback diode wouldn't work. In fact, since my motor will only ever turn in one direction, couldn't I use a number of diodes to ensure the current only goes into the motor in one direction, and then just let the motor dissipate that power in heat?

ober WROTE:And how is your UNO is being powered? Using the same power supply as the motor driver shield?


The Uno and the shield are being powered by a small USB power adapter. That is separate from the 12V, 5A power adapter that is also connected to the motor shield to drive the motor. Both are plugged into the same power bar, if that matters any.

Re: 10A Motor Shield Restart Problem

PostPosted: Wed Sep 13, 2017 12:52 pm
by germ
So I went out and got myself a couple of B10100G diodes. I tried the flyback arrangement, like this:
Image

I additionally tried some more diodes:
Image

The second arrangement seemed to take longer for the motor to spin down, but both cases would only run a few cycles of starting and stopping before the board and Arduino would reset. With those diodes, I'm not exactly sure how feedback current could even cause the board to reset. Is it possible there is something wrong with my board (possibly as a result of something I've done)?

Re: 10A Motor Shield Restart Problem

PostPosted: Sat Feb 05, 2022 7:21 pm
by Kryspin
waiweng83 WROTE:Are you using a power supply for the motor power?
When the motor is being slowed down, the motor will become a generator and generate some current.
Normally this current will flow back to the battery to charge the battery.
However, if the power source is a power supply, this current has nowhere to go and cause a voltage spike and consequently reset your board.


What happens, when the battery is for example Li-pol and charging needs some charging circuit, which is missing?