Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 12

Stepper Motor with 8051 Microcontroller.

BY: PROF. AMIT N KSHIRSAGAR


Contents
 Stepper Motor: Introduction, Types

 Why stepper Motor??

 Full stepping mode, Half stepping mode

 Interfacing of Stepper motor with 8051 Microcontroller

 Program to rotate stepper motor continuously in clockwise


direction
Stepper Motor: Introduction
 A stepper motor is a brushless, synchronous electric motor that converts digital
pulses into mechanical shaft rotation.
 Every revolution of the stepper motor is divided into a discrete number of
steps.
 In many cases 200 steps, and the motor must be sent a separate pulse for each
step.
 The stepper motor can only take one step at a time and each step is the same
size.
 Each pulse causes the motor to rotate a precise angle, typically 1.8°, therefore
motor's position can be controlled without any feedback mechanism.
Stepper Motor: Introduction
 As the digital pulses increase in frequency, the step movement changes into
continuous rotation, with the speed of rotation directly proportional to the
frequency of the pulses.
 Step motors are used every day in both industrial and commercial applications
because of their low cost, high reliability, high torque at low speeds and a
simple, rugged construction that operates in almost any environment.
Construction of stepper Motor
4-Step Sequence: Full stepping Mode Sequence
8-Step Sequence: Half stepping Mode Sequence
Interfacing of Stepper motor with 8051 Microcontroller
Program to rotate stepper motor continuously

 ORG 0000h
 SJMP 0030H
  
 ORG 0030H
 MOV P1, #80H ; Initialise port 1 // 1000 0000
 ACALL DELAY ; Delay
 START: MOV DPTR,#FORWARD ; Load forward
direction table Address
 MOV R7, #08H ; Steps
 NEXT: CLR A
 MOVC A,@A+DPTR ; Initialise A for signal.
 INC DPTR
 MOV P1,A ; Out stepper signal to p1
 ACALL DELAY
 DEC R7
 CJNE R7,#00,NEXT ; keep in step loop
 SJMP START ; keep in continuous loop
Code: Delay Subroutine

 DELAY: MOV R1,#0F2H ;delay as per user


 MOV R2,#0F2H ;motor speed is depend on delay
 MOV R3,#010H ; if you want slow speed increase delay
 D1: DJNZ R1,D1
 MOV R1,#010H
 DJNZ R2,D1
 MOV R2, #010H
 DJNZ R3,D1
 RET
Code: Storing Step value table in RAM Memory

 /* hex code values for clockwise rotation */


 FORWARD: DB 01H,03H,02H,06H,04H,0CH,08H,09H

 /* hex code values for anti-clockwise rotation */


 REVERSE: DB 09H,08H,0CH,04H,06H,02H,03H,01H
 END

You might also like