You are on page 1of 7

“Interfacing the stepper motor with FPGA

controller”
Chetan Umbarkar * Anshuman Singh ** Shubham
Kushwaha*** Saloni Parab ****
*
Fr. Conceicao Rodrigues Institute of Technology, Navi-Mumbai, INDIA
E-mail: ccumbarkar@gmail.com

Abstract— The use of Field Programmable Gate


Arrays(FPGAs) for enforcing different types of Pulse programmable rational pieces and pecking order of
Width Modulation(PWM) controllers has increased reconfigurable permitting pieces to be tied together.
steadily in the last many times. They come dominant Rationale squares can be designed to perform complex
tools for enforcing different types of PWM due to the combinational capacity or act as straightforward rational
flexibility they give compared to other Digital Signal passages like AND and XOR.
Processors(DSPs). Different types of PWM have
been enforced for single and three-phase circuits The VHSIC Hardware Description Language (VHDL)
similar as Digital PWM(DPWM), Sinusoidal could be a hardware description language (HDL) that can
PWM(SPWM), Space Vector(SVPWM), carrier phase display the behavior and structure of advanced frameworks
shifted SPWM(CPS- SPWM), Third harmonious at different levels of reflection, extending from the
Injection Sinusoidal Pulse Width Modulation framework level down to that of rationale doors, for plan
(THISPWM) using different FPGA boards. This paper section, documentation, and confirmation purposes.
presents a methodical review of the enforced PWM
regulators grounded on FPGA. It describes in detail 2. APPLICATIONS OF STEPPER MOTOR
their types, infrastructures, and intended operation they
used for. It also addresses the main benefactions, Stepper motors are versatile electromechanical devices
advantages, and disadvantages of different exploration widely used in various applications due to their precise
papers in this area. Current limitations and unborn control of position and speed. Here are some common
development have been drawn grounded on pressing the applications of stepper motors:
enforced and unimplemented PWM grounded on
FPGA. 1. CNC Machines (Computer Numerical Control):
Stepper motors are extensively used in CNC machines
Keywords: Stepper motor, PWM. for controlling the movement of the cutting tools. Their
ability to move in precise increments makes them
suitable for applications where accuracy is crucial.
I. INTRODUCTION
FPGA stands for "Field-Programmable Gate Array." It is 2. 3D Printers: Stepper motors are essential components
a type of integrated circuit (IC) that is designed to be in 3D printers to control the movement of the print
configured or programmed by a user or designer after head along the X, Y, and Z axes. They enable precise
manufacturing. FPGAs are unique in that they can be positioning and control, contributing to the accuracy of
reprogrammed to perform a wide range of digital the printed objects.
functions, making them highly versatile in a variety of
applications. 3. Robotics: Stepper motors are commonly used in
To give this programmability, an FPGA has robotics for precise control of the robot's joints and
Configurable (Programmable)Logic Blocks which have limbs. They are favored for their ability to move in
configurable interconnects between these blocks. When discrete steps, allowing for accurate positioning.
compared to a similar caliber ASIC with Standard Cells.
In current society, the stepper motor is found widely 4. Automotive Systems: Stepper motors find applications
from family appliances to commercial and industrial in automotive systems, such as fuel injection systems,
applications. HVAC (Heating, Ventilation, and Air Conditioning)
actuators, and automotive instrument clusters. They are
A field-programmable gate array (FPGA) is an integrated used for controlling various mechanical components
circuit developed to be built by a client or a developer, with precision.
hence the term field-programmable. The FPGA
configuration is generally named using a hardware 9 5. Printers and Scanners: Stepper motors are used in
description language(HDL). FPGAs contain a bunch of printers and scanners to control the movement of print
heads, paper feed mechanisms, and scanning
components. Their ability to move in precise steps
ensures accurate printing and scanning.
–1 –
6. Medical Devices: Stepper motors are employed in function without the need for external feedback devices.
various medical devices, such as infusion pumps, This simplicity makes them easier to implement and more
lab automation equipment, and diagnostic cost-effective in certain applications.
instruments. Their precise control is essential in
applications where accuracy and reliability are 3. Simple Control Interface: Stepper motors are relatively
critical. easy to control using simple pulse and direction signals.
This makes them suitable for applications where a
7. Camera Systems: Stepper motors are used in straightforward control interface is desired, especially in
camera systems for precise control of focus, zoom, scenarios where complex feedback systems may not be
and aperture mechanisms. They contribute to the necessary.
accuracy and stability of the camera's performance.
4. Low-Speed Torque: Stepper motors provide high torque at
8. Textile Machinery: In textile manufacturing, low speeds, making them suitable for applications where
stepper motors are used in machines for controlling low-speed precision and control are essential. This is
the movement of yarn feeders, fabric cutters, and advantageous in tasks such as positioning and holding
other components. Their ability to provide precise loads.
control aids in maintaining quality in the
production process. 5. No Feedback Required for Basic Tasks: For applications
that do not require continuous feedback and correction,
9. Consumer Electronics: Stepper motors can be stepper motors offer a cost-effective solution. Open-loop
found in various consumer electronics, such as disk stepper control can be sufficient for scenarios where
drives, camera lenses, and home automation precise positioning is more critical than closed-loop
systems. They are used for precise control of feedback.
moving parts in these devices.
6. Reliability: Stepper motors have a relatively simple
10. Satellite Systems: Stepper motors are employed in construction with fewer parts compared to some other
satellite systems for accurate positioning of types of motors. This simplicity often translates to
antennas, solar panels, and other movable increased reliability and robustness in certain applications.
components. Their reliability and precision make
them suitable for space applications. 7. Compact Design: Stepper motors can be designed with a
compact form factor, making them suitable for
11. Industrial Automation: Stepper motors play a applications where space is limited. This characteristic is
significant role in industrial automation for tasks valuable in various industries, including automotive,
such as conveyor belt control, pick-and-place aerospace, and consumer electronics.
operations, and other manufacturing processes that
require precise movement and positioning. 8. Low Maintenance: Stepper motors typically have a simple
design with fewer wear parts, leading to lower
maintenance requirements compared to some other motor
Overall, stepper motors are widely used in types. This can contribute to increased system reliability
applications where precise control of position, and reduced downtime.
speed, and torque is essential. Their reliability, ease
of control, and ability to move in discrete steps 9. Low-Cost Solutions: Stepper motors are often more cost-
make them suitable for a diverse range of effective than alternative motor types for certain
industries. applications. This cost advantage, combined with their
suitability for specific tasks, makes them a preferred
3. STEPPER MOTOR choice in budget-conscious projects.

