Différences entre versions de « AdaFruit Motor Shield FAQ »

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche
Ligne 14 : Ligne 14 :
  
 
Don't bother writing up uploading code or wiring up motors if the LED doesn't light up, its not going to work.
 
Don't bother writing up uploading code or wiring up motors if the LED doesn't light up, its not going to work.
What is the LED for?
+
 
 +
== What is the LED for? ==
  
 
The LED indicates the '9V' motor power supply is working. If it is not lit, then the DC/Stepper motors will not run. The servo ports are 5V powered and does not use the DC motor supply
 
The LED indicates the '9V' motor power supply is working. If it is not lit, then the DC/Stepper motors will not run. The servo ports are 5V powered and does not use the DC motor supply
Im trying to build this robot and it doesn't seem to run on a 9V battery....
+
 
 +
== Im trying to build this robot and it doesn't seem to run on a 9V battery.... ==
  
 
Please read the user manual for information about appropriate power supplies
 
Please read the user manual for information about appropriate power supplies
Can this shield control small 3V motors?
+
 
 +
== Can this shield control small 3V motors? ==
  
 
Not really, its meant for larger, 6V+ motors. In theory you should be able to get it working with 3V motors but I have no information on how to do so or whether it will work
 
Not really, its meant for larger, 6V+ motors. In theory you should be able to get it working with 3V motors but I have no information on how to do so or whether it will work
What is the power connector on the shield for? How do I power my motors?
 
  
Please read the user manual for information about appropriate power supplies
+
== What is the power connector on the shield for? How do I power my motors? ==
My Arduino freaks out when the motors are running! Is the shield broken?
+
 
 +
Please read the ***LIEN*** user manual ***LIEN** for information about appropriate power supplies
 +
 
 +
== My Arduino freaks out when the motors are running! Is the shield broken? ==
  
 
Motors take a lot of power, and can cause 'brownouts' that reset the Arduino. For that reason the shield is designed for seperate (split) supplies - one for the electronics and one for the motor. Doing this will prevent brownouts. Please read the user manual for information about appropriate power supplies
 
Motors take a lot of power, and can cause 'brownouts' that reset the Arduino. For that reason the shield is designed for seperate (split) supplies - one for the electronics and one for the motor. Doing this will prevent brownouts. Please read the user manual for information about appropriate power supplies
I have good solid power supplies, but the DC motors seem to 'cut out' or 'skip'
 
  
Try soldering a ceramic or disc 0.1uF capacitor between the motor tabs (on the motor itself!) this will reduce noise that could be feeding back into the circuit (thanks macegr!)
+
== I have good solid power supplies, but the DC motors seem to 'cut out' or 'skip' ==
What if I need more than 600mA per motor?
+
 
 +
