Fuzzy Logic - Manafeddin Namazov

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

2018 Global Smart Industry Conference (GloSIC)

Fuzzy Logic Control Design for 2-Link Robot


Manipulator in MATLAB/Simulink via Robotics
Toolbox
Manafaddin Namazov
Head of Process Automation Engineering Department
Baku Higher Oil School
Baku, Azerbaijan
Manafaddin.Namazov@socar.az

Abstract—In this paper, it is aimed to achieve fuzzy logic model, nonlinear, time-varying systems. One of the most
control of a simple 2-link robot manipulator via Robotics and significant strengths of fuzzy control is the ability to be
Fuzzy Logic Toolboxes of MATLAB©. The blocks from these successfully applied to complex systems such as Mamdani‘s
toolboxes were blended in the Simulink© environment in order steam engine and boiler combination [9], Kickert‘s warm
to obtain the simulations. The robot block available in the water plant [10] and Ostergaard‘s heat exchanger system
Robotics Toolbox was used to create the model by modifying [11] using experience, or control engineering knowledge
the block parameters. Next, a PD-controller was designed and without a mathematical model of the plant [12,13].
optimized, which results, in turn, acted as a guide for
generating the fuzzy rule-base of the fuzzy controller. The Modeling the robot manipulator, design and analysis of
fuzzy controller was then designed and implemented into the the fuzzy control algorithm and acquisition of the simulation
system using the Fuzzy Logic Toolbox. Finally, the fuzzy results using the strong computational tools listed above are
control system that has a satisfactory reference tracking of primary interest to this research. The main advantage of
performance was simulated for various inputs. using such computational tools is the ability to address the
issue of synthesis and analysis of such complex systems in a
Keywords—Fuzzy control, Robotics Toolbox, 2-link robot very easy and compact manner. In this paper, we first
manipulator introduce the model of the robot manipulator. Then, a PD-
controller is implemented and optimized for the desired
I. INTRODUCTİON operation regime. Next, the design procedure of a fuzzy
These days, robot manipulators are widely used in controller based on optimized PD parameters, which
manufacturing, and tuning of the controllers is an actual performs fuzzy tuning is described. This paper focuses on the
problem in the control of these systems. Classical controller design of fuzzy logic control of a simple 2-link robot
schemes require tuning for each reference and disturbance manipulator via simultaneous application of Simulink,
signals. Using the advantageous features of fuzzy controller Robotics Toolbox and Fuzzy Logic Toolbox of MATLAB.
scheme, control of plants with a wider range of reference and
disturbance signals can be handled [12,17]. II. MODEL OF THE ROBOT MANİPULATOR
There are several approaches for robot manipulator The robot manipulator is modeled so as to obtain a
control that are well defined in literature [2,3,6,7]. However, solution to the inverse dynamics problem in which the
one of these approaches, namely, computed-torque control, torques applied by the actuators is computed in order to
provides a quite satisfactory performance particularly when follow a prescribed trajectory. In other words, the goal of this
the robot arm parameters are known fairly accurately [7]. model is to determine the torque regimes required to achieve
This method was first introduced in Paul‘s 1972 report [1], given position, velocity and acceleration objectives for each
and the name was first used in Markiewicz and Bejczy link of the robot manipulator. Manipulator dynamics deals
[2,3,15]. with the equations of motion in order to obtain such a
solution [4]. In a general sense, this problem is formulated as
A fundamental problem in robot control is to accomplish follows [5]:
the task of tracking a desired trajectory with adequate
precision. In classical robot manipulator control, tuning of τ (t ) = D(q (t ))q(t ) + h(q (t ), q (t )) + c(q (t )), (1)
the controllers are achieved by ranging the controlled
variables. However, in real applications, control systems are
subject to external effects such as noise and disturbance. In where τ(t) is the torque vector, q is the vector of generalized
order to suppress the undesired effects of these inputs, the coordinates, D is the inertial matrix, h is the Coriolis and
fuzzy control algorithm, which allows for control in a wider centrifugal terms, and c is the gravitational term. The 2-link
interval of the controlled variables, is implemented. robot manipulator of interest is illustrated in Fig. 1 [5].
In contrast with the conventional methods, fuzzy control
schemes based on the Fuzzy Set Theory, proposed by Zadeh
[8], provides a more effective method for the analysis and
control of relatively complex, mathematically difficult to

978-1-5386-7386-7/18/$31.00 ©2018 IEEE


