Fuzzy Logic using MATLAB
A SeminarPaper Report
by
SATYENDRA KUMAR J
M. Tech. (Mechatronics) 2nd semester Student
(Roll No. 162072901)
Under the supervision of
T. ESWAR RAO
ASSOCIATE PROFESSOR
DEPARTMENT OF MECHANICAL ENGINEERING
K L University, Green Fields,
Vaddeswaram- 522502, Guntur(Dist), Andhra Pradesh, India.
November- 2017
1/9/2018 1Department of Mechanical Engineering
Fuzzy Logic Using MATLAB
Satyendra Kumar Jaladi
2nd Semester student
Mechatronics Engineering
Overview
Brief History
How it Works
Basics of Fuzzy Logic
Rules
Step by Step Approach of Fuzzy Logic
Fuzzification
Rule Evaluation
Defuzzification
Examples
Modeling Inverse Kinematics in a 2DOF Robotic
Arm
1/9/2018 Department of Mechanical Engineering Confidential 3
Overview
Mamdani FIS editor
Simple GUI
Other applications of Fuzzy Logic
Mamdani Fuzzy Inference System(FIS)editor example
Conclusion
1/9/2018 Department of Mechanical Engineering Confidential 4
Brief History
 Fuzzy logic can be defined as a superset of
conventional (Boolean) logic that has been extended
to handle the concept of partial truth - truth values
between “completely true” and “completely false”
 Brought up by Lofti Zedah in the 1960s
 Professor at University of California at Beckley
1/9/2018 Department of Mechanical Engineering Confidential 5
Introduction
 Fuzzy – “not clear, distinct, or precise; blurred”
 fuzzy logic variables may have a truth value that
ranges in degree between 0 and 1.
 Example Cold = 0 ,Hot = 1 then fuzzy logic uses truth
as mathematical model vagueness
1/9/2018 Department of Mechanical Engineering Confidential 6
1/9/2018 Department of Mechanical Engineering
 Lofti Zadeh(Fuzzy Logic Founder)
 Fuzzy logic began with the 1965 proposal of fuzzy set
theory by Lotfi Zadeh Fuzzy logic has been applied to
many fields, from control theory to artificial
intelligence.
Confidential 7
1/9/2018 Department of Mechanical Engineering Confidential 8
Inverse Kinematics 2DOF
1/9/2018 Department of Mechanical Engineering Confidential 9
How it works
 Fuzzy Logic (Rules) operates similar to humans
 Humans base their decisions on conditions.
 Fuzzy Logic operates on a bunch of IF-THEN statements
1/9/2018 Department of Mechanical Engineering Confidential 10
Examples
1/9/2018 Department of Mechanical Engineering Confidential 11
IF – Then Rules
 IF temperature IS very cold THEN fan_speed is
stopped.
 IF temperature IS cold THEN fan_speed is slow.
 IF temperature IS warm THEN fan_speed is
moderate.
 IF temperature IS hot THEN fan_speed is high.
1/9/2018 Department of Mechanical Engineering Confidential 12
Examples contd.
1/9/2018 Department of Mechanical Engineering Confidential 13
Mamdani Example
1/9/2018 Department of Mechanical Engineering Confidential 14
Rule editor
1/9/2018 Department of Mechanical Engineering Confidential 15
Rules Viewer
1/9/2018 Department of Mechanical Engineering Confidential 16
Surface Viewer
1/9/2018 Department of Mechanical Engineering Confidential 17
Modeling IK in a 2DOF Robotic Arm
 Task
– use a fuzzy system to model the inverse
kinematics in a two-joint robotic arm.
1/9/2018 Department of Mechanical Engineering Confidential 18
Modeling IK in a 2DOF Robotic Arm
 The input and output relationships of the
variables of the fuzzy system are then
determined.
– Inputs:
• A desired location for the tip of the robotic
arm
• Lengths of Link 1 and Link2.
– Outputs:
• Angles of the joints (theta1 ,theta2)
1/9/2018 Department of Mechanical Engineering Confidential 19
 Use membership functions to graphically
describe the situation (Fuzzification)
 The output which are joint angles theta1