Stepper motors are chosen for various applications due to Despite these advantages, it's essential to note that stepper
their specific characteristics and advantages that make them motors also have limitations, such as potential heat generation
well-suited for certain tasks. Here are some reasons why during operation, a tendency to lose steps under high loads, and
stepper motors are commonly used: a lower efficiency compared to some other motor types.
Therefore, the selection of a stepper motor should be based on
1. Precise Position Control: Stepper motors move in a thorough understanding of the application requirements and
discrete steps, allowing for precise control of position trade-offs involved.
and rotation. This characteristic is beneficial in
applications where accuracy and repeatability are
critical, such as in CNC machines, 3D printers, and
robotics.

2. Open-Loop Operation: Stepper motors can operate in


an open-loop control system, meaning they can

–1 –
A. Open Loop Operation of stepper motor ❑ An ideal stepper motor has a sinusoidal torque
One of the most significant advantages of a stepper vs displacement characteristic as shown in
motor is its ability to be accurately controlled in an open figure 2
loop system. Open loop control means no feedback
information about position is needed. This type of
control eliminates the need for expensive sensing and
feedback devices such as optical encoders. Here position
is known simply by keeping track of the input step
pulses.

B. Torque Generation of stepper motor


Figure 2. Torque Vs. Rotor Angular Position
The torque produced by a stepper motor depends
on several factors.

• The step rate


• The drive current in the windings
• The drive design or type

In a stepper motor a torque is developed when the


magnetic fluxes of the rotor and stator are displaced from
each other [5].
Figure 3. Angular Position at Different Holding Torques

C. Stepping Modes of stepper motor


The following are the most common drive modes.

❑ Wave Drive (1 phase on)

❑ Full Step Drive (2 phases on)

❑ Half Step Drive (1 & 2 phases on)

❑ Micro stepping (Continuously varying motor


currents)

D. Torque Vs. Angle Characteristics of stepper motor


