Pages: [1] 2   Go Down
Author Topic: 12v Motor Control  (Read 2869 times)
0 Members and 1 Guest are viewing this topic.
Florida
Offline Offline
God Member
*****
Karma: 2
Posts: 559
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I have 2 12v motors that I would like to control (speed and direction) using my Arduino and I have a few questions.

1. What parts do I need besides my Arduino, motors and power sources?

2. Are there any programing examples?

Thanks,
Drew Davis
Logged

Ontario, Ohio
Offline Offline
Full Member
***
Karma: 1
Posts: 209
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Need more information. And yes there are tons of programming examples. We need to know what kind of motors. (provide link) And we need to know what you are trying to accomplish with your motors. 
Logged

Florida
Offline Offline
God Member
*****
Karma: 2
Posts: 559
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is the link…
http://www.robotmarketplace.com/products/0-B16.html

I'm building a robot and I need to control the motors speed and direction.

Could I just use a h-bridge (or make my own), plugged in to a PWM digital pin, for direction and use "analogWrite()" to control the speed of the motors?
Logged

Ontario, Ohio
Offline Offline
Full Member
***
Karma: 1
Posts: 209
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You seem to be running before you walk. You might want to check out this tutorial:
http://www.jeremyblum.com/2011/01/31/arduino-tutorial-5-motors-and-transistors/

Rather than make your own h-bridge, this motor driver from Rugged Circuits is very good deal: http://ruggedcircuits.com/html/rugged_motor_driver.html

Here's another series of tutorials that would help you from Tronixstuff:
http://tronixstuff.wordpress.com/tutorials/
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You need a dual H-bridge motor driver. Mosfet ones are best, they run cool and have low voltage drop. I suggest something like http://www.pololu.com/catalog/product/1213. The motor shield from Rugged Circuits looks good to me too.
« Last Edit: October 28, 2012, 12:18:07 pm by dc42 » Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Florida
Offline Offline
God Member
*****
Karma: 2
Posts: 559
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

First off I would like to thank everybody for your help.

Also,
would I program the Dual MC33926 Motor Driver Carrier just like a
SN754410…
http://www.robotshop.com/sn754410-dual-motor-driver-2.html

Thanks,
Drew Davis
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I just spotted that Pololu does a shield version of that motor driver. See http://www.pololu.com/catalog/product/2503. The Resources tab on that page has a link to a user's guide, which includes a sample program.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Florida
Offline Offline
God Member
*****
Karma: 2
Posts: 559
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I did not even know that there were motor shields so thanks for the info!

Also, what do you think about this sparkfun one I found. It is $10 cheaper so if you think it is good I will probably purchase it as I don't have extra money setting around.

http://www.robotshop.com/sfe-ardumoto-motor-shield-arduino.html

Thanks,
Drew Davis
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Also, what do you think about this sparkfun one I found. It is $10 cheaper so if you think it is good I will probably purchase it as I don't have extra money setting around.

I would avoid anything based on bipolar chips such as the L298N (as in that one) or L293. Those chips have a high voltage drop (which also means that they run hot) and no current limiting. They are OK for very small motors if you can tolerate the voltage drop.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Florida
Offline Offline
God Member
*****
Karma: 2
Posts: 559
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 I'm worried about getting the pololu because it looks very hard to program while the SFE seems extremely easy to program.

The motors would be under little stress, would be going pretty slow, and would draw less than 1 A. Also, they would not be running for more than 120 seconds. I could add a fan if needed.

How much do you think the voltage would drop under the circumstance I listed above? Robot Shop said the shield could handle 2amps per channel so I would be using half of it's power.

Thanks,
Drew Davis
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The datasheet for the L298N will tell you how much they drop. The total voltage drop is the sum of the "Source saturation voltage" and the "Sink saturation voltage".
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Florida
Offline Offline
God Member
*****
Karma: 2
Posts: 559
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As you know I'm new to the Arduino (and electrical stuff) and I do not understand the data sheet completely.

1. When it says the "typical voltage loss" does that mean that I can rely on the fact that it will typically be that much lower or are their test results not practical when it come to real applications?

2. What exactly is voltage loss. I know that it means you lose voltage, but when do you lose it? Do you lose it when power goes into the shield, and can combat that with a bigger battery, or can you combat voltage loss with a good program?

Thanks for all of your help,
Drew Davis
Logged

Florida
Offline Offline
God Member
*****
Karma: 2
Posts: 559
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Link to data sheet...
http://www.robotshop.com/content/PDF/l298-h-bridge-data-sheet-dev-09815.pdf
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

As you know I'm new to the Arduino (and electrical stuff) and I do not understand the data sheet completely.

1. When it says the "typical voltage loss" does that mean that I can rely on the fact that it will typically be that much lower or are their test results not practical when it come to real applications?

It means exactly what it says. The voltage drop will typically be somewhere near the "typical" figure, but it could be as high as the maximum figure.

2. What exactly is voltage loss. I know that it means you lose voltage, but when do you lose it? Do you lose it when power goes into the shield, and can combat that with a bigger battery, or can you combat voltage loss with a good program?

It is the difference between the voltage supplied to the H-bridge and the voltage appearing across the motor when the H-bridge is on. You can combat it by increasing the voltage going in to the H-bridge. The lost power is dissipated as heat.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Florida
Offline Offline
God Member
*****
Karma: 2
Posts: 559
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for being so helpful!

I will probably get the one you suggested. 



Thanks,
Drew Davis
Logged

Pages: [1] 2   Go Up
Jump to: