0% found this document useful (0 votes)
32 views

DC Motor Control Using Fuzzy Logic Contr

The document summarizes a study that uses a fuzzy logic controller to control the speed and position of two DC motors to trace desired paths with a five bar planar mechanism. A fuzzy logic controller is proposed to control the DC motors instead of a PID controller to avoid issues like mechanical locking. The system consists of a microcontroller, DC motor driver circuit, two DC motors connected to a five bar mechanism. The fuzzy logic controller determines the motor speeds based on the desired coordinates to smoothly trace paths with accuracy of ±2.5% while avoiding locking conditions.

Uploaded by

NH Nghĩa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

DC Motor Control Using Fuzzy Logic Contr

The document summarizes a study that uses a fuzzy logic controller to control the speed and position of two DC motors to trace desired paths with a five bar planar mechanism. A fuzzy logic controller is proposed to control the DC motors instead of a PID controller to avoid issues like mechanical locking. The system consists of a microcontroller, DC motor driver circuit, two DC motors connected to a five bar mechanism. The fuzzy logic controller determines the motor speeds based on the desired coordinates to smoothly trace paths with accuracy of ±2.5% while avoiding locking conditions.

Uploaded by

NH Nghĩa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

International Journal of Latest Technology in Engineering, Management & Applied Science (IJLTEMAS)

Volume V, Issue IX, September 2016 | ISSN 2278-2540

DC Motor Control using Fuzzy Logic Controller for


Input to Five Bar Planar Mechanism
Aditi A. Abhyankar#1, S. M. Chaudhari*2
#
Department of Electrical Engineering, AISSMS’s Institute of Information Technology,
Kennedy Road, Pune , Maharashtra, India 411001
* Professor, Department of Electrical Engineering, AISSMS’s Institute of Information Technology,
Kennedy Road, Pune , Maharashtra, India 411001

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

T he use of DC motor is very popular in Robotics,


Automation, Industrial Drives systems, Material Handling
etc. In these entire systems closed loop control of motor is
required. The advantages to use DC motors in such systems
are constant speed torque (Liner) characteristics, accurate and
high control of torque, better dynamic response, high speed
and simple control methods. There are many traditional
methods are available to control position and speed of DC
motor. In this project new control method of Fuzzy Logic
Controller is designed for speed and position control of DC
motor. Where DC motors will act as a drive for application of Fig. 2.1: FBPM
Five Bar Planar Mechanism. In the proposed system two DC The Prototype of Five bar planer mechanism is shown in
motors are used as input to the first two links of Five Bar above Fig.2.1 FBPM has second DOF. One link is always
Planar Mechanism. The Five Bar Mechanism is basically used fixed which is link 1-3 in above fig. When the input link
for required curve (path) tracing. The required cure can be connected to it, is set to a predefined position, it is not

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

B. Block diagram of system


The block diagram gives a brief idea about the working of Reverse the directions
whole system. The two DC motors have operating voltage of of both the motors.
24 volts. On the each shaft of the two motors link 1 and link 2
of mechanism is attached respectively. The Arduino UNO
(AT-mega 328) controller used for driving two DC motors
based on Fuzzy Rule-base. Arduino has output voltage level 5 Check w hether
Yes mechanism is having locking
volts and the operating voltage of DC motors are 24 volts each.
co-ordinates
Arduino cannot provide that much voltage to drive the motor or not by formula
therefore there is need of the Driver Circuit which is L298n r1 + b + r 2 < L 1 + L 2
duel dc motor driver.
NO
Arduino AT-mega
328 Initialise the motor
(Microcontroller) parameters w ith the
homepositions, initial
direction and initial speed

Driver Circuit Input the set of co-ordinates


Motor 1 Motor 2
L298 and , d for respective
co-ordinates

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.

Step 1 Defining Linguistic variables


1. Theta θ (Angle to be reached)
2. Difference between theta dθ (Difference between
Theta and Current angle)
3. Speed S (Output)

Fig. 3.1: Simulation using Existing 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]

Fig. 3.3: Selection of Linguistic inputs and outputs in MATLAB

Step 2
TABLE I
LINGUISTIC VARIABLE THETA θ

Linguistic variable Theta θ


Linguistic Value Notion Numerical Range
Small S [0 15 30]
Medium M [30 55 80]
Large L [80 110 140]
Huge H [140 160 180]

Step 3
TABLE II
RANGES LINGUISTIC VARIABLE dθ
Fig. 3.5: Ranges for variable S in MATLAB

Linguistic variable Difference between Theta, dθ (Actual angle –Current Step 5


angle)
Linguistic Value Notion Numerical Range
Inputs are two which are Theta θ and Difference between
Small S [0 0.125 0.25] Theta θ Linguistic values are four which are small Medium,
Medium M [0.25 0.375 0.5] Large and Huge.
Large L [0.5 0.625 0.75] The formula for calculating the no. of rules is as follows
Huge H [0.747 0.872 0.997]

TABLE IV
FUZZY RULE-BASE TABLE

Difference between Theta θ (Actual angle –Current angle)

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

The change in the direction is not considered as output for


Fuzzy system. Rules in matlab from above table 5.10

b)
Fig. 4.1 Complete Hardware Setup

B. Testing of Five Bar Mechanism for given curves tracing:


Five bar mechanism can trace ‗n‘ no. of paths or
Fig. 3.6: Constructing Fuzzy Rules in MATLAB coordinates. In this scope for testing purpose three sets of co-
ordinates with unlocking mechanism and one set with locking
condition. For testing purpose coordinates to be traced are
taken from existing simulation software mentioned in section
III Simulation.
Testing procedure for set 1 co-ordinate tracing is given in
following section.
1) The X-Y Co-ordinates with respect to desired Curve are
taken as inputs to the system.
2) The system is set to home position which has X-Y
coordinates as X= 66 and Y = 150, angular position θ 1 =
900 and θ2 = 900, speeds are zero for both motor.
3) The Fuzzy system decides speed of two motors to trace
desired co-ordinates.
4) The co-ordinates traced during travel are tabulated in
table 6.3.
TABLE V
INPUT CO-ORDINATES OF SET - 1
Fig. 3.7: Rule Viewer in MATLAB Set 1
X Y Theta1 Theta2 Dth1 Dth2 Dir1 Dir2
IV. TESTING 66 150 90 90 -70 0 -1 1
A. Hardware Setup: 43 142 20 90 55 -55 1 -1
90 138 75 35 -25 -35 -1 -1
102 132 50 0 80 40 1 1
76 111 130 40 50 20 1 1
53 92 180 60 -90 30 -1 1
66 150 90 90

5) The results are compared with the results obtained in


software.
6) The system tested for desired curve with respect to 5
co-ordinates in table 6.3. The co-ordinates traced by
a) system are illustrated in fig 4.3 to 4.7.

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

Following figures show the hardware results achieved same as


the software results.

Fig. 4.6: Position 4 of set 1 of the two motors

Fig. 4.8: Comparison of Simulation with Actual Curve

Similarly for set two and set three of co-ordinates the


above procedure is repeated. Only when locking of
mechanism will occur, procedure will be different. First of all
the locking condition of mechanism should be studied.
Following fig shows example of locking conditions and how
the mechanism will get locked.

Fig. 4.7: Position 5 of set 1 of the two motors


a) Locking condition 1

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

5. 55 138 56 139 1.41


6. 66 150 66 151 1.0
Set 3 Co-ordinates : Dimensional locking : Safe
1. 54 163 54 163 0
2. 82 109 83 111 2.23
3. 67 120 69 121 2.23
4. 94 135 96 137 2.82
5. 54 163 53 162 1.41
Set 4 Co-ordinates : Dimensional locking : Locked
1. 54 163 54 163 0
2. 82 109 83 111 2.23
3. 88 88 - - -
4. 37 146 - - -
b) Locking condition 2 5. 40 123 - - -
6. 54 163 - - -

Observe that in set 4, when the locking mechanism is


connected, the first reading is correct but for the next point
given, the point is not reachable/ the mechanism goes through
the locking step. As the fuzzy logic avoids the locking by
stopping the motor and reversing the direction, the next points
cannot be reached. The basic purpose of the fuzzy logic is also
to avoid the damage to the mechanism. The locking may
occur due to dimensional limitations or the construction
limitations as the screws connected, may result in locking.
The particular point set is chosen to indicate the locking
c) Locking condition 3 during the traversal. If the points are given without the locking
the mechanism performs correctly. The motors can stop after
Fig. 4.9: Locking conditions of mechanism
locking but, in the code we have implementing the recovery
from locking,
At locking conditions the speed rules will remain the same
but as the locking angles are known namely the range –LTH1
to + LTH1 for theta 1 and –LTH 2 to + LTH 2 for theta 2 the
fuzzy logic gives 0 speed to the first length which reaches the
locking range the second link will continue to pass the locking
range and then link 1 continues the movement. The locking
range indicates that simultaneously theta 1 and theta 2 cannot
be in locking range.

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

You might also like