Professional Documents
Culture Documents
ENGINEERING
UNIVERSITY OF ENGINEERING AND
TECHNOLOGY, PESHAWAR
MtE-226L ACTUATING SYSTEM LAB, 4th Semester
LAB NO. 10
SUBMITTED BY : TAIMOOR KHAN
REG NO. : 20PWMCT0739
SUBMITTED TO : SIR WAHAD-UR-REHMAN
SUBMISSION DATE: 26-06-2022
LAB TITLE CONTROLLING SPEED AND POSITION OF
STEPPER MOTOR USING DIFFERENT TECHNIQUES.
INTRODUCTION:
STEPPER MOTOR:
A stepper motor is a brushless, synchronous electric motor that converts digital pulses
into mechanical shaft rotation.
Its normal shaft motion consists of discrete angular movements of essentially uniform
magnitude when driven from sequentially switched DC power supply. [1]
The stepper motor is a digital input-output device. It is particularly well suited to the type
of application where control signals appear as digital pulses rather than analog voltages.
One digital pulse to a stepper motor drive or translator causes the motor to increment one
precise angle of motion.
As the digital pulses increase in frequency, the step movement changes into continuous
rotation.[1]
Some industrial and scientific applications of stepper motors include robotics, machine
tools, pick and place machines, automated wire cutting and wire bonding machines, and
even precise fluid control devices. [1]
WORKING:
The construction of a stepper motor is fairly related to a DC motor.
It includes a permanent magnet like Rotor which is in the middle & it will turn once force
acts on it.
This rotor is enclosedthrough a no. of the stator which is wound through a magnetic coil
all over it. The stator is arrangednear to rotor so that magnetic fields within the stators
can control the movement of the rotor. [2]
The stepper motor can be controlled by energizing every stator one by one.
So, the stator will magnetize & works like an electromagnetic pole which uses repulsive
energy on the rotor to moveforward.
The stator’s alternative magnetizing as well as demagnetizing will shift the rotor
gradually &allows it to turn through great control. [2]
The stepper motor working principle is Electro-Magnetism.
It includes a rotor which is made with a permanent magnet whereas a stator is with
electromagnets.
Once the supply is provided tothe winding of the stator then the magnetic field will be
developed within the stator.
Now rotor inthe motor will start to move with the rotating magnetic field of the stator.
So, this is the fundamentalworking principle of this motor. [2]
TYPES OF STEPPER MOTOR
There are three main types of stepper motors, they are:
1. Permanent magnet stepper
2. Hybrid synchronous stepper
3. Variable reluctance stepper
TASK 1:
THE MOTOR SHOULD REVOLVE ONE REVOLUTION IN ONE
DIRECTION, THEN ONE REVOLUTION IN THE OTHER DIRECTION
CODING:
#include <Stepper.h>
const int stepsPerRevolution = 90;
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
void setup() {
// set the speed at 60 rpm:
myStepper.setSpeed(5);
// initialize the serial port:
Serial.begin(9600);
}
void loop() {
// step one revolution in one direction:
Serial.println("clockwise");
myStepper.step(stepsPerRevolution);
delay(500);
// step one revolution in the other direction:
Serial.println("counterclockwise");
myStepper.step(-stepsPerRevolution);
delay(500);
CIRCUIT DIAGRAM
EXPERIMENT RESULT:
TASK 2:
MOVES THE STEPPER MOTOR CLOCKWISE SLOWLY AND THEN
COUNTERCLOCKWISE QUICKLY
CODING
// Rotate CCW
quickly
myStepper.setSpeed(
700);
myStepper.step(-
stepsPerRevolution);
delay(1000);
}
CIRCUIT CONNECTION:
EXPERIMENT RESULT:
TASK 3
A STEPPER MOTOR FOLLOWS THE TURNS OF A POTENTIOMETER
(OR OTHER SENSOR) ON ANALOG INPUT 0.
CODING:
#include <Stepper.h>
// change this to the number of steps on your motor
#define STEPS 100
// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it's
// attached to
Stepper stepper(STEPS, 8, 9, 10, 11);
// the previous reading from the analog input
int previous = 0;
void setup() {
// set the speed of the motor to 30 RPMs
stepper.setSpeed(30);
}
void loop() {
// get the sensor value
int val = analogRead(0);
// move a number of steps equal to the change in the
// sensor reading
stepper.step(val - previous);
// remember the previous value of the sensor
previous = val;}
CIRCUIT CONNECTION:
EXPERIMENT RESULT:
TASK 4
THE MOTOR WILL STEP ONE STEP AT A TIME, VERY SLOWLY AND
PRINT THE NUMBER OF STEPS ON SERIAL MONITOR AND LCD
SCREEN
CODING:
#include <Stepper.h>
const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
int stepCount = 0; // number of steps the motor has taken
void setup() {
// initialize the serial port:
Serial.begin(9600);
}
void loop() {
// step one step:
myStepper.step(1);
Serial.print("steps:");
Serial.println(stepCount);
stepCount++;
delay(500);
}
CIRCUIT CONNECTION:
EXPERIMENTAL RESULT:
References:
https://www.omega.co.uk/prodinfo/stepper_motors.html [1]
https://www.elprocus.com/stepper-motor-types-advantages-applications/ [2]
https://www.monolithicpower.com/stepper-motors-basics-types-uses [3]