0% found this document useful (0 votes)
7 views5 pages

Lab-9 Stepper Motor Interfacing With PIC16F877A Microcontroller

The document discusses the interfacing of stepper motors with the PIC16F877A microcontroller, explaining their operation based on electromagnetism and detailing the different types of stepper motors, including unipolar and bipolar configurations. It describes various stepping modes such as full step, half step, and micro step, highlighting their respective advantages in terms of torque and control precision. Additionally, it provides a sample Mikro C code for controlling the stepper motor and mentions common driver circuits like ULN2003 and L293D used for driving applications.

Uploaded by

Shakib Hossain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views5 pages

Lab-9 Stepper Motor Interfacing With PIC16F877A Microcontroller

The document discusses the interfacing of stepper motors with the PIC16F877A microcontroller, explaining their operation based on electromagnetism and detailing the different types of stepper motors, including unipolar and bipolar configurations. It describes various stepping modes such as full step, half step, and micro step, highlighting their respective advantages in terms of torque and control precision. Additionally, it provides a sample Mikro C code for controlling the stepper motor and mentions common driver circuits like ULN2003 and L293D used for driving applications.

Uploaded by

Shakib Hossain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Stepper Motor Interfacing With PIC16F877A Microcontroller

Theory:
Stepper motors are working on the same principle of dc motors. It is a synchronous dc motor
which moves in discrete steps to complete its rotation. Normally, each step moves 1.8 degree
and therefore a total of 200 steps for a rotor to finish a single rotation. Unlike normal dc motors,
it contains multiple stator magnets used to trigger each step. Apart from 1.8 degree, stepper
motors with step angle 30, 15.5, 2.5 and 2 are also available. The stepper motor completes it’s
each revolution with each step completely controlled by the controller which is followed by a
driver circuit. Because of the high precision properties, stepper motors are highly preferred in
motion control application such as robotics.

Figure: Stepper Motor

Mainly there are four types of stepper motors:

 Permanent magnet stepper


 Hybrid synchronous stepper
 Variable reluctance stepper
 Lavet type stepping motor

PRINCIPLE OF OPERATION AND WORKING


The basic principle behind the working of a stepper motor is electromagnetism. Since stepper
motors are working under the same principle of a dc motor, they are normally regarded as dc
motors. But unlike dc motors they have multiple stator coils which are called phases. By
energizing each phase in a controlled manner or with a predetermined pulse sequence, the
motor completes its full revolution with one step at a time. We can achieve motion in more
precise and controlled manner with the help of a control circuitry.

Similar to any other motor, a stepper motor has a rotating part which is aptly called a rotor and
a static part termed stator. The stator and rotor have magnetic poles. By energizing the stator
poles, the rotor moves in order to align with the stator. A rotor is a central gear-shaped piece
of iron. The stator is a set of toothed electromagnets arranged around the central gear.

When the phase windings of the stepper motor are provided with a current, corresponding
magnetic flux will be developed in the stator in the direction perpendicular to the direction of
current flow. Electromagnets are energized one at a time. When one electromagnet is energized
with the help of an external driver circuit or a microcontroller, the rotor shaft turns in such a
way that it aligns itself with the stator in a position which minimizes the flux opposition. That
means the electromagnet attracts the gear teeth by which the electromagnet is offset from the
rest of the electromagnets. Because of this, when the next electromagnet is turned on, the first
electromagnet gets turned off which results in the gear teeth getting attracted to the second
electromagnet. Thus the rotor is made rotating in steps which are an integer determined by the
angle of movement in each step.

Unipolar and Bipolar stepper motors


According to the winding arrangements of the electromagnetic coils in a two-phase stepper
motor, they are classified as unipolar and bipolar stepper motors. In the unipolar stepper motor
which works with one winding with a center tap per phase, each section of the phase winding
is turned on for each of the magnetic field direction. Since unipolar stepper motors are quite
easy to operate, these are highly preferred among hobbyists.

Figure: Unipolar stepper motor

In a bipolar stepper motor, there is a single winding per phase. This makes the driver circuit lot
more complicated while reversing the magnetic poles which in turn reverses the current in the
winding. Usually, an H-Bridge arrangement is used to do this task. One can also purchase
simpler driver chips to make the task less complicated.

Figure: Bipolar stepper motor

STEPPING MODES – Unipolar stepper motors


A unipolar stepper motor works only in positive voltage. That means it has only one polarity.
The upper and lower voltage levels are positive. For example, upper voltage level 5V and lower
voltage level 0V. A unipolar stepper motor requires a wire in the middle of each coil to allow
current to flow through.
Mainly there are 3 types of stepping modes in Unipolar stepper motors

 Full step
 Half step
 Micro-step

Full Step
In full step operation each step has a movement of 1.8 degrees and hence it takes 200 steps to
complete a full revolution. This is made possible by energizing either single of stator winding
or two phases. Since the two phases are energized at the same time in the dual phase operation,
torque and speed are greater in this kind of operation while the single phase operation requires
a lower amount of power from the driver circuit.

There are two types of full step mode:

 One step mode/wave step


 Dual-phase mode

In one step mode/ wave step, the motor is operated with only one phase energized at a time.
This mode of operation requires a small amount of power.

In dual phase mode, the motor operated in both phases get energized at the same time. This
mode provides more torque and high-speed performance. But this mode requires twice the
amount of power used in one step mode.

Half Step
The rotor moves through half the base angle in a single step which results in improved torque
than single phase full step operation. Also it doubles smoothness of rotation and resolution.
In half step mode, they have only half the basic step angle when compared to full step mode
which results in more precise motion control and smoother motor performance. Resolution is
also increased. But in this mode, motor produces less torque compared to other modes.

Micro step
In the micro step mode, it divides the motor steps up to 256 times which improves the low-
speed smoothness and low-speed resonance effects. But in this mode, the motor produces less
torque compared to other modes.
In micro step operation, the basic angle is divided into minute values even up to 256 times.
Micro step operation is preferred where increased smoothness of rotation is required.

Stepper motor driver


The stepper motor phases are completely controlled by the microcontroller. But it cannot be
controlled directly because the controller is not capable of supplying that much amount of
current directly. So it can be achieved using a driver circuitry. Commonly ULN2003 and
L293D are widely used for simple stepper motor driving applications and there are specialized
ICs or drivers for driving large and complex applications.

Mikro C Code:

void main()
{
TRISD = 0b0000000; // PORT D as output port
PORTD = 0b1111111;
do
{
PORTD = 0b00000011; // energizing two phases at a time
Delay_ms(500); // delay of 0.5s
PORTD = 0b00000110;
Delay_ms(500);
PORTD = 0b00001100;
Delay_ms(500);
PORTD = 0b00001001;
Delay_ms(500);
}while(1); // loop executed infinite times
}
Circuit Diagram:

You might also like