2018 Global Smart Industry Conference (GloSIC)
TABLE I. COLUMN ASSİGNMENTS FOR THE ‗DYN‘ MATRİX OF THE
TOOLBOX [4]

Symbol Description Actual values


αi Link twist angle [rad] α1 = α2 = 0
Ai Link length A1 = A2 = 1
θi Link rotation angle [rad] θ1 = θ2 = 0
Di Link offset distance D1 = D 2 = 0
σi Optional joint type; 0 for σ1 = σ2 = 0
revolute, non-zero for
prismatic
Fig. 1. 2-link robot manipulator used as the plant of the fuzzy control m Link mass m1 = m2 = 1
system [6]
III. FUZZY CONTROL DESİGN OF THE ROBOT MANİPULATOR
Equations of motion for the robot manipulator can be
calculated as follows [5]: Computed-torque control provides easy-to-understand
schemes for robot manipulator control. In general, these
schemes work well especially when the arm parameters are
1 2 4 2 2 1 2 1 2  known fairly precisely [7]. In this section, a fuzzy controller
 τ1   3 m1l + 3 m2 l + m2 C2 l 3 m2 l + 2 m2 l C2   θ1  will be designed based on computed-torque control scheme
τ   1 1 1   θ  +
 2  m2 l 2 + m2 l 2 C2 m2 l 2  2  to improve the reference tracking performance of the 2-link
 3 2 3  robot manipulator discussed above. The design will be
 1 2 2 2   
carried out in Simulink environment and will involve blocks
 − m S
2 2 l θ 2 − m S
2 2 l θ θ
1 2
+ 2 + from the Fuzzy Logic Toolbox, as well.
1 2 2
 m2 S2 l θ1 
 2  The first step to fuzzy control design is achieved by
1 1  utilizing a PD controller scheme to find the optimized
m glC
2 1 1 2 2 + m glC 12 + m 2 glC1 
+  controller gains. The optimization procedure was carried out
1
 m2 glC12  using the Signal Constraint block of Response Optimization
 2  Toolbox of MATLAB instead of the well-known
conventional methods such as Ziegler-Nichols and hand
An effective computational tool for the simulation and tuning due to their shortcomings mentioned in [12,20].
analysis of robotic control systems is the Robotics Toolbox Signal constraint block allows for graphically constraining
for MATLAB, which is introduced by Corke [4]. Among the response signal, and optimization of the model
various methods for deriving the dynamic equations of parameters that satisfy the performance requirements,
motion [refs], the Robotics Toolbox utilizes the Newton- namely, rise time, settling time, overshoot, and steady-state
Euler formulation due to its computational efficiency [18]. error [16,21,22]. Optimized parameters for our design that
The overall robotic system was modeled in satisfy given conditions were computed after six iterations as
MATLAB/Simulink via blending the blocks from both shown in Figure 2.
Simulink and Robotics Toolbox. The main components of
the model include the robot object, inverse dynamics (rne)
and the reference trajectory (jtraj) blocks. Important features
of these blocks are discussed below.
The first block is called jtraj, which provides a reference
trajectory to be followed by the robot manipulator. The
inverse dynamics (rne) block computes the torques required
to accomplish the task of following the assigned trajectory by
using recursive Newton-Euler formulation. Finally, the 2-
link robot manipulator is modeled based on
Denavit&Hartenberg (DH) Representation in the Robotics
Toolbox of MATLAB. Input to this block consists of the
torques applied by the actuators, and it outputs the
generalized coordinates and their derivatives for each Fig. 2. Optimization procedure of the PD parameters in Signal Constraint
link.Kinematics and dynamics of the manipulator are Block.
compactly represented in a single matrix (dyn) [4], which in
turn, provides the Simulink robot object with the necessary A fuzzy controller is then implemented on each robot arm,
parameters such as DH parameters and inertial parameters, which utilizes the position and velocity error signals as its
etc. A complete list of parameters that are passed to the robot inputs, and outputs a control signal to adjust the Kp and Kd
object is given in Table 1. parameters, accordingly. Optimal values of these parameters
are given in Table 2.
2018 Global Smart Industry Conference (GloSIC)
TABLE II. OPTİMAL VALUES FOR KP AND KD PARAMETERS FOR EACH Ranges and locations of the membership functions are
LİNK‘S CONTROLLER
determined according to the error signal values obtained
Kpopt Kdopt from the previous design (with a PD controller). The rule-
Controller 1 1x10-4 70.4696 base of the FIS is then constructed after careful examination
of the error signals. Fuzzy rules employed in the FIS are
Controller 2 8.9944 4.2533 given in Table 3.
The membership functions of inputs/outputs of the Fuzzy
inference system (FIS) are shown in Figure 3 [14]. TABLE III. FUZZY RULES OF THE FIS
e
NB NS ZE PS PB
de

