 Open Access
 Total Downloads : 82
 Authors : Vo Quang Truong
 Paper ID : IJERTV6IS050615
 Volume & Issue : Volume 06, Issue 05 (May 2017)
 Published (First Online): 01062017
 ISSN (Online) : 22780181
 Publisher Name : IJERT
 License: This work is licensed under a Creative Commons Attribution 4.0 International License
Designing and Fabricating Fuzzy Controller of DC Servo Motor with HMI
Vo Quang Truong
Department of Mechanical Engineering, Danang College of Technology,
The University of Danang, Vietnam
Abstract In this paper, the design and fabrication of fuzzy controller to DC servo motor for education is investigated. This equipment provides the basic experiment device for elementary control and automation courses in electronic and computer engineering, mechanical engineering. Student can understand the basic principles of Fuzzy control and its influence on system performance, master the method to adjust the speed controller parameters of the DC servo motor and comprehend the influence of disturbing torque on speed control performance, so as to learn the practical skills of the motion control. In addition, this equipment allows users to integrate the selfdeveloped controller or third party controllers flexibly.
Keywords Fuzzy logic, fuzzy controller, DC motor, servo motor.

INTRODUCTION
Nowaday, DC motor is widely used in industrial application, defense, robotics, home appliances etc. Therefore, speed and position control of motor is very important and required. The nonlinear characteristic of DC motor could degrade the performance of the conventional controller. To reduce these effects, many advanced model control methods have been proposed by scientists such as analog PID controllers, digital PID controller [1], optimal controller [2], LQG… However, the performance of these methods depends on the accuracy of model and parameter of DC motor. Generally, it is difficult to find and accurate nonlinear model and indentify all parameters. The Fuzzy logic control (FLC) able to cope with system uncertainties.
The field of Fuzzy logic control has been making rapid progress in recent years. It is one of the most successful application of Fuzzy set theory introduced by L.A.Zadel [3] and applied in an attempt to control the systems that are difficult to model. Just as fuzzy logic can be described simply as computing with words rather than numbers; FLC can be described simply as control with sentences rather than

DC MOTOR MODEL
DC motor directly provides rotary motion and, coupled with wheels or drums and cables, can provide translational motion. The electric equivalent circuit of the armature and the freebody diagram of the rotor are shown in the figure 1
We will assume that the magnetic field is constant and, therefore, that the motor will generate a torque proportional to only the armature current Ia (input curent) by a constant factor KT as shown in the equation below
Tg = KT.Ia (1)
Where KT is the torque constant.
The back emf, Eg, is determined by the angular velocity of the shaft with a constant factor KE
Eg = KE. (2)
Where is angular velocity of the shaft.
KE is the voltage constant
Figure 1. Equivalent circuit of DC motor
Apply Newton's 2nd law and Kirchhoff's voltage law to derive the following governing equations based on
dI
equations. FLC can include empirical rules, especially useful in operator controlled plants. Tuning FLC may seem at first to be a daunting task. There are many parameters that can be adjusted. These include the rules, membership functions and
V = Eg + R.Ia + La. a
dt
V= KE . + R.Ia + La. dIa
dt
(3)
(4)
any other gains within the control system.[4].
This paper present speed control system simulation blocks, especially that related with a separately excited D.C
Because La is very small so we ignore this component, the equation (3) and (4) become:
V R.Ia = KE . (5)
motor considerations, which can be applied as a experiental model for training in department of Mechatronic at Universities.
V R.Ia
KE
(6)
Equation of load torque Tm:
T (J J ). d D. T T
m m L dt f L
Where
(7)

