Any 4 phase unipolar stepper motor can be driven in 3 different modes -:
1. Single coil excitation mode
2. Double coil excitation mode
3. Half step excitation mode
SINGLE COIL EXCITATION MODE
In this mode, at a time only one coil of the motor is energized. All four coils are energized one by one in sequence (please refer the table). In this mode, motor consumes very less power but also provides very less torque. This mode is also known as wave drive and it is not used to drive any load because of very less torque. Usually, stepper motors are not driven in this mode.
Fig. 1: Table listing stepper motor coil status for Single Coil Excitation Mode
DOUBLE COIL EXCITATION MODE
In this mode, two motor coils are energized to gather. Then after coils are two coils are energized in sequence (please refer the table). In this mode, motor consumes double the power than single coil excitation mode and provides very high torque. Stepper motors are mostly driven in this mode to drive the load.
Fig. 2: Table listing stepper motor coil status for Double Coil Excitation Mode
HALF STEP EXCITATION MODE
This mode is a combination of above two modes. Please refer the following table to see coil energizing sequence.
Fig. 3: Table listing stepper motor coil status for Half Step Excitation Mode
It takes double steps to complete the sequence. When the motor is rotated in this mode, it rotates very smoothly because the step angle of the motor decreases to half (e.g. if motor step angle is 1.8o then in this mode it rotates 0.9o in each step). The step resolution gets doubled. The motor angle can be controlled more precisely and accurately. In this mode, motor consumes moderate power and provides higher torque than single coil excitation mode.
The given project demonstrates how to drive any unipolar stepper motor in these three different modes. It uses arduino UNO board and unipolar stepper motor library to drive the stepper motor. It also controls speed (RPM) of the motor and displays the current speed and driving mode on LCD. So let us first see the circuit diagram followed by its description and working.
CIRCUIT DESCRIPTION
As shown in the figure, the circuit is built using Arduino UNO board, ULN2003A motor driver chip, 16×4 LCD and few other components.
• The pot is connected to analog input pin A0 as shown. its slider pin is connected to A0 and other two pins are connected to 5 V and Gnd of the board
• Two push buttons are connected to pin 2 and 3 as when the button is pressed the pin will get logic 1 input. Both pins 2 and 3 are pulled down to ground through 10 K resistor
• Pins 4, 5, 6 and 7 drives stepper motor through ULN chip. These pins are connected to inputs of ULN chip and the outputs of chip are connected to stepper motor coil terminals
• Arduino pins 8 and 9 are connected to LCD control pins Rs and En respectively. 3rd control pin RW of LCD is connected to board ground. Data pins D4 – D7 of LCD are connected to arduino pins 10, 11, 12 and 13 in sequence
CIRCUIT OPERATION
• The pot is used to set the speed of the motor in RPM in between 0 to 100. As the pot is varied the voltage at analog input pin varies from 0 to 5 V. The arduino converts this analog input into a digital value in between 0 to 1023. This value is again mapped between 0 to 100 to vary and set motor RPM
• The set RPM value is displayed on LCD
• Two push buttons are used to
1. Select driving mode of motor
2. Start rotating motor
• When mode select button is pressed 1st time, it selects single coil excitation mode. Pressing it second 2nd time selects double coil excitation and when it is pressed 3rd time it selects half step coil excitation. Every time the selected mode is displayed on LCD.
• After selecting mode, now when start motor button is pressed the motor starts rotating continuously in selected mode at set RPM
• Then to stop motor the reset button is pressed. The initial message is displayed on LCD as “Set RPM using pot and select mode and press start” and again user is asked to set RPM and select driving mode
SOFTWARE PROGRAM
Complete functionality of project is because of the program downloaded into arduino board microcontroller ATMega328. The program is the soul of the project. The program (also known as sketch) is written and compiled in arduino IDE software tool. And it is burned (embedded) into ATMega328 using built in software programmer tool AVRISP MK-II through the USB port.
The program uses built in Liquidcrystal library for arduino and Uni_polar_Steeper library to control the stepper motor.
You can download Uni_polar_Steeper library from here and use this library in your arduino sketch, just copy the Uni_polar_Stepper folder into the root directory of arduino library folder like C:arduino-1.6.7libraries
Project Source Code
###
#include <Uni_polar_Stepper.h> #include <LiquidCrystal.h> #define mode_sel_but 2 #define start_motor_but 3 Uni_polar_Stepper my_step_motor(4,5,6,7); LiquidCrystal lcd(8,9,10,11,12,13); int rpm,mode,mode_count=0,strt; void setup() { // put your setup code here, to run once: lcd.begin(16, 4); lcd.clear(); lcd.print("setRPM using pot"); lcd.setCursor(0,1); lcd.print("Select Mode &"); lcd.setCursor(0,2); lcd.print("press start"); delay(5000); lcd.clear(); lcd.print("set RPM:"); lcd.setCursor(0,1); lcd.print("Mode:"); pinMode(mode_sel_but,INPUT); pinMode(start_motor_but,INPUT); my_step_motor.set_step_per_rev(48); } void loop() { // put your main code here, to run repeatedly: rpm = analogRead(A0); rpm = map(rpm,0,1023,0,100); my_step_motor.set_RPM(rpm); lcd.setCursor(8,0); lcd.print(" "); lcd.setCursor(8,0); lcd.print(rpm); mode = digitalRead(mode_sel_but); strt = digitalRead(start_motor_but); if(mode) { mode_count++; if(mode_count==1) {lcd.setCursor(5,1);lcd.print("Single Coil ");} else if(mode_count==2) {lcd.setCursor(5,1);lcd.print("Double Coil ");} else if(mode_count==3) {lcd.setCursor(5,1);lcd.print("Half Step ");} else {mode_count=0;lcd.setCursor(5,1);lcd.print("Select again");} delay(250); } if(strt) { lcd.setCursor(0,2); lcd.print("motor starts"); if (mode_count==1) rotate_in_mode1(); else if(mode_count==2) rotate_in_mode2(); else if(mode_count==3) rotate_in_mode3(); } delay(300); } void rotate_in_mode1() { while(1) { my_step_motor.rotate(0); } } void rotate_in_mode2() { while(1) my_step_motor.rotate_doublecoil(0); } void rotate_in_mode3() { while(1) my_step_motor.rotate_halfstep(0); }
###
Circuit Diagrams
Project Video
Filed Under: Electronic Projects
Filed Under: Electronic Projects
Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.