Anda di halaman 1dari 6

Development of a CPLD based novel open

loop stepper motor controller for high


performance using VHDL
Zoonubiya Ali * and R.V Kshirsagar **
*

Disha Institute of Management and Technology, Electronics & Telecommunication Engg., Raipur (C.G.), INDIA
** Priyadarshini College of Engg. & Architecture, Nagpur (M.S.), INDIA
E-mail: zoonubiyakhan@yahoo.co.in

Abstract In motion control systems, stepper motors are


widely used and the stepper motor driver is mainly
implemented using a DSP (Digital Signal Processor). 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 SOC (system on chip) and CPLD
(complex programmable logic device) are popular with
designers. However, when mass production is needed,
CPLD (complex programmable logic device) based drivers
are preferred since the CPLD based design is compatible
with conversation to an ASIC (Application Specific
Integrated Circuit). Previous studies proposed CPLD based
drivers but the quality is still limited because of the
difficulty of handling complex computations in the CPLD.
Nowadays, with the improvement of CPLD techniques, it is
possible to perform various computations in the CPLD &
FPGA so it can be used instead of the DSP in motor driver
design. This paper presents an open loop driver of stepper
motor controller based on the CPLD. This driver can
perform stable, precise control and is responsive. The
experimental results verify the performance of the control
algorithm.
Keywords: Stepper motor, CPLD , Open loop mode.

A simplified description of CPLD design flow is as


follows:
1. The design is written in a high-level language, such as
Verilog or VHDL, using a software development tool.
2. The design is simulated for functional correctness.
3. The design is fit to a particular CPLD, providing the
physical aspects such as resource utilization and timing
paths.
Figure 1 shows the block diagram for controlling stepper
motor using CPLD. Here sequence of applied pulses is
directly proportional to direction of rotation, frequency of
applied pulses is directly proportional to speed of rotation,
and number of pulses applied is directly proportional to
length of rotation.
START/STOP
CONTROL
SWITCH

CPLD

LATCH

DIRECTION
CONTROL
SWITCH

I. INTRODUCTION
The stepper motor consists of permanent magnet rotor
and wound stator. The coils of wound stator are called
control windings. The rotation of stepper motor is
controlled by switching ON/OFF the current through
control windings. Normally the control windings are
excited through driver transistors. The stepper motor
controller generates a sequences of digital data called
switching sequence at a particular clock rate which can be
used to switch the transistors that are used to drive the
motor. The controller can be made to generate the
switching sequences at variables rate to drive the motor at
variable speed. The direction of rotation of motor can be
reversed by generating the switching sequences in reverse
order. In this work, the control of the rotation and speed
of the stepper motor is done by using CPLD (Complex
programmable logic device) instead of DSP &
Microprocessor[1]. The characteristic of non volatility
makes the CPLD the device of choice in modern digital
designs to perform the function before handing over
control to other devices not having this capability [6].

978-1-4244-7652-7/10/$26.00 2010 IEEE

BUFFER

307

STEPPER
MOTOR
DRIVER
CIRCUIT

STEPPER
MOTOR

CLOCK
GENERATOR

Figure 1. Block Diagram of stepper motor controller

II. WHY STEPPER MOTOR?

A stepper motor can be a good choice whenever


controlled movement is required.

They can be used to advantage in applications


where control on rotation angle, speed, position
and synchronism is required.
Because

A stepper motor is an electromechanical device


which converts electrical pulses into discrete
mechanical movements.

INES 2010 14th International Conference on Intelligent Engineering Systems May 57, 2010 Las Palmas of Gran Canaria, Spain

An ideal stepper motor has a sinusoidal torque vs


displacement characteristic as shown in figure 2

The shaft or spindle of a stepper motor rotates in


discrete step increments when electrical
command pulses are applied to it in the proper
sequence

A. Open Loop Operation of stepper motor


One of the most significant advantages of a stepper motor
is its ability to be accurately controlled in an open 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.

Figure 2. Torque Vs. Rotor Angular Position

B. Torque Generation of stepper motor


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

Figure 3. Angular Position at Different Holding Torques

In a stepper motor a torque is developed when the


magnetic fluxes of the rotor and stator are displaced from
each other [5].

E. Step Angle Accuracy of stepper motor


One reason why the stepper motor has achieved such
popularity as a positioning device is its accuracy and
repeatability.

C. Stepping Modes of stepper motor


The following are the most common drive modes.

Typically stepper motors will have a step angle


accuracy of 3 5% of one step.

Wave Drive (1 phase on)


This error is also noncumulative from step to step.
Full Step Drive (2 phases on)
The accuracy of the stepper motor is mainly a function
of the mechanical precision of its parts and assembly.

Half Step Drive (1 & 2 phases on)


Micro stepping (Continuously varying motor
currents)

Figure 4. Typical Plot of the Positional Accuracy of a


Stepper Motor

D. Torque Vs. Angle Characteristics of stepper motor


The torque vs angle characteristics of a stepper motor
are the relationship between the displacement of the
rotor and the torque which applied to the rotor
shaft when the stepper motor is energized at its rated
voltage.

F. Torque Vs Speed characteristic

308

The torque vs speed characteristics are the key


to selecting the right motor and drive method for
a specific application.

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


(change with) the motor, excitation mode and
type of driver or drive method[4]

The advantage of microprocessor is that it is


easy for design the control mode of stepper
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
constant speed.

Figure 5. A typical speed torque curve

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
advance. For performing high precision positioning and
smooth rotation operation, design of stepper motor
controller is a very important issue.
III. NECESSITY OF STEPPER MOTOR CONTROL

Stepper motors can be found


in printers, disk drives, X-Y
plotters, and many others
which are required to move
controlled objects to accurate
positions within nominated
time.
The
precision
positioning is a top priority
than others consideration.

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
straightforward [3].
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.

CRUCIAL CONTROL PARAMETERS

Position

To control the stepper motor, the driver can apply an


open loop control algorithm or closed loop algorithm.

Time

Kos (2006) presented an algorithm to realize the linear


variable speed controller by adjusting the torque
corresponding current [4].

For those applications that


demand the controlled objects
moved with designated time
to prearranged positions; such
as those used in autonomous
cars, robotic arms with low
moment of inertia, industrial
plants, etc. In such cases,
time should dominate among
others.

Le (2006), proposed variable speed controller using


close-loop control. He used an optical encoder coupling
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].

IV. WORK DONE IN PAST FOR THE CONTROLLER


SIDE OF STEPPER MOTOR
Petrov (1988) proposed a system by a microcomputer
achieved a variable speed controller. On account of
processing speed restrictedly, high resolution could not
be provide. In order to approach the linear acceleration,
the digital-to-analog converter (DAC) is used to increase
resolution [1].

With applications where load torque is stable and


operations are at low speed, an open loop driver is
preferred since it needs a simple control algorithm and an
encoder is not required[12].Here in this work as we are
forcing motor to rotates in two direction clockwise and
counter clock wise mode.The output sequence for driver
circuit is as follows.

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.

309

INES 2010 14th International Conference on Intelligent Engineering Systems May 57, 2010 Las Palmas of Gran Canaria, Spain

TABLE II.
OUTPUT SEQUENCE FOR DRIVER CIRCUIT
output

Step
0

Step
1

Step
2

Step
3

Step
4

Step
5

Start

Step
6

Step
7

A_n

B_N

Initialization of Clock, Reset, and Full_Half_step &


CW_CCW as input pins And A, A_n, B, B_n as output
pins
Architecture begin

Clock event
Clock=1

B
1
Step 0

If
Reset=1

For initial condition assumed that motor is in step 0

which shows A A_n B B_n=1010 ,after every clock

motor is incremented by one for half step mode.

State_motor<Next_State_motor=0

So, State_motor<= next_state_motor+1

CW_CCW
=1

& for,, Full step mode it is incremented by two

If
Full_Half=
1

State_motor<= next_state_motor+2
Both is true for clockwise rotation.similarly for counter
clockwise rotation for Half step mode it is decremented
by 1
State_motor<= next_state_motor-1

If Full
_Half=1

Whereas for full step mode the rotation takes place for
90 in four step only from step 0 to step 6
4

6).

The state diagram for eight half step mode is as follows


Clock = 1, Reset =0

1/0

1000

0/6

0/0

0010

1/7
1/1
1001

0010

1000
0110

0/1

0/5

1/6
1/2
0110

Figure 7. Proposed algorithm Flow chart

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
system can be implemented in CPLD.The flow chart for
controlling stepper motor using VHDL is already been
explain.If CPLDs are compared with FPGA[9] then this
design can fit into FPGA with some changes[8][11]
Here in this work we are Controlling Stepper motor using
VHDL and its implementation into CPLD. When CPLD
is interface with stepper motor then due to difference in
there specification one driver circuit is to be connected
between them.various Ics are available which will work
as driver circuit between two depending upon
specification of motor & designing we can select any one
by connecting some buffers and latches to driver ICs.The
clock generator is also connected so that continous 5v for
CPLD is generated.The ULN2801A-ULN2805A can be
better choice for small voltage motor.

1010

0/7

1001

0001
0100

0/2
1/5

0/4
0100

1/3
0101

0001

0/3

Figure 6. State diagram

1/4

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)

State_motor<=next_
motor+2

State_motor<=ne
xt_motor-2

State_motor<=n
ext_motor-1

For full step motor it decremented by 2


State_motor<= next_state_motor-2.

(0

State_motor<=next_
motor+1

0101

310

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 state.
Outputsmaybe paralleled for higher current capability.
Five versions are available to simplify interfacing to
standard logic families : the ULN2801Ais designed for
generalpurpose applicationswith a current limit resistor ;
the ULN2802A has a 10.5kW inputresistor and zener for
14-25VPMOS; the ULN2803A has a 2.7kW input
resistor for 5V TTL and CMOS , theULN2804A has a
10.5kW input resistor for
-15V CMOS and the
ULN2805A is designed to sink a minimum of 350mA for
standard and Schottky TTL where higher output current
is required.In our work we are using ULN2803A.The
setup for which is shown below in fig. 9
5v
Clock
Generator

12v

Reset

Start

33

35

2
8
0
3

It is generated after the HDL synthesis phase of the


synthesis process.

The result for rotating stepper motor in clockwise,


counter clock wise for full step & for half step is as
follows:

12v

16
D

15

CW/CCWw

37

10k

This representation is in terms of generic symbols,


such as adders, multipliers, counters, AND gates, and
OR gates.

17

5
+5v

18

10k

This is a schematic representation of the preoptimized design shown at the Register Transfer
Level (RTL).

ULN
1

10k
+5v

output simulation is shown below:


Reset=0, CW_CCW=1 Full_Half_step=1

10

1
+5v

Figure 10. RTL View

39

+5
v
Full/Half

10k

Figure 11. Output Simulation Result


Figure 9. Functional Block Diagram of Controller
Using Driver

311

INES 2010 14th International Conference on Intelligent Engineering Systems May 57, 2010 Las Palmas of Gran Canaria, Spain

Hardware Implementation, IEEE Industrial Electronics,


IECON 2006-32nd Annual Conference, pp. 3916 3921, in
Paris, France, Dec. 2006.

Reset=0 ,CW_CCW=0 Full_Half_step=0

Figure 12. Output Simulation Result


Stepper motors are commonly found in consumer,
industrial, medical and scientific applications. The Xilinx
CoolRunner-II CPLD and alteras MAX II CPLDs is the
perfect device with which to control stepper motors with
the added benefit that the CPLD can be reprogrammed to
accommodate a different motor if the system
specifications change.
V. CONCLUSION
1.

2.

This paper presents an open loop stepper motor


driver using a CPLD. The basics of stepper motor
was described, the CPLD is used to build a high
performance open loop driver without using a DSP
or microcontroller. Furthermore it is compatible
with ASICs and mass production methods for
CPLDs & FPGA [7]
Experimental verification of the proposed
controller is expected to justify the key theoretical
results which will be available in the final version
of paper.

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. Gonzlez, 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.

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
COEX, Seoul, Korea, 1322-1326

9.

Brown and Rose, (1996) Architecture of FPGAs and CPLDs:


A Tutorial , Survey published by University of Toronto

10. Gayakwad,(year of publication) Analog & Digital control


systems, Prentice Hall Publications, ISBN 0- 13- 033028.
11. Ngoc Quy Le and Jae Wook Jeon, (2007), An Open-loop
Stepper Motor Driver Based on FPGA, International
Conference on Control, Automation and Systems, Oct. 17-20,
2007 , Seoul, Korea, pp. 1322-1326.
12. Tzung-Cheng Chen and Yung-Chun Su, (2008), High
Performance Algorithm Realization on FPGA for Stepper
Motor Controller, SICE Annual Conference, August 20-22,
2008, The University Electro- Communications, Japan.
13. Daniel Carrica, Marcos A. Funes, and Sergio A.
Gonzlez,(2003), Novel Stepper Motor Controller Based on
FPGA Hardware Implementation, IEEE/ASME Transactions on
Mechatronics, vol. 8, no. 1,pp 120-124.
14. Robert Dueck, (2004), Digital design with CPLD Applications
& VHDL, 2nd edition , Thomnson Delmar Learning, ISBN 11401840302.

VI. REFERENCES
1.

5.

J. Petrov and S. Strmik, A Microcomputer-Based Speed


Controller for Lift Drives, IEEE Transactions on Applications,
Vol. 24, No. 3, pp. 487 - 498, 1988.

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

312

15. IEEE standard VHDL Language reference manual, IEEE STD


1076-2002.

Anda mungkin juga menyukai