DESIGN CONTROLLER
The fuzzy controller is designed for training and research of students specialized in mechatronics and automation so the model has the following functions:
Jm : Motor moment of inertia.
JL : Load moment of inertia converted on a motor shaft D : Motor damping coefficient
Tf: Motor friction torque
TL: Load friction torque converted on a motor shaft From torque equation
Tm = Tg = KTIa (8)
Assume J = Jm + JL, Tf + TL = 0 , D = 0.
Apply Laplace transform:
Measure and test motor speed: this module is used for motor model identification. Most of our students often use the second hand servo motors, which they difficult find all specification of motor to build mathematical models for control. At that time, students need to conduct model identification. With this function, students can test the performance, measure the speed of any servo motor that satisfies some of the controller specifications (operating voltage and maximum current). Based on the measured
V (s) 1 s.J.(s.L
R).(s) K .(s)
(9)
results, students can identify the model quite accurately. This
KT
G(s) (s)
V (s)
a E
KT
s.J.(s.La R) KE .KT
(10)
function is very useful in model identification. Especially in trajectory control in robot application, syncronize velocity of motor. This module will assist students participating in the robotic competition at Danang College of Technology.
According to DC motor datasheet
equation (10) expressed
R2 J [5],
L K K
a
E T
Simulation of Fuzzy logic control: the theory of fuzzy control is often difficult to explain to undergrade students. So
Gm(s) (s)
1/ KE
L
(11)
this function has bult to help them deeply understand theory
of FLC. It can simulate how the fuzzy controller work and
Set
Tm
V (s) (s.
R.J KE .KT
R.J KE .KT
1)(s.
a 1)
R
(12)
students can understand how the fuzzy controller change the output signal when the input signal changed.
Because this function serves to explain in lectures, the program only builds SISO (Single Input Single Output).
Hardware experiment modul: this is a complete test with full functionality such as fuzzification, fuzzy rule base,
Tm is the mechanical time constant – second defuzzification of the fuzzy controller and connected to the
T La e R
Te is the electrical time constant – second
(13)
actual devices. On the Human Machine Interface, students can set the parameters of the fuzzy controller to monitor the change of motor speed as well as time response.
Gm(s) (s)
1/ KE
(14)
MCU
Driver
V (s) (s.Tm 1)(s.Te 1)
If Tm >> Te transfer function expressed
PIC 18f4331
Gm(s) (s)
1/ KE
V (s) (s.Tm 1)
DC motor is selected in this research: DC SERVOMOTOR ENCODER TS1982 by manufacturer TAMAGAWA SEIKI [5]
Winding no
E6
Torque constant (KT)
5.7 102 N.m/A
Voltage constant (KE)
6.0 103 V/(min1)
Amature resistance (Ra)
1.1
Amature inductance (La)
0.9 mH
Rated output power
60 W
Rated voltage (Vo)
25V
Rated current (Io)
3.9 A
Rated speed (No)
/td>
3000 min1
Rated torque (To)
0.191 Nm
Momen of inertial (JM)
0.157×104 kg.m2
Mechanical time constant (Tm)
5.3 m sec
Electrical time constant (Te)
0.82 m.sec
Thermal resistance (Rth)
2.3oC/W
Friction torque (Tf)
1.7×102 N.m
Mass
0.65 kg
TABLE 1: SPECIFICATION OF DC MOTOR TS1982
HMI
DC Servo
Figure 2. Block diagram of the Fuzzy controller

MICROCONTROLLER
This module is main controller, it will receive signal from computer via serial port (RS232) to control the speed of motor by change the PWM value. Encorder equipped on the DC motor will send signal to this microcontroller and count number of pulse. The speed of motor continuous update and transmit to computer to graph on the HMI.
Curently, many PIC microcontroller series are commercialized and they have different functions for specific applications. PIC18f4x31 is among the microcontroller refer
12v
2
2
3
Q29 C2383
1 1
R65
LS7
8
D44 4007
to DC motor control, it is widely used in industrial
D63 1N4007
330_1W
Q28
2
Q26
2
D48
7
24V 2
4
RLA1
J12
3
application. Therefore, we select this microcontroller PIC
MT12
1 2 6 1
1 C61 2
18f4331 for this study.
5v
J1
1
clock
5v
R63 220
1
Q27 A1013
1 1
D62
3 3
2 1
4
5v
D61 DIODE
3
5
5v
2 1
3 4
12VC 12v
104
DC1
SW0
R0
10k
2 data D59
3
DC1
D43
ISO14
4
Vdd 5v
RS
D38
ISO13
RELAY 1 RL1
RST
Vpp
5 Vpp
DIODE
PWM1
R55
R62
Vpp
Y 1
U0 PIC18F4331

