Friday, 29 July 2016

Stepper motor interfacing with 8051

Now I can show you "How to Interface Stepper motor with 8051 micro-controller using some logic's Click here to see the logic's. I miss two logic's on that link I will give below.



These two logic's are also used when the driver is used.Lets go the programming shown in given below

#include<reg51.h>
sbit w = P2^0;                        
sbit x = P2^1;                           // Motor pins assigned to port 2
sbit y = P2^2;                        
sbit z = P2^3;                        
sbit H = P1^0;                         // Home switch is connected to port 1, pin-0
sbit R_45 = P1^2;                    // Rotate_45 switch is connected to port 1, pin-2
sbit R_90 = P1^4;                                // Rotate_90 switch is connected to port 1, pin-4
sbit R_135 = P1^6;                              // Rotate_135 switch is connected to port 1, pin-6
sbit R_180 = P1^7;                              // Rotate_180 switch is connected to port 1, pin-7

                                                   
void Home()                                //  Motor "Home" function (Starting stage)
{
 w = 0;
 x = 1;
 y = 0;
 z = 1;
}

void Rotate_45()                          // Motor "Rotate 45 degree" function
{
 w = 0;
 x = 1;
 y = 0;
 z = 0;
}

void Rotate_90()                          // Motor "Rotate 90 deg" function
{
 w = 1;
 x = 1;
 y = 0;
 z = 0;
}

void Rotate_135()                         // Motor "Rotate 135 deg" function
{
 w = 1;
 x = 1;
 y = 1;
 z = 0;
}

void Rotate_180()                          // Motor "Rotate 180 degree" function
{
 w = 1;
 x = 0;
 y = 1;
 z = 0;
}

void main()                                         // Main function
{
  H = 0;                                              // Initialize all switches to zero
  R_45 = 0;
  R_90= 0;
  R_135 = 0;
R_180 = 0;
  while(1)
     {
         if(H==1)
             Home();                                
         else if(R_45==1)
             Rotate_45();
         else if(R_90==1)
             Rotate_90();
         else if(R_135==1)
          Rotate_135();
       else if(R_180==1)
          Rotate_180();
         else
             Home();
     }
}

Copy this program into Keil software and create hex file. Next do the same hardware connections  as shown in below using Proteus software.


 If you want detailed description see the below video. See you soon with future updates.


Wednesday, 27 July 2016

Uni-polar stepper motor

This post is only useful to know the basics of uni-polar stepper motor. This is very useful basics of uni-polar stepper motor when it is interfaced with micro-controller. And this post only shows the how to control Uni-polar stepper motor logically. If you want to know about step angle of the stepper motor and formula Click this link.

                      Stepper motor having two types one is uni-polar and second one is bi-polar stepper motor. Here I explain about Uni-polar stepper motor. Below diagram  shows the difference between these two stepper motor.

                                   
As you seen in above diagram Uni-polar stepper motor having five terminals namely A, B(A'), C(B), D(B') and final one is connected to Ground terminals. When your connected to micro-controller these four terminals(A, B, C, D) are controlled logically and you get different Step Angles using different logic's. It seems like this


As you seen above figure A, B, C, D terminals are controlled logically by using Micro-controllers.
If logic-0 or logic-1 is applied to all four terminals then angle made by the stepper motor is 0 (Zero) deg. Similarly some logic's are their as shown in below table.


This different logic's will help to get different step angles, when stepper motor is interfacing with micro-controller this logic's are very helpful to get different step angles. I will show you in next post how to interfacing stepper motor with micro-controller using above logic's.