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.
Previous
Next Post »
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.
Related Posts Plugin for WordPress, Blogger...

Label

KITAIFA NEWS KIMATAIFA MICHEZO BURUDANI SIASA TECHNICAL ARTICLES f HAPA KAZI TU. LEKULE TV EDITORIALS ARTICLES DC DIGITAL ROBOTICS SEMICONDUCTORS MAKALA GENERATOR GALLERY AC EXPERIMENTS MANUFACTURING-ENGINEERING MAGAZETI REFERENCE IOT FUNDAMENTAL OF ELECTRICITY ELECTRONICS ELECTRICAL ENGINEER MEASUREMENT VIDEO ZANZIBAR YETU TRANSDUCER & SENSOR MITINDO ARDUINO RENEWABLE ENERGY AUTOMOBILE SYNCHRONOUS GENERATOR ELECTRICAL DISTRIBUTION CABLES DIGITAL ELECTRONICS AUTOMOTIVE PROTECTION SOLAR TEARDOWN DIODE AND CIRCUITS BASIC ELECTRICAL ELECTRONICS MOTOR SWITCHES CIRCUIT BREAKERS MICROCONTROLLER CIRCUITS THEORY PANEL BUILDING ELECTRONICS DEVICES MIRACLES SWITCHGEAR ANALOG MOBILE DEVICES CAMERA TECHNOLOGY GENERATION WEARABLES BATTERIES COMMUNICATION FREE CIRCUITS INDUSTRIAL AUTOMATION SPECIAL MACHINES ELECTRICAL SAFETY ENERGY EFFIDIENCY-BUILDING DRONE NUCLEAR ENERGY CONTROL SYSTEM FILTER`S SMATRPHONE BIOGAS POWER TANZIA BELT CONVEYOR MATERIAL HANDLING RELAY ELECTRICAL INSTRUMENTS 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 cartoon CELL CHEMISTRY EARTHING SYSTEM ELECTRIC LAMP ENERGY SOURCE FUNDAMENTAL OF ELECTRICITY 2 BIPOLAR JUNCTION TRANSISTOR 555 TIMER CIRCUITS AUTOCAD C PROGRAMMING HYDRO POWER LOGIC GATES OPERATIONAL AMPLIFIER`S SOLID-STATE DEVICE THEORRY DEFECE & MILITARY FLUORESCENT LAMP HOME AUTOMATION INDUSTRIAL ROBOTICS ANDROID COMPUTER ELECTRICAL DRIVES GROUNDING SYSTEM BLUETOOTH CALCULUS REFERENCE DC METERING CIRCUITS DC NETWORK ANALYSIS ELECTRICAL SAFETY TIPS ELECTRICIAN SCHOOL ELECTRON TUBES FUNDAMENTAL OF ELECTRICITY 1 INDUCTION MACHINES INSULATIONS 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 USB AUDIO 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 ELECTRICAL LAWS HMI[HUMANI INTERFACE MACHINES 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 BASIC CONCEPTS OF ELECTRICITY CONDUCTOR AND INSULATORS TABLES CONDUITS FITTING AND SUPPORTS CONTROL MOTION 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 APPS & SOFTWARE BASIC AC THEORY 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 RESONANCE SCIENTIFIC NOTATION AND METRIC PREFIXES SULFURIC ACID TROUBLESHOOTING TROUBLESHOOTING-THEORY & PRACTICE 12C BUS APPLE BATTERIES AND POWER SYSTEMS ELECTROMECHANICAL RELAYS ENERGY EFFICIENCY-LIGHT INDUSTRIAL SAFETY EQUIPMENTS MEGGER MXED-FREQUENCY AC SIGNALS PRINCIPLE OF DIGITAL COMPUTING QUESTIONS REACTANCE AND IMPEDANCE-CAPATIVE RECTIFIER AND CONVERTERS SEQUENTIAL CIRCUITS SERRIES-PARALLEL COMBINATION CIRCUITS SHIFT REGISTERS BUILDING SERVICES COMPRESSOR CRANES DC MOTOR DRIVES DIVIDER CIRCUIT AND KIRCHHOFF`S LAW ELECTRICAL DISTRIBUTION EQUIPMENTS 1 ELECTRICAL DISTRIBUTION EQUIPMENTS B ELECTRICAL TOOL KIT ELECTRICIAN JOB DESCRIPTION LAPTOP THERMOCOUPLE TRIGONOMENTRY REFERENCE UART WIRELESS BIOMASS CONTACTOR ELECTRIC ILLUMINATION ELECTRICAL SAFETY TRAINING FILTER DESIGN HARDWARE INDUSTRIAL DRIVES JUNCTION FIELD-EFFECT TRANSISTORS NASA NUCLEAR POWER SCIENCE VALVE WWE oscilloscope 3D TECHNOLOGIES COLOR CODES ELECTRIC TRACTION FEATURED FLEXIBLE ELECTRONICS FLUKE GEARMOTORS INTRODUCTION LASSER MATERIAL 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