Modifications

Sauter à la navigation Sauter à la recherche
Ligne 165 : Ligne 165 :  
[[Fichier:ADF-MOTOR-SHIELD-USE-BIPOLAR-STEPPER.jpg]]
 
[[Fichier:ADF-MOTOR-SHIELD-USE-BIPOLAR-STEPPER.jpg]]
   −
Stepper motors are great for (semi-)precise control, perfect for many robot and CNC projects. This motor shield supports up to 2 stepper motors. The library works identically for bi-polar and uni-polar motors
+
Un moteur pas-à-pas est genial pour un contrôle (semi-)précis, parfait pour beaucoup de robot projets CNC (commande numérique). Ce shield moteur est capable de supporter jusqu'à 2 moteurs pas-à-pas. La librairie fonctionne à l'identique avec les moteurs bipolaires et unipolaires.
   −
For unipolar motors: to connect up the stepper, first figure out which pins connected to which coil, and which pins are the center taps. If its a 5-wire motor then there will be 1 that is the center tap for both coils. [http://www.ladyada.net/make/mshield/resources.html Theres plenty of tutorials online on how to reverse engineer the coils pinout]. The center taps should both be connected together to the GND terminal on the motor shield output block. then coil 1 should connect to one motor port (say M1 or M3) and coil 2 should connect to the other motor port (M2 or M4).
+
=== Moteurs unipolaires ===
 +
Pour les moteurs unipolaires: pour raccorder le moteur, vous devez d'abord savoir quel fil est connectée à quel bobine, et quelle fil se trouve au centre de la bobine. Si c'est un moteur à 5 fils alors il y a un seul fil qui est centre pour les deux bobinages. [http://www.ladyada.net/make/mshield/resources.html Il y a plein de tutoriels en ligne qui permet de déduire le brochage/raccordement des moteurs pas-à-pas]. Les milieux de bobines doivent tous les deux être raccordés à la masse (borne GND) du bloc de raccordement moteur. Ensuite, la bobine 1 doit être connectée sur un port moteur (disons M1 ou M3) et la deuxième bobine sur l'autre port moteur (M2 ou M4).
   −
For bipolar motors: its just like unipolar motors except theres no 5th wire to connect to ground. The code is exactly the same.
+
=== Moteurs bipolaires ===
 +
Pour les moteurs bipolaires: C'est comme pour les moteurs unipolaires excepté qu'il n'y a pas de 5ieme fil à raccorder à la masse.
   −
Running a stepper is a little more intricate than running a DC motor but its still very
+
Le code du programme restera exactement pareil.
easy
      +
=== Nbre de pas ===
 +
Une information importante sur un moteur pas à pas est le nombre de pas par révolution. C'est donc le nombre de pas nécessaire pour que moteur fasse un tour complet.
   −
# Make sure you include <AFMotor.h>
+
Les fiches techniques ne fonctionnent pas cette information telle quel mais indique plutôt le nombre de degrés par pas.
# Create the stepper motor object with '''AF_Stepper(steps, stepper#)''' to setup the motor H-bridge and latches.'' '''Steps''' '' indicates how many steps per revolution the motor has. a 7.5degree/step motor has 360/7.5 = 48 steps.'' '''Stepper#''' '' is which port it is connected to. If you're using M1 and M2, its port 1. If you're using M3 and M4 its port 2
+
 
 +
Sur un moteur à 7.5 degrés/pas, le moteur à 360/7.5 = 48 pas par révolution.
 +
 
 +
Sur un moteur à 1.8 degrés/pas, le moteur à 360/1.8 = 200 pas par révolution.
 +
 
 +
=== Le code ===
 +
Faire fonctionner un moteur pas-à-pas est juste un peu plus complexe d'un moteur continu mais cela reste encore simple.
 +
 
 +
# Assurez vous que vous avez inlus la librairie <AFMotor.h>
 +
# Créez un object pour moteur pas-à-pas avec '''AF_Stepper(nbre_pas, numéro_moteur)''' pour initialiser le pont-H et les latch.'' '''nbre_pas''' '' combien de pas sont nécessaire au moteur pour faire une tour.<br />.'' '''Numéro_moteur''' '' indique à quel port (bornier) le moteur est raccordé. If you're using M1 and M2, its port 1. If you're using M3 and M4 its port 2
 
# Set the speed of the motor using '''setSpeed(rpm)''' where '' '''rpm''' '' is how many revolutions per minute you want the stepper to turn.
 
# Set the speed of the motor using '''setSpeed(rpm)''' where '' '''rpm''' '' is how many revolutions per minute you want the stepper to turn.
 
# Then every time you want the motor to move, call the '''step(#steps, direction, steptype)''' procedure. '' '''#steps''' '' is how many steps you'd like it to take. direction is either '''FORWARD''' or '''BACKWARD''' and the step type is '''SINGLE, DOUBLE. INTERLEAVE''' or '''MICROSTEP'''.<br />"Single" means single-coil activation, "double" means 2 coils are activated at once (for higher torque) and "interleave" means that it alternates between single and double to get twice the resolution (but of course its half the speed). "Microstepping" is a method where the coils are PWM'd to create smooth motion between steps. [http://www.ladyada.net/make/mshield/resources.html Theres tons of information about the pros and cons of these different stepping methods in the resources page].<br />You can use whichever stepping method you want, changing it "on the fly" to as you may want minimum power, more torque, or more precision.
 
# Then every time you want the motor to move, call the '''step(#steps, direction, steptype)''' procedure. '' '''#steps''' '' is how many steps you'd like it to take. direction is either '''FORWARD''' or '''BACKWARD''' and the step type is '''SINGLE, DOUBLE. INTERLEAVE''' or '''MICROSTEP'''.<br />"Single" means single-coil activation, "double" means 2 coils are activated at once (for higher torque) and "interleave" means that it alternates between single and double to get twice the resolution (but of course its half the speed). "Microstepping" is a method where the coils are PWM'd to create smooth motion between steps. [http://www.ladyada.net/make/mshield/resources.html Theres tons of information about the pros and cons of these different stepping methods in the resources page].<br />You can use whichever stepping method you want, changing it "on the fly" to as you may want minimum power, more torque, or more precision.
29 917

modifications

Menu de navigation