Vous êtes sur la page 1sur 9

Stepper Motor Experiment

Microprocessor Lab.

Experiment
Stepper Motor Application
Introduction:
In this experiment, you will write 8086 assembly language to control a stepper
motor using the MDA-8086 kit. This experiment requires background in stepper
motor basic theory, including the concepts of poles and half/full steps control codes.
These concepts are summarized in the Theory section of this experiment. In addition
to writing the assembly program, you are required to build an interface circuit to
drive the motor from the MDA-8086 kit outputs.

Objective:
To learn how to use stepper Motor through a MDA-8086 kit.
To learn about stepper motor basics and how to control a stepper motor using
MDA-8086 kit in full/half step mode and clockwise/counterclockwise
direction, while controlling the speed of rotation and displaying the current
position.

Theory:
A motor is an electromagnetic rotating machine where current flow in a coil
around the poles induces an electromotive force that attracts or repels a rotating part
in the center of the motor. DC motors consist of a rotor, which is the center part and
a stator, which is the outer block as in Figure 1. To allow the rotor to turn without
twisting the wires, the ends of the wire loop are connected to a set of contacts called
the commutator, which rubs against a set of conductors called the brushes. Stepper
motors are very different from DC motors in the way they are physically composed
and used. Unlike DC motors, which may be composed of two large stator magnets,
one on each side of the rotor, stepper motors are composed of many ferrite poles
surrounding a permanently magnetized stator core. Figure 1 shows the two basic
models of DC and stepper motors.
1

Stepper Motor Experiment

Microprocessor Lab.

As illustrated in Figure 1, each pole within the stepper motor is wound by a thin wire.
When any one of these wires is energized by current passing through it, a magnetic
field is created across the ferrite material. This thereby induces a magnetic North and
a magnetic South on the pole. A magnetized stator pole will attract a magnetized
portion of the rotor with the opposite polarity. By using a specific combination of
energized poles, the rotor can be held in place by the magnetism, or it can be made
to rotate by energizing adjacent poles and de-energizing the current ones so that the
rotor is then attracted to the adjacent source of magnetism.
The stepper motor shown in Figure 1 has 4 internal ferrite poles, but pairs of poles are
connected together to form one coil.

Figure 1: Comparing a DC motor (left) to a Stepper Motor (right).


The following formula defines angular resolution of a stepper motor.
Angular Resolution

360 Degrees
2 number of internal poles

In general, there are three types of stepping motor:


(1). VR( Variable Reluctance ) stepping motors
(2). Hybrid stepping motors
(3). PM( Permanent Magnet ) stepping motors

Application of stepper motor:


Typical applications are computer peripherals, such as printers (Fig.2), plotters,
and disk drives, watches, and other devices which require accurate position control.
Moreover, since the stepping motor is operated by current pulses, it may be
controlled by command signals stored digitally. It is therefore suitable for computer
controlled operations.

Stepper Motor Experiment

Microprocessor Lab.

Figure 2: External view of printer.

Stepper Motor Operation:


Figure 3 is used to explain the operation of simplified stepping motor
(90/step). Here the A coil and B coil are perpendicular to each other. If either A or B
coil is excited( a condition which is known as single-phase excitation), the rotor can
be moved to 0, 90, 180, 270degree position depending on the current's ON/OFF
conditions in the coils, see Figure 3 (a). If both coils have current flowing at the same
time, then the rotor positions can be 45, 135, 225, 315degrees as shown in Figure
3 (b). This is known as two-phase exception. In Figure 3 (c), the excitation alternates
between 1-phase and 2-phase, then the motor will rotates according to 0, 45, 90,
135, 180, 225, 270, 315sequence. This is 1-2 phase excitation, each step distance
is only half of step movement of either 1-phase or 2-phase excitation. Stepping motor
can rotate in clockwise or counter-clockwise direction depending on the current pulse
sequence applied to the excitation coils of the motor. Referring to the truth tables in
Figure 3 (a), (b), (c). If signals are applied to coil A and B according to Step
1,2,3,4,5,6,7,8, then counter-clockwise movement is achieved. And vice-versa is true.
If signals are applied according to step 8,7,6,5,4,3,2,1, then clockwise movement is
achieved. Commercial stepping motor uses multimotor rotor, the rotor features two
bearlike PM cylinders that are turned one-half of tooth spacing. One gear is south
pole, the other gear is north pole. If a 50-tooth rotor gear is used, the following
movement sequences will proceed.
Single-phase excitation: The stepping position will be 0,1.8, 3.6, .......
358.2, total 200 steps in one round.
3

Stepper Motor Experiment

Microprocessor Lab.

