Stepper Motor Basics

continued from previous Post ....

Microsteps

Most (but certainly not all) stepper motors do 200 full steps per revolution. By appropriately managing the current in the coils it is possible to make the motor move in smaller steps. The Pololu A4988 can make the motor move in 1/16th steps - or 3,200 steps per revolution.

The main advantage of microstepping is to reduce the roughness of the motion. The only fully accurate positions are the full-step positions. The motor will not be able to hold a stationary position at one of the intermediate positions with the same position accuracy or with the same holding torque as at the full step positions.

Generally speaking when high speeds are required full steps should be used.

It is possible with most drivers including the Pololu A4988 to use the Arduino program to change the microstep setting. This would require additional connections between the driver and the Arduino.

Stepper Motor Speed

By comparison with regular DC motors stepper motors are very slow devices.

Typical speeds might be 1000 to 4000 steps per second and for a 200 step motor that would represent 5 to 20 rps (300 to 1200 rpm).

Generally speaking the motors with low coil resistance and high currents (and low nominal voltages) will be most suitable for higher speeds. A high voltage will also be needed for high speed.

Acceleration

If the stepper motor is required to move a heavy load it will normally be necessary to start the movement slowly (as with any motor) and accelerate to the desired speed and, equally, to decelerate when it is necessary to stop.

This is quite different from a DC motor which will accelerate and decelerate automatically.

If you try to start or stop a stepper motor too quickly it will simply skip steps with no damage to motor. However The Arduino has no means to know whether or how many steps have been missed and all of the position control will be lost.

For this reason, in particular, it is essential to choose a motor with sufficient torque for the job and to use acceleration and deceleration when necessary.

Position Feedback

Stepper motors do not have the ability to tell the Arduino what position they are at, nor do they have the ability (like a servo) to go to a particular position. All they can do is move N steps from where they are now.

If it is essential to have position feedback a rotary encoder can be attached to the motor shaft - but that is beyond the scope of this essay.

Initial Position

When it starts up the Arduino has no means of knowing where the stepper motor is positioned - for example somebody might have moved it manually when the power was off.

The usual way to establish a datum for counting steps is with a limit switch. At startup the Arduino will move the motor until it triggers the switch. The Arduino will then regard that step position as step zero for the purpose of future position keeping.

Arduino Libraries

When using an Arduino with a specialized stepper motor driver board such as the Pololu A4988 there is little to be gained from using an Arduino library unless you need the acceleration feature of the AccelStepper library.

Demonstration Arduino code

The code in my simple stepper demo is intended as a first step to getting your motor working. It also shows how easy it is to control a motor without a library when a specialized stepper motor driver such as the Pololu A4988 i8s used.

Wiring connections for a stepper motor

The code in my simple stepper demo assumes that the motor is connected as shown in the wiring diagrams on the Pololu A4988 web page.

Arduino Pulse Width Modulation (PWM)

Arduino PWM using analogWrite() has nothing to do with controlling stepper motors. To control a stepper motor though a specialized stepper motor driver the Arduino just needs to provide step and direction signals using digitalWrite().

PWM may be used within the stepper motor driver to limit the current in the motor coils but this process is invisible to the Arduino user.

....END

...R

Edit 01 Jan 2014 to change "proper" to "specialized"

7 Likes