Stepping Motor Control
Stepping Motor Control
Stepping Motor Control
LAB MANUAL 18
Name
Roll No
Section
Marks
Stepping motors are suitable for translating digital inputs into mechanical motion. In general, there
are three types of stepping motor:
Motor type
PM VR Hybrid
Characteristics
Efficiency
High Low High
Rotor Inertia
High Low Low
Speed
High High Low
Torque
Fair Low High
Power O/P
High Low Low
Damping
Good Poor Poor
Typical Step Angle 1.8°,15°,30° 7.5°,15°,30° 0.18°,0.45°
Figure 18-1 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°, 270°degree position
depending on the current's ON/OFF conditions in the coils, see FIGURE 8-1(a). If both coils have
current flowing at the same time, then the rotor positions can be 45°, 135°, 225°, 315°degrees as
shown in FIGURE 8-1(b). This is known as two-phase exception. In FIGURE 8-1(c), the excitation
alternates between 1-phase and 2-phase, then the motor will rotates according to 0°, 45°, 90°, 135°,
180°, 225°, 270°, 315°sequence. 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
8-1(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.
A. Single-Phase Excitation:
The stepping position will be 0°,1.8°, 3.6°, ....... 358.2°, total 200 steps in one round.
B. Two-Phase Excitation:
The stepping positions will be 0.9°, 2.7°, 4.5°, ..... 359.1°, total 200 steps in one round.
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.
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.
; FILENAME : STEPMO_1.ASM
; PROCESSOR : I8086
;
101B B0 80 MOV AL,10000000B
101D E6 1F OUT PPIC_C,AL
;
101F B0 FF MOV AL,11111111B
1021 E6 19 OUT PPIA,AL
1023 B0 00 MOV AL,00000000B
1025 E6 1D OUT PPIC,AL
;
1027 E8 126C R CALL ALLCLR
;
;
102A BE 11C5 R MOV SI,OFFSET DATA
102D E8 128A R CALL STRING
;
1030 E8 1271 R CALL LN21
1033 BE 11D6 R MOV SI,OFFSET DATA1
1036 E8 128A R CALL STRING
; CLEAR
1039 BB 0000 MOV BX,0
103C 89 1E 12B4 R MOV WORD PTR SPD_BUF,BX
1040 88 1E 12B1 R MOV BYTE PTR P_CONT,BL
1044 88 1E 12B2 R MOV BYTE PTR FULS_STR,BL
;
1048 E6 01 MAIN: OUT KEY,AL
104A FB STI
104B E8 129C R CALL SCAN
104E FA CLI
104F A0 12B0 R MOV AL,BYTE PTR K_BUF
;
1052 3C 00 CMP AL,0
1054 75 03 JNE MAIN1
1056 E9 1122 R JMP L_45
;
1059 3C 01 MAIN1: CMP AL,1
105B 74 23 JE R_45
;
105D 3C 02 MAIN2: CMP AL,2
105F 75 03 JNE MAIN3
1061 E9 114B R JMP L_90
;
1064 3C 03 MAIN3: CMP AL,3
1066 74 40 JE R_90
;
1068 3C 04 MAIN4: CMP AL,4
106A 75 03 JNE MAIN5
;
10D0 FA R_180: CLI
10D1 B0 64 MOV AL,100
10D3 A2 12B1 R MOV BYTE PTR P_CONT,AL
10D6 32 C0 XOR AL,AL
10D8 A2 12B3 R MOV BYTE PTR LR_FLAG,AL
;
10DB E8 1271 R CALL LN21
10DE BE 10E8 R MOV SI,OFFSET R_180D
10E1 E8 128A R CALL STRING
10E4 FB STI
10E5 9 1048 R JMP MAIN
;
10E8 52 69 67 68 74 20 R_180D: DB 'Right 180 degree',00H
31 38 30 20 64 65
67 72 65 65 00
10F9 FA R_REV:CLI
10FA B0 FF MOV AL,0FFH
10FC A2 12B1 R MOV BYTE PTR P_CONT,AL
10FF 32 C0 XOR AL,AL
1101 A2 12B3 R MOV BYTE PTR LR_FLAG,AL
;
1104 E8 1271 R CALL LN21
;
1107 BE 1111 R MOV SI,OFFSET R_MSG
110A E8 128A R CALL STRING
110D B STI
110E E9 1048 R JMP MAIN
;
1111 52 69 67 68 74 20 R_MSG: DB 'Right Revolution',00H
52 65 76 6F 6C 75
74 69 6F 6E 00
;
;
1122 FA L_45: CLI
1123 B0 19 MOV AL,25
1125 A2 12B1 R MOV BYTE PTR P_CONT,AL
1128 B0 01 MOV AL,1
112A A2 12B3 R MOV BYTE PTR LR_FLAG,AL
;
112D E8 1271 R CALL LN21
1130 BE 113A R MOV SI,OFFSET L_45D
1133 E8 128A R CALL STRING
1136 FB STI
1137 E9 1048 R JMP MAIN
;
11B1 FB STI
11B2 E9 1048 R JMP MAIN
;
11B5 4C 65 66 74 20 52 L_MSG: DB 'Left Revolution',00H
65 76 6F 6C 75 74
69 6F 6E 00
;
11C5 53 74 65 70 70 69 DATA DB 'Stepping Control',00H
6E 67 20 43 6F 6E
74 72 6F 6C 00
11D6 50 72 65 73 73 20 DATA1: DB 'Press 0 - 7 Key ',00H
30 20 2D 20 37 20
4B 65 79 20 00
;
11E7 50 INT_SER:PUSH AX
11E8 BE 12B1 R MOV SI,OFFSET P_CONT
11EB 2E: 8A 24 MOV AH,BYTE PTR CS:[SI]
11EE 0A E4 OR AH,AH
11F0 74 45 JZ OUT_INT
;
11F2 80 FC FF CMP AH,0FFH
11F5 74 03 JE CHK_RL
11F7 2E: FE 0C DEC BYTE PTR CS:[SI]
;
11FA A0 12B3 R CHK_RL: MOV AL,BYTE PTR LR_FLAG
11FD 3C 01 CMP AL,1
11FF 74 15 JE LEFT
;
1201 BF 12B2 R MOV DI,OFFSET FULS_STR
1204 2E: 8A 05 MOV AL,BYTE PTR CS:[DI]
1207 3C 04 CMP AL,4
1209 75 05 JNE STEP0
120B 32 C0 XOR AL,AL
120D 2E: 88 05 MOV BYTE PTR CS:[DI],AL
;
1210 2E: FE 05 STEP0: INC BYTE PTR CS:[DI]
1213 EB 13 90 JMP OUT_PULSE
;
1216 BF 12B2 R LEFT: MOV DI,OFFSET FULS_STR
1219 2E: 8A 05 MOV AL,BYTE PTR CS:[DI]
121C 3C FF CMP AL,-1
121E 75 05 JNE STEP1
1220 B0 04 MOV AL,4
1222 2E: 88 05 MOV BYTE PTR CS:[DI],AL
;
1225 2E: FE 0D STEP1:DEC BYTE PTR CS:[DI]
;
1228 OUT_PULSE:
1228 BE 1247 R MOV SI,OFFSET PULSE_TBL
122B 25 00FF AND AX,00FFH
122E 03 F0 ADD SI,AX
;
1230 2E: 8A 04 MOV AL,BYTE PTR CS:[SI]
1233 24 F0 AND AL,0F0H
1235 E6 1B OUT PPIB,AL
;
1237 OUT_INT:
1237 A1 12B4 R MOV AX,WORD PTR SPD_BUF
123A E6 0B OUT CTC1,AL
123C 8A C4 MOV AL,AH
123E E6 0B OUT CTC1,AL
;
1240 B0 20 MOV AL,00100000B
1242 E6 10 OUT INTA,AL
1244 FB STI
1245 58 POP AX
1246 CF IRET
;
1247 PULSE_TBL:
1247 66 DB 01100110B
1248 33 DB 00110011B
1249 99 DB 10011001B
124A CC DB 11001100B
;
124B P_INIT PROC NEAR
124B 50 PUSH AX
124C B0 70 MOV AL,01110000B
124E E6 0F OUT CTCC,AL
;
1250 A1 12B4 R P_INIT1: MOV AX,WORD PTR SPD_BUF
1253 E6 0B OUT CTC1,AL
1255 8A C4 MOV AL,AH
1257 E6 0B OUT CTC1,AL
1259 58 POP AX
125A C3 RET
125B P_INIT ENDP
;
125B INIT PROC NEAR
; ICW1
125B B0 13 MOV AL,00010011B
125D E6 10 OUT INTA,AL
;ICW2 interrupt vector