. .
.
Expt-10:SM-Part3: Stepper Motor Control Using ATMEGA-16 Microcontroller
.
.

# STEPPER MOTOR

## STEPPER MOTOR:

A stepper motor is a brushless, electric motor that can divide a full rotation into a large number of steps. It works on the principle of electromagnetism. There is a magnetic rotor shaft of soft iron which is surrounded by the electromagnetic stators. Depending on the type the stepper motor may be teethed or non-teethed rotor and stator. When the stators are energized the rotor moves to align itself along with the stator (in case of a permanent magnet type stepper) or moves to have a minimum gap with the stator (in case of variable reluctance stepper). In this way the stators are energized in a sequence to rotate stepper motor. In stepper motor like and unlike poles concept is used.

FIG : - EXPLODED VIEW OF STEPPER MOTOR

## TYPES OF STEPPER MOTOR

• Permanent Magnet Stepper Motor
• Variable Reluctance Stepper Motor
• Hybrid Stepper Motor

## CLASSIFICATION ACCORDING TO WINDING:

GENERALLY STEPPER MOTORS ARE CLASSIFIED INTO TWO TYPES ACCORDING TO WINDINGS. THEY ARE

• Unipolar Stepper Motor
• Bipolar Stepper Motor

### BIPOLAR STEPPER MOTOR:

It has four wires with no common center connection. It has two independent sets of coils. We can distinguish them from unipolar stepper motor by measuring the resistance between the wires. We should find two pairs of wires with equal resistance. If we have got the leads of our meter connected to two wires that are not connected (i.e., not attached to the same coil ), We should see infinite resistance (or no continuity) .

IN THIS EXPERIMENT WE HAVE CONSIDERED THE UNIPOLAR STEPPER MOTOR SO LETS DISCUSS ABOUT IT.

### UNIPOLAR STEPPER MOTOR:

It has five or six wires and four coils (actually two coils divided by center connections on each coil). The centre connections of the coils are tied together and used as the power connection. They are called unipolar stepper motors because power always comes in one pole.

### BELOW SHOWN IS THE CIRCUIT DIAGRAM FOR UNIPOLAR STEPPER MOTOR:

## CONTROLLING TYPES:

THERE ARE TWO TYPES OF CONTROLLING SEQUENCE FOR UNIPOLAR STEPPER MOTOR:

• Half Step Sequence.
• Full Step Sequence.

### FULL STEP SEQUENCE:

Here two coils are energized at the same time and motor shaft rotates. The order in which coils has to be energized is given below.

STEP              A         B        A        B      HEXADECIMAL NO

