Вы находитесь на странице: 1из 12

ASSIGNMENT NO.

1
OBJECTIVES:
To demonstrate movement of stepper motor.
PROBLEM STATEMENT:
Develop stepper motor Application using Beagleblack bone Board.
THEORY:
A stepper motor (or step motor) is a brushless DC electric motor that divides a full
rotation into a number of equal steps. The motor's position can then be commanded
to move and hold at one of these steps without any feedback sensor (an open-loop
controller), as long as the motor is carefully sized to the application.

Nowadays, stepper motors are used in a wide variety of applications. They are
prevalent in consumer office equipment such as printers, scanners, copiers and
plotters. They also play an important role in the industry, use in robotics or
dashboard indicators, climate control systems in the automotive industry. The
software and hardware configurations published here are just examples and are not
intend for mass production.

A step motor can be viewed as a synchronous AC motor with the number of poles
(on both rotor and stator) increased, taking care that they have no common
denominator. Additionally, soft magnetic material with many teeth on the rotor and

stator cheaply multiplies the number of poles (reluctance motor). Modern steppers
are of hybrid design, having both permanent magnets and soft iron cores. A stepper
motor is made up of a rotor, which is normally a permanent magnet and it is, as the
name suggests the rotating component of the motor. A stator is another part which
is in the form
of winding. In the diagram below, the center is the rotor which is surrounded by the
stator
winding. This is called as four phase
winding.

Fig: Stepper Motor


Stepper Motor Types
There are three basic stepper motor
types. They are :
Variable-reluctance
Permanent-magnet

Hybrid

Unipolar vs Bipolar motors

Unipolar motors use 6 wires and require a unipolar driver. In addition to the A and
B phases,there are two extra wires called the common wires, Current always flows in
one direction: from the phases, through the common wires. In addition, only one
portion of the motor is energized at a time. Bipolar motors use 4 wires and require a
bipolar drive. Common wires are not used.Current can flow in two directions. In
addition, two phases can be energized at one time.

Working of Stepper Motor

The centre tap on the stator winding allows the current in the coil to change
direction when the winding are grounded. The magnetic property of the stator
changes and it will selectively attract and repel the rotor, thereby resulting in a
stepping motion for the motor.

Stepping Sequence
In order to get correct motion of the motor, a stepping sequence has to be followed.
This stepping sequence gives the voltage that must be applied to the stator phase.
Normally a 4 step sequence is followed. When the sequence is followed from step 1 to

4, we get a clock wise rotation and when it is followed from step 4 to 1, we get a
counter clockwise rotation.

Fig:Full step drive

Fig:Half setpping

Step No.

MATHEMATICAL MODEL (State Transition Diagram)

SOFTWARE REQUIRED: Embedded Linux Operating Systems, GCC Compiler.

HARDWARE REQUIRED: Beagle black bone board with ARM Cortex Processor,
Robotic Arm (stepper motor) and cables for interfacing.
INPUT: Input data as default values and user defined values.
OUTPUT: It will rotate stepper motor in clockwise/anticlockwise direction.
Let S be a set such that
S={s, e, i, o, f, DD, NDD, success, failure}
s=initial state
e = end state
i= input of the system.
o=output of the system.
f= functions

DD-deterministic data it helps identifying the load store functions or assignment


functions.
NDD- Non deterministic data of the system S to be solved.
Success-desired outcome generated.

State transition diagram:

States: S0 S1 S2 S3 S4 S5
S0: initial State (Power supply)
S1: Monitor Display editor (Write and Design application using gedit)
S2: Beagle Board Black
S3: stepper Motor
S4: Final State (clockwise Rotation)
S5: Final State (Anticlockwise Rotation

State transition Table:

S0

S0

S1

S2

S1

S2

S2

S1

S3

S3

S2

S4

S5

S4

S5

CODE:
Implement Stepper motor
import Adafruit_BBIO.GPIO as GPIO
import time
import math

#stepper pin mapping to BBB


pin1 = "P8_7"
pin2 = "P8_8"
pin3 = "P8_9"
pin4 = "P8_10"

x=0;
i=0;
#Setup mode for leds of particular mode
GPIO.setup(pin1, GPIO.OUT)
GPIO.setup(pin2, GPIO.OUT)
GPIO.setup(pin3, GPIO.OUT)
GPIO.setup(pin4, GPIO.OUT)

#Sequence of the steper motor in shifted format


def sequence(x):
if(x==1):
GPIO.output(pin1, GPIO.LOW)
GPIO.output(pin2, GPIO.HIGH)
GPIO.output(pin3, GPIO.LOW)
GPIO.output(pin4, GPIO.HIGH)
elif(x==2):
GPIO.output(pin1, GPIO.LOW)
GPIO.output(pin2, GPIO.HIGH)
GPIO.output(pin3, GPIO.HIGH)
GPIO.output(pin4, GPIO.LOW)
elif(x==3):
GPIO.output(pin1, GPIO.HIGH)

GPIO.output(pin2, GPIO.LOW)
GPIO.output(pin3, GPIO.HIGH)
GPIO.output(pin4, GPIO.LOW)
elif(x==4):

GPIO.output(pin1, GPIO.HIGH)
GPIO.output(pin2, GPIO.LOW)
GPIO.output(pin3, GPIO.LOW)
GPIO.output(pin4, GPIO.HIGH)

return;

def sequence1(x):
if(x==1):
GPIO.output(pin1, GPIO.LOW)
GPIO.output(pin2, GPIO.HIGH)
GPIO.output(pin3, GPIO.LOW)
GPIO.output(pin4, GPIO.HIGH)
elif(x==2):
GPIO.output(pin1, GPIO.LOW)
GPIO.output(pin2, GPIO.HIGH)
GPIO.output(pin3, GPIO.HIGH)
GPIO.output(pin4, GPIO.LOW)

elif(x==3):
GPIO.output(pin1, GPIO.HIGH)
GPIO.output(pin2, GPIO.LOW)
GPIO.output(pin3, GPIO.HIGH)
GPIO.output(pin4, GPIO.LOW)
elif(x==4):

GPIO.output(pin1, GPIO.HIGH)
GPIO.output(pin2, GPIO.LOW)
GPIO.output(pin3, GPIO.LOW)
GPIO.output(pin4, GPIO.HIGH)

return;

while true:
print (Enter 1:Clockwise 2:Anti Clockwise)
a=input(
if(a==1)
for i in range(1,5):
sequence(i);
time.sleep(0.5);

elif

for i in range(1,5):
sequence1(i);
time.sleep(0.5);

Use Case:
The use case for the stepper motor controller depicts the user interaction with the
system, thus the user can view (speed and direction) and change (speed and direction
of the motor). The user input is obtained through a keypad interface, where he can
input a three digit speed (only a certain range of speeds are permissible, limited by
the servo specifications)

Class diagram:
Class diagram lists the objects in the system, and their hierarchy in composition.
The attributes list the variables that characterize the class of objects. The classes
define behavior or methods that define the interactions between the objects.
The class diagram for the stepper-motor controller is given below:

CONCLUSION :
Hence, we have studied & demonstrated movement of stepper motor.

Вам также может понравиться