/Stepper-Motor-Control-using-AVR

AVR based project for controlling Speed, Mode and direction of rotation of Stepper motors.

Primary LanguageC

Stepper-Motor-Control-using-AVR

This is an AVR based project that is written in codevisionAVR environment and simulated in proteus.
purpose of this project is to control Speed, Direction of Rotation and Selecting a specific Mode for Stepper Motors.

Hardware and tools:

In this project i used ATMEGA8 as a Microcontroller and L293D driver for a Bipolar(4-Wire) Stepper Motor and 4x16 alphanumeric LCD to display Mode, Direction of Rotation and Speed.

Three supported Modes of operation for Stepper Motors in this project:

  • Full-step
  • Half-step
  • Microstep

Micro step Calculation:

Microstep functions declared in this project are:

void u16Step(int cnt, char forwards);
void u24Step(int cnt, char forwards);
void u32Step(int cnt, char forwards);
void u48Step(int cnt, char forwards);
void u64Step(int cnt, char forwards);
void u96Step(int cnt, char forwards);

ℹ️ I Assumed that Step angle of the stepper motor is 90 degree (step angle of Stepper Motor in simulation is 90 degree).
so u16Step means that it takes 16 steps for a motor with 90 degree step angle to complete one revolution (obviously it takes 4 steps for 90 degrees) and similarly we can calculate steps per revolution for other functions and for other motors with different step angles.