Hello

Welcome lekule blog

Hi, I`m Sostenes, Electrical Technician and PLC`S Programmer.
Everyday I`m exploring the world of Electrical to find better solution for Automation.
together in the world. #lekule86
Join us on

Stepper Motor Control Using AVR (Atmega) Microcontroller

An electric machine that converts electrical energy into mechanical energy is called as an electric motor. First and foremost electric motor is a simple electrostatic device created by Scottish monk Andrew Gordon in 1740s. But in 1821, Michael Faraday demonstrated the conversion of electrical energy into mechanical energy.
Electric motors are primarily classified into two categories: AC motors and DC motors. Again, each category is subdivided into many types. Many loads such as mixer, grinder, fans, etc., most frequently used home appliances in which we can find different types of motors and these can be operated at different speeds with speed controlling provision of the motors . In this article, we are going to discuss about one of the major types of DC motors, namely Stepper motor and its control using microcontroller.

Stepper Motor

A synchronous and brushless DC motor  that converts electric pulses into mechanical movements and thus, rotates stepwise with a certain angle between each step for completing a full rotation is called as Stepper Motor. The angle between the steps of rotation of the stepper motor is termed as the stepper angle of the motor.


Stepper Motor
Stepper Motor


Stepper motors are classified into two types according to their winding: Unipolar Stepper Motors and Bipolar Stepper Motors. The unipolar stepper motor is frequently used in many applications due to its ease of operation compared to the bipolar stepper motor. But there are different types of stepper motors such as Permanent Magnet Stepper Motor, Variable Reluctance Stepper Motor, and Hybrid Stepper Motor.

Stepper Motor Control

The stepper motor can be controlled with various techniques, but here we are discussing about the stepper motor control using an Atmega microcontroller. The 89C51 is a mircocontroller of the 8051 microcontroller family.


Block Diagram of Stepper Motor Control
Block Diagram of Stepper Motor Control


The block diagram of a stepper motor control using an 8051 microcontroller is shown in the figure with power supply, microcontroller, stepper motor and control switch blocks.

2 Methods To Design Stepper Motor Control Circuit

The stepper motor controller is designed using 8051 microcontroller and switching circuit for controlling the speed of the stepper motor. The control switch circuit can be designed by using transistor switches or by using stepper motor controller IC such as ULN2003 in place of the transistors.

1. Control Circuit Using Stepper Motor Controller IC

The unipolar stepper motor can be rotated by energizing the stator coils in a sequence. The sequence of these voltage signals applied across the motor coils or leads is enough to drive the motor and hence, no driver circuit is required for controlling the direction of the current in the stator coils.
Stepper Motor Control using IC
Stepper Motor Control using IC


The two-phase-stepper motor consists of four end wires connected to the coils and two common wires connected to the two end leads to form two phases. The common points and end points of the two phases are connected to the ground or Vcc and the microcontroller pins, respectively. For rotating the motor, the endpoints of the two phases are to be energized. Primarily a voltage is applied to the first end point of the phase1, and further voltage is applied to the first end point of the phase2, and so on.

The stepper motor can be operated in different modes such as Wave Drive Stepping Mode, Full Drive Stepping Mode and Half Drive Stepping Mode.


Wave Drive Stepping Mode


By repeating the above sequence, the motor can be rotated in wave-drive- stepping mode either in a clockwise or anticlockwise direction based on the selection of end points. The table below shows the signal phase sequence for wave-drive-stepping mode.
Wave Drive Stepping Mode
Wave Drive Stepping Mode


Full Drive Stepping Mode


Energizing the two endpoints of different phases simultaneously achieves a full-drive-stepping mode. The table shows the signal phase sequence for full-drive -stepping mode.
Full Drive Stepping Mode
Full Drive Stepping Mode
Half Drive Stepping Mode
The combination of the steps of the wave and full-drive-stepping modes achieves a half-drive-stepping mode. Thus, in this mode, stepping angle is divided into half. The table shows the signal phase sequence of a half-drive-stepping mode.


Half Drive Stepping Mode
Half Drive Stepping Mode


In general, the stepping angle depends on the resolution of the stepper motor. The size of thesteps and the direction of rotation are directly proportional to the number and order of the input sequence. The rotating speed of the shaft depends on the frequency of the input sequence. The torque and the number of magnets magnetized at a time are proportional.

The stepper motor requires 60mA current, but the maximum current rating of the Atmega microcontroller AT89C51 is 50mA. So, a stepper-motor-controller ICisused to interface the stepper motor with microcontroller for transferring the signals.

2. Control Switch Circuit Using Transistors

The power supply to the circuit can be given by stepping down the voltage from 230V to 7.5V using a step-down transformer, and then rectifying by a bridge rectifier with diodes. This rectified output is fed to a filter capacitor, and then passed through the voltage regulator. The 5V regulated output is obtained from the voltage regulator. The reset pin9 is connected between the capacitor and resistor.

Stepper Motor Control Circuit using Transistor
Stepper Motor Control Circuit using Transistor


In general, stepper motor consists of four coils as shown in the figure. So, to drive the motor, four motor-driver circuits are required. Instead of using the stepper motor controller IC to drive the motor, four transistors are connected as the driver circuits at 21, 22, 23 and 24 pins of the microcontroller, respectively.

If the transistors start conduction, then a magnetic field will be created around the coil causing rotation of the motor. The stepper motor speed is directly proportional to the input pulse frequency. A crystal oscillator is connected to the pins 18 and 19 to provide microcontroller clock frequency of about 11.019MHz.


The execution time of any instruction can be calculated using the below formula
Time=((C*12))/f
Where C= number of the cycle
And F = crystal frequency
One of the application based circuit that uses stepper motor for rotating solar panel is described below.

Stepper Motor Control Using Programmed 8051 Microcontroller

Sun Tracking Solar Panel project is intended to generate the maximum amount of energy by automatically adjusting the solar panel. In this project, a stepper motor controlled by programmed microcontroller of 8051 family is interfaced to the solar panel to maintain the solar panels’ face always perpendicular to the sun.

Stepper Motor Control Using Microcontroller by Edgefxkits.com
Stepper Motor Control Using Microcontroller 

The programmed microcontroller generates stepped electrical pulses at regular intervals to the stepper motor for rotating the solar panel. The driver IC is used to drive the stepper motor as the controller is unable to provide the power requirements of the motor.



Please leave your suggestions, feedback and queries by posting comments in the comment section below. We will do our best to help you technically regarding this article and developing electrical and electronics projects using stepper motor.

Share this:

ABOUTME

Hi all. This is deepak from Bthemez. We're providing content for Bold site and we’ve been in internet, social media and affiliate for too long time and its my profession. We are web designer & developer living India! What can I say, we are the best..

Post a Comment
My photo

Hi, I`m Sostenes, Electrical Technician and PLC`S Programmer.
Everyday I`m exploring the world of Electrical to find better solution for Automation. I believe everyday can become a Electrician with the right learning materials.
My goal with BLOG is to help you learn Electrical.

