Your SlideShare is downloading. ×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Interfacing Stepper motor with 8051

25,010

Published on

Interfacing Stepper motor with 8051

Interfacing Stepper motor with 8051

Published in: Education
6 Comments
19 Likes
Statistics
Notes
  • nice,,,,
    i wanna cotrol d.c motor pleas snd me
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • my email id is manoj8indore@gmail.com,I am experienced in stepper motor drives
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • connect driver between 8051 and stepper motor
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • i write a very small code just to rotate motor to right. The number of steps i want to move are in r1.
    but in lab there is problem i have a unipolar stepper motor with 48 steps. How am i suppose to connect the controller with motor please help me as soon as possible.
    if possible send a circut diagram for that purpose.
    The code is as follow

    ORG 0H
    MOV A,#66H
    MOV R1,#48
    MAIN:
    H1: ACALL ROTATE_R
    DJNZ R1,H1
    AJMP M

    ROTATE_R: MOV P1,A
    RR A
    ACALL DELAY
    RET

    DELAY: MOV R2,#10
    H2: MOV R3,#200
    H3: MOV R4,#250
    H4: DJNZ R4,H4
    DJNZ R3,H3
    DJNZ R2,H2
    RET

    M: SJMP $
    END
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • in slide 7.
    what is between motor and microcontroller and how the connections are made.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
25,010
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
6
Likes
19
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Interfacing Stepper Motor with 8051
    www.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 position can be controlled precisely without any feedback mechanism, as long as the motor is carefully sized to the application.
    • 4. Stepper motors are similar to switched reluctance motor (which are very large stepping motors with a reduced pole count, and generally are closed-loop
    • 5. The stepper motor can be interfaced with the 8051 using l293d connected to p1.0,p1.2,p1.3,p1.4
    • 6. Stepper motor two types of step sequence 1) full step and 2) half step sequence
    • 7. 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 below
    WHAT IS STEPPER MOTOR ?
  • 8. Full step and 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 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. Full step sequence
  • 10. Full step sequence
  • 11. Half step sequence
  • 12. Confidential © Copyright 2008 Pantech solutions Pvt Ltd
    Stepper motor interfacing
  • 13. Half step sequence
  • 14.     org0Hstepper equP1main:        mov stepper,#0CH        acall delay        mov stepper,#06H        acall delay        mov stepper,#03H        acall delay        mov stepper,#09H        acall delay        sjmp main
    STEPPER MOTOR ASSEMBLY CODE
  • 15. delay:        mov r7,#4wait2:        mov r6,#0FFHwait1:        mov r5,#0FFHwait:        djnz r5,wait        djnz r6,wait1        djnz r7,wait2        ret        end
    ASSEMBLY CODE CONTD
  • 16. #include <reg51.h> //Define 8051 registers
    #include<stdio.h>
    void DelayMs(unsigned int); //Delay function
    void 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)
    {
    unsigned int 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 Port0
    C CODE CONTD
  • 18. C CODE CONTD
    while(1) //Loop Forever
    {
    Clockwise ();
    DelayMs (100);
    P0 = 0;
    AntiClockwise ();
    DelayMs (100);
    P0 = 0;
    }
    }
    void DelayMs(unsigned int n)
    {
  • 19. unsigned int i,j;
    for(j=0;j<n;j++)
    {
    for(i=0;i<800;i++);
    }
    }
    C CODE CONTD
  • 20. For more details
    www.pantechsolutions.net
    http://www.slideshare.net/pantechsolutions
    http://www.scribd.com/pantechsolutions
    http://www.youtube.com/pantechsolutions

×