0% found this document useful (0 votes)
68 views13 pages

301 Project

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views13 pages

301 Project

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Course instructor

Abu S.M. Mohsin, PhD


Assistant Professor
Department of Electrical and Electronic Engineering
BRAC University

Topic: Designing Stepper motor driver and controller.

Group Members:
Name ID E-mail

MD. Walid Ahmed Mafuj 18321040 [email protected]

Meer tahmidur Rahman 18321044 [email protected]

Mahfuzur Rahman 18321035 [email protected]

Safayet Ahmed Pranto 18321037 [email protected]


Table of content:
Index Contents Page No.

1 Research statement 1-2

2 Objective 3
3 Motivation 3
4 Materials 4
5 Gantt Chart 4

6 Methodology/Theory/Calculation 5-6

7 System Design Flow 7

8 Results/Analysis/Code/Graph/Simulation 8-9

9 Future work & Conclusion 10-11

10 References 11
Page |1

Title: Designing Stepper motor driver and controller.

Research statement:

● What is the research all about: Stepper motors enable accurate positioning?
They are used in various types of equipment for accurate rotation angle and
speed control using pulse signals. Stepper motors generate high torque with
a compact body, and are ideal for quick acceleration and response. Stepper
motors also hold their position at stop, due to their mechanical design. For
precision motion control applications like 3D printers, CNC and plotters,
stepper motors are the best choice. Our main focus is to build a controller
and a driver which takes pulse signals in and converts them to motor
motion. There are four different drive methods for stepper motors: Wave
Drive, Full Step, Half Step, Micro step. As half stepping method is commonly
used thus, we have tried to build the controller for this method. The truth
table for half step is shown below.

[1]
Page |2

[2]

● Purpose of the research: From the truth table we can see that the motor coils
need to be energized, in a specific sequence, to generate the magnetic field
with which the rotor is going to align. We have two options to achieve this
sequence. First one is using a micro controller and second choice is building a
specific circuit using basic logic gates, flip flop and encoder-decoder, counter
etc. As our purpose of the research is to become familiar with these basic
components and its cheaper and takes very less amount of current, we have
selected the second option.

● Details about research: In this project we have designed a stepper motor controller
and a stepper driver. The controller will take input from the users and drive the
motor exactly the same steps. We have done this in three parts. Firstly, we have
obtained inputs from the users. Secondly, we subtracted the input such that the
inputs will be counted down to zero and will stop functioning. Finally, we have
designed and applied some conditions to the subtractors to function the
countdown properly.
Page |3

Objective:

The main purpose is to design the motor controller and motor driver. In this project, we
are more likely getting familiar with some basic logic gates, some ICs like Multiplexer,
Demultiplexer, Encoder, Decoder, counter, adder etc. Our goal is to design the stepper
motor controller and driver using the knowledge we have obtained from our EEE301
course. In the process we can certainly observe the depth of the working process of these
logic gates and ICs.

Motivation:

Working with logic gates and their relevant ICs is always very interesting. The main reason
behind choosing this project is the working manual of the stepper driver. If we closely
look at the truth table of the motor driver, it is very similar to what we have learnt in this
course. But controlling the steps and the output is always a big challenge. Hence, here is
the interesting part to design these drivers and controllers using the ICs and some basic
logic gates. Furthermore, it will create interests among us as well as to the upcomers
who want to have a good look at this course materials. CNC machines are being used in
all manufacturing industries. Consistent manual production and fabrication needs
continuous effort & focus of technicians thus the production quality is not always up to
the mark and takes much more time. We want to build a CNC machine controller to ensure
the best possible safety, accuracy & efficiency of consistent product quality. Using CNC
machines are much safer than manually operated machines as they work behind a guard
or even a closed, transparent safety door. Moreover, the process is more precise than
manual machining.
Page |4

Materials:

