You are on page 1of 6

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/324261648

Modelling and Simulation of Stepper Motor For Position Control Using


LabVIEW

Article  in  Recent Innovations in Mechatronics · April 2018


DOI: 10.17667/riim.2018.1/7

CITATIONS READS

4 9,276

3 authors:

Ahmet Mehmet Karadeniz Malek Alkayyali


Széchenyi István University, Gyor Clemson University
4 PUBLICATIONS   4 CITATIONS    10 PUBLICATIONS   25 CITATIONS   

SEE PROFILE SEE PROFILE

Péter Tamás Szemes


University of Debrecen
124 PUBLICATIONS   325 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Dynamic Simulation and Modelling of an Industrial Manipulator (KUKA KR5 arc) View project

Modelling and Simulation of Stepper Motor Using PID and Fuzzy Logic Controllers on LabVIEW View project

All content following this page was uploaded by Ahmet Mehmet Karadeniz on 23 October 2018.

The user has requested enhancement of the downloaded file.


Recent Innovations in Mechatronics (RIiM) Vol. 5. (2018). No. 1.
DOI: 10.17667/riim.2018.1/7

Modelling and Simulation of Stepper Motor For


Position Control Using LabVIEW
Ahmet Mehmet KARADENIZ Malek ALKAYYALI Dr. Peter Tamas SZEMES
Department of Mechatronics Department of Mechatronics Department of Mechatronics
University of Debrecen University of Debrecen University of Debrecen
Debrecen, Hungary Debrecen, Hungary Debrecen, Hungary
ahmetm.karadeniz@gmail.com malekkayyali@gmail.com szemespeter@eng.unideb.hu

Abstract—This paper presents hybrid stepper motor (is a type graph technique is explained and stepper motor mathematical
of stepping motor) modelling and simulation which is widely used model and bond graph modelling is described in in Section II.
a kind of motor in industrial applications. In this study, the Section III explains the design of the general PID controller
stepper motor was modelled using bond graph technique and and introduces the close loop position control. Finally, the
simulation for desired position was executed on LabVIEW conclusions are summarized in Section IV.
graphical interface. Then, firstly a convenient PID controller was
designed for position, speed and current and PID close loop II. STEPPER MOTOR MODELING
response was obtained for position control. Then, PID
parameters for each controller were arranged separately to A. Mathematical Modelling
obtain good response Secondly, Fuzzy Logic controller applied to In this section, the mathematical model of a hybrid stepper
the system and its response was obtained. Finally, both responses motor is derived. Fig. 1 shows the schematic drawing of a
are compared. According to comparison, it was observed that simple two-phase hybrid stepper motor with three teeth [4].
Fuzzy Logic controller’s response is better than PID’s. (In this
paper, all shown responses were observed for 120 degree desired
position)

Keywords—stepper motor, position control, bond graph


modelling, PID controller, Fuzzy Logic.

I. INTRODUCTION
Stepper Motors can be defined as DC Motors that can move
in discrete steps. They have multiple coils. Each phase is
energized in order to provide step by step rotation of motor.
Then, highly precise positioning and speed control can be
obtained in computer controlled stepping applications.
Therefore, stepper motors are the most preferred motors for
many precise motion control applications.
There are three type of stepper motors: permanent magnet
stepper motors, variable reluctance stepper motors (it may
named switched reluctance stepper motors) and hybrid stepper Fig. 1: Schematic view of a stepper motor with three teeth[4].
motors [1]. In this paper, the study for hybrid stepper motor
application was performed. The mathematical model of a stepper model could be divided
into two sub-models, electrical model and mechanical model.
Hybrid Stepper Motors are widely used in highly precise Starting with the electrical model, each phase of the stepper
position controlled applications such as robotic systems, 3d
motor phases could be modelled as an RL circuit plus a back
printers, etc. [2]. This type of stepper motors have all features
that other types of stepper motors behave. Hybrid stepper electromotive force (emf) in Figure 2[4]. According to [4] the
motors use disc rotor which is magnetized longitudinal to differential equations of phase a and phase b are given by (1)
produce small step angle and low inertia torque. Therefore, and (2), respectively,
hybrid stepper motors are more costly via according to other
type of stepper motors and have more complex structure [3]. (1)
The rest of this paper is organized as follows. The stepper
motor and its mathematical model is introduced and the bond (2)
Recent Innovations in Mechatronics (RIiM) Vol. 5. (2018). No. 1.
DOI: 10.17667/riim.2018.1/7
where: and B. Bond Graph Modelling
. Bond Graphs are a graphical approach for diagramming
the distribution and flow of power and energy within a
In equation (1) and (2), the phase resistances and dynamic system. More specifically, bond graphing is a unified
inductances are assumed to be equal, [Ω] and graphical approach for modelling the storage, dissipation, and
[H]. Moreover, and are the terminal transformation of energy within a dynamic system. The
voltages [V], and are the back emf [V], is the structure of the bond graph has been designed to facilitate
motor constant, is the number or motor poles pairs (teeth), systematic derivation of differential equations governing the
is the rotor (mechanical) angular speed [rad/s], and is dynamic response of the system model. The bond graph
the rotor (mechanical) angular position [rad]. approach leads directly to a computer simulation of the
dynamic response because it delineates the causal
relationships between elements or components of the model.
That is, the bond graph accounts for the input/output relations
between elements and subsystems of the model[5][7].

