Sunteți pe pagina 1din 22

Minor Project

“Stepper Motor Control USing


ArdUino”

Group 15

Members
Ankit Kumar (1602015) Project Guide
Gautam Verma (1602052) Dr. Ramesh Kumar
Aditya Kumar Shrivastava (1602063)
Abstract

In this project, we are going to control a stepper motor by using an


arduino microcontroller. Arduino has been programmed in order to
rotate the stepper motor for various applications. The motor drive
which acts as an interface between the arduino board and the stepper
motor. The arduino board is triggered manually by applying the
external voltage of about 5V. From this, it can directly deliver the input
to the stepper motor drive where it provides sufficient current to the
stepper motor which in turn rotates the stepper motor. By
programming the stepper drive, we are able to control the speed and
direction of the stepper motor, either in clockwise or an anticlockwise
direction. Motor drive protects the stepper motor from damages.
Hence the stepper motor drive is connected between the stepper
motor and the arduino board.
Introduction

We are going to use ARDUINO microcontroller (Arduino Uno).


ARDUINO microcontroller has different numbers of analog and digital
inputs. A specially provided USB cable which acts as an interface
between the micro controller and the computer. From the USB cable,
we upload the program to the microcontroller. Based on the program
done in the microcontroller, we can use the microcontroller for various
applications such as rotating and to control the speed of the motor.

Stepper motor can be varied from a normal motor only from stepwise
rotation. Different kinds of stepper motors are used for step wise
rotation for various applications. Stepper motor can be used only for
the application based on stepwise rotation. Direction of the motor can
be controlled by using the microcontroller. These 4 wired stepper
motor which has 2 north poles and 2 south poles. Based on triggering
the circuit, the motor can be rotated either in clock wise or counter
clock wise direction. The motor can be rotated by connecting the motor
with the microcontroller.

ARDUINO microcontroller has been connected with the stepper motor


drive circuit by using the jumper cables. The input and the power
supply are connected with the microcontroller. The digital input of the
microcontroller is connected with the stepper motor drive for the
efficient input deliver to the motor. The 4 wires present in the stepper
motor are connected with the motor drive according to the input of the
system. When the input signal is given either by manually or by
triggering the circuit, microcontroller fed the input to the stepper
motor drive. The stepper motor drive which in turn amplifies the signal
and therefore it sends the amplified signal to the stepper motor.
Stepper motor is rotated according to the program developed in the
arduino software. The rotation, speed, direction of the motor can be
controlled by using arduino software.
HARDWARE DESCRIPTION

1. ARDUINO - Microcontroller:

Arduino is an open source hardware and software company, project


and user community that designs and manufactures single board
microcontroller and microcontroller kits for building digital devices and
interactive objects that can sense and control both physically and
digitally.

Arduino microcontroller consists of 6 analog inputs (A0 to A5) and 13


digital inputs. Power supply pins and ground pins are used for the
power supply of the component. Analog inputs are used to trigger the
circuit manually. But majority of the applications works on digital input
of the circuit. The stepper motor is being connected with the digital
input of the circuit. Reset button is provided in the microcontroller
board to reset the program and also to upload the other program.
Arduino programming is done by using the arduino software and the
program is uploaded in the microcontroller.

2. Stepper Motor Drive:

Stepper motor drive is used to rotate the stepper motor with particular
input and also it protects the motor from the back Emf. It amplifies the
input provided by the microcontroller and further it passes the
amplified signal to the stepper motor. It provides the sufficient signal to
drive the stepper motor. It acts as an interface between the arduino
microcontrollers to the stepper motor.

If the microcontroller and the stepper motor are connected directly,


the circuit can get damaged because of the inefficient power supply.
Stepper motor requires a specific voltage to rotate in clockwise or
counter clockwise direction. The role of stepper motor drive is to
provide a sufficient input signal to the stepper motor by obtaining an
input from the microcontroller. Various motor drives are used to drive
various kinds of motors. Stepper motor drive is particularly used in
order to obtain the desired output without any damages to the
component.