and theta2 values.
 These different values of output of the
platform are defined by specifying the
membership functions for the fuzzy-sets
1/9/2018 Department of Mechanical Engineering Confidential 20
DESIGN STRATEGIES
design
1/9/2018 Department of Mechanical Engineering Confidential 21
DESIGN STRATEGIES
1/9/2018 Department of Mechanical Engineering Confidential 22
GUIDE
1/9/2018 Department of Mechanical Engineering Confidential 23
 Code behind GUIDE (CALCULATOR)
 total = str2double(get(handles.edit1,'string')) + str2double(get(handles.edit2,'string'));
 set(handles.text1,'string',num2str(total));
 How to use handles?
 [Handles.controlname]
Eg: handles.edit1 , handles.edit2
1/9/2018 Department of Mechanical Engineering Confidential 24
Other Applications
 Coal Power Plant
 Refuse Incineration
Plant
 Water Treatment
Systems
 AC Induction Motor
 Fraud Detection
 Customer Targeting
 Quality Control
 Speech Recognition
 Nuclear Fusion
 Truck Speed Limiter
 Sonar Systems
 Toasters
 Photocopiers
 Creditworthiness
Assessment
 Stock Prognosis
 Mortgage Application
 Hi-Fi Systems
 Humidifiers
 Domestic Goods -
Washing
Machines/Dryers
 Microwave Ovens
 Consumer Electronics –
Television
 Still and Video Cameras
- Auto focus, Exposure
and Anti-Shake
 Vacuum Cleaners
1/9/2018 25Department of Mechanical Engineering
Future scope
• Work on Forward and Inverse kinematics
for 3 DOF manipulator using ANFIS.
• Implement Fuzzy Logic controller and port
it on a microcontroller and test it in real
working environment.
1/9/2018 Department of Mechanical Engineering Confidential 26
• Calculator Code files
1/9/2018 Department of Mechanical Engineering Confidential 27
Questions??