❑ The torque vs angle characteristics of a stepper
motor are the relationship between the displacement E. Torque Vs Speed characteristic
of the rotor and the torque which applied to the ❑ The torque vs speed characteristics are the key
rotor shaft when the stepper motor is energized at its to selecting the right motor and drive method
rated voltage. for a specific application.

–3 –
Z. Ali , R. V. Kshirsagar • Development of a CPLD-based Novel Open Loop Stepper Motor Controller for High Performance Using VHDL

❑ These characteristics are dependent upon ✓ The advantage of microprocessor is that it is


(change with) the motor, excitation mode and easy for design the control mode of stepper
type of driver or drive method[4] motor by user, including start, stop, and
clockwise or counter- clockwise indeed.

Nevertheless, it cannot make a breakthrough in


variable speed controller of stepper motor for
limited capability of microprocessor[2].

However, microprocessor can only control by


Figure 5. A typical “speed – torque curve”
constant speed.

Although the capability of microprocessor is limited, it


has taken some important steps in automation.
According to various situations of applications, the
choice of stepper motor controller between the
controlling scheme of position or speed must be made in To control the stepper motor, the driver can apply an
advance. For performing high precision positioning and open loop control algorithm or closed loop algorithm.
smooth rotation operation, design of stepper motor
controller is a very important issue. Bae and Krishnan (1996) reported that when the open
loop driver is implemented with a DSP in the C
programming language, the coding and debugging is
II. NECESSITY OF STEPPER MOTOR CONTROL
straightforward [3].

CRUCIAL CONTROL PARAMETERS


As the IC industry boomed over the recent decade, large
amounts of data process more and more fast in digital
system. Because of this, the system on chip (SOC) and
DSP are popular with designers.
Position Time

Kos (2006) presented an algorithm to realize the linear


Stepper motors can be found in For those applications that demand
variable speed controller by adjusting the torque
printers, disk drives, X-Y plotters, the controlled objects moved with
and many others which are designated time to prearranged corresponding current [4].
required to move controlled objects positions; such as those used in
to accurate positions within autonomous cars, robotic arms with
nominated time. The precision low moment of inertia, industrial Le (2006), proposed variable speed controller using
positioning is a top priority than plants, etc. In such cases, time close-loop control. He used an optical encoder coupling
others consideration. should dominate among others. with motor. This encoder can check the angle of motor.
If angle exceed the range between winding and rotor, it
will switch to close-loop, whereas open loop. This
system is implemented on DSP, and velocity profile
stored in memory [5].

III. WORK DONE IN PAST FOR THE CONTROLLER


SIDE OF STEPPER MOTOR With applications where load torque is stable and
operations are at low speed, an open loop driver is
Petrov (1988) proposed a system by a microcomputer preferred since it needs a simple control algorithm and an
achieved a variable speed controller. On account of encoder is not required[12].Here in this work as we are
processing speed restrictedly, high resolution could not forcing motor to rotates in two direction clockwise and
be provide. In order to approach the linear acceleration, counter clock wise mode.The output sequence for driver
the digital-to-analog converter (DAC) is used to increase circuit is as follows.
resolution [1].

Kenjo (1994) advanced a theory that derived the


formulas of linear acceleration [2].

Kang (1994) developed a new method using single


microprocessor to control stepper motor at the same
time.

–4 –
INES 2010 • 14th International Conference on Intelligent Engineering Systems • May 5–7, 2010 Las Palmas of Gran Canaria, Spain

TABLE II.

OUTPUT SEQUENCE FOR DRIVER CIRCUIT

Start
output Step Step Step Step Step Step Step Step
Initialization of Clock, Reset, and Full_Half_step & CW_CCW as input pins And A, A_n, B, B_n as output
0 1 2 3 4 5 6 7

A 1 0 0 0 0 0 1 1
Architecture begin

A_n 0 0 1 1 1 0 0 0

B 1 1 1 0 0 0 0 0 Clock “event”
A Clock=1 B
B_N 0 0 0 0 1 1 1 0 1

Step 0
For initial condition assumed that motor is in step 0 If
Reset=1
1
which shows A A_n B B_n=1010 ,after every clock 0

State_motor<- Next_State_motor=0
motor is incremented by one for half step mode.

So, State_motor<= next_state_motor+1 0


If
CW_CCW Full_Half= 1
& for,, Full step mode it is incremented by =1
1
two 0
State_motor<=next_ motor+2
State_motor<=next_
motor+1
State_motor<= next_state_motor+2 1
0
If Full
Both is true for clockwise rotation.similarly for counter _Half=1
clockwise rotation for Half step mode it is decremented B
State_motor<=n ext_motor-1 State_motor<=ne xt_motor-2
by 1
State_motor<= next_state_motor-1
A
For full step motor it decremented by 2
State_motor<= next_state_motor-2.

Figure 7. Proposed algorithm Flow chart


These is the case because in Half step mode motor rotates
for all eight step if we take rotation for 45° from step 0 to
step 7 (0 1 2 3 4 5 6 7) The design and simulation of the stepper motor controller
can be performed using Active VHDL[14]. Also the
timings of various signals can be verified. Then the
Whereas for full step mode the rotation takes place for system can be implemented in CPLD.The flow chart for
90° in four step only from step 0 to step 6 controlling stepper motor using VHDL is already been
(0 2 4 6). explain.If CPLD’s are compared with FPGA[9] then this
The state diagram for eight half step mode is as follows design can fit into FPGA with some changes[8][11]

Clock = 1, Reset
=0 Here in this work we are Controlling Stepper motor
using VHDL and its implementation into CPLD. When
0/7 1010
1/0
CPLD is interface with stepper motor then due to
difference in there specification one driver circuit is to be
0/6
1000
0/0 0010
connected between them.various Ic’s are available which
1/7 will work as driver circuit between two depending upon
1001 0010 1000
1/1
specification of motor & designing we can select any one
0110
by connecting some buffers and latches to driver
0/5
0/1 IC’s.The clock generator is also connected so that
1/6
1/2 continous 5v for CPLD is generated.The ULN2801A-
0110 1001
ULN2805A can be better choice for small voltage motor.
0001
0100
0/2

0/4 1/5
0100
1/3
0101 0001
0/3

1/4 0101

Figure 6. State diagram

–5 –
Z. Ali , R. V. Kshirsagar • Development of a CPLD-based Novel Open Loop Stepper Motor Controller for High Performance Using VHDL

when coding is done in VHDL and xylinx its shcematic


and RTL(Resistor transfer logic) is generated.The RTL
view is shown below in fig 10.

Figure 8. PIN CONNECTION of 2803

The ULN2801A-ULN2805A each contain eight


darlington transistors with common emitters and integral
suppression diodes for inductive loads. Each darlington
features a peak load current rating of 600mA (500mA
continuous) and can withstand at least50V in the off Figure 10. RTL View
state. Outputsmaybe paralleled for higher current
capability. Five versions are available to simplify • This is a schematic representation of the pre-
interfacing to standard logic families : the ULN2801Ais optimized design shown at the Register Transfer
designed for generalpurpose applicationswith a current Level (RTL).
limit resistor ; the ULN2802A has a 10.5kW
inputresistor and zener for 14-25VPMOS; the • This representation is in terms of generic symbols,
ULN2803A has a 2.7kW input resistor for 5V TTL and such as adders, multipliers, counters, AND gates,
CMOS , theULN2804A has a 10.5kW input resistor for - and OR gates.
15V CMOS and the ULN2805A is designed to sink a
minimum of 350mA for standard and Schottky TTL • It is generated after the HDL synthesis phase of the
synthesis process.
where higher output current is required.In our work we
are using ULN2803A.The setup for which is shown The result for rotating stepper motor in clockwise,
below in fig. 9 counter clock wise for full step & for half step is as
5v 12v
follows:
Clock
Generator
1 10 output simulation is shown below:
+5v Reset=0, CW_CCW=1 Full_Half_step=1
C ULN
33 1 2
Reset
10k
8
3 P
+5v 0
12v
35 2 3 A
18

Start B
10k L 17 Stepper
5 Motor
C
+5v 37 316
D
D 15
CW/CCWw

10k
39 4
7
+5

Full/Half
10k

9
9
Figure 11. Output Simulation Result

Figure 9. Functional Block Diagram of


Controller Using Driver