3.Stepper Motor:
There are different types of stepper motor such as unipolar and bipolar
stepper motor. It is a four wired stepper motor. It rotates in a stepwise
manner. Each two wires represent the north and south poles of a
magnet. It consist of two elements namely stator and rotor. Stator
represents the magnets in stationary movement and the rotor which
represents the magnets in rotatory movement. Stationary part of the
magnet can be wounded with the coil. When the copper coil receives
the current supply, the magnet gets energised and then it acts like a
magnet. By applying the power supply in the circuit, the rotor may
rotate either in forward or in a reverse direction. The speed of the
stepper motor can be controlled by arduino microcontroller. By varying
the program parameters, the speed, torque and the direction of the
stepper motor can be controlled. These stepper motor can be used for
many industrial applications and also for the general purpose
applications.
Types of Stepper Motors
 Permanent Magnet (PM):
Also called “tin can” or “can stock,” these are a cheap, low resolution
type of stepper motors having step angles of typically 7.5 to 15
degrees (48 to 24 steps per revolution.)
The working concept of a PM stepper motor can be understood
through the illustration provided below. The type utilizes permanent
magnets and eliminates the employment of rotor teeth or steps
normally associated with the other more sophisticated types of
stepper motors. Instead the rotational effect is produced through
alternate magnetization of the rotor plate. The electrical pulses
applied to the windings generate induced magnetic flux alternately
which influence the permanent magnets of the rotor. The effect of
these interacting magnetic fluxes produces the high torque levels
responsible for the required rotations.

The above mechanism with PM stepper motors make them


comparatively more efficient than the variable reluctance types.
 Variable reluctance (VR): This type of stepper motor primarily
consists of a central rotor cylinder/shaft assembly made of
multiple toothed elevations over its entire radial surface. The
stator assembly, which consists of several layers of super
enameled copper wire wound over laminated iron stampings, is
kept closely attached with the rotor. The electrical pulses applied
to the stator windings produce alternately sequencing magnetic
fluxes over the rotor teeth creating a twisting effect. These
alternate push/pulls and twisting of the rotor give rise to the
required revolutions and the torque to the rotor/shaft assembly.
 Hybrid (HB): The stepper motors included in this type are more
expensive than the above types due to the following interesting
features:
Hybrid stepper motors have improved step resolution with
increment angles ranging from 3.6 to 1 degree for 100 to 400
steps per revolution respectively.
The system incorporates the advantages of both PM and VR types
and utilizes a special arrangement of permanent magnet poles
over the entire concentric multi-toothed rotor/shaft assembly.
The multi-toothed rotor assembly exhibits excellent coordination
with the magnetic fluxes generated by the stator windings, which
guides the rotor movement in a well-controlled manner across
the intermediate air gaps.
The above operations of the hybrid type produce more dynamic torque
resolutions and high efficiency compared to the PM and the VR types.
Control Of Stepper Motor

The usual ways of stepper motor control are:

1. wave –mode

2. full-step mode

3. half-step mode

4. micro-step mode
Wave -mode

In this drive method only single phase is activated at a time.It has same
number of steps as full step drive.

Full-Step

Typical hybrid stepping motors combine the strengths of variable


reluctance and permanent magnet motors. They usually have two
hundred rotor teeth, i.e. two hundred full steps for each revolution of
the motor shaft (or one point eight degrees per step). Full-step
operation is attained by energizing both of the motor’s windings while
alternately reversing the current. A single pulse from the stepper
motor’s generator equals one step.

Half-Step
In half-step operation the stepper motor rotates at four hundred steps
every revolution. One winding is energizing after the other which
makes the motor rotate halfway (point nine degrees). While half-step
operation offers smoother rotation than full-step, it provides roughly
thirty percent less torque.