Labels

LEKULE TV EDITORIALS ARTICLES DC ROBOTICS DIGITAL SEMICONDUCTORS GENERATOR AC EXPERIMENTS MANUFACTURING-ENGINEERING REFERENCE FUNDAMENTAL OF ELECTRICITY ELECTRONICS ELECTRICAL ENGINEER MEASUREMENT TRANSDUCER & SENSOR VIDEO ARDUINO RENEWABLE ENERGY AUTOMOBILE TEARDOWN SYNCHRONOUS GENERATOR DIGITAL ELECTRONICS ELECTRICAL DISTRIBUTION CABLES AUTOMOTIVE MICROCONTROLLER SOLAR PROTECTION DIODE AND CIRCUITS BASIC ELECTRICAL ELECTRONICS MOTOR SWITCHES CIRCUIT BREAKERS CIRCUITS THEORY PANEL BUILDING ELECTRONICS DEVICES MIRACLES SWITCHGEAR ANALOG MOBILE DEVICES WEARABLES CAMERA TECHNOLOGY COMMUNICATION GENERATION BATTERIES FREE CIRCUITS INDUSTRIAL AUTOMATION SPECIAL MACHINES ELECTRICAL SAFETY ENERGY EFFIDIENCY-BUILDING DRONE CONTROL SYSTEM NUCLEAR ENERGY SMATRPHONE FILTER`S POWER BIOGAS BELT CONVEYOR MATERIAL HANDLING RELAY ELECTRICAL INSTRUMENTS ENERGY SOURCE PLC`S TRANSFORMER AC CIRCUITS CIRCUIT SCHEMATIC SYMBOLS DDISCRETE SEMICONDUCTOR CIRCUITS WIND POWER C.B DEVICES DC CIRCUITS DIODES AND RECTIFIERS FUSE SPECIAL TRANSFORMER THERMAL POWER PLANT CELL CHEMISTRY EARTHING SYSTEM ELECTRIC LAMP FUNDAMENTAL OF ELECTRICITY 2 BIPOLAR JUNCTION TRANSISTOR 555 TIMER CIRCUITS AUTOCAD BLUETOOTH C PROGRAMMING HOME AUTOMATION HYDRO POWER LOGIC GATES OPERATIONAL AMPLIFIER`S SOLID-STATE DEVICE THEORRY COMPUTER DEFECE & MILITARY FLUORESCENT LAMP INDUSTRIAL ROBOTICS ANDROID ELECTRICAL DRIVES GROUNDING SYSTEM CALCULUS REFERENCE DC METERING CIRCUITS DC NETWORK ANALYSIS ELECTRICAL SAFETY TIPS ELECTRICIAN SCHOOL ELECTRON TUBES FUNDAMENTAL OF ELECTRICITY 1 INDUCTION MACHINES INSULATIONS USB ALGEBRA REFERENCE HMI[Human Interface Machines] INDUCTION MOTOR KARNAUGH MAPPING USEUL EQUIATIONS AND CONVERSION FACTOR ANALOG INTEGRATED CIRCUITS BASIC CONCEPTS AND TEST EQUIPMENTS DIGITAL COMMUNICATION DIGITAL-ANALOG CONVERSION ELECTRICAL SOFTWARE GAS TURBINE ILLUMINATION OHM`S LAW POWER ELECTRONICS THYRISTOR BOOLEAN ALGEBRA DIGITAL INTEGRATED CIRCUITS FUNDAMENTAL OF ELECTRICITY 3 PHYSICS OF CONDUCTORS AND INSULATORS SPECIAL MOTOR STEAM POWER PLANTS TESTING TRANSMISION LINE C-BISCUIT CAPACITORS COMBINATION LOGIC FUNCTION COMPLEX NUMBERS CONTROL MOTION ELECTRICAL LAWS INVERTER LADDER DIAGRAM MULTIVIBRATORS RC AND L/R TIME CONSTANTS SCADA SERIES AND PARALLEL CIRCUITS USING THE SPICE CIRCUIT SIMULATION PROGRAM AMPLIFIERS AND ACTIVE DEVICES APPS & SOFTWARE BASIC CONCEPTS OF ELECTRICITY CONDUCTOR AND INSULATORS TABLES CONDUITS FITTING AND SUPPORTS ELECTRICAL INSTRUMENTATION SIGNALS ELECTRICAL TOOLS INDUCTORS LiDAR MAGNETISM AND ELECTROMAGNETISM PLYPHASE AC CIRCUITS RECLOSER SAFE LIVING WITH GAS AND LPG SAFETY CLOTHING STEPPER MOTOR SYNCHRONOUS MOTOR AC METRING CIRCUITS BECOME AN ELECTRICIAN BINARY ARITHMETIC BUSHING DIGITAL STORAGE MEMROY ELECTRICIAN JOBS HEAT ENGINES HOME THEATER INPECTIONS LIGHT SABER MOSFET NUMERATION SYSTEM POWER FACTORS REACTANCE AND IMPEDANCE INDUCTIVE RECTIFIER AND CONVERTERS RESONANCE SCIENTIFIC NOTATION AND METRIC PREFIXES SULFURIC ACID TROUBLESHOOTING TROUBLESHOOTING-THEORY & PRACTICE 12C BUS APPLE BATTERIES AND POWER SYSTEMS DC MOTOR DRIVES ELECTROMECHANICAL RELAYS ENERGY EFFICIENCY-LIGHT INDUSTRIAL SAFETY EQUIPMENTS MEGGER MXED-FREQUENCY AC SIGNALS PRINCIPLE OF DIGITAL COMPUTING QUESTIONS REACTANCE AND IMPEDANCE-CAPATIVE SEQUENTIAL CIRCUITS SERRIES-PARALLEL COMBINATION CIRCUITS SHIFT REGISTERS WIRELESS BUILDING SERVICES COMPRESSOR CRANES DIVIDER CIRCUIT AND KIRCHHOFF`S LAW ELECTRICAL DISTRIBUTION EQUIPMENTS 1 ELECTRICAL DISTRIBUTION EQUIPMENTS B ELECTRICAL TOOL KIT ELECTRICIAN JOB DESCRIPTION INDUSTRIAL DRIVES LAPTOP SCIENCE THERMOCOUPLE TRIGONOMENTRY REFERENCE UART oscilloscope BIOMASS CONTACTOR ELECTRIC ILLUMINATION ELECTRICAL SAFETY TRAINING ELECTROMECHANICAL FEATURED FILTER DESIGN HARDWARE JUNCTION FIELD-EFFECT TRANSISTORS NASA NUCLEAR POWER VALVE COLOR CODES ELECTRIC TRACTION FLEXIBLE ELECTRONICS FLUKE GEARMOTORS INTRODUCTION LASSER PID PUMP SEAL ELECTRICIAN CAREER ELECTRICITY SUPPLY AND DISTRIBUTION MUSIC NEUTRAL PERIODIC TABLES OF THE ELEMENTS POLYPHASE AC CIRCUITS PROJECTS REATORS SATELLITE STAR DELTA VIBRATION WATERPROOF