![]() |
Stepper Motor (animation source : wikipedia) |
Stepper Motors and It's Working Principles :
In this tutorial I will show , how to interface stepper motor with microcontroller and in this case I will use pic18f2550 microcontroller .Basically stepper motor works step by step .It can rotate 360 degree by the movements of equal steps.They are available stepper motor with steps 200, 180, 144, 72, 24 with rotation angles 1.8°, 2°, 2.5°, 5°, 15° respectively. Stepper motor moves each step at a time where every steps are equal .Generally stepper motor works on the principle of electromagnetic induction. A internal rotor is surrounded by electromagnetic stators where rotor and stator like to be stable by achieving different poles.In this way the stepper motor rotate .If one stator gets power , thetab stator attracts the rotor .At this situation the rotor rotates so that the stable state can be achieved .If next stator is on and others are off .The motor will complete the next step .
Generally Stepper Motors are Divided into Three Types :
1.Hybrid Stepper Motor
2.Permanent Magnet Stepper Motor
3.Variable Reluctance Stepper Motor
[Note : If you would like to learn more about Stepper motor with more details ,please follow the link wikipedia ]
According to the arrangement of windings the stepper motors are divided into two types :
1.Unipolar Motor2.Bipolar Motor
Unipolar :
This type of stepper motor is very popular and most preferable for the hobbyists .Unipolar stepper motor contains centre tapped windings inside .In this case coils are connected through a common wire and the poles can be changed without changing the direction of current .That's why the commutation circuit is very simple for unipolar stepper motor .To control a motor through microcontroller we need H-bridge circuit and we use L293D IC as a replacement of h-bridge circuit . You know motor is one kind generator of electricity .Due to the effect of magnetic field the rotation makes back emf and we shouldn't use a MCU to interface directly with motor.That's why we will use L293D .
Bipolar :
This types of motor have no centre taped windings .For achieving reverse magnetic poles the current should be reversed in direction .In order to control this motor we need L293D ic because it is more complex to control .Basically L293D is used as the alternative of H-bridge circuit .H-bridge circuit is also used to controlling dc motor .[Note : If you would like to see "How to Interface Unipolar Stepper Motor " ,Please follow the link]
Now at this situation , we have got necessary information to create a Project .
Proteus Circuit for Bipolar Stepper Motor:
Let's Create a Project on Proteus .Please Follow the instructions given in the pictures .
Please Complete the circuit as Given below . This Circuit is for Unipolar Stepper Motor
![]() |
Bipolar Stepper Motor Interfacing With PIC Microcontroller (PIC18F2550) in Proteus [step by step] |
Now Create a Project in MikroC .If you are a beginner , you can follow the instruction :
MikroC Code for Bipolar Stepper Motor:
Source Code :
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
void main() {
CMCON = 0x07;
ADCON1 = 0x0F;
Trisb=0x00;
delay_ms(1000);
while(1){
PORTB.F0=0;
PORTB.F1=0;
PORTB.F2=0;
PORTB.F3=1;
delay_ms(1000);
PORTB.F0=0;
PORTB.F1=1;
PORTB.F2=0;
PORTB.F3=0;
delay_ms(1000);
PORTB.F0=0;
PORTB.F1=0;
PORTB.F2=1;
PORTB.F3=0;
delay_ms(1000);
PORTB.F0=1;
PORTB.F1=0;
PORTB.F2=0;
PORTB.F3=0;
delay_ms(1000);
}
}
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
How to run the MikroC and save hex file .
Now go to the proteus circuit to load the hex file
Run the Project
Result :
![]() |
Bipolar Stepper Motor Interfacing With PIC Microcontroller (PIC18F2550) in Proteus [step by step] |
Download Proteus File
Download Source Hex
Just Click on '' SKIP ADD '' and You will get the download link
Thank You !
0 comments:
Post a Comment