MCLR/VPP

RA0/AN0
RB7/PGD 40
RB6/PGC 39
3
data
clock
Y 2
TX1
RX1
TX2
RX2
E
GO
OK
OSC1
OSC2

RA1/AN1

RA2/AN2

RA3/AN3

RA4/AN4

RA5/AN5

RE0/AN6

RE1/AN7

RE2/AN8
14
13 OSC1/CLK
RB5/PWM4 38
RB4/PWM5 37
RB3/PWM3 36
RB2/PWM2 35
RB1/PWM1 34
RB0/PWM0 33
RD7/PWM7 30
RD6/PWM6 29
27
28
RELAY 1
PWM3
PWM2
RELAY 2
PWM1
RELAY 3
PWM4
RELAY 4
RELAY 5
Figure 5. DC motor driver circuit
C. DESIGN FUZZY LOGIC CONTROLLER
Fuzzy logic controller is shown on figure 6, this
RS
PWM6
PWM5
OSC2/CLKOUT RD5/(PWM4)
15
RD4
16
RC0/T1OSO/T1CLK
24
17 RC1/CCP2/FLTA 26
RELAY 6
INT8
controller is composed of:

Fuzzification interface
20
encoder1 18
RC2/CCP1/FLTB RC7/RX/DT 25
INT7
19
23
22
INT2 INT1
VDD
VDD
C6
RC3/SCK/SCL RD0/PSP0 RD1/SDO
RC6/TX/CK RC5/SDO RC4/SDI/SDA RD3/SCK/SCL RD2/SDI/SDA
INT6
INT5
INT4 INT3

Defuzzification interface

Rule base
21
22p OSC1
Y1

Decision making unit (inference mechanism)

DC servo motor
Fuzzy controller
11
32
+
12
GND
31
GND
C7 4M C4
22p
OSC2 220_16v
C5
Vdd 104
5v
set
e(t)
(t)
Figure 3. Diagram of microcontroller
We use serial port DB9 to transmit data between computer and microcontroller. Because there is difference voltage between computer and microcontroller so we must use IC MAX232 to adapt the logic level (figure 4)
U4
Encoder
Figure 6. Block diagram of the Fuzzy controller
13 R1IN
8 R2IN
R1OUT 12 RXD P1
R2OUT 9 5
Inputs of controller are the error e(t) between the reference (set) and actual speed () and the change in error
TXD 11 T1IN
T1OUT 14 9
C4
10u
C5
10u
10 T2IN
1 C1+
3 C1
4 C2+
5 C2
15
MAX232
T2OUT 7
16
V+ 2 VCC
GND
V 6
C6
10u
4
C7 5V 8
3
u
10
7
2
6
1
CONNECTOR DB9
0 , the output is the change in amature voltage as PWM to
control motor speed. The range of input and output signals are normalized into [1,1].
Figure 4. Serial commulnication module


DESIGN MODULE OF DRIVER
To increase stability of whole control module, we need to use opto modle for separate power between microcontroller and motor. The driver modul designed by using MetalOxide Semiconductor FieldEffect Transistor MOSFET IRF540 which able to stand up to 5A and controlled by change voltage on pin Gate. The PUSH PULL output stage circuit used for trigging.
Figure 7. Block diagram of fuzzy controller [6]
To perform fuzzy computation, the input and output must be converted from numberical or crisp value to linguistic form. The term of Small and Large are used to quantitize the inputs and outputs to linguistic value. In this paper, linguistic terms that used to represent inputs and outputs value are defined by five fuzzy variables
VS Very Small SM Small
ZR Zero LR Large
VL Very Large
And the triangular function is selected for fuzzy membership. Value of a and b in membership function can be adjusted by user.
R6: if the error e(t) = S and the change in error
then PWM = VS
R7: if the error e(t) = S and the change in error
then PWM = SM
R8: if the error e(t) = S and the change in error
thÃ¬ PWM = SM
de(t) = VS
dt
de(t) = SM
dt
de(t) = ZR
dt
R9: if the error e(t) = S and the change in error de(t) = LR
dt
then PWM = ZR
R10: if the error e(t) = S and the change in error
thÃ¬ PWM = LR
de(t) = VL
dt
R11: if the error e(t) = ZR and the change in error de(t) = VS
dt
then PWM = SM
R12: if the error e(t) = ZR and the change in error de(t) = SM
dt
Figure 8. Define membership of inputs
then PWM = SM
R13: if the error e(t) = ZR and the change in error de(t) = ZR
dt
then PWM = ZR
R14: if the error e(t) = ZR and the change in error de(t) = LR
dt
then PWM = LR
R15: if the error e(t) = ZR and the change in error de(t) = VL
dt
Figure 9. Define membership of output
then PWM = LR
R16: if the error e(t) = LR and the change in error de(t) = VS
dt
Define the fuzzy rules.
The fuzzy rules are mearly a series of ifthen statements as mentioned above. These statements are derived by an expert to achieve optimum results.
Some examples of these rules are:

