KKKL3293 - Sem 1 20212022 - Lab 4 - Stepper Motor
KKKL3293 - Sem 1 20212022 - Lab 4 - Stepper Motor
OBJECTIVES
1. To understand the interfacing and assembly language programming between 8086
microprocessor and a stepper motor.
2. To write the assembly language program to interface 8086 microprocessor to a stepper motor.
INTRODUCTION
Data acquisition and control represent the most popular applications of microprocessors. Stepper
motor control is a very popular application of microprocessors in the control area, as stepper motors
can accept pulses directly from the microprocessor and move accordingly. Two types of stepper
motors are a permanent magnet (PM) and variable reluctance (VR). The principle and operations
of these motors are as follows.
With the winding 'A' excited as before, winding 'B' is now switched on to a voltage +V, as shown
in Figure B. This produces a magnetic field Fb in addition to Fa. The resulting magnetic field F
makes an angle 45o as shown in Figure B. Consequently, the rotor moves through 45o (in the
counterclockwise direction) again to locking rotor poles with corresponding stator poles.
While winding 'B' has voltage +V applied to it, winding 'A' is switched off in Figure C. The rotor
then moves through a further 45° in an anticlockwise direction to align itself with stator field Fb.
With voltage +V on winding 'B,' a voltage -V is applied to winding 'A' as shown in Figure D. Then
the stator magnetic field has two components; Fa, Fb and their resultant F make an angle of 135°
position.
In this way as the pattern of excitation of the state of windings is changed, the rotor moves
successively through 45° steps through Figures E to H and completes one full revolution in the
counterclockwise direction. The figures are meant only to illustrate the principle of operation of the
PM stepper motor. A practical PM stepper motor has 1.8° step angle and 50 teeth on its rotor, there
are eight main poles on the stator, each having five teeth in the pole face. The step angle is given
Universiti Kebangsaan Malaysia 1
LAB 4 KKKL3293
by:
A = 360/(N*K) degrees
Two-Phase Mode: Here, both the stator phases are excited at a time as shown in Appendix A,
Figure B, D, F, H. There are 4 steps in the excitation sequence, K = 2, and step angle is 90°.
However, the two phases' rotor positions are 45° away from those in single-phase mode.
Hybrid Mode: This is a combination of single-phase and two-phase modes, as shown in Figures
A to H. There are 8 steps in the excitation sequence, K = 2, and step angle = 45°.
B = 360(N1 - N2)/(Nl*N2)
The motor can be half-stepped by turning on a pair of magnets, followed by a single magnet. The
motor can be fully stepped by turning on a pair of magnets, followed by another pair of magnets,
then in the end, followed by a single magnet, and so on. The best way to make a full step is to make
two half steps. A half step is equal to 11.25 degrees. Meanwhile, the full step is equivalent to 22.5
degrees. The motor can be rotated both clockwise and counterclockwise. For example, the code
Universiti Kebangsaan Malaysia 3
LAB 4 KKKL3293
Besides, the data from port 7 can be acquired using IN instruction, for instance:
IN AL, 7
In addition, the stepper motor sets the most significant bit (MSB) of byte value in port 7 when it is
ready.
EXPERIMENT:
1) Open the stepper motor program sample in the EMU8086 software folder, as shown in Figure
2. The filename is "stepper_motor.asm". Figure 3 depicts a part of this program.
QUESTION:
i. Execute the program. Observe and record the motor's direction either clockwise (CW),
counterclockwise (CCW), or both. Discuss the flow of the program using a flowchart.
ii. Modify the program so that the motor rotates in these conditions, separately. Provide the
programs and screenshot of each condition in the lab report.
(a) The stepper motor moves CW at one full rotation 5 times.
(b) The stepper motor rotates alternately 360° in CCW and 360° in CW direction 4
times.
(c) The stepper motor rotates 90° in CCW and 180° in CW direction 4 times.