Encoder Stepper
Encoder Stepper
Abstract— Hybrid Stepper Motors (HSMs) have received at high reference speeds, lower efficiency, and poor damping
enormous industrial applications due to their higher efficiency, characteristics generating significant overshoot and long
better resolution, better detent torque and smoother operation as settling time [1]. An alternative closed loop HSM control
compared to other stepper motors and servomotors. HSM system employing Fuzzy Logic Controllers (FLCs) used to
conventional control schemes however could not overcome poor
drive the HSM eliminates these problems to significant levels
damping characteristics at increasing load inertia, high
overshoot, undershoot and settling time which compromise such that their effects on the motor can be neglected. Since its
motor integrity in terms of efficiency and precise positioning. In inception, the theory of fuzzy logic and the fuzzy logic
this paper, a PI-based Mamdani type Fuzzy Logic Controller controller has solved many engineering problems in industry
(FLC) was designed for an HSM. Triangular and trapezoidal due to its ability to tackle complex, non-linear, mathematical
membership functions for input and output linguistic variables and linguistic problems [2], [3]. The stepper motor is a
were employed giving 49 rules in the rule base of the FLC. synchronous servomotor in which digital signals generated in
Matlab fuzzy logic toolbox was used for the FLC design. The the form of series of pulses of current and sequentially applied
FLC was used to model a position controller for the HSM in to the stator winding are used to control the rotor which moves
Simulink. The dynamic response for a unit step input for the
through a fixed step angle for each command pulse. It is
HSM position control system presented better characteristics in
terms of overshoot and undershoot but higher settling time and unique because its output shaft rotates in a series of discrete
rise time as compared to the system without FLC. With the FLC, angular intervals known as the step angle, one step being
overshoot and undershoot were 0.454% and 1.892% as against taken each time a command pulse is received.
0.562% and 4.069% for the non-FLC respectively. The settling A number of software approaches have been reported. In [4],
time and rise time were 15.36 ms and 9.83 ms for the FLC as Morar (2014) modelled and simulated a bipolar hybrid
against 13.727 ms and 5.306 ms for the non-FLC respectively. stepping motor using Matlab/Simulink software to obtain
Further, the FLC response had almost no ripples. The FLC could current, voltage torque and speed characteristics for no-load
be considered for the control of the HSM. and rated load operation. [5] designed a new Simulink model
of hybrid stepper motor that eliminated the drawbacks of
Keywords— Control, Hybrid Stepper Motor, Matlab Simulink, missing steps and torque drops that could not be accounted for
Simulations, Modelling, by the “Simpower Systems” hybrid stepper motor library
block model. [6] presented dynamic model of multi-phase
I. INTRODUCTION hybrid stepper Motors making use of Lagrangian approach in
The Hybrid Stepper Motor (HSM) has attracted much focus the frame of Power – Oriented Graphs (POG) technique. The
for drives implemented in position control applications due to generic model is implementable in Matlab/Simulink
its higher efficiency, smoother operation and higher precision environment. [7] designed a lead angle estimator – based
in such applications as compared to other stepper and servo position tracking controller of the hybrid stepper motor to
motors. This motor finds application in computer peripherals, produce the highest non – step – out torque that assure of wide
business machines, process control systems and machine operating speed range of motor. For validation, experimental
tools. They are usually used in open loop control mode due to comparism with the open – loop technique was conducted and
their nature vis a vis their ability to work directly with the proposed method is implementable on Digital Signal
computers, microprocessors, programmable controllers and Processing (DSP) – based platform.
direct response to digital input signals. The HSM is a non-
linear servo drive which is difficult to control when driven by Few cases of stepper motor control using fuzzy logic
traditional control techniques like open loop control circuits. It controllers have been reported in the literature: [8] designed a
gives poor response and low efficiency when driven using circuit to control the motor position of a PM stepper motor.
other traditional control techniques like microcontroller-based This robust and adaptive control circuit uses a type-2 FLC to
control. In such open loop control systems, the motor give precise rotor position. The results revealed that the
experiences disadvantages such as resonance, uneasy starting desired output is reached faster in the type-2 controller as
Authorized licensed use limited to: Carleton University. Downloaded on July 11,2020 at 17:00:22 UTC from IEEE Xplore. Restrictions apply.
compared to the type-1 controller. [9] looked at a fuzzy gain and/or position is then fed back to the control logic circuit to
scheduling control of a PM stepper motor. The mathematical determine the appropriate signal to feed the motor in order to
model of the motor was used to model a fuzzy based control eliminate the error. The block diagram in Fig. 1 represents the
circuit. The simulation response was compared with the output design of a fuzzy logic-based position control of an HSM.
of a PID controller for the same motor under similar
conditions. The fuzzy tuning controller demonstrated
Matlab
superiority in terms of very fast response and a little Simulink Power Supply
Unit
overshoot. [10] presented an approach for the implementation
of an FLC for PM stepper motor on a Field Programmable
Gate Array (FPGA) using VHDL. Each component of the
fuzzy inference system was coded based on specifications of Hybrid
the system. Synthesis and simulation of system was done Control
Stepper
Hybrid
Stepper
Motor
using Xilinx tools. The output of the system of the FLC was Board
Driver
Motor
Circuit
then compared to that of a PID controller. System overshoot
and settling time were observed to have improved.
On the HSM control using fuzzy logic, Bindu, Unnikrisnan
and Gopika-Kumari [11] proposed an adaptive fuzzy logic Incremental
position control of an HSM. The least mean square algorithm Encoder
was used for combining fuzzy rules and motor parameters Fig. 1 Design Block Diagram of a Fuzzy Logic based
estimated using a Kalman filter. The stability of the motor was Position Control of an Hybrid Stepper Motor
checked by computing Lyapunov exponents from the
evolutions of the state space of direct axis current, quadrature The hardware of this design consists of a control board which
axis current, synchronous speed and was found to be stable at is loaded with fuzzy logic coded instructions from a Personal
all times. The simulation results showed that the proposed Computer (PC) on which system manipulation and monitoring
control strategy operates robustly under modelling uncertainty are done. An FLC designed for the control of the HSM on the
with good dynamic performance. [1] designed a DSP-based computer is loaded into the processor of the control board and
FLC and PI servosystem for an HSM. An outer fuzzy control command signals are generated by the control board based on
strategy was designed to compensate the position feedback the nature of the error, the derivative of the error and the fuzzy
pulse disturbance. Gaussian membership functions were used logic algorithms. Command signals from the control board are
for output speed change partitioned variables. Experimental sent to the stepper motor driver circuit which feeds the HSM
results revealed good performance for the servo system. In [ with the appropriate pulse-width modulated signals. An
12], Karadeniz, Alkayyali and Szemes modelled using bond incremental encoder feeds back the shaft angular velocity
graphs and simulated on LabVIEW graphical interface of the and/or position in the form of pulsed electrical signals to the
hybrid stepper motor for position control where fuzzy logic control board to be compared with the reference signal. Errors
controller outperformed the PID controller for a 120° desired generated from these signals are used to determine the nature
position. The inner loops were current and speed loops. of the input signal to the HSM in order to attain the required
The criteria for high performance evaluation of HSM as output. The design is meant to be intuitive and well suited to
reported in the literature are speed of dynamic response, human inputs, relatively easy to understand, less dependent on
overshoot, undershoot, settling time, steady state error, steady motor’s mathematical model, and simulated using a user
state accuracy, speed recovery time, and load disturbance friendly software.
effect [13], [14]. The reported cases of HSM control using
FLC have not been able to sufficiently improve the speed of A. Mathematical Model of the Hybrid Stepper Motor
dynamic response, overshoot, undershoot, settling time and
steady state error of the HSM. This study is meant to improve The mathematical model that describes the dynamics of two-
these parameters using a PI-based rule base, mixed triangular phase HSMs is given in the Equation (1) [10].
and trapezoidal membership functions for inputs and output
linguistic variables and a better tuning of controller. 1
𝑖𝑎 = (𝑣𝑎 − 𝑅𝑖𝑎 + 𝐾𝑚 ω sin 𝑝𝜃)
𝑙
1
𝑖𝑏 = (𝑣𝑏 − 𝑅𝑖𝑏 + 𝐾𝑚 ω sin(𝑝𝜃 − 𝜋⁄2))
II. MATERIALS AND METHODS 𝑑𝑖𝑎
𝑙
1
= (𝑣𝑎 − 𝑅𝑖𝑎 − 𝐾𝑚 ω cos 𝑝𝜃) (1)
Advances in power electronics and signal processing have 𝑑𝑡 𝑙
𝑑𝑖𝑏 1 𝜋
made it possible to drive the HSM in closed loop systems such = (𝑣𝑏 − 𝑅𝑖𝑏 − 𝐾𝑚 ω cos(𝑝𝜃 + ⁄2))
𝑑𝑡 𝑙
that they are employed in high precision operations such as in 𝑑𝜔 1
= [𝐾𝑚 𝑖𝑎 cos 𝑝𝜃 + 𝐾𝑚 𝑖𝑏 cos(𝑝𝜃 + 𝜋⁄2) − 𝛽𝜔 − 𝜏𝐿 ]
robotic manipulators and in machine tools. Closed loop 𝑑𝑡 𝐽
control of the HSM is generally characterised by driving the
motor using a series of pulse signals generated from a logic
system through a motor driver circuit. Shaft angular velocity
Authorized licensed use limited to: Carleton University. Downloaded on July 11,2020 at 17:00:22 UTC from IEEE Xplore. Restrictions apply.
𝑑𝜃
where, = 𝜔, 𝜔 = rotor angular speed, 𝜃 = rotor angular Membership functions
𝑑𝑡
position, 𝑖𝑎 = Current in phase A, 𝑖𝑏 = Current in phase B, In this design, rotor position error, change in rotor position
𝑣𝑎 = Voltage of phase A, 𝑣𝑏 = Voltage of phase B, 𝐾𝑚 = error and the change in motor input voltage are given in the
motor torque constant, 𝑝 = number of rotor teeth, 𝑙 = form of a set of linguistic variables with membership
inductance of each phase winding, 𝛽 = viscous friction functions, and the elements of these linguistic variables are
constant, 𝑅 = resistance of each phase winding, 𝜏𝐿 = load given as Positive Big (PB); Positive Medium (PM); Positive
torque. Small (PS); Zero (ZE); Negative Small (NS); Negative
Medium (NM); and Negative Big (NB).
The input rotor position error and change in error are defined
B. Design of Fuzzy Logic Controller in the range:
−1 ≤ 𝑒(𝑡) ≤ +1 and −1 ≤ 𝑐𝑒(𝑡) ≤ +1 respectively.
Basically, the FLC used in this paper is designed based on the The change in the output pulse-width modulated voltage
principle of operation of a Proportional-Integral (PI) signal is also defined by the range:
controller. The output, u(k) of a PI controller is a function of −17.67 ≤ ∆𝑣(𝑡) ≤ +17.67
the error, e(k) and change in error, e(k-1) of the input signal as Triangular membership functions are employed for all three
depicted in the mathematical computations of the Equation parameters in the design of the fuzzy logic controller due to
(2): the better control performance and simplicity except the first
and the last elements, ie PB and NB, where trapezoidal
1
(∑𝐾 membership functions are employed.
𝑢(𝑘) = 𝐾 [𝑒(𝑘) +
𝑇𝑖 𝑛=0 𝑒(𝑘 − 𝑛))∆𝑇]
1
𝑢(𝑘 − 1) = 𝐾 [𝑒(𝑘 − 1) + (∑𝐾
𝑛=0 𝑒(𝑘 − 1 − 𝑛))∆𝑇] Fuzzy rule base and inference mechanism
𝑇𝑖
1 The rule base is constructed based on the PI control theory.
𝑢(𝑘) − 𝑢(𝑘 − 1) = 𝐾 [𝑒(𝑘) − 𝑒(𝑘 − 1) + 𝑒(𝑘)∆𝑇] The rule base is given in a form of “IF … THEN” rules. The
𝑇𝑖
𝑢(𝑘) − 𝑢(𝑘 − 1) = ∆𝑢(𝑘) (2) output of the FLC is determined by the inference mechanism
𝑢(𝑘) = ∆𝑢(𝑘) + 𝑢(𝑘 − 1) based on the rule base. The general considerations used in the
1 formulation of the rule base for the design of the FLC are:
𝑢(𝑘) = 𝐾 [𝑒(𝑘) − 𝑒(𝑘 − 1) + 𝑒(𝑘)∆𝑇] (i) If both e(t) and ce(t) are zero, then maintain the present
𝑇𝑖
control setting i.e. ∆v = 0
+ 𝐾 [𝑒(𝑘 − 1) (ii) If e(t) is not zero but is approaching this value at a
satisfactory rate, then maintain the present control setting.
1
𝐾 (iii) If e(t) is growing, then change the control signal ∆v
+ (∑ 𝑒(𝑘 − 1 − 𝑛)) ∆𝑇] depending on the magnitude and sign of e(t) and ce(t) to force
𝑇𝑖 e(t) towards zero.
𝑛=0
where, 𝑢(𝑘) = controlled output signal, 𝑒(𝑘) = input error Table 1 Rule Table for Fuzzy Position Controller
signal, 𝑇𝑖 = sampling time, ∆𝑢(𝑘) = change in output signal e(t)
ce(t) NB NM NS ZE PS PM PB
The Mamdani type FLC employed in this design is modelled
after the PI controller hence, its inputs are also error, e(t) and NB NB NB NB NB NM NS ZE
change in error, ce(t) of rotor shaft position. The output of the
controller is a change in the voltage signal, ∆v(t) used to drive
NM NB NB NB NM NS ZE PS
the motor. The controller observes the pattern of the speed
loop error signal and correspondingly updates the output v(t)
so as to match the actual shaft position, θm to the reference NS NB NB NM NS ZE PS PM
shaft position command, θref. The error is the difference
between these two inputs. Fig. 2 shows the FLC and its inputs ZE NB NM NS ZE PS PM PB
and output signals.
θref e(t)
PS NM NS ZE PS PM PB PB
V(t)
FLC
d/dt PM NS ZE PS PM PB PB PB
θm
Incremental Encoder PB ZE PS PM PB PB PB PB
Fig. 2 Inputs and Output Signals of the Fuzzy Logic Table 1 shows the corresponding rule table for the fuzzy logic
Controller position controller. The top row and left column of the matrix
indicate the fuzzy sets of the variables e(t) and ce(t)
Authorized licensed use limited to: Carleton University. Downloaded on July 11,2020 at 17:00:22 UTC from IEEE Xplore. Restrictions apply.
respectively and the membership function of the body of the Table 2 HSM Parameter Specifications Used for the
matrix represents the output variable, ∆v. There are 7 x 7 = 49 Simulation
possible rules in the matrix, where a typical rule reads as: If Parameter Value
e(t) is PB and ce(t) is NM then ∆v is PS and so on. Phase Winding Resistance (Ohm) 0.55
Phase Winding Inductance (H) 0.0015
C. Hardware and Software Motor Torque Constant (Nm/A) 0.19
Full Step Size (Deg) 1.8
Rotor Inertia (Kgm2) 4.5e-05
Hardware of the system includes the DC 1103 PPC control
Rotor Damping Constant (Nm/(rad/s) 1.0e-02
board (Fig. 3), bipolar transistor bridge HSM driver circuit
(Fig. 4), regulated power supply unit giving a constant DC Initial Rotor Speed (rpm) 0.00
output voltage of 5 V (Fig. 5), EP8 optical incremental Initial Rotor Angle (Deg) 0.00
encoder (Fig. 6) and HSM. The specifications of the HSM
used in the simulations are given in Table 2. The control card D. System Flowchart
is connected to a computer via a bus interface. The control
system can be manipulated and monitored using this
computer. The fuzzy logic toolbox of Matlab/ Simulink The flowchart for the design of the Mamdani type FLC is
presented in Fig. 7.
software was employed in designing and simulating the FLC.
Start
COM
C1
220/12
1000µF
VAC
T1 IN4007 IN4007
Design Output Fuzzy Sets
D1 D2
220V AC
Supply
IN4007 IN4007
D4 D3
Tune the Rules and Membership
Functions
Design
Satisfactory?
No
Yes
Fig. 6 EP8 Optical Incremental Encoder
Stop
Authorized licensed use limited to: Carleton University. Downloaded on July 11,2020 at 17:00:22 UTC from IEEE Xplore. Restrictions apply.
III. DESIGN OF THE FUZZY LOGIC CONTROLLER
USING MATLAB FUZZY LOGIC TOOLS BOX
There are five primary GUI tools for building, editing, and
observing fuzzy inference systems in the fuzzy logic toolbox:
the Fuzzy Inference System Editor (FISE), the Membership
Function Editor (MFE), the Rule Editor (RE), the Rule Viewer
(RV), and the Surface Viewer (SV). These GUIs are
dynamically linked, such that changes made to the FISE when
using one of them, affects any of the other open GUIs [15].
(a)
A. Fuzzy Inference System Editor
The FISE was used to specify the Mamdani FIS and also input
the number and names of the input linguistic variables: rotor
position error, e(t) and change in error, ce(t) and the output
linguistic variable: change in voltage, ∆v(t). It was also used
to specify the And-Method (A-M), Or-Method (O-M),
Implication Method (IM), Aggregation Method (AM) and the
Defuzzification Method (DM) as shown in Table 3. The FIS
Editor for the FLC design is shown in Fig. 8.
(b)
Table 3: Fuzzification and Defuzzification Methods of
Fuzzy Logic Controller Design
Method Type
And Min
Or Max
Implication Min
Aggregation Max
Defuzzification Centroid
(c)
This tool was used to specify the shapes and range of all the
membership functions associated with each linguistic variable.
Fig. 9 shows the MFE depicting the membership function of
Fig. 10 Implementation of Rule Editor in Matlab Fuzzy
each variable.
Logic Toolbox
Authorized licensed use limited to: Carleton University. Downloaded on July 11,2020 at 17:00:22 UTC from IEEE Xplore. Restrictions apply.
C. Rule Editor of the Fuzzy Logic Controller A. Results of Fuzzy Logic Toolbox
The RE was used for editing the list of rules of the fuzzy rule The results of the FLC design in the Matlab fuzzy logic
base that define the behaviour of the HSM. The rules entered toolbox are presented in the rule viewer (Fig. 13; Fig. 14) and
in the RE are based on the rules of Table 1. The RE is shown the surface viewer (Fig. 15).
in Fig.10.
Rule Viewer: The rule viewer shows the behaviour of the FLC
and allows for the interpretation of the entire fuzzy inference
IV. SIMULATION OF HYBRID STEPPER MOTOR process. It shows how the voltage signal, ∆v(t) changes with
CONTROL CIRCUITRY USING SIMULINK different values of error, e(t) and change in error, ce(t) of rotor
shaft position input vector specified within range. The rule
The FLC block in the Simulink model is used to modify the viewer is shown in Fig. 13. The rule viewers showing the
HSM position controller. The FLC block is given a two outputs corresponding to the extreme linguistic variables
dimension input vector of error, e(t) and change in error, ce(t) Positive Big (PB) and Negative Big (NB) for different input
with saturation blocks to limit the peaks of these input signals vectors for both input variables: error, e(t) and change in error,
and it gives a one-dimensional output vector of the control ce(t) are presented in Fig. 14. These rule viewers depict how
signal as shown in Fig. 11. Fig. 12 gives the simulation model variations in input variables of the FLC change the output
of system in Simulink. variable.
Authorized licensed use limited to: Carleton University. Downloaded on July 11,2020 at 17:00:22 UTC from IEEE Xplore. Restrictions apply.
(c) e(t), ce(t) = (NB, NB)
VI. CONCLUSION
An FLC has been employed for the position control of an
HSM. Matlab fuzzy logic toolbox was employed for the FLC
design. The designed FLC was used successfully to design a
position controller for an HSM simulated in Simulink. The
dynamic position response for HSM model simulation with
FLC and without FLC were compared. Simulation results
Fig. 16 Rotor Angle versus Response Time without Fuzzy indicated that the model with FLC present better
Logic Controller characteristics in terms of overshoot and undershoot but
Authorized licensed use limited to: Carleton University. Downloaded on July 11,2020 at 17:00:22 UTC from IEEE Xplore. Restrictions apply.
settling time and rise time for the response with FLC were controller. International Journal of Computer and
higher as compared to the circuit without FLC. The design Network Security 1(3): 77 - 81.
should be considered for the control of hybrid stepper motors.
[11] Bindu, V., Unnikrisnan, A. and Gopika-Kumari, R.
2012. Adaptive Fuzzy Logic Position Control of a
REFERENCES Stepper Motor with Extended Kalman Filter.
[1] Jingzhou, S., Diangou, X., Liang, T. and Zonpei, W. International Conference on Power, Signals, Control
2000. Hybrid Stepping Motor Fuzzy Speed Servo and Computation , Kochi, India, 1-6.
System Based on DSP. (IPEMC 2000), 3rd International
Conference Proceedings on Power Electronics and [12] Karadeniz, A. V., Alkayyali, M. and Szemes P.T.
Motion Control, Beijing, China, 838 – 842 2018. Modelling and Simulation of Stepper Motor for
Position Control Using LabVIEW. Recent Innovations
[2] Ahmad, K. 2011. Fuzzy Logic Control and Fuzzy Logic in Mechatronics, Vol. 5, No. 1, 5pp. DOI:
Systems. Unpublished MSc Lecture Notes, University of 10.17667/riim.2018.1/7.
Dublin, Trinity College, Dublin, 54pp.
[13] Elkasasy, M. S. M. and Gad, H. H. 2008. A New
[3] Ross, T. J. 2004. Fuzzy Logic with Engineering Technique for Controlling Hybrid Stepper Motor
Applications, 2nd Edition, John Wiley and Sons Ltd, through Modified PID Controller. International Journal
West Sussex. of Electrical and Computer Sciences 10(2): 29 - 39.
[4] Morar, A. 2014. The Modelling and Simulation of [14] Stolte, J. 2006. Understanding Instability in Hybrid
Bipolar Hybrid Stepping Motor by Matlab/Simulink. 8 th Stepper Motors. Published MSc Thesis, Eindhoven
International Conference Interdisciplinarity in University of Technology, Eindhoven.
Engineering, Tirgu – Mures, Romania, in Procedia
Technology 19 (2015) 576 – 583. [15] Anon. 2012. Fuzzy Logic Toolbox for Use with
MATLAB. 12th ed., Mathworks Inc., Natick,
Massachusetts, USA.
[5] Samovhvalov, D., Stoliarov, S. and Kekkonen, A. 2015.
The Hybrid Stepper Motor: Modeling in Simulink.
Proceedings of the 2015 North West IEEE Russia Section
Young Researchers in Electrical and Electronic
Engineering Conference, St. Petersburg, Russia, 282 –
285.
Authorized licensed use limited to: Carleton University. Downloaded on July 11,2020 at 17:00:22 UTC from IEEE Xplore. Restrictions apply.