KEMBAR78
Interfacing Stepper motor with 8051 | PPTX
Interfacing Stepper Motor with 8051www.pantechsolutions.net
A stepper motor (or step motor) is a brushless synchronous electric motor that can divide a full rotation into a large number of steps.
The motor's position can be controlled precisely without any feedback mechanism, as long as the motor is carefully sized to the application.
Stepper motors are similar to switched reluctance motor (which are very large stepping motors with a reduced pole count, and generally are closed-loop
The stepper motor can be interfaced with the 8051 using l293d connected to p1.0,p1.2,p1.3,p1.4
Stepper motor two types of step sequence 1) full step and 2) half step sequence
In the full step sequence, two coils are energized at the same time and motor shaft rotates. The order in which coils has to be energized is given in the table belowWHAT IS STEPPER MOTOR ?
Full step and half step sequenceIn the full step sequence, two coils are energized at the same time and motor shaft rotates. The order in which coils has to be energized is given in the table below.In Half mode step sequence, motor step angle reduces to half the angle in full mode. So the angualar resolution is also increased i.e. it becomes double the angular resolution in full mode. Also in half mode sequence the number of steps gets doubled as that of full mode. Half mode is usually preffered over full mode. Table below shows the pattern of energizing the coils.
Full step sequence
	Full step sequence
Half step sequence
Confidential © Copyright 2008 Pantech solutions Pvt LtdStepper motor interfacing
Half step sequence
    org0Hstepper equP1main:        mov stepper,#0CH        acall delay        mov stepper,#06H        acall delay        mov stepper,#03H        acall delay        mov stepper,#09H        acall delay        sjmp mainSTEPPER MOTOR ASSEMBLY CODE
delay:        mov r7,#4wait2:        mov r6,#0FFHwait1:        mov r5,#0FFHwait:        djnz r5,wait        djnz r6,wait1        djnz r7,wait2        ret        endASSEMBLY CODE CONTD

Interfacing Stepper motor with 8051

  • 1.
    Interfacing Stepper Motorwith 8051www.pantechsolutions.net
  • 2.
    A stepper motor(or step motor) is a brushless synchronous electric motor that can divide a full rotation into a large number of steps.
  • 3.
    The motor's positioncan be controlled precisely without any feedback mechanism, as long as the motor is carefully sized to the application.
  • 4.
    Stepper motors aresimilar to switched reluctance motor (which are very large stepping motors with a reduced pole count, and generally are closed-loop
  • 5.
    The stepper motorcan be interfaced with the 8051 using l293d connected to p1.0,p1.2,p1.3,p1.4
  • 6.
    Stepper motor twotypes of step sequence 1) full step and 2) half step sequence
  • 7.
    In the fullstep sequence, two coils are energized at the same time and motor shaft rotates. The order in which coils has to be energized is given in the table belowWHAT IS STEPPER MOTOR ?
  • 8.
    Full step andhalf step sequenceIn the full step sequence, two coils are energized at the same time and motor shaft rotates. The order in which coils has to be energized is given in the table below.In Half mode step sequence, motor step angle reduces to half the angle in full mode. So the angualar resolution is also increased i.e. it becomes double the angular resolution in full mode. Also in half mode sequence the number of steps gets doubled as that of full mode. Half mode is usually preffered over full mode. Table below shows the pattern of energizing the coils.
  • 9.
  • 10.
  • 11.
  • 12.
    Confidential © Copyright2008 Pantech solutions Pvt LtdStepper motor interfacing
  • 13.
  • 14.
        org0HstepperequP1main:        mov stepper,#0CH        acall delay        mov stepper,#06H        acall delay        mov stepper,#03H        acall delay        mov stepper,#09H        acall delay        sjmp mainSTEPPER MOTOR ASSEMBLY CODE
  • 15.
    delay:       mov r7,#4wait2:        mov r6,#0FFHwait1:        mov r5,#0FFHwait:        djnz r5,wait        djnz r6,wait1        djnz r7,wait2        ret        endASSEMBLY CODE CONTD
  • 16.
    #include <reg51.h> //Define 8051registers#include<stdio.h>void DelayMs(unsigned int); //Delay functionvoid Clockwise (void){ unsigned int i; for (i=0;i<30;i++) { P0 = 0x01;DelayMs(5); //Delay 20msec P0 = 0x02;DelayMs(5); P0 = 0x04;DelayMs(5); P0 = 0x08;DelayMs(5); } }STEPPER MOTOR C CODE
  • 17.
    void AntiClockwise (void){ unsignedint i; for (i=0;i<30;i++) { P0 = 0x08;DelayMs(5); //Delay 20msec P0 = 0x04;DelayMs(5); P0 = 0x02;DelayMs(5); P0 = 0x01;DelayMs(5); }}void main (void){ P0 = 0; //Initialize Port0C CODE CONTD
  • 18.
    C CODE CONTDwhile(1) //LoopForever { Clockwise ();DelayMs (100); P0 = 0; AntiClockwise (); DelayMs (100); P0 = 0; }}void DelayMs(unsigned int n){
  • 19.
  • 20.