–6 –
INES 2010 • 14th International Conference on Intelligent Engineering Systems • May 5–7, 2010 Las Palmas of Gran Canaria, Spain

Hardware Implementation”, IEEE Industrial Electronics,


IECON 2006-32nd Annual Conference, pp. 3916 –3921, in
Reset=0 ,CW_CCW=0 Full_Half_step=0 Paris, France, Dec. 2006.

5. N. Q. Le, J. U. Cho, and J, W, Jeon, ”Application of Velocity


Profile Generation and Closed-Loop in Step Motor Control
System”, SICE-ICASE Internation Joint Conference, pp. 3593
–3598, in Bexco, Busan, Korea, Oct. 2006,

6. D. O. Carrica, S. A. González, and M. Benedetti, “A high speed


velocity control algorithm of multiple stepper motors”,
Elsevier, Mechatronics, Vol. 14, Issue 6, pp. 675 – 684, 2004.

7. Xiaoyin Shao and Dong Sun, “Development of an FPGA-Based


Motion Control ASIC for Robotic Manipulators,” IEEE
Proceedings of The Sixth World Congress on Intelligent
Control and Automation, vol. 2, pp. 8221-8225, Jun. 2006.

Figure 12. Output Simulation Result 8. Ngoc Quy Le and Jae Wook Jeon An Open-loop Stepper
Motor Driver Based on FPGA, International Conference on
Control, Automation and Systems 2007, Oct. 17-20, 2007 in
Stepper motors are commonly found in consumer, COEX, Seoul, Korea, 1322-1326
industrial, medical and scientific applications. The Xilinx
CoolRunner-II CPLD and alteras MAX II CPLD’s is the 9. Brown and Rose, (1996) Architecture of FPGAs and CPLDs:
perfect device with which to control stepper motors with A Tutorial , Survey published by University of Toronto
the added benefit that the CPLD can be reprogrammed to
accommodate a different motor if the system 10. Gayakwad,(year of publication) Analog & Digital control
specifications change. systems, Prentice Hall Publications, ISBN 0- 13- 033028.

11. Ngoc Quy Le and Jae Wook Jeon, (2007), An Open-loop


IV. CONCLUSION
Stepper Motor Driver Based on FPGA, International
1. This paper presents an open loop stepper motor Conference on Control, Automation and Systems, Oct. 17-20,
2007 , Seoul, Korea, pp. 1322-1326.
driver using a CPLD. The basics of stepper motor
was described, the CPLD is used to build a high
12. Tzung-Cheng Chen and Yung-Chun Su, (2008), High
performance open loop driver without using a
Performance Algorithm Realization on FPGA for Stepper
DSP or microcontroller. Furthermore it is Motor Controller, SICE Annual Conference, August 20-22,
compatible with ASICs and mass production 2008, The University Electro- Communications, Japan.
methods for CPLD’s & FPGA [7]
13. Daniel Carrica, Marcos A. Funes, and Sergio A. González,
2. Experimental verification of the proposed (2003), Novel Stepper Motor Controller Based on FPGA
controller is expected to justify the key theoretical Hardware Implementation, IEEE/ASME Transactions on
Mechatronics, vol. 8, no. 1,pp 120-124.
results which will be available in the final version
of paper.
14. Robert Dueck, (2004), Digital design with CPLD Applications
& VHDL, 2nd edition , Thomnson Delmar Learning, ISBN 1-
V. REFERENCES 1401840302.
1. J. Petrov and S. Strmik, “A Microcomputer-Based Speed
Controller for Lift Drives”, IEEE Transactions on Applications, 15. IEEE standard VHDL Language reference manual, IEEE STD
Vol. 24, No. 3, pp. 487 - 498, 1988. 1076-2002.

2. T. Kenjo and A. Sugawara, “Stepping Motors And Their


Microprocessor Controls Second Edition”, Oxford University
Press, 1994.

3. Bae and Krishnan (1996) H. K. Bae and R. Krishnan, “A Study


of Current Controllers and Development of a Novel Current
Controller for High Performance SRM Drivers,” IEEE Industry
Applications Conference, vol. 1, pp. 68-75, Oct.1996.

4. D. Kos, A. Kapun, M. Curkovic, and K. Jezernik, “Efficient


Stepper Motor Torque Ripple Minimization Based on FPGA

–7 –

You might also like