NB NB NB NB NS ZE
NS NB NB NS ZE PS
ZE NB NS ZE PS PB
PS NS ZE PS PB PB
PB ZE PS PB PB PB

NB Negative BIG
NS Negative SMALL
ZE ZERO
PS Positive SMALL
a)
PB Positive BIG

Optimal Kp and Kd parameters are tuned according to


the following formulas [19]:

K p K popt + ∆K p
=
(3)
K d K dopt + ∆K d
=

In Table 3, fuzzy values of the output variable are shown


according to the values of error and change of error. As the
fuzzy controller is designed, next step will be simulating the
overall system to check its performance.

IV. SİMULATİON AND RESULTS


The fuzzy control system was designed and simulated in
b) MATLAB Simulink in order to evaluate the reference
tracking performance of the system. For this purpose,
Robotics and Fuzzy Logic Toolbox blocks were
implemented on the Simulink model. The functional block
diagram of the overall system is illustrated in Figure 4 and 5.
3D simulation of the manipulator is obtained using the
plot block. Such a simulation is given in Fig. 6.

c)
Fig. 3. Membership functions of the input and output signals: (a) error of
q1, (b) change of error of q1, (c) Fuzzy value of Kp1. Fig. 4. Simulation of the robot manipulator.
2018 Global Smart Industry Conference (GloSIC)

e_q1
Kpd1
e_q2
de_q1
de_q2
Kpd2

Fuzzy PD Controller

2-link robot 2-link robot q


q q 2-link robot
qd qd tau tau qd
qdd qdd
qdd Animation of Robot
Manipulator
Inverse Dynamics 0
Trajectory
Robot Object
Generator
Clock
simout

To Workspace

Fig. 5. Simulink model of the 2-link robot manipulator system with fuzzy control

Fig. 6. Simulink model of the subsystem Fuzzy PD Controller

Output signals are then subtracted from the reference considered in this paper was found to be relatively effective
inputs, and the calculated error signals are sent to two compared to the PD-controller scheme.
separate fuzzy controllers, in which the control signals are
generated for the two links of the manipulator. Control V. CONCLUSİON
signals are finally fed back to the RNE block as acceleration
inputs that will regulate the torques accordingly. Dynamic model of a 2-link robot manipulator is created
and a fuzzy logic controller is designed and implemented in
Some simulation results are provided below to order to adjust the PD-controller parameters for improved
understand the dynamic behavior of the system. In these reference-tracking performance. Design procedures for all
simulations, input values of angular position are pi/4 for both components of the overall system are explained in detail. The
links. system is then simulated in MATLAB/Simulink and the
output curves are presented to emphasize the results. The
As seen from the output curves on Fig 7, trajectory fuzzy logic controller is found to be efficient in terms of
tracking performance of the fuzzy control system is adjusting Kp and Kd parameters, which in turn decreased the
satisfactory in terms of time-domain characteristics such as tracking error, and improved the reference tracking
overshoot, rise time, settling time, and steady-state error, performance of the robot manipulator. Future work might be
even though they are not readily observed because of the the design of a model-based (Takagi-Sugeno) fuzzy
structure of the input signal. As a result, the fuzzy approach controller scheme which includes several uncertainties.
2018 Global Smart Industry Conference (GloSIC)

Fig. 7. (a) Angular position (q1) and velocity (qd1) of link-1 versus time, (b) Angular position (q2) and velocity (qd2) of link-2 versus time

[12] M. Namazov and O. Basturk, “Fuzzy Proportional-Derivative


REFERENCES Controller Design forPosition Control of a DC Motor,” Turkish
Journal of Fuzzy Systems, vol. 1, no. 1, pp. 36–54, 2010.
[1] H. Behzadi-Khormouji, V. Derhami, and M. Rezaeian, “Adaptive
Visual Servoing Control of robot Manipulator for Trajectory Tracking [13] M. Namazov and O. Basturk, “Computer Simulation of a Stable
tasks in 3D Space,” 2017 5th RSI International Conference on Takagi-Sugeno Fuzzy Control System Designed via Linear Matrix
Robotics and Mechatronics (ICRoM), Tehran, pp. 376–382, 2017. Inequalities,” International Symposium on Innovations in Intelligent
DOI: 10.1109/ICRoM.2017.8466231. Systems and Applications, pp. 244–249, June 2010.
[2] L. Ge, J. Chen, and R. Li, “Feedforward control based on Fourier [14] A. Nawrocka, M. Nawrocki, and A. Kot, “Type - 2 fuzzy logic
series trajectory fitting method for industrial robot,” 2017 29th controller for nonlinear object control,” Proceedings of the 2015 16th
Chinese Control And Decision Conference (CCDC), Chongqing, pp. International Carpathian Control Conference (ICCC), Szilvasvarad,
4890–4894, 2017. pp. 334–337, 2015.
[3] K. Belda and O. Rovný, “Predictive control of 5 DOF robot arm of [15] M. Şinasi Ayas, Y. Danayiyen and İ. H. Altaş, “Design of a fuzzy
autonomous mobile robotic system motion control employing logic controller for a 2-DOF robot manipulator,” 2013 International
mathematical model of the robot arm dynamics,” 2017 21st Conference on Electronics, Computer and Computation (ICECCO),
International Conference on Process Control (PC), Strbske Pleso, pp. Ankara, pp. 265–268, 2013.
339–344, 2017. [16] A. Nawrocka, M. Nawrocki, and A. Kot, “Type - 2 fuzzy logic
[4] P. I. Corke, “A Robotics Toolbox for MATLAB,” IEEE Robotics & controller for nonlinear object control,” Proceedings of the 2015 16th
Automation Magazine, pp. 24–32, March 1996. International Carpathian Control Conference (ICCC), Szilvasvarad,
pp. 334–337, 2015.
[5] Li Yang, Z. Cao, M. Tan, and G. Liu, “Vision-based Fuzzy
Coordination Control for Multiple Robots,” 2008 IEEE Conference [17] A. Green and J. Z. Sasiadek, “Dynamics and Trajectory Tracking
on Robotics, Automation and Mechatronics, Chengdu, pp. 521–524, Control of a Two-Link Robot Manipulator,” Journal of Vibration and
2008. Control, pp. 15–16, 2004.
[6] J. Zhao, L. Han, L. Wang, and Z. Yu, “The fuzzy PID control [18] Manjeet and Sathans, “Fuzzy Based Control of Two Link Robotic
optimized by genetic algorithm for trajectory tracking of robot arm,” Manipulator and Comparative Analysis,” 2013 International
2016 12th World Congress on Intelligent Control and Automation Conference on Communication Systems and Network Technologies,
(WCICA), Guilin, pp. 556–559, 2016. Gwalior, 2013, pp. 562–567, 2013.
[7] P. Corke, “Robot Manipulator Capability in MATLAB: A Tutorial on [19] O. Wahyunggoro, H. Wibawa, and A. I. Cahyadi, “Speed control
Using the Robotics System Toolbox,” in IEEE Robotics & simulation of DC servomotor using hybrid PID-fuzzy with ITAE
Automation Magazine, vol. 24, no. 3, pp. 165–166, September 2017.. polynomials initialization,” 2017 International Conference on
Computer, Control, Informatics and its Applications (IC3INA),
[8] L. A. Zadeh, “Fuzzy Sets‖, Information and Control,” vol. 8, pp. Jakarta, pp. 95–99, 2017.
338–353, 1965.
[20] J. Jantzen, Foundations of Fuzzy Control. WS: John Wiley & Sons,
[9] Fahmizal and C. Kuo, “Development of a fuzzy logic wall following Ltd., 2007, pp. 79–83.
controller for steering mobile robots,” 2013 International Conference
on Fuzzy Theory and Its Applications (iFUZZY), Taipei, pp. 7–12, [21] Simulink® Response Optimization™ Getting Started Guide, 3rd
2013. printing. Natick: The Mathworks Inc., 2008.
[10] W. J. M. Kickert and H. R van Nauta Lemke, “Application of a Fuzzy [22] E. I. Veremey and S. B. Pogojev. Nonlinear Control
Controller in a Warm Water Plant,” Automatica, vol. 12(4), pp. 301– Design Blockset. [Online].
308, 1976. Available:http://matlab.exponenta.ru/nonlinecondes/book1/preface.ph
p
[11] J. J. Ostergaard, “Fuzzy Logic Control of a Heat Exchanger System,”
In Fuzzy Automata and Decision Processes, North-Holland,
Amsterdam, 1977.

You might also like