External Subcircuit
Materials
→BUTTON x12 Condition Decade Tens Subtractor Shift
→16 Key ENCODER Subtractor
→AND x4 →4-bit synchronous →4-bit →D flip-flop x4
(MM74C922) Sub circuit
→NAND (2-to- counters (74161) synchronous
→Display x4(7SEG-
→OR x5 1_MUX) →XOR x4 counters (74161)
BCD)
→D flip-flop →4-bit →4-bit Full Adder →XOR x4
→Capacitor x2 (CAP)
(DTFF) x2 synchronous (74LS83) →4-bit Full Adder
→Logic toggle
→NOT x2 counters (74161) →Power (74LS83)
→Pulse
→Logic toggle x4 →NOT x4 →Power
→Pulse →AND x8

→2-to-1_MUX →OR x5
→Power

Gantt Chart:

[4]
Page |5

Methodology/Theory/Calculation:

As we have discussed earlier, we are designing a stepper motor controller and a motor
driver. We have adopted a few methods to get going with our work. Firstly, we have
designed the output of the stepper motor which we have obtained from some earlier
research and articles. There are four types of output truth tables of a stepper motor. On
our project, we will be working with the two most popular outputs which are “Full-step
sequence” and “Half-step sequence”.

The full step sequence is similar to what we have learnt in our counter topic which is
known as ring counter. We have used four D flip flops (4013) and their preset and clear
button to design the full step sequence.

We have designed the half step sequence using four 8-to-1multiplexer IC (74151) where
we have given the input as the same as the truth table and used the selector lines to get
the output from the input pulse. We have changed the selected lines using the clock. So,
after every pulse this selector lines were changed and we obtained the expected output
from the Multiplexers.

To get inputs from users, we designed a keypad. To design the keypad, we have used
switches and given series-parallel connections to a decoder IC(MM74C922). [3] We have
used MM74C922 decoder IC to decode the decimal inputs to BCD outputs. We have
designed the system such that the user can give double-digit inputs on the keypad. To
show the output we have used two 7-segment displays.

Now we have inputs from the users. We designed two 4-bit adder ICs(74LS83) and made
subtractors from them such that the inputs that we have obtained from the users will be
down-counted to zero. That means the user is giving commands to the stepper motor to
rotate exactly the same times as given inputs. After counting down to zero, the circuit will
stop and wait for another input.

To design the subtractors we had to use 4-bit counters IC(74161). 4-bit counter outputs
were given as the subtrahend to the subtractor. And the inputs obtained from the users
were given as the minuends.
Page |6

The main challenge was to design a condition for the subtractors. When we obtained
output from the users, we converted the digits to BCD outputs. For example, if a user
gives 75 as an input, the decoder converts it to [0111 0101]. So subtracting normally will
not produce the results we wanted. So we have designed a condition for the subtractor
so that it can act normally.

For example, if the input is 45, 5 will be counted down to 0. We have designed a custom
sub circuit containing four 2-to-1 multiplexers designed with basic logic gates and a
counter IC(74161). We have given the single digit as the first input of the 2-to-1
multiplexers which we obtained from the user. And we have given 9 as the second input
of these multiplexers. When the first digit will be counted down to zero, the selector line
will be changed and select 9 as the single digit. This selector line will change only once.
Then the subtractors will count 9 down to 0 for the rest of the times. Every time the
subtractor will count the first digit to zero, the second subtractor will subtract 1 from the
tens digit. This process will continue till both of the digits become zero.

After receiving inputs from the user, the driving circuit will turn on. It will update the
motor's state whenever there will be a subtraction. When the inputs are down-counted to
zero, the driver circuit will stop and hold on to that state.
Page |7

System Design Flow:

Power on

Taking decimal inputs from user


using keypad

Convert decimal input to BCD Display input values on


using MM74C922 Decoder IC 7 segments display

No

Press run
button
YES

Update to next step

Ones digit == 0 No

Subtract one from ones digit


using counter IC(74161) &
Adder IC( 74LS83)
Tens digit ==
0
No

Subtract one from tens digit


using counter IC(74161) &
Stop Adder IC(74LS83)

Set ones digit to 9


Page |8

Results/Analysis/Code/Graph/Simulation:

Initial stage:

C2