If angle is zero and angular velocity is zero then speed is also zero.

If angle is zero and angular velocity is low then the speed shall be low.
R1: if the error e(t) = VS and the change in error de(t) = VS
dt
then PWM = VS
R2: if the error e(t) = VS and the change in error de(t) = SM
dt
then PWM = VS
then PWM = SM
R17: if the error e(t) = LR and the change in error de(t) = SM
dt
then PWM = ZR
R18: if the error e(t)= LR and the change in error de(t) = ZR
dt
then PWM = LR
R19: if the error e(t) = LR and the change in error de(t) = LR
dt
then PWM = LR
R20: if the error e(t) = LR and the change in error de(t) = VL
dt
then PWM = VL
R21: if the error e(t) = VL and the change in error de(t) = VS
dt
R3: if the error e(t) = VS and the change in error
then PWM = SM
R4: if the error e(t) = VS and the change in error
then PWM = SM
R5: if the error e(t) = VS and the change in error then PWM = ZR
de(t) = ZR
dt
de(t) = LR
dt
de(t) = VL
dt
then PWM = ZR
R22: if the error e(t) = VL and the change in error de(t) = SM
dt
then PWM = LR
R23: if the error e(t) =VL and the change in error de(t) = ZR
dt
then PWM = LR
R24: if the error e(t) =VL and the change in error de(t) = LR
dt
then PWM = VL
R25:if the error s e(t) =VL and the change in error
de(t) =VL then PWM = VL.
dt
Defuzzification
Here are MAX MIN type decomposition is used. In order to choose an appropriate representative value as the final output (crisp values), defuzzification must be done. There are numerous defuzzification methods, but the most common one used is the center of gravity of the set as shown below.
Z * (z).z.dz
(z).dz
(15)
Figure 10. Result of defuzzification process if speed error e(t) = 0.3.
Test the SISO module
Figure 11. HMI of speed measurement module
Figure 12. HMI of Fuzzy controller
Figure 13. Experimental modul test
Figure 14. Response of controller under disturbance by adding load


CONCLUSION
This study has demonstrated the implementation of Fuzzy Logic control for the speed control of DC motor by using microcontroller. The controller shows very good result by tracking the setting velocity under load and no load condition. The experimental modul is useful for training in Department of Mechatronic, Danang College of Technology.
REFERENCES

P. Ravi Kumar, V. Naga Babu, Position control of Servo systems using PID controller turning with soft computing optimization technique, International Journal of Engineering Research and Technology, Vol 3, Issue 11, 2014.

Tayfun Abut, Modeling and Optimal control of a DC motor, International journal of Engineering Trends and Technology, Vol 32,
No. 3, 2016

L. A. Zadeh, Fuzzy sets, Information and Control 8, Page 338 353, 1965

Pavol Fedor, Daniela Perdukova, Simple fuzzy controller structure, Acta Electrotechnica At Informatica No.4, Vol.5, 2005.

DC servomotors and DC motor Calalogue No.2, T12, Tamagawa Seiki Co., Ltd.

Website http://championed.info.