Controlling a DC motor with Arduino UNO and VNH5019 Motor Driver

Thread Starter

azazellohun

Joined Sep 8, 2017
3
I am a mechanical engineer student and building a self balancing inverse pendulum for my project, although I have very limited understunding of electronics.
The reaction forse used is the torque provided by a DC motor. The operation involves rapidly changing the direction of the motor and getting big amplitudes of torque out of it in both directions. I also am not a native english speaker so pardon me if I use incorrect phrases.

In my initial set up I used a Cytron 13A, 5-25V Single DC Motor Controller. The motor should only drain 7A at stall so I thought this driver IC should be more than enough. It worked for a long period of time but at one point something went wrong and the motor driver failed and now it's shorted on the battery side (I guess): the cables connected to it (from a 9.6 V airsoft battery) heated up very quickly and the plastic casing melted (and the motor driver won't even turn on now). I think the motor is still operational (I connected it directly to the battery and it worked).
I need help with figuring out what did I do wrong and to prevent future malfunction protecting both my arduino and the new motor driver I ordered.

The new IC's datasheet has something about thermal protection, u
ndervoltage and overvoltage shutdown, and current limitation in it but I'm not sure if it is enough to protect it.
It also speaks about reverse battery protection (2.5 Reverse battery protection, page 19) and series resistors that must be inserted to the microcontroller I/Os, but I have trouble understunding the formula presented there and what to do exactly.
Is V
CC the voltage of the battery, what is VIOs , should I insert those resistors between the arduinos OUT pins and the motor driver, and will the motor driver get the control signals through them?

Thank You for your help in advance
 

MrAl

Joined Jun 17, 2014
11,494
Hi,

When i was studying control theory the inverted pendulum was for me a cute way to see just what control theory can do. I never built one, but had to go through the math that would show how the control system would have to work.

One of the things about any power system though is the specs of all the components have to be checked carefully. Often the absolute limits are given in a single dimensional form and in this form the other parameters are assumed to be in proper range.
Case in point for a simple example is a regulator such as the LM317. The limit on current is a given spec, but that does not mean that you can always get that current level. It depends on other things too and if certain conditions are not met the max current can be much lower.

So the idea then is to go over the specs and combine then with other specs and see if something did not cause a problem, such as overheating. This requires a little thought.

Another problem that comes up in power circuits with bridges and motors or transformers or inductors is the inductive kickback spike. It has to be properly handled or it could blow transistors. It might seem like the diodes can handle the kickback but because the diode in the opposite transistor handles the spike, that means there could be significant inductance between the transistor and the diode, which still leaves room for a significant spike across the transistor. To remedy this, a snubber circuit is usually employed. This is a circuit that is designed to absorb the spike energy and prevent the voltage peak from shooting up too high. This circuit must be wired in close proximity to the transistor it is meant to protect however so that there is little inductance between it and the transistor collector and emitter.

Since the destructive effects of a lack of a snubber may not be noticed right away, this could be the reason for the problem. The other possibility is overheating due to poor heatsinking or a rise in ambient temperature.
 

shteii01

Joined Feb 19, 2010
4,644
Suggestion for the future.
The fact that you melted the insulation tells me that proper protection was not employed. Next time include a fuse into your wiring.
 

Thread Starter

azazellohun

Joined Sep 8, 2017
3
First of all thank you for your answers!

I'll definitely employ a fuse to prevent future meltdowns.
upload_2017-9-9_15-34-31.png

As for what MrIA said;
I've read that these snubber circuits could be RC snubbers and diode snubbers (or RCD snubbers). But...
In case of a diode wouldn't it prohibit the motor to run in both directions?
And for the RC snubber, how could I calculate the R and C values?

And you said that
This circuit must be wired in close proximity to the transistor
.
Where exactly I should implement it and how?

And for last, the datasheet of my IC states that in the case of reverse batter condition "Series resistor must be inserted to limit the current sunk from the microcontroller I/Os." given by the formula:
upload_2017-9-9_15-56-10.png
but I don't know what VIOs and VCC are exactly and that the control signals could get throgh them.
 

Attachments

MrAl

Joined Jun 17, 2014
11,494
First of all thank you for your answers!

I'll definitely employ a fuse to prevent future meltdowns.
View attachment 134643

As for what MrIA said;
I've read that these snubber circuits could be RC snubbers and diode snubbers (or RCD snubbers). But...
In case of a diode wouldn't it prohibit the motor to run in both directions?
And for the RC snubber, how could I calculate the R and C values?

And you said that
.
Where exactly I should implement it and how?

And for last, the datasheet of my IC states that in the case of reverse batter condition "Series resistor must be inserted to limit the current sunk from the microcontroller I/Os." given by the formula:
View attachment 134644
but I don't know what VIOs and VCC are exactly and that the control signals could get throgh them.

Hi,

You may be thinking of a diode CLAMP circuit instead of a SNUBBER.
A clamp circuit clamps the voltage when it reverses so that the voltage stays very low. A snubber just absorbs the energy of the back EMF spike so that it stays low, but does not prevent the full voltage from getting to the output.

The RC values are chosen based on the energy in the spike. Using a scope you can look at the spike and come up with some values, or you can try some values until you see the spike get reduced to a low enough level so that nothing gets damaged.
The snubbers are usually made with a diode and resistor and capacitor. The diode conducts and charges the cap and that absorbs energy, then the resistor discharges the cap and gets it ready for a new spike later. There are various schematics on the web showing these circuits.

Also, a good capacitor across the supply lines is a good idea too so that back emf energy has a low impedance path with the diodes that are build in.
 

MrAl

Joined Jun 17, 2014
11,494
Thanks for the help :)
Hi,

You're welcome, and here is a little more info.

The bleeder resistor average power is:
Pavg=((1-e^(-2*t1))*A^2)/(2*Tp*R)

where
A is the peak amplitude of the spike in volts,
t1 is the approximate duration of the spike (approximate because it's hard to tell when it reaches near zero) in seconds,
Tp is the total period in seconds,
R is the bleeder resistor value in Ohms.

It is hard to estimate the energy in the spike itself with little information. Connecting a snubber into the circuit however allows us to look at the voltage across the resistor (the spike) and then compute the energy during discharge, and that allows us to size the resistor.
The resistor value has to be small enough to keep the voltage low enough as the cap charges, and the power rating has to be about twice that of the average power. In many cases it will get hot anyway so precautions have to be taken to not allow that heat to bother any other components or case plastic, etc.

The attachment shows the spike and a typical snubber. The voltages shown are measured across the resistor Rs.
 

Attachments

Top