Interfacing of Stepper-Motor

Updated on 2017/08/28 18:32

Syllabus

Interfacing of 8051 Micro-controller with: Stepper motor 

Introduction to Stepper-Motor

Principle of Working

A stepper motor is an electromechanical device which converts electrical pulses into discrete mechanical movements. The shaft or spindle of a stepper motor rotates indiscrete step increments when electrical command pulses are applied to it in the proper sequence. The motors rotation has several direct relationships to these applied input pulses. The sequence of the applied pulses is directly related to the direction of motor shafts rotation. The speed of the motor shafts rotation is directly related to the frequency of the input pulses and the length of rotation is directly related to the number of input pulses applied.

permanent-magnet-stepper-motor.jpg

steepper-motor-working.png
 

Stepper motor can be operated in two types of sequences:

  1. Half step: In this sequence single coil is energized and then both coils are energized at the same time and motor shaft rotates. Refer figure 1 shown above.
    Step Angle = 45 degree
    No of steps = 8
  2. Full step: In this sequence single coil is energized or both coils are energized at the same time and motor shaft rotates. Refer figure 1 shown above.
    Step Angle = 90 degree
    No of steps = 4

Half step Sequence

Half Step Sequence
StepABA'B'Hex Value
0100008H
111000CH
2010004H
3011006H
4001002H
5001103H
6000101H
7100109H

Full Step Sequence

Full step sequence
StepABA'B'Hex value
0100008H
1010004H
2001002H
3000101H
Full step sequence
StepABCDHex codes
011000CH
1011006H
2001103H
3100109H

When to use a stepper motor

stepper-motor1.jpg

  • A stepper motor can be a good choice whenever controlled movement is required.
  • They can be used to get advantage in applications where you need to control rotation angle, speed, position and synchronism.
  • Because of inherent advantages listed previously, stepper motor have their place in many different applications.

Interfacing

Algorithm for Interfacing

Interfacing Diagram

8051_motor.jpg

Assembly Language Program for Interfacing

Program: Write an ALP to rotate stepper motor 90 degree in the clockwise direction which is interfaced to 8051 microcontroller.

ORG 00H
Main:Mov A,#OCH
Acall Delay
Mov A,#06H
Acall Delay
Mov A,#03H
Acall Delay
Mov A,#09H
Acall Delay
SJMP Main
Delay:Mov R7,#4
up2:Mov R6,#0FFH
up1:Mov R5,#0FFH
Here:DJNZ R5,Here
DJNZ R6,up1
DJNZ R7,up2
ret
end

Note:-In order to rotate stepper motor in anticlockwise direction just reverse the sequence of excitation of windings (from bottom to top) refer table above

Program: Write an ALP to rotate stepper motor 45 degree in the clockwise direction which is interfaced to 8051 microcontroller.

ORG 00H
Main:Mov A,#O8H
Acall Delay
Mov A,#OCH
Acall Delay
Mov A,#O4H
Acall Delay
Mov A,#06H
Acall Delay
Mov A,#O2H
Acall Delay
Mov A,#03H
Acall Delay
Mov A,#O1H
Acall Delay
Mov A,#09H
Acall Delay
SJMP Main
Delay:Mov R7,#4
up2:Mov R6,#0FFH
up1:Mov R5,#0FFH
Here:DJNZ R5,Here
DJNZ R6,up1
DJNZ R7,up2
ret
end

Video Simulation in Proteus


References

  • Interfacing image by Jayesh Gopal, WikiNote Volunteer, Pune
  • Created and edited by Prof.S.M.Wagh, SKNCOE, Pune
  • WikiNote Foundation
Tags:
Created by Sujit Wagh on 2017/08/03 16:40