Hardware Reference
In-Depth Information
current, the center tap can be used as a grounding point for the current, and
one pole or the other can be powered, therefore effectively inverting polarity
without the need for complicated electronics. The center taps are often joined
together, so these motors often have i ve leads.
Bipolar motors do not have a center tap; instead, the hardware must be used to
invert current. As this inversion is easily achieved with an H-bridge, managing
this is no longer a major factor. Bipolar motors do present a major advantage;
because they have simplii ed coils, they can often achieve more torque for the
same weight.
NOTE H-bridge drivers are commonly used for both unipolar and bipolar stepper
motors, therefore no longer requiring the center tap, maximizing the torque of unipo-
lar motors.
The Stepper Library
The Arduino IDE has built-in support for stepper motors through the Stepper
library. To import the Stepper library, either add the library automatically via
the Sketch
Import Library
Stepper menu item, or manually:
#include <Stepper.h>
To begin using a stepper motor, you must create a new instance of the Stepper class.
Stepper(steps, pin1, pin2);
Stepper(steps, pin1, pin2, pin3, pin4);
The steps parameter is an int which indicates the number of steps that your
motor must make to complete one revolution. Some motors only document
the number of degrees per step; in that case, divide that number by 360 to
get the number of steps. The pin1 and pin2 parameters are digital output pins
used for two lead stepper motors. The pin3 and pin4 parameters are used for
motors with four leads. This is done like so:
Stepper myStepperMotor = Stepper(84, 5, 6, 7, 8);
Stepper motors turn by performing single steps, and to increase the speed
of the motor, you must change the frequency at which steps are performed. To
do this, use setSpeed() :
Stepper.setSpeed(rpm);
This function does not return any data and coni gures the output sequence
to make the motor turn at the specii ed speed in revolutions per minute. The
 
Search WWH ::




Custom Search