Pages: [1]   Go Down
Author Topic: Motors and Controllers  (Read 382 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone,

Let me start by saying i am very new to the Arduino and I am just starting to teach myself how to use many of the controllers, displays, sensors, and arduino code in general. My Question is very basic but I will provide some detail of goal i'm trying to accomplish

Goals: to control a stepper motor with a potentiometer, and use the L298N dual H Bridge DC stepper motor controller to interface with the Arduino (I want to learn the controller for scaled up projects and bigger motors).

My circuit is not complete yet, however my question at this point is aimed at the code which is my weak part about this hobby....
Is using a motor controller/shield like the one i'm using going to change the code i try to find or write? That is to say could i use code from the arduino library even though i will be using the controller (i know this question might be very easy to answer but im very new and i like to have some code to start with before i build) any help is helpful

Thanks!   



Logged

Offline Offline
Faraday Member
**
Karma: 100
Posts: 5982
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do us  all a favor and spend 30 to 60 minutes Googling "arduino L298 H-Bridge Driver Examples" before asking that question.
You are expected to do your due diligence researching your topic before posting on the forum. Our job is to help you when you are unable to find the answer yourself. There are tons of examples online complete with schematics and code. The fact that you asked that question indicates you have not done your homework.
Come back after you have researched it.
« Last Edit: September 04, 2014, 11:03:08 pm by raschemmel » Logged

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9682
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Reading material

https://www.google.com/search?as_q=L298N+stepper+motor+&as_epq=&as_oq=&as_eq=&as_nlo=&as_nhi=&lr=&cr=&as_qdr=all&as_sitesearch=http%3A%2F%2Fforum.arduino.cc%2Findex&as_occt=any&safe=images&tbs=&as_filetype=&as_rights=&gws_rd=ssl
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

UK
Offline Offline
Tesla Member
***
Karma: 135
Posts: 7651
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do yourself a big favour and use a proper stepper motor driver board such as an Easydriver or a Pololu A4988. An L298 is a very poor choice for driving stepper motors.

...R
Logged

Offline Offline
Faraday Member
**
Karma: 100
Posts: 5982
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good point Robin, even though that wasn't my point. (which I think still applies to the A4988 code and schematics).
Logged

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Offline Offline
Jr. Member
**
Karma: 1
Posts: 83
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Raschemmel, I find your tone condescending and snippy.  Though the OP may not have worded his question so you could understand , it doesn't really deserve your response of "do your homework".

Robin had a good response.  Find a chip that powers and sequences the windings for you, and you take a lot of the gruntwork out of moving a stepper.  Now if only it ramped up, down, and kept position.  Oh wait, we have to give the Arduino something to do.
Logged

Offline Offline
Faraday Member
**
Karma: 100
Posts: 5982
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is using a motor controller/shield like the one i'm using going to change the code i try to find or write? That is to say could i use code from the arduino library even though i will be using the controller (i know this question might be very easy to answer but im very new and i like to have some code to start with before i build) any help is helpful  


@Metzner49,

My point is simple. The forum should never be anyone's first stop. I don' t see anything condescending about asking someone yo take 5 seconds to Google the topic . The  internet is rife with examples for the L293. I responded to the OP's question about the L293.  
A Google search of the L293 would locate example code for that chip. A Google search of "arduino stepper" would yield both L293 code and A4988 code which uses the AccelStepper Library. An examination of the examples in the two libraries would basically answer the OP's question, would it not ? (without needing to post on the forum.)


@ OP,

The short answer is YES.  If you use the L293  , you can't run code written for a proper stepper like the A4988  because  it uses three control pins (EN, DIR, & Step), whereas the L293 uses  six (ENA, ENB, IN1, IN2, IN3  & IN4). The IDE comes with the Stepper library which will work with the L293. Look up the AccelStepoer library and compare that code to the Stepper library code.
The point is not that we don't want to help you. It's a "give a man a fish etc...."/"teach a man to fish etc. "  scenario.  90% of what we do here when we answer posts is Googling. We don't know everything, but we know a lot about searching for information.
When you decided to use an arduino, you joined that club whether you like it or not. You will be researching everything with Google every time you decide to build a new circuit or start a new project. We waste a lot of time answering unnecessary questions so we try to train Newbies to learn to research so they will not be handcuffed to the forum. You can learn just like we did, (and still do). I was in your shoes a year ago when I bought my first arduino on October 30, 2014. Your question was a valid one , but one you could have answered yourself. If more people did a little research before posting we would have more time to spend on each post. Welcome to the forum, (where you do all the legwork..)...

 https://github.com/adafruit/AccelStepper  
« Last Edit: September 16, 2014, 10:30:23 am by raschemmel » Logged

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 5594
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do yourself a big favour and use a proper stepper motor driver board such as an Easydriver or a Pololu A4988. An L298 is a very poor choice for driving stepper motors.

Well - today it is. But if you have a lot of them (I have a few tubes worth myself) - they are cheaper overall. And provided you stay within the parameters of the design, they work fairly well (with proper heatsinking, of course).

Finally - they work best (for steppers, at least), when paired with the L297.
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Offline Offline
Faraday Member
**
Karma: 100
Posts: 5982
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There is an example in the Stepper library that comes with the IDE called Motor_Knob that controls a stepper motor position with a pot. Look in the IDE "File\Examples\Stepper\MotorKnob"
Logged

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Pages: [1]   Go Up
Jump to: