DC Motor Control Using Fuzzy Logic Contr
DC Motor Control Using Fuzzy Logic Contr
Abstract—DC motor speed and position control finds various traced by controlling speed and position of DC motor
applications in Robotics, Material handling, Industrial drives accurately.
and Automation. In this paper, a control of Five Bar Mechanism
Motion is obtained by DC motor position and speed control using The Most popular and conventional method of close loop
Fuzzy rule-based system. The Five Bar Mechanism has second control is PID controller. PID controller is useful for both,
degree of freedom. The second degree of freedom is very difficult speed and position control of system. PID controller needs
to handle as for the deterministic positions there can be multiple proper tuning of controller parameters for accurate control.
orientations. By providing the restriction of the input links and PID controller cannot work properly when dynamic
controlling the positions of the input links the degree of freedom conditions like Maximum Overshoot, Response action time.
is reduced to one. Mechanically such a restriction is possible
through the use of gears which have the limitation due to gear
In case of Five Bar Mechanism real time conditions like
ratio. With rule based system it is possible to achieve desired mechanical locking, occurrence of unknown dynamics as
orientation of path by controlling speeds of the two DC motors. friction may cause damage to the proposed system. Due to
Using DC motors instead of gears one can achieve various these drawbacks of PID controller, the design and
deterministic orientations of mechanism. The dimensions of the implementation of new controller is discussed in this project
mechanism may introduce the locking conditions. The locking for application of Five Bar Planar. The Fuzzy Logic
condition means the two input links have the restriction of Controller will be useful in real operating conditions
position with respect to other. The rule base system also detects mentioned above. Most importantly it will avoid mechanical
the locking position and resets the system. The system is locking of mechanism for particular curves of Mechanism by
simulated using Software developed for Five Bar Planar
Mechanism. The coordinates for the motion path or locus are
controlling speed and position of DC motors.
obtained through the software. The fuzzy rule based system
II. PROPOSED SYSTEM
controls the motion of motor, such that the desired coordinates
are travelled using a smooth curve. The five bar mechanism can A. Five bar planar mechanism (FBPM)
trace the desired path with an accuracy of ±2.5%.
Keywords — DC Motor control, FBPM, PID, FLC.
I. INTRODUCTION
www.ijltemas.in Page 42
International Journal of Latest Technology in Engineering, Management & Applied Science (IJLTEMAS)
Volume V, Issue IX, September 2016 | ISSN 2278-2540
possible to deterministically find the positions of other three input pin. The driver circuit has two output channels where
links. Where as in four-bar mechanism there is a unique the two motors are connected. Input voltage i.e. 24V for the
position of remaining two links. Hence it is the most DC motor is given to the input pin of driver circuit. Driver
popularly used mechanism. The mechanism has wide number circuit needs 5V logic supply for itself which will be given by
of applications in the field of Material handling, Robotics and external 5V supply. The Five Bar Mechanism will be mounted
applications where coupler curve is very important. The five on the two motors. The feedback pins i.e. encoder output of
bar mechanism with rotation constraint reduces the DOF to position and speed is again connected back to the Arduino
one. The mechanism uses two input links connected to the controller‘s digital pins. Those pins will read actual position
fixed link. These input links have initial positional relation and speed of motor. At last stage DC motor drive mechanism
among themselves mentioned as θ2 = f (θ1). Further there is a with such speed and positions that it will trace desired curve at
relation in the speeds of input links as ω2 = g (ω1). Thus the locking and unlocking conditions.
constraints are specified in terms of angular positions and
angular velocity Start
24V DC
Supply Set speed of M 1 and M 2 by
Rule-based system
Five bar
mechanism 6
5
Continue tracing of co-
2 4 ordinates.
1 3
Check w hether
Fig. 2.2: Block diagram of proposed system. Yes home
positions are reached
C. Functional Flowchart or not?
The input coordinates of the curve will be given as input to
the Arduino program. The Arduino program will select the NO
required speed and positions of the two motors based on Stop
Fuzzy Rule-base. Arduino and the motors are interfaced using
the driver circuit. The output from the arduino is given to the
Fig. 2.3: Functional Flowchart of proposed system.
driver circuit speed pin i.e. encoder pin and direction pin i.e.
www.ijltemas.in Page 43
International Journal of Latest Technology in Engineering, Management & Applied Science (IJLTEMAS)
Volume V, Issue IX, September 2016 | ISSN 2278-2540
III. SIMULATION
The existing software for Five Bar Mechanism developed
in C++ and CG is very useful for this scope. The Software can
give the different curves or path drawn by Five Bar
Mechanism with set home positions. Therefore with the help
of this software the co-ordinates of desired can be calculated
very easily just by simulating the Five Bar Mechanism.
Simulation software helps also for constructing the Fuzzy
Rule Base Table. The collection of data can be done which
will be used as different inputs for Fuzzy Set operations.
Based on these data collection and using proper Fuzzy
Inference the Fuzzy Rules can be formed. Next step will be to
calculate input Speeds, Positions and Directions for desired
curve using Fuzzy Rule Base table. The system is simulated in
both C++ and CG as well as in MATLAB. First part will
describe study of existing software used and some changes
done according to DC motor position and speed control,
second part will describe formulation of fuzzy rule-base
system for speed and position control of motor using
MATLAB. Fig. 3.2: Parametric values for motors given by Software for required co-
ordinate tracing.
A. Simulation using existing software
Above figures shows an example of two co-ordinates from
The Simulation for two DC motors as input to the Five the set of curve, and required direction, speed, and angular
Bar Mechanism is done using C++ and CG. In the simulation position for reaching that co-ordinate.
the Graphical User Interface (GUI) is designed. In this Project
scope first using Simulation of Five Bar Mechanism the B. Simulation using MATLAB for Fuzzy Expert system.
desired curves and co-ordinates on those curves are finalized. The coordinates, to be traced, are translated into the
The desired curves and co-ordinates are finalized for both, positions of the input links. The scope of the project work is
Locking and Unlocking conditions. The simulation software related to the position and speed control of the input links.
has provision of setting the different directions, speeds and From current angular positions of the input links to the next
angular positions of motors to trace different co-ordinates. angular positions, the motors should be rotated. It is necessary
that the motors reach the angular destinations in the same
amount of time. This requires the speed control of the motor
during this traversal. Thus the fuzzy system will take the
current position and the next position as the input. But instead
of increasing the input parameters, we input the next change
in the angles of the input links. Development of Fuzzy system
requires defining linguistic variables and specifying problem
statement so that a controller can be designed. Mamdani
controller is used in this scope.
Steps for designing Mamdani Controller using
MATLAB software.
www.ijltemas.in Page 44
International Journal of Latest Technology in Engineering, Management & Applied Science (IJLTEMAS)
Volume V, Issue IX, September 2016 | ISSN 2278-2540
Step 4
TABLE III
RANGES LINGUISTIC VARIABLE S
Linguistic variable Speed S
Linguistic Value Notion Numerical Range
Small S [40 50 60]
Medium M [60 70 80]
Large L [80 90 100]
Step 2
TABLE I
LINGUISTIC VARIABLE THETA θ
Step 3
TABLE II
RANGES LINGUISTIC VARIABLE dθ
Fig. 3.5: Ranges for variable S in MATLAB
TABLE IV
FUZZY RULE-BASE TABLE
Speed(Output) S M L H
S S - - -
Theta θ M S S - -
L S M M
H S M H H
As observed in the table IV,there are 6 positions which
can not be reached and hence show -.The reason behind this is
we perform the direction change based on the next angular
position so that the difference always remains less than 180
degrees. 180 degrees in clockwise and anticlockwise direction
Fig. 3.4: Ranges for variable dθ in MATLAB allow us to cover all the angular positions of the input links.
www.ijltemas.in Page 45
International Journal of Latest Technology in Engineering, Management & Applied Science (IJLTEMAS)
Volume V, Issue IX, September 2016 | ISSN 2278-2540
b)
Fig. 4.1 Complete Hardware Setup
www.ijltemas.in Page 46
International Journal of Latest Technology in Engineering, Management & Applied Science (IJLTEMAS)
Volume V, Issue IX, September 2016 | ISSN 2278-2540
Fig. 4.2: Home positions of set 1 of the two motors Fig. 4.4: Position 2 of set 1 of the two motors
Fig. 4.3: Position 1 of set 1 of the two motors Fig. 4.5: Position 3 of set 1 of the two motors
www.ijltemas.in Page 47
International Journal of Latest Technology in Engineering, Management & Applied Science (IJLTEMAS)
Volume V, Issue IX, September 2016 | ISSN 2278-2540
www.ijltemas.in Page 48
International Journal of Latest Technology in Engineering, Management & Applied Science (IJLTEMAS)
Volume V, Issue IX, September 2016 | ISSN 2278-2540
V. RESULTS
Fig. 5.1: Error Band
TABLE VI
OBSERVATIONS OF 4 SETS VI. CONCLUSION
Sr. Input Output A five bar mechanism control system, using DC motor,
No. % Error controlled by Fuzzy Logic Controller is design and fabricated
X Y X Y in this project. The DC motor‘s speed is controlled using
Set 1 Co-ordinates : No dimensional locking fuzzy logic for reaching the desired positions of mechanism.
1. 66 150 66 150 0 The Fuzzy logic is selected because it needs minimum speed
2. 43 142 40 141 3.16 changes to achieve desired co-ordinate position without
3. 90 138 91 140 2.23 overshoot i.e. retracing of the path. PID controller cannot
4. 102 132 103 130 2.23
avoid oscillations and response time is more than Fuzzy Logic
5. 76 111 77 110 1.41
6. 53 92 54 92 1.0 Controller. In fuzzy we can define the rules to avoid particular
7. 66 150 66 151 1.0 angular positions in combination but in PID it will be a
Set 2 Co-ordinates : No dimensional locking difficult task because in critical situation the overshoot will
lock the system. The Fuzzy logic controller used will avoid
1. 66 150 66 150 0
locking of mechanism and will trace the desired co-ordinates.
2. 76 148 77 147 1.41
3. 93 120 94 122 2.23 The simulation for tracing desired coordinates is done the
4. 40 133 41 134 1.41
software. Hardware is simulated and tested for set of co-
www.ijltemas.in Page 49
International Journal of Latest Technology in Engineering, Management & Applied Science (IJLTEMAS)
Volume V, Issue IX, September 2016 | ISSN 2278-2540
ordinates of locking and unlocking positions. It is observed [3] G. Sudha, Dr. R Anita, ―Performance Based Comparison Between
Various Z-N Tuninng PID And Fuzzy Logic PID Controller In
that system traces path with an accuracy of ±2.5% but largely Position Control System Of Dc Motor‖ International Journal on Soft
dependent on the mechanical system as the play in the links Computing (IJSC) Vol.3, No.3, August 2012.
will increase the error. System will trace the path successfully [4] Her-Terng Yau1, Po-Hsien Yu and Yuan-Hung Su, ―Design and
implementation of Optimal Fuzzy-PID Controller for Dc servo motor‖,
avoiding locking conditions.
Appl. Math. Inf. Sci. 8, No. 1L, 231-237 (2014) 231.
[5] A.K. Abhyankar, S.Y. Gajjal, ― Simulation Model for Coupler Curve
REFERENCES Generation using Five Bar Planar Mechanism With Rotation
constraint‖, IJLTEMAS (ISSN 2278-2540) Volume IV, Issue III ,
[1] R.Manikandan R.Arulmozhiyal, ―Position Control of DC Servo Drive March 2015, pp 88-92.
Using Fuzzy Logic Controller‖ [6] A.K. Abhyankar, S.Y. Gajjal, ― Software Modelling of Coupler Curve
[2] Munadi, M. Amirullah Akbar ―Simulation of Fuzzy Logic Control for Generation using Five Bar Constrained Mechanism‖, International
DC Servo Motor using Arduino based on Matlab/Simulink‖, 2014 Journal of Mechanical Engineering and Information Technology
International Conference on Intelligent Autonomous Agents, Networks IJMEIT (ISSN 2348-196x) Volume III, Issue IV , April 2015, pp 1097-
and Systems Bandung, Indonesia, August 19-21, 2014. 1106.
www.ijltemas.in Page 50