Microstep
Microstep operation divides each step into two hundred fifty-six
discrete microsteps which allow fifty-one thousand two hundred steps
for each revolution (point zero zero seven degrees per step).
Microstepping is generally used in situations where one needs highly
accurate positioning and fluid motion throughout a larger range of
speeds. As with half-step operation microstepping improves motion
control at the cost of reduced torque.
A stepper motor’s windings are connected in either series or parallel:
series connections offer more torque at low speeds whereas parallel
connections lower the inductance, allowing more torque at faster
speeds. The stepper motor’s torque versus its speed is dependant on
the driver output voltage. The drive should be current-limited in
relation to the stepper motor rating because the driver’s output can be
rated as much as twenty times higher than the motor’s voltage.

Advantages

• low cost,

• high reliability,

• high torque at low speeds,

• Rotation angle of the stepper motor is proportional to the input


pulse

• a simple, rugged construction that operates in almost any


environment

Disadvantages
• Low efficiency

• decreasing torque with increasing speed.


WORKING OF THE PROJECT

In the project arduino uno is connected to driver board which further is


connected to the stepper motor and the speed and direction of the
stepper motor is successfully controlled.

In order to control the speed of the stepper motor potentiometer


terminal acts as analog input to the arduino. Thus, on increasing
potentiometer resistance the analog input into the arduino increases
which in turn leads to higher digital output and hence at higher
resistance of potentiometer we get higher speed of stepper motor and
vice- versa.

On pressing the push button (SPST switch) the phase sequence of


energization of windings of stepper motor are reversed and hence the
direction of stepper motor is reversed.

The connections in the stepper motor are connected according to the


circuit diagram given below
Circuit Diagram
We have also conducted simulation of this circuit in isis
proteus as shown below
LOGIC OF FULL STEP CONTROL
In the full step control mode always both windings are energized at the
same time according to the following two tables where first table
shows the driving sequence for one rotation direction and second table
for the other direction:
CODING
/*
Bipolar stepper motor speed and direction control with Arduino
*/
#include <Stepper.h>

//no. of steps of our motor


#define STEPS 20

// create an instance of the stepper class, specifying the number of steps of the motor and the pins it's
attached to

Stepper stepper(STEPS, 8, 9, 10, 11);

const int button = 4; // direction control button is connected to Arduino pin 4


const int pot = A0; // speed control potentiometer is connected to analog pin 0

void setup()
{
pinMode(button, INPUT_PULLUP);
}

int direction_ = 1, speed_ = 0;

void loop()
{
if ( digitalRead(button) == 0 ) // if button is pressed
if ( debounce() ) // debounce button signal
{
direction_ *= -1; // reverse direction variable
while ( debounce() ) ; // wait for button release
}

// read analog value from the potentiometer


int val = analogRead(pot);

// map digital value from [0, 1023] to [5, 100]


// ===> min speed = 5 and max speed = 100 rpm
if ( speed_ != map(val, 0, 1023, 5, 100) )
{ // if the speed was changed
speed_ = map(val, 0, 1023, 5, 100);
// to set the speed of the motor
stepper.setSpeed(speed_);
}

// direction of stepper motor


stepper.step(direction_);

}
bool debounce()
{
byte count = 0;
for(byte i = 0; i < 5; i++) {
if (digitalRead(button) == 0)
count++;
delay(10);
}
if(count > 2) return 1;
else return 0;
}
Applications
Stepper motors are used for operation control in

 robotics devices

 Applications requiring incremental motion are

 typewriters,
 line printers,

 Automatic digital camera focus and zoom functions

 Microwatt rated stepper motor used in wrist watches

 Used in surveillance cameras for security


References:-

1. J.B. Gupta, (2015). Theory & Performance of Electrical


Machines . New Delhi: S.K Katariya & Sons
2. K.R. Siddhapura and D.B. Raval, (2014). A Textbook Of Electrical
Machines .New Delhi: Vikash Publishing House Pvt Ltd
3. Ashfaq Hussain and Haroon Ashfaq, (2005). Electrical Machines.
New Delhi: Dhanpat Rai & Co.
4. Tutorials Point(2019). Arduino - Quick Guide. Retrieved from
https://www.tutorialspoint.com/arduino/arduino_quick_guide.
html

S-ar putea să vă placă și