According to stepper motor model in Fig. 2, the bond graph

Fig. 2: The equivalent circuits of hybrid stepper motor.

The shaft of the hybrid stepper motor, which represents


the mechanical part of the system, is modelled as a rigid body
subjected to different torques as shown in Fig. 3 [4]. The
differential equation of the mechanical sub-system is given by
(3),

(3) Fig. 4: Bond graph modelling of hybrid stepper motor.

model of hybrid stepper motor is shown in Fig. 4.


where: and
. III. CLOSED LOOP POSITION CONTROL, PID AND FUZZY LOGIC
CONTROLLERS OF HYBRID STEPPER MOTOR
In the mechanical model, [ is the motor The behaviour of the system as observed by a signal
moment of inertia, [ ] is the motor viscous friction transducer or sensor is compared with the desired or command
coefficient, [ ] is the electromagnetic torque, value of that variable, and the difference or error is sent to a
[ ] is the detent torque applied, is the phase shift related controller, which in turn directs the actuator such that it reduces
to , and [ ] is the applied load torque. the error. In complex systems the actuators themselves are
imbedded control subsystems, with their own brains, sensors
and muscle.
In order to control the position of hybrid stepper motor,
field oriented control (FOC) method is used in this research.
The main idea of FOC is to change the electrical signals from
one coordinate to another. This transformation is done to
transform these signals from the reference frame linked to
stator phases to the rotating frame linked to the rotor to control
the produced torque precisely since it is directly related to the
current in one of the axis of this new frame [4].
FOC is the most commonly used method to control AC
Fig. 3: The mechanical sub-system of the hybrid stepper motor[4]. motors especially induction motors. It is used to control the
Recent Innovations in Mechatronics (RIiM) Vol. 5. (2018). No. 1.
DOI: 10.17667/riim.2018.1/7
speed and position of the motor by controlling its torque, this (8) and (9).
controlling technique achieves a very precise response close to
DC motors drives. The main advantages of FOC are the very (8)
fast transient response and smooth operation. Moreover,
according to the literature, this controlling method is used with
synchronous machines and stepper motors [4]. (9)

According to [4], park transformation is used to transform The block diagram of the decoupled system with the
the electrical model from a and b frame to d and q frame. The electrical drive subsystem, electrical subsystem in d and q
new transformed electrical model is given by (4) and (5). frame, and the mechanical subsystem is shown in Fig. 5 [4].
(4)
Now, the configuration of the motor closed-loop drive
system mentioned in [6] is considered in this research. In this
(5) configuration, three controllers are required, one for the
position, the other for the speed and the third one for the
As can be seen from (4) and (5) the currents and are current. The most inner loop is the current controller loop and
coupled, [4] proposed a method to decouple them, the new it has the largest bandwidth. The most outer loop is the
electrical decoupled and linear system is given by (6) and (7). position control loop. Fig. 6 shows the block diagram of this
control configuration.
(6) Fuzzy theory was firstly introduced by Lotfi A. Zadeh in
the middle of 1960s. Nowadays, many industrial products use
(7) fuzzy controllers to control its operation since it is an
automated mechanism that depends on linguistic rules to
achieve a desired output or response. Fuzzy logic controllers
In order to achieve this decoupling, the electrical drive
are in general nonlinear and there is no simple mathematical
system adds the quantities and to the desired equation that can describe them. But it is widely used in
and . The equations of these two quantities are given by control applications because of the following reason: its
simplicity since it uses if-then structured rules which allows

Fig. 5: Block diagram of decoupled stepper motor.

Fig. 6: Closed loop control system of stepper motor.


Recent Innovations in Mechatronics (RIiM) Vol. 5. (2018). No. 1.
DOI: 10.17667/riim.2018.1/7
the designer to take them from the expert and embed them in
the controller.[9].
IV. LABVIEW MODEL
For the hybrid stepper motor studied in this research,
the model block diagram which has the mechanical
subsystem, d-phase electrical subsystem and q-phase
electrical subsystem and four control loops; position loop,
speed loop with four controllers is shown in Fig. 8. Since
four PID and Fuzzy Logic controllers are required to
control this system, subsystems for these controllers are
built. The block diagram with Fuzzy Logic can be obtained Fig. 9: LabVIEW block diagram for the Fuzzy Logic controller.
only using Fuzzy Logic controller instead of PID controller.
TABLE I shows the rules for Fuzzy Logic controller, Fig. 7
shows the structure of PID controller and Fig. 9 shows the
structure of Fuzzy Logic controller inside LabVIEW block
diagram. Then, Fig. 10, Fig. 11 and Fig. 12 shows Fuzzy
Logic membership functions ‘u’, ‘du’ and ‘output’
respectively.

Fig. 10: Fuzzy System Designer input membership function ‘u’.

Fig. 11: Fuzzy System Designer input membership function ‘du’.


Fig. 7: LabVIEW block diagram for the PID controller.

TABLE I.
u
du
NB NS Z PS PB
NB NB NB NB NS Z Fig. 12: Fuzzy System Designer output membership function.
Z NB NS Z PS PB
V. SIMULATION RESULTS
PB Z PS PB PB PB In this section, the simulation results are presented for the
hybrid stepper motor. The parameters of the hybrid stepper
motor were taken from [4, 7] as follows: 0.08 ,

Fig. 8: LabVIEW block diagram with PID controller subsystem for the stepper motor model.
Recent Innovations in Mechatronics (RIiM) Vol. 5. (2018). No. 1.
DOI: 10.17667/riim.2018.1/7
, , , , , the desired position. The hybrid stepper motor was studied in
, . two modes: PID controlled closed loop and Fuzzy Logic
controlled closed loop. As we noticed from the results, the
To make the comparison more convenient, the PID and motor achieves position accurately with a small overshoot
Fuzzy Logic closed loop responses are studied. Fig. 13 shows using PID controller. Comparison of both controller’s response
the PID closed loop response with 120 degree desired position on the system Fuzzy Logic’s is better than PID’s according to
with tuned parameters as follows: the position control loop; settling time and overshoot.
, , ; the speed control loop;
, , ; the d-phase current loop; , , Acknowledgment
; the q-phase current loop; , ,
. And also Fuzzy Logic controller’s response is shown in We acknowledge the support and help of Dr. Peter Tamas
Fig. 14. Furthermore, for the comparison of both controllers Szemes who encouraged us to work on this topic and we would
two responses are shown in Fig. 15. like to thank our friend Ammar Alsabbagh for his support
about fuzzy logic controller applications.

References
[1] A. Morar, “Stepper motor model for dynamic simulation”,
University of Targue-Mures, vol. 44, no. 2, pp. 117- 122, June
2003.
[2] K. M. Le, H. Van Hoang and J. W. Jeon, “An Advanced Closed-
Loop Control to Improve the Performance of Hybrid Stepper
Motors”, IEEE Transactions on Power Electronics, vol. 32, no. 9,
pp. 7244-7255, Sep. 2017
[3] M. Aydin, “Stepper Motors”, Lecture Notes, Kocaeli University
Mechatronics Engineering Department , May 2017.
[4] Ruilope R. P., “Modelling and Control of Stepper Motors For High
Accuracy Positioning System Used in Radioactive Environments”,
Fig. 13: PID controlled closed loop response. Thesis, Politechnical University of Madrid, 2014.
[5] J. Kypuros, System Dynamics and Control with Bond Graph
Modeling. CRC Press, 2013.
[6] S. H. Kim, “Ch. 2 Control of Direct Current Motors”, Electric
Motor Control, pp. 39-93, Elsevier, 2017.
[7] W. Borutzky, Ed., Bond Graph Modelling of Engineering Systems.
New York, NY: Springer New York, 2011.
[8] N. E. I. S. U. Manual, “NI Educational Laboratory Virtual
Instrumentation Suite II Series (NI ELVISTM II Series) User
Manual.”,2009.
[9] J. Jantzen, Foundations of fuzzy control. Chichester, England ;
Hoboken, NJ: John Wiley & Sons, 2007.

Fig. 14: Fuzzy Logic controlled closed loop response.

Fig. 15: Comparison of both responses.

VI. CONCLUSIONS
One of the most efficient techniques to control the stepper
motors which is field oriented control (FOC) is used to achieve

View publication stats

You might also like