Fuzzy logic using matlab

  • 1.
    Fuzzy Logic usingMATLAB A SeminarPaper Report by SATYENDRA KUMAR J M. Tech. (Mechatronics) 2nd semester Student (Roll No. 162072901) Under the supervision of T. ESWAR RAO ASSOCIATE PROFESSOR DEPARTMENT OF MECHANICAL ENGINEERING K L University, Green Fields, Vaddeswaram- 522502, Guntur(Dist), Andhra Pradesh, India. November- 2017 1/9/2018 1Department of Mechanical Engineering
  • 2.
    Fuzzy Logic UsingMATLAB Satyendra Kumar Jaladi 2nd Semester student Mechatronics Engineering
  • 3.
    Overview Brief History How itWorks Basics of Fuzzy Logic Rules Step by Step Approach of Fuzzy Logic Fuzzification Rule Evaluation Defuzzification Examples Modeling Inverse Kinematics in a 2DOF Robotic Arm 1/9/2018 Department of Mechanical Engineering Confidential 3
  • 4.
    Overview Mamdani FIS editor SimpleGUI Other applications of Fuzzy Logic Mamdani Fuzzy Inference System(FIS)editor example Conclusion 1/9/2018 Department of Mechanical Engineering Confidential 4
  • 5.
    Brief History  Fuzzylogic can be defined as a superset of conventional (Boolean) logic that has been extended to handle the concept of partial truth - truth values between “completely true” and “completely false”  Brought up by Lofti Zedah in the 1960s  Professor at University of California at Beckley 1/9/2018 Department of Mechanical Engineering Confidential 5
  • 6.
    Introduction  Fuzzy –“not clear, distinct, or precise; blurred”  fuzzy logic variables may have a truth value that ranges in degree between 0 and 1.  Example Cold = 0 ,Hot = 1 then fuzzy logic uses truth as mathematical model vagueness 1/9/2018 Department of Mechanical Engineering Confidential 6
  • 7.
    1/9/2018 Department ofMechanical Engineering  Lofti Zadeh(Fuzzy Logic Founder)  Fuzzy logic began with the 1965 proposal of fuzzy set theory by Lotfi Zadeh Fuzzy logic has been applied to many fields, from control theory to artificial intelligence. Confidential 7
  • 8.
    1/9/2018 Department ofMechanical Engineering Confidential 8
  • 9.
    Inverse Kinematics 2DOF 1/9/2018Department of Mechanical Engineering Confidential 9
  • 10.
    How it works Fuzzy Logic (Rules) operates similar to humans  Humans base their decisions on conditions.  Fuzzy Logic operates on a bunch of IF-THEN statements 1/9/2018 Department of Mechanical Engineering Confidential 10
  • 11.
    Examples 1/9/2018 Department ofMechanical Engineering Confidential 11
  • 12.
    IF – ThenRules  IF temperature IS very cold THEN fan_speed is stopped.  IF temperature IS cold THEN fan_speed is slow.  IF temperature IS warm THEN fan_speed is moderate.  IF temperature IS hot THEN fan_speed is high. 1/9/2018 Department of Mechanical Engineering Confidential 12
  • 13.
    Examples contd. 1/9/2018 Departmentof Mechanical Engineering Confidential 13
  • 14.
    Mamdani Example 1/9/2018 Departmentof Mechanical Engineering Confidential 14
  • 15.
    Rule editor 1/9/2018 Departmentof Mechanical Engineering Confidential 15
  • 16.
    Rules Viewer 1/9/2018 Departmentof Mechanical Engineering Confidential 16
  • 17.
    Surface Viewer 1/9/2018 Departmentof Mechanical Engineering Confidential 17
  • 18.
    Modeling IK ina 2DOF Robotic Arm  Task – use a fuzzy system to model the inverse kinematics in a two-joint robotic arm. 1/9/2018 Department of Mechanical Engineering Confidential 18
  • 19.
    Modeling IK ina 2DOF Robotic Arm  The input and output relationships of the variables of the fuzzy system are then determined. – Inputs: • A desired location for the tip of the robotic arm • Lengths of Link 1 and Link2. – Outputs: • Angles of the joints (theta1 ,theta2) 1/9/2018 Department of Mechanical Engineering Confidential 19
  • 20.
     Use membershipfunctions to graphically describe the situation (Fuzzification)  The output which are joint angles theta1 and theta2 values.  These different values of output of the platform are defined by specifying the membership functions for the fuzzy-sets 1/9/2018 Department of Mechanical Engineering Confidential 20
  • 21.
    DESIGN STRATEGIES design 1/9/2018 Departmentof Mechanical Engineering Confidential 21
  • 22.
    DESIGN STRATEGIES 1/9/2018 Departmentof Mechanical Engineering Confidential 22
  • 23.
    GUIDE 1/9/2018 Department ofMechanical Engineering Confidential 23
  • 24.
     Code behindGUIDE (CALCULATOR)  total = str2double(get(handles.edit1,'string')) + str2double(get(handles.edit2,'string'));  set(handles.text1,'string',num2str(total));  How to use handles?  [Handles.controlname] Eg: handles.edit1 , handles.edit2 1/9/2018 Department of Mechanical Engineering Confidential 24
  • 25.
    Other Applications  CoalPower Plant  Refuse Incineration Plant  Water Treatment Systems  AC Induction Motor  Fraud Detection  Customer Targeting  Quality Control  Speech Recognition  Nuclear Fusion  Truck Speed Limiter  Sonar Systems  Toasters  Photocopiers  Creditworthiness Assessment  Stock Prognosis  Mortgage Application  Hi-Fi Systems  Humidifiers  Domestic Goods - Washing Machines/Dryers  Microwave Ovens  Consumer Electronics – Television  Still and Video Cameras - Auto focus, Exposure and Anti-Shake  Vacuum Cleaners 1/9/2018 25Department of Mechanical Engineering
  • 26.
    Future scope • Workon Forward and Inverse kinematics for 3 DOF manipulator using ANFIS. • Implement Fuzzy Logic controller and port it on a microcontroller and test it in real working environment. 1/9/2018 Department of Mechanical Engineering Confidential 26
  • 27.
    • Calculator Codefiles 1/9/2018 Department of Mechanical Engineering Confidential 27
  • 28.