
Stepper motors
Stepper motors provide one of the best solutions for driving mechanical loads where precise control of speed and/or position are required.
Most standard stepper motors can be powered in one of four phases, each represented by the presence or polarity of the current flow in each of the motor coils.
Phases
Each phase has:
• One neighbouring phase that represents a small angular movement in one direction
• One neighbouring phase that represents a small angular movement in the opposite direction
• A third alternative phase that represents an illegal transition.
The angular movement represented by a 'step' is determined by the mechanical construction of the motor.
Applying a single (legal) phase change to the motor drive will cause the motor shaft to move by a single step angle and stop. Sequencing through the states in the appropriate order produces continuous rotation of the drive shaft. The frequency of the phase changes is a precise measure of the speed of rotation of the motor shaft. A count of the phase changes (incremented in one direction, decremented in the other) provides a precise representation of the position or angle of rotation.
Motor types
The two main types of stepper motor under consideration are:
• uni-polar (6-wire) 1 wire each from 4 coils + 2 common connections
• bi-polar (4-wire) 2 wires each from 2 coils
The diagrams above show the drive sequence required to turn a very basic, 4 step per revolution, stepper motor through a single revolution.
Legal phase changes are those that move from any phase to either of its neighbours (first and last are neighbours). The most efficient direction of rotation is clearly defined in these cases.
Illegal phase changes are those that involve jumping to a non-adjacent phase, rotation in either direction is equally likely.
In practice, a greater number of magnetic poles are used so the four step sequence will move the motor shaft through a much smaller angle. The bi-polar stepper motor supplied as part of the Locktronics range has a resolution of 48 steps per revolution (7.5 degrees per step).
Half-stepping
Half-stepping can increase the resolution, torque, and maximum speed of a stepper motor. This is achieved by creating control phases that are a combination of two adjacent mechanical phases
The smoother transitions between mechanical phases can increase the available torque when running continuously and effectively doubles the angular resolution of the motor.
MIAC is capable of directly controlling bi-polar stepper motors. The full-bridge outputs also allow the MIAC to control uni-polar stepper motors with their common connections connected to either 0V or V+.
Flowcode Stepper Component
The Flowcode Stepper component can be configured to operate with motors connected in any of the listed configurations. Macros are provided are:
IncrementStep - One step in the forward directioj
DecrementStep - One step in the reverse direction
EnableMotor - Configure the device outputs
DisableMotor - Release the device outputs
These macros allow full control of the speed and position of a stepper motor from within a Flowcode program.
Example program
The example program linked to this article uses a MIAC to control the Locktronics bi-polar stepper motor in half-step mode. Four inputs and the LCD are used to demonstrate some of the capabilities of a stepper motor:
I1 drives the motor in its forward direction at constant speed.
I2 drives the motor in its reverse direction at constant speed.
I3 captures the current position of the motor and stores it as a reference.
I4 causes the motor to move to its captured reference position from any location.
The LCD continuously displays the current position of the stepper motor, and which of the eight half-step phases is currently being executed.
Alternative hardware
As an alternative to MIAC, the EB006 multi-programmer or HP488 development board can be connected to EB011 Power E-Blocks (up to 2 stepper motors per EB011 ), or EB022 Motors E-Blocks (1 stepper motor per EB022) to perform the same function. Check that the current and voltage specifications of these boards meet the requirements of the motors.
The Matrix Multimedia HPACT Actuators board contains a stepper motor and on-board drive circuitry, allowing direct interfacing to microcontroller port pins capable of supplying 5V logic levels.
Multiple instances of the Stepper component can be loaded onto each flowchart and the pins used for each motor can be freely allocated.