Two-phase excitation: The stepping positions will be 0.9, 2.7, 4.5, .....
359.1, total 200 steps in one round.
Single-phase and two-phase excitations combined: The stepping positions
will be 0, 0.9, 1.8, 2.7, 3.6, 4.5, ............... 358.2, 359.1, total 400 steps
in one round.

Figure 3: Half-step and full-step rotation.


Since stepping motor makes step-by-step movement and each step is
equidistant, the rotor and stator magnetic field must be synchronous. During start-up
and stopping, the two fields may not be synchronous, so it is suggested to slowly
accelerate and decelerate the stepping motor during the start-up or stopping period.

Stepper Motor Experiment

Microprocessor Lab.

Stepping Motor Interface:

Stepper Motor Experiment

Microprocessor Lab.

Stepper Motor Assembly Program using MDA-8086 kit

;*****************************************
;
MDA-Win8086 EXPERIMENT PROGRAM
*
;
FILENAME : STEPMO.ASM
;
PROCESSOR : I8086
;
Stepping Motor Test
;
-- 1 Phase Magnetization
;*****************************************
0000
CODE SEGMENT
ASSUME CS:CODE,DS:CODE,ES:CODE,SS:CODE
;
= 001F
PPIC_C
EQU 1FH
= 001D
PPIC EQU 1DH
= 001B
PPIB EQU 1BH
= 0019
PPIA EQU 19H
;
1000
ORG 1000H
;
1000 B8 0000
MOV AX,0
1003 8E D8
MOV DS,AX
;
1005 B0 80
MOV AL,10000000B
1007 E6 1F
OUT PPIC_C,AL
;
1009 B0 FF
MOV AL,11111111B
100B E6 19
OUT PPIA,AL
100D B0 00
MOV AL,00000000B
100F E6 1D
OUT PPIC,AL
;
1011 B0 EE
MOV AL,11101110B
1013 E6 1B
L1: OUT PPIB,AL
6

Stepper Motor Experiment

1015
1018
101A
101C
101F
1020
1021
1022
1023
1025
1026

E8 101C R
D0 C0
EB F7
B9 0000
90
90
90
90
E2 FA
C3

Microprocessor Lab.

CALL TIMER
ROL AL,1
JMP L1
;
TIMER:
MOV CX,0
TIMER1: NOP
NOP
NOP
NOP
LOOP TIMER1
RET
;
CODE ENDS
END

;*****************************************
;*
MDA-IO APPLICATION PROGRAM
*
;*
Stepping Motor (MDA-012)
*
;*
PROGRAM BY MIDAS ENGINEERING
*
;*****************************************
;
; FILENAME : step1.ASM
7

Stepper Motor Experiment

Microprocessor Lab.

; PROCESSOR : I8086
; VER.
: V1.1
;
CODE SEGMENT
ASSUME
CS:CODE,DS:CODE,ES:CODE,SS:CODE
;
PPIC_C
EQU 1FH
PPIC EQU 1DH
PPIB EQU 1BH
PPIA EQU 19H
;
ORG 1000H
;
MOV AX,0
MOV DS,AX
;
MOV AL,10000000B
OUT PPIC_C,AL
;
MOV AL,11111111B
OUT PPIA,AL
MOV AL,00000000B
OUT PPIC,AL
;
MOV AL,11101110B
L1: OUT PPIB,AL
CALL TIMER
ROL AL,1
JMP L1
;
TIMER:
MOV CX,0
TIMER1: NOP
NOP
NOP
NOP
LOOP TIMER1
RET
;
CODE ENDS
END

Stepper Motor Experiment

Microprocessor Lab.

Exercises:
1. Write a program to perform the following operations:
Step 1
Rotate the stepper motor using full-step sequence clockwise for 5 s.
Step 2
Rotate the stepper motor using full-step sequence counterclockwise for 5 s.
Step 3
Rotate the stepper motor using half-step sequence clockwise for 5 s.
Step 4
Rotate the stepper motor using half-step sequence clockwise for 5 s.
2. Write a program where the stepper motor will rotate based on the following
degrees:
i. 35 to 125 degrees
ii. 180 to 0 degrees
3. Write a program to rotate the stepper motor as a follow:
i. Clockwise one cycle using the full-step sequence.
ii. One cycle in the counterclockwise direction using the half-step
sequence by using 5 ms as the delay between two half steps.
iii. Clockwise one cycle using the full-step sequence with 5 ms as the
delay between two steps.

Discussion:
1. List and describe the constructions and principles of the main types of
stepping motors.
2. What type of drive circuit would be suitable for each stepping motor listed
in problem (1)?
3. What is the maximum torque that the motor can provide (at low speeds)?
4. Write program where the stepper motor will step exactly 20 steps in the
clockwise direction, stop and then step exactly 10 steps in the counterclockwise direction. The stepper motor should also move twice as fast in the
clockwise direction than the counter-clockwise direction.

Vous aimerez peut-être aussi