Try soldering a ceramic or disc 0.1uF capacitor between the motor tabs (on the motor itself!) this will reduce noise that could be feeding back into the circuit ([http://www.ladyada.net/forums/viewtopic.php?f=31&t=10290 Merci à macegr]!)
 +
 
 +
== What if I need more than 600mA per motor? ==
 +
 
 +
[http://www.ladyada.net/make/mshield/use.html You can subsitute SN754410's (at your risk) or piggyback solder some more L293D drivers on top of the existing ones]
  
You can subsitute SN754410's (at your risk) or piggyback solder some more L293D drivers on top of the existing ones.
+
== What pins are not used on the motor shield? ==
What pins are not used on the motor shield?
 
  
All 6 analog input pins are available. They can also be used as digital pins (pins #14 thru 19)
+
'''All 6 analog input pins are available.''' They can also be used as digital pins (pins #14 thru 19)
  
Digital pin 2, and 13 are not used.
+
'''Digital pin 2, and 13 are not used.'''
  
The following pins are in use only if the DC/Stepper noted is in use:
+
'''The following pins are in use only if the DC/Stepper noted is in use''':<br />
Digital pin 11: DC Motor #1 / Stepper #1 (activation/speed control)
+
  <nowiki>Digital pin 11: DC Motor #1 / Stepper #1 (activation/speed control)
 
Digital pin 3: DC Motor #2 / Stepper #1 (activation/speed control)
 
Digital pin 3: DC Motor #2 / Stepper #1 (activation/speed control)
 
Digital pin 5: DC Motor #3 / Stepper #2 (activation/speed control)
 
Digital pin 5: DC Motor #3 / Stepper #2 (activation/speed control)
Digital pin 6: DC Motor #4 / Stepper #2 (activation/speed control)
+
Digital pin 6: DC Motor #4 / Stepper #2 (activation/speed control)</nowiki>
 
+
'''
The following pins are in use if any DC/steppers are used
+
The following pins are in use if any DC/steppers are used'''<br />
 
Digital pin 4, 7, 8 and 12 are used to drive the DC/Stepper motors via the 74HC595 serial-to-parallel latch
 
Digital pin 4, 7, 8 and 12 are used to drive the DC/Stepper motors via the 74HC595 serial-to-parallel latch
  
The following pins are used only if that particular servo is in use:
+
'''The following pins are used only if that particular servo is in use:'''<br />
 
Digitals pin 9: Servo #1 control
 
Digitals pin 9: Servo #1 control
 
Digital pin 10: Servo #2 control
 
Digital pin 10: Servo #2 control
Which pins are connected to the DC/Stepper motors?
+
 
 +
== Which pins are connected to the DC/Stepper motors? ==
  
 
The DC/Stepper motors are NOT connected to the Arduino directly. They are connected to the 74HC595 latch which is spoken to by the Arduino. You CANNOT talk directly to the motors, you MUST use the motor shield library
 
The DC/Stepper motors are NOT connected to the Arduino directly. They are connected to the 74HC595 latch which is spoken to by the Arduino. You CANNOT talk directly to the motors, you MUST use the motor shield library
Huh? I don't understand...
 
  
You can try reading this nice overview written by Michael K
+
== Huh? I don't understand... ==
How can I connect to the unused pins?
+
 
 +
[http://docs.google.com/View?docid=dgwf6cmm_2fznx7qgr You can try reading this nice overview written by Michael K] (''en anglais'')
 +
 
 +
== How can I connect to the unused pins? ==
  
 
The analog pins (analog 0-5 also known as digital pins 14-19) are broken out in the bottom right corner.
 
The analog pins (analog 0-5 also known as digital pins 14-19) are broken out in the bottom right corner.
Ligne 66 : Ligne 77 :
  
 
The remaining pins are not broken out because they could be used by the motor shield. If you are sure that you are not using those pins then you can connect to them by using stacking headers when assembling the kit or soldering onto the top of the header with wires, or using a "Wing shield"
 
The remaining pins are not broken out because they could be used by the motor shield. If you are sure that you are not using those pins then you can connect to them by using stacking headers when assembling the kit or soldering onto the top of the header with wires, or using a "Wing shield"
I get the following error trying to run the example code:
+
 
"error: AFMotor.h: No such file or directory...."
+
== I get the following error trying to run the example code:
 +
"error: AFMotor.h: No such file or directory...." ==
  
 
Make sure you have installed the AFMotor library
 
Make sure you have installed the AFMotor library
How do I install the library?
 
  
Read our tutorial on libraries
+
== How do I install the library? ==
I have two stepper motors and I want to run them simulaneously but the example code can only control one and then the other?
+
 
 +
*** LIEN vers article en français ***
 +
 
 +
[http://www.ladyada.net/library/arduino/libraries.html Read our tutorial on libraries] (''AdaFruit'' en anglais).
 +
 
 +
== I have two stepper motors and I want to run them simulaneously but the example code can only control one and then the other? ==
  
 
The stepper motor library step() routine does not have the ability to run both motors at a time. Instead, you will have to 'interleave' the calls. For example, to have both motors step forward 100 times you must write code like this:
 
The stepper motor library step() routine does not have the ability to run both motors at a time. Instead, you will have to 'interleave' the calls. For example, to have both motors step forward 100 times you must write code like this:
  
for (i=0; i<100; i++) {
+
<nowiki>for (i=0; i<100; i++) {
 
motor1.step(1, FORWARD, SINGLE);
 
motor1.step(1, FORWARD, SINGLE);
 
motor2.step(1, FORWARD, SINGLE);
 
motor2.step(1, FORWARD, SINGLE);
}
+
}</nowiki>
 +
 
 +
{{ambox | text = No existing stepper motor driver has the ability to 'intelligently' interleave the steps. You will have to write a loop or use interrupts to control the motors the way you'd like. }}
  
No existing stepper motor driver has the ability to 'intelligently' interleave the steps. You will have to write a loop or use interrupts to control the motors the way you'd like.
+
== What are some 'suggested motors'? ==
What are some 'suggested motors'?
 
  
 
Most people buy motors from surplus shops and no motor will make everyone happy
 
Most people buy motors from surplus shops and no motor will make everyone happy
  
However, since its a popular question, I suggest buying motors from Pololu (DC Servos, DC motors) or Jameco (all sorts!) As well as the many surplus webshops.
+
However, since its a popular question, I suggest buying motors from Pololu ([http://www.pololu.com/catalog/category/23 DC Servos], [http://www.pololu.com/catalog/category/51 DC motors]) or Jameco ([http://www.jameco.com/webapp/wcs/stores/servlet/StoreCatalogDrillDownView?langId=-1&storeId=10001&catalogId=10001&categoryName=cat_35&subCategoryName=Motors&category=3515&refine=1&jameco_page=54 all sorts]!) As well as the [http://www.ladyada.net/library/procure/hobbyist.html many surplus webshops].
  
 
{{ADF-Accord}}
 
{{ADF-Accord}}
  
 
{{MCH-Accord}}
 
{{MCH-Accord}}

Version du 14 décembre 2012 à 12:37

How many motors can I use with this shield?

You can use 2 DC servos that run on 5V and up to 4 DC motors or 2 stepper motors (or 1 stepper and up to 2 DC motors) Can I connect more motors?

No, at this time it is not possible to stack the shield or otherwise connect it up easily to control 4 steppers, for example.

HELP! My motor doesnt work!

HELP! My motor doesnt work!...But the servos work FINE!

Is the LED lit? The Stepper and DC motor connections wont do a single thing if the LED is not lit

Don't bother writing up uploading code or wiring up motors if the LED doesn't light up, its not going to work.

What is the LED for?

The LED indicates the '9V' motor power supply is working. If it is not lit, then the DC/Stepper motors will not run. The servo ports are 5V powered and does not use the DC motor supply

Im trying to build this robot and it doesn't seem to run on a 9V battery....

Please read the user manual for information about appropriate power supplies

Can this shield control small 3V motors?

Not really, its meant for larger, 6V+ motors. In theory you should be able to get it working with 3V motors but I have no information on how to do so or whether it will work

What is the power connector on the shield for? How do I power my motors?

Please read the ***LIEN*** user manual ***LIEN** for information about appropriate power supplies

My Arduino freaks out when the motors are running! Is the shield broken?

Motors take a lot of power, and can cause 'brownouts' that reset the Arduino. For that reason the shield is designed for seperate (split) supplies - one for the electronics and one for the motor. Doing this will prevent brownouts. Please read the user manual for information about appropriate power supplies

I have good solid power supplies, but the DC motors seem to 'cut out' or 'skip'

Try soldering a ceramic or disc 0.1uF capacitor between the motor tabs (on the motor itself!) this will reduce noise that could be feeding back into the circuit (Merci à macegr!)

What if I need more than 600mA per motor?

You can subsitute SN754410's (at your risk) or piggyback solder some more L293D drivers on top of the existing ones

What pins are not used on the motor shield?

All 6 analog input pins are available. They can also be used as digital pins (pins #14 thru 19)

Digital pin 2, and 13 are not used.

The following pins are in use only if the DC/Stepper noted is in use:

 Digital pin 11: DC Motor #1 / Stepper #1 (activation/speed control)
Digital pin 3: DC Motor #2 / Stepper #1 (activation/speed control)
Digital pin 5: DC Motor #3 / Stepper #2 (activation/speed control)
Digital pin 6: DC Motor #4 / Stepper #2 (activation/speed control)

The following pins are in use if any DC/steppers are used
Digital pin 4, 7, 8 and 12 are used to drive the DC/Stepper motors via the 74HC595 serial-to-parallel latch

The following pins are used only if that particular servo is in use:
Digitals pin 9: Servo #1 control Digital pin 10: Servo #2 control

Which pins are connected to the DC/Stepper motors?

The DC/Stepper motors are NOT connected to the Arduino directly. They are connected to the 74HC595 latch which is spoken to by the Arduino. You CANNOT talk directly to the motors, you MUST use the motor shield library

Huh? I don't understand...

You can try reading this nice overview written by Michael K (en anglais)

How can I connect to the unused pins?

The analog pins (analog 0-5 also known as digital pins 14-19) are broken out in the bottom right corner.

Pin 2 has a small breakout since its the only truly unused pin

The remaining pins are not broken out because they could be used by the motor shield. If you are sure that you are not using those pins then you can connect to them by using stacking headers when assembling the kit or soldering onto the top of the header with wires, or using a "Wing shield"

== I get the following error trying to run the example code: "error: AFMotor.h: No such file or directory...." ==

Make sure you have installed the AFMotor library

How do I install the library?

      • LIEN vers article en français ***

Read our tutorial on libraries (AdaFruit en anglais).

I have two stepper motors and I want to run them simulaneously but the example code can only control one and then the other?

The stepper motor library step() routine does not have the ability to run both motors at a time. Instead, you will have to 'interleave' the calls. For example, to have both motors step forward 100 times you must write code like this:

for (i=0; i<100; i++) { motor1.step(1, FORWARD, SINGLE); motor2.step(1, FORWARD, SINGLE); }

What are some 'suggested motors'?

Most people buy motors from surplus shops and no motor will make everyone happy

However, since its a popular question, I suggest buying motors from Pololu (DC Servos, DC motors) or Jameco (all sorts!) As well as the many surplus webshops.

Traduit avec l'autorisation d'AdaFruit Industries - Translated with the permission from Adafruit Industries - www.adafruit.com

Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : «  Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.

L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.