1nF
SHIFT
C1
O1
1 shift O1
O2
O2
s1 O3 1nF

dis1
dis2
dis3
dis4
s1 O3 HALF STEP

O4
O3
O2
O1
s2 O4
s2 O4
s3
s3 U1
s4 pulse
s4 Forward
11 6
CCT002
0 1 2 3 10
X1 KBM
5
1
X2 OSC
8
X3 2
7 12
X4 DA
13
OE 3
4 5 6 7 1 17 s1
Y1 A 4
2 16 s2
Y2 B
3 15 s3
Y3 C
4 14 s4 CCT0022
Y4 D
8 9 ENTER MM74C922

RUN
1
main

0
CONDITION

FULL STEP
pulse
dd4 Forward_full y1

dd3
dd2
dd1
TENS_SUBSTRACTOR y2

cc4
cc3
cc2
cc1
y3
on
pulse
pulse y4
U19_CLK U19_CLK dd1
on main
main
U19_ENP+ENT U19_ENP+ENT dd2
on
dd3

dd4
O1
O1
0 en_full

O2 CCT006

0
O2
cc1
cc1
dis1 O3
dis1 O3
cc2
cc2
dis2 O4
dis2 O4
cc3
cc3
dis3
dis3
cc4
cc4
dis4
dis4

dd4 CCT003
dd4
dd3
dd3
dd2 SINGLE_SUBTRACTOR
dd2
dd1
dd1
U6_ENP+ENT U6_ENP+ENT
cc1
U6_load U6_load
cc2
U6_CLK
pulse
cc3

cc4

m1 m4
m1 m4
m2 m3
m2 m3
m3 m2
m3 m2
m4 m1
m4 m1

CCT005
CCT004

After taking user input:

C2

1nF
SHIFT
C1
O1
1 shift O1
O2
O2
s1 O3 1nF
dis1
dis2
dis3
dis4

s1 O3 HALF STEP
O4
O3
O2
O1

s2 O4
s2 O4
s3
s3 U1
s4 pulse
s4 Forward
11 6
CCT002
0 1 2 3 10
X1 KBM
5
1
X2 OSC
8
X3 2
7 12
X4 DA
13
OE 3
4 5 6 7 1 17 s1
Y1 A 4
2 16 s2
Y2 B
3 15 s3
Y3 C
4 14 s4 CCT0022
Y4 D
8 9 ENTER MM74C922

RUN
0
main

CONDITION

FULL STEP
pulse
Forward_full y1
dd4
dd3
dd2
dd1

TENS_SUBSTRACTOR y2
cc4
cc3
cc2
cc1

y3
on
pulse
pulse y4
U19_CLK U19_CLK dd1
on main
main
U19_ENP+ENT U19_ENP+ENT dd2
on
dd3

dd4
O1
O1
0 en_full

O2 CCT006
1

O2
cc1
cc1
dis1 O3
dis1 O3
cc2
cc2
dis2 O4
dis2 O4
cc3
cc3
dis3
dis3
cc4
cc4
dis4
dis4

dd4 CCT003
dd4
dd3
dd3
dd2 SINGLE_SUBTRACTOR
dd2
dd1
dd1
U6_ENP+ENT U6_ENP+ENT
cc1
U6_load U6_load
cc2
U6_CLK
pulse
cc3

cc4

m1 m4
m1 m4
m2 m3
m2 m3
m3 m2
m3 m2
m4 m1
m4 m1

CCT005
CCT004
Page |9

Obtained truth table from experimental setup:

Full Step Truth Table


Run Clock Enable User 1A 1B 2A 2B
input
0 ↑ 0 X X X X X
1 ↑ 1 N 1 0 0 1
1 ↑ 1 N-1 1 1 0 0
1 ↑ 1 N-2 0 1 1 0
1 ↑ 1 N-3 0 0 1 1
1 ↑ 1 N-4 1 0 0 1
1 ↑ 1 N-5 1 1 0 0
1 … 1 … … … … …
1 ↑ 1 1 0 0 1 1
1 0 0 0 0 0 1 1

