0% found this document useful (1 vote)
877 views

AccelStepper Library For Arduino1

Uploaded by

vr_xlent
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
877 views

AccelStepper Library For Arduino1

Uploaded by

vr_xlent
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

AccelStepper: AccelStepper library for Arduino

airspayce.com/mikem/arduino/AccelStepper/

This is the Arduino AccelStepper library. It provides an object-oriented interface for 2, 3


or 4 pin stepper motors and motor drivers.

The standard Arduino IDE includes the Stepper library


(http://arduino.cc/en/Reference/Stepper) for stepper motors. It is perfectly adequate for
simple, single motor applications.

AccelStepper significantly improves on the standard Arduino Stepper library in several


ways:

Supports acceleration and deceleration


Supports multiple simultaneous steppers, with independent concurrent stepping
on each stepper
Most API functions never delay() or block (unless otherwise stated)
Supports 2, 3 and 4 wire steppers, plus 3 and 4 wire half steppers.
Supports alternate stepping functions to enable support of AFMotor
(https://github.com/adafruit/Adafruit-Motor-Shield-library)
Supports stepper drivers such as the Sparkfun EasyDriver (based on 3967 driver
chip)
Very slow speeds are supported
Extensive API
Subclass support

The latest version of this documentation can be downloaded from


http://www.airspayce.com/mikem/arduino/AccelStepper The version of the package that
this documentation refers to can be downloaded from
http://www.airspayce.com/mikem/arduino/AccelStepper/AccelStepper-1.61.zip

Example Arduino programs are included to show the main modes of use.

You can also find online help and discussion at


http://groups.google.com/group/accelstepper Please use that group for all questions
and discussions on this topic. Do not contact the author directly, unless it is to discuss
commercial licensing. Before asking a question or reporting a bug, please read

http://en.wikipedia.org/wiki/Wikipedia:Reference_desk/How_to_ask_a_software_que
stion
http://www.catb.org/esr/faqs/smart-questions.html
http://www.chiark.greenend.org.uk/~shgtatham/bugs.html

1/7
Tested on Arduino Diecimila and Mega with arduino-0018 & arduino-0021 on OpenSuSE
11.1 and avr-libc-1.6.1-1.15, cross-avr-binutils-2.19-9.1, cross-avr-gcc-4.1.3_20080612-
26.5. Tested on Teensy http://www.pjrc.com/teensy including Teensy 3.1 built using
Arduino IDE 1.0.5 with teensyduino addon 1.18 and later.

Installation

Install in the usual way: unzip the distribution zip file to the libraries sub-folder of your
sketchbook.

Theory

This code uses speed calculations as described in "Generate stepper-motor speed


profiles in real time" by David Austin
http://fab.cba.mit.edu/classes/MIT/961.09/projects/i0/Stepper_Motor_Speed_Profile.pdf
or http://www.embedded.com/design/mcus-processors-and-socs/4006438/Generate-
stepper-motor-speed-profiles-in-real-time or
http://web.archive.org/web/20140705143928/http://fab.cba.mit.edu/classes/MIT/961.09/
projects/i0/Stepper_Motor_Speed_Profile.pdf with the exception that AccelStepper uses
steps per second rather than radians per second (because we dont know the step angle
of the motor) An initial step interval is calculated for the first step, based on the desired
acceleration On subsequent steps, shorter step intervals are calculated based on the
previous step until max speed is achieved.

Adafruit Motor Shield V2

The included examples AFMotor_* are for Adafruit Motor Shield V1 and do not work with
Adafruit Motor Shield V2. See
https://github.com/adafruit/Adafruit_Motor_Shield_V2_Library for examples that work
with Adafruit Motor Shield V2.

Donations

This library is offered under a free GPL license for those who want to use it that way. We
try hard to keep it up to date, fix bugs and to provide free support. If this library has
helped you save time or money, please consider donating at http://www.airspayce.com
or here:

Trademarks

AccelStepper is a trademark of AirSpayce Pty Ltd. The AccelStepper mark was first used
on April 26 2010 for international trade, and is used only in relation to motor control
hardware and software. It is not to be confused with any other similar marks covering
other goods and services.

Copyright

2/7

You might also like