0                   1          1         0         0         (C)
1                   0          1         1         0`        (6)
2                   0          0         1         1         (3)
3                   1          0         0         1         (9)

courtesy : - www.8051projects.net

### HALF STEP SEQUENCE:

Here motor's step angle reduces to half the angle than in full mode. So the angular resolution is also increased i.e., it becomes double the angular resolution than in full mode. Also in half mode sequence the no. of steps gets double as that of full mode. Half mode is usually preferred over full mode. The patterns of energizing the coils are:

STEP              A         B        A        B    HEXADECIMAL NO

0                 1          1         0         0              (C)
1                 0          1         1         0               (6)
2                 0          0         1         1               (3)
3                 1          0         0         1               (9)
4                 0          0         1         1               (3)
5                 0          0         0         1               (1)
6                 1          0         0         1               (9)
7                 1          0         0         0               (8)

courtesy : - www.8051projects.net

## STEP ANGLE CALCULATION:

Step Angle, Φ = 360/ No. of steps

FULL SEQUENCE:

Step Angle, Φ = 360/4 = 90 degree

HALF SEQUENCE:

Step Angle, Φ = 360/8 = 45 degree

## DIRECTION FOR ROTATION OF STEPPER MOTOR:

CLOCKWISE ROTATION:

For Clockwise Rotation, step Sequence Should be ---- 0-1-2-3                (In case of full sequence)
---- 0-1-2-3-4-5-6-7  (In case of half sequence)

ANTICLOCKWISE ROTATION:

For Anti-Clockwise Rotation, step Sequence should be ---- 3-2-1-0                (In case of full sequence)
----7-6-5-4-3-2-1-0 (In case of half sequence)

## ATMEGA16's  DESCRIPTION

The AVR architecture is based upon modified Harvard architecture where program and data are stored in separate physical memory systems. The AVR family can be briefly classified as

•   Tiny AVR
•   Mega AVR
•   XMEGA AVR
•   Application specific AVR
•   FPSLIC
•   32-bit AVR

Atmel's AVRs have a two stage, single level pipeline design. This means the next machine instruction is fetched as the current one is executing. Most instructions take just one or two clock cycles, making AVRs relatively fast among the eight-bit microcontrollers. The AVR processors were designed with the efficient execution of compiled C code in mind and have several built-in pointers for the task.

ATMEGA16 is a low power CMOS 8-bit microcontroller. It is based on the AVR enhanced RISC architecture. It executes powerful instructions in a single clock cycle. It has 16kb of flash memory. They have in-built  features such as internal PWM channels, 10-bit A/D converters, UART / USART etc.

## SOME FEATURES OF ATMEGA 16

• It has 16 kilo Bytes of Flash memory.
• It has 512 Bytes of EEPROM.
• It has 1 kilo Bytes of SRAM.
• It has 131 instructions set.
• It has 32 x 8 general purpose working registers.
• On chip 2 cycle multiplier.
• Programming locks for software security.
• Two 8-bit timers.
• One 16 bit timer.
• On chip Analog comparator.
• Internal calibrated RC Oscillator.
• 32 programmable I/O lines.
• Programmable serial USART.
• Max Speed: 16 MHz(ATmega16)
• Watchdog timer.
• USB controller support.
• Ethernet controller support.
• LCD controller support.
• DMA controller.

Here, each I/O port has 3 registers associated with each of them. These three registers are:

• DDRx
• PORTx
• PINx                                                                                       x  ----------- A, B, C, D.

## EXPERIENCE ON AVR STUDIO

Atmel AVR Studio is an Integrated Development Environment (IDE) for developing and debugging embedded Atmel AVR applications. It enables full control execution of programs on the AT90S In-Circuit Emulator or on the built-in AVR Instruction Set Simulator. It provides a project management tool, source file editor, simulator, assembler and front-end compiler for C/C++ programming, emulator and on-chip debugger. The AVR Studio gives a seamless and easy-to-use environment to write, build, and debug C/C++ and assembly code.

AVR Studio supports source level execution of assembly programs assembled with the Atmel Corporation's AVR Assembler and C programs compiled with compilers such as IAR Embedded Workbench, Code Vision AVR C compiler, GCC(GNU), etc. In AVR studio 5 there is an integrated C compiler, and need not be installed separately.

The assembler translates assembly source code into object code. The generated object code can be used as input to a simulator such as the ATMEL AVR Simulator or an emulator such as the ATMEL AVR In-Circuit Emulator. The Assembler also generates a PROMable hex code which can be programmed directly into the program memory of an AVR microcontroller. The Assembler generates fixed code allocations, consequently no linking is necessary.

AVR Studio 4(or higher version) has a modular architecture which allows even more interaction with 3rd party software vendors. GUI plug-ins and other modules can be written and hooked to the system.

To know how to program AVR studio kindly follow the Videos tab.

## EXPERIENCE ON PROTEUS SOFTWARE

Proteus Virtual System Modelling (VSM) combines mixed mode SPICE circuit simulation, animated components and microprocessor models to facilitate co-simulation of complete microcontroller based designs.ISIS is a long established product and combines ease of use with powerful editing tools. It is capable of supporting schematic capture for both simulation and PCB design. ISIS also provides a very high degree of control over the drawing appearance, in terms of line widths, fill styles, fonts, etc. These capabilities are used to the full in providing the graphics necessary for circuit animation.

To know how to  design and simulate your circuit in proteus kindly follow the Videos tab.

Cite this Simulator:

.....
..... .....