Half Step Truth Table


Run Clock Enable User 1A 1B 2A 2B
input
0 ↑ 0 X X X X X
1 ↑ 1 N 1 0 0 0
1 ↑ 1 N-1 1 1 0 0
1 ↑ 1 N-2 0 1 0 0
1 ↑ 1 N-3 0 1 1 0
1 ↑ 1 N-4 0 0 1 0
1 ↑ 1 N-5 0 0 1 1
1 … 1 … … … … …
1 ↑ 1 1 1 0 0 1
1 0 0 0 1 0 0 1
P a g e | 10

Future work & conclusion:

A stepper motor, at its most basic definition, is an electromechanical device that converts electrical
power into mechanical power. Specifically, it’s a brushless motor that can divide a full rotation
into an equal number of steps and can be accurately controlled with no feedback mechanism when
the motor is properly sized to the application.
In our project we have controlled the stepper motor through logic gates and some basic ICs. With
that we can use the motor more accurately and precisely.

In terms of electric motor, we can either rotate is clockwise or anti clockwise. But in the stepper
motor we can manipulate the motor with the help of stepper motor controller. Thus, we will be
able to control the same motor in both directions, clock-wise and anti-clockwise.

If we do further work on the project, we will be able to make an option where we can run the motor
continuously and it will also keep the count of the number of times it rotated.

Furthermore, by developing stepper motor driver we will be able to put an option which will tell
us the distance the stepper motor has rotated in millimeters.

In addition, in this project we used half-step and Full-step configuration. If we do further research,
we will be able to do Baby-step and micro-step. Here, Micro stepping is a way of moving the stator
flux of a stepper more smoothly than in full- or half-step drive modes. This results in less vibration,
and makes noiseless stepping possible down to 0 Hz. It also makes smaller step angles and better
positioning possible. And with the help of baby step, we will be able to tune the layers of stepper
motor precisely. In a result, the stepper motor will work more accurately and we will be able to
perform critical works.

Before talking about impact of social impact of stepper motor controller lets look into some of the
advantages of stepper motor:
Advantages

• Low cost for control achieved


• High torque at startup and low speeds
• Ruggedness
• Simplicity of construction
• Can operate in an open loop control system
• Low maintenance
• Less likely to stall or slip
• Will work in any environment
• Can be used in robotics in a wide scale.
P a g e | 11

• High reliability
• The rotation angle of the motor is proportional to the input pulse.
• The motor has full torque at standstill (if the windings are energized)
• Precise positioning and repeatability of movement since good stepper motors have an
accuracy of 3–5% of a step and this error is non-cumulative from one step to the next.
• Excellent response to starting/stopping/reversing.
• Very reliable since there are no contact brushes in the motor. Therefore, the life of the
motor is simply dependent on the life of the bearing.
• The motors response to digital input pulses provides open-loop control, making the
motor simpler and less costly to control.
• It is possible to achieve very low-speed synchronous rotation with a load that is directly
coupled to the shaft.
• A wide range of rotational speeds can be realized as the speed is proportional to the
frequency of the input pulses.

With development of stepper motor drive, we will be able to improve some of the devices like:
printer’s print heads accuracy, DSLR camera’s aperture/ focus, 3d printer’s accuracy, video
camera, engraving machine, arms of robots, atm machines etc. Stepper motor is also used in the
medical sector to do microscopic operations and also used inside medical scanners, samplers, and
also found inside digital dental photography, fluid pumps, respirators, and blood analysis
machinery. Thus, with the help of stepper motor driver we will be able to conduct medical
operations more accurately and save lives. Moreover, stepper motor’s application is also used in
agricultural sectors. So, hopefully it will be very beneficial for the society and the community as
we will step onto further researches on what we have showcased in our project.

Reference:
1. https://36projectsblog.wordpress.com/10-arduino-stepper-motor-
control/
2. https://36projectsblog.wordpress.com/10-arduino-stepper-motor-
control/
3. https://www.youtube.com/watch?v=iFolA5v6PKY

You might also like