fuzzy logic and sun tracking systems ryan johnson december 9, 2002 calvin college engr315a

26
Fuzzy Logic and Sun Fuzzy Logic and Sun Tracking Systems Tracking Systems Ryan Johnson Ryan Johnson December 9, 2002 December 9, 2002 Calvin College Calvin College ENGR315A ENGR315A

Post on 21-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

Fuzzy Logic and Sun Fuzzy Logic and Sun Tracking SystemsTracking Systems

Ryan JohnsonRyan JohnsonDecember 9, 2002December 9, 2002

Calvin CollegeCalvin CollegeENGR315AENGR315A

Page 2: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

OverviewOverview

• IntroductionIntroduction

• History and Explanation of Fuzzy History and Explanation of Fuzzy LogicLogic

• Fuzzy Logic AppliedFuzzy Logic Applied

• ConclusionConclusion

• QuestionsQuestions

Page 3: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

IntroductionIntroduction

• The world we live in: How do we The world we live in: How do we describe it?describe it?– Defined in 1’s and 0’s, true and false, A Defined in 1’s and 0’s, true and false, A

or not-A, black and whiteor not-A, black and white– How do we define a half eaten apple?How do we define a half eaten apple?

•Half there or half gone? Half there or half gone?

– Is the glass half full or half empty?Is the glass half full or half empty?

• What is a house?What is a house?

Page 4: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

GraynessGrayness

• Grayness in a world of black and Grayness in a world of black and white…white…– Math and science do not fit the world they Math and science do not fit the world they

describe.describe.•We have taken tendencies and relationships We have taken tendencies and relationships

that have remained true for a period of time…that have remained true for a period of time…

– The world we live in is filled with much The world we live in is filled with much grayness that can not be accurately grayness that can not be accurately described in black and white.described in black and white.

• This grayness can be described as This grayness can be described as “Fuzziness.”“Fuzziness.”

Page 5: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

Grayness ExampleGrayness Example

• Scientific model showing either adult Scientific model showing either adult or not adult…or not adult…

Page 6: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

• Grayness model showing a gray area where Grayness model showing a gray area where someone could have both non-adult and adult someone could have both non-adult and adult characteristics. To a degree they are an adult and characteristics. To a degree they are an adult and to a degree they are a non-adult…to a degree they are a non-adult…

• Grayness is a key principle in Fuzzy Logic…Grayness is a key principle in Fuzzy Logic…

Page 7: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

What is Fuzzy Logic?What is Fuzzy Logic?

• Fuzzy logic is a rule-based decision Fuzzy logic is a rule-based decision process.process.

• It seeks to solve problems where the It seeks to solve problems where the system is difficult to model and where system is difficult to model and where ambiguity or vagueness (grayness) is ambiguity or vagueness (grayness) is abundant between extremes.abundant between extremes.

• It allows the system to be defined by It allows the system to be defined by logiclogic equations rather than equations rather than complexcomplex differential differential equations.equations.

Page 8: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

HistoryHistory• Originator-Lotfi Zadeh, UC Berkeley, Dept. of Electrical Originator-Lotfi Zadeh, UC Berkeley, Dept. of Electrical

Engineering and Computer SciencesEngineering and Computer Sciences– Began with a paper in 1965 on fuzzy sets.Began with a paper in 1965 on fuzzy sets.– He named it “fuzzy” because “it ties to common sense.”He named it “fuzzy” because “it ties to common sense.”

• U.S. HistoryU.S. History– Took much criticism from probability schools, people who wanted to Took much criticism from probability schools, people who wanted to

see fuzzy logic applied, and people who couldn’t see the grayness that see fuzzy logic applied, and people who couldn’t see the grayness that he was speaking about. he was speaking about.

– The Western world had a hard time accepting Fuzzy Logic because it The Western world had a hard time accepting Fuzzy Logic because it challenged their scientific ideas and thought.challenged their scientific ideas and thought.

• Eastern WorldEastern World– Accepted and embraced fuzzy thinking.Accepted and embraced fuzzy thinking.– In 1980, Japan pursued fuzzy logic for their controls and by 1990 had In 1980, Japan pursued fuzzy logic for their controls and by 1990 had

over 100 real fuzzy control applications.over 100 real fuzzy control applications.

• Today…Today…

Page 9: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

Fuzzy SetsFuzzy Sets• Fuzzy thinking and fuzzy logic occurs Fuzzy thinking and fuzzy logic occurs

in sets. in sets. • Example:Example:

– Vehicle: What is a vehicle to you? Vehicle: What is a vehicle to you? – Vehicle represents a fuzzy set and things Vehicle represents a fuzzy set and things

belong to this fuzzy set to some degree.belong to this fuzzy set to some degree.

• Fuzzy sets are the building blocks of Fuzzy sets are the building blocks of fuzzy systems.fuzzy systems.– They can be broken down further into They can be broken down further into

subsets such as an off road vehicle. An subsets such as an off road vehicle. An off road vehicle is a subset of vehicle.off road vehicle is a subset of vehicle.

Page 10: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

Fuzzy RulesFuzzy Rules• Human knowledge builds fuzzy rules. Human knowledge builds fuzzy rules.

– Consider the decision to bring an umbrella to Consider the decision to bring an umbrella to work under the following circumstances:work under the following circumstances:• 70% chance of rain.70% chance of rain.

• An umbrella keeps you dry.An umbrella keeps you dry.

• If it rains you will get wet.If it rains you will get wet.

• If you get wet, you will be uncomfortable at work.If you get wet, you will be uncomfortable at work.

• If you have an umbrella you will be dry.If you have an umbrella you will be dry.

– Through this knowledge, you reason to bring Through this knowledge, you reason to bring an umbrella to work. an umbrella to work.

– The knowledge of the percentage of rain and The knowledge of the percentage of rain and what an umbrella is used for led you to make what an umbrella is used for led you to make rules that guided you through your reasoning.rules that guided you through your reasoning.

Page 11: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

Fuzzy SystemFuzzy System

• The fuzzy sets and fuzzy rules The fuzzy sets and fuzzy rules combine to form a fuzzy system. combine to form a fuzzy system.

• Consider a sun tracking system for a Consider a sun tracking system for a standalone photovoltaic system… standalone photovoltaic system…

Page 12: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

Building the Fuzzy SystemBuilding the Fuzzy System• Details and BackgroundDetails and Background

– Single Axis tracking systemSingle Axis tracking system– Pole mount system that rotates with the sun Pole mount system that rotates with the sun

throughout the daythroughout the day– Fixed tilt angle with the seasonFixed tilt angle with the season– Two light intensity sensors, one on the right Two light intensity sensors, one on the right

side of the panel, one on the left side of the side of the panel, one on the left side of the panel.panel.

– At night, the panel automatically moves At night, the panel automatically moves back to the morning position.back to the morning position.

• MATLAB VS. MathematicaMATLAB VS. Mathematica– Mathematica only has fuzzy tools in version Mathematica only has fuzzy tools in version

2.2 (Very old school)2.2 (Very old school)

Page 13: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

MATLAB Fuzzy ToolboxMATLAB Fuzzy Toolbox• Type in Type in

“fuzzy” in “fuzzy” in at the at the MATLAB MATLAB prompt.prompt.

• Included in Included in MATLAB MATLAB 6.1.6.1.

Page 14: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

System Sketch and SetupSystem Sketch and Setup

Page 15: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

Step 1: Choose variablesStep 1: Choose variables• The variables become the input (X) and The variables become the input (X) and

output (Y)output (Y)– In this case, X is bIn this case, X is both of the light intensity oth of the light intensity

sensors. There is a logic device that compares sensors. There is a logic device that compares each sensor measurement to see which side each sensor measurement to see which side has more intensity making this a single input has more intensity making this a single input system. system.

– Y, the output is the amount (degrees) to move Y, the output is the amount (degrees) to move the panel clockwise or counter-clockwise. the panel clockwise or counter-clockwise.

– If X, then YIf X, then Y– If the sun is more intense in the right sensor, If the sun is more intense in the right sensor,

rotate the panel toward the right some rotate the panel toward the right some degrees.degrees.

Page 16: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

Step 2: Pick the Fuzzy SetsStep 2: Pick the Fuzzy Sets

• Pick subsets of the inputs and Pick subsets of the inputs and outputs. outputs.

• Draw these as curves or triangles.Draw these as curves or triangles.

Page 17: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

Input SubsetsInput Subsets• Engineering Engineering

judgment and judgment and common common sense define sense define how these how these triangles are triangles are shaped. shaped.

• The widest The widest sets are least sets are least important and important and give rough give rough control.control.

• Thin sets give Thin sets give fine control fine control and bring and bring quick quick adjustment.adjustment.

Page 18: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

Output SubsetsOutput Subsets

Page 19: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

Step 3: Pick the fuzzy rulesStep 3: Pick the fuzzy rules

Page 20: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

Curve of RulesCurve of Rules

Page 21: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

Results: Facing the sun Results: Facing the sun

Page 22: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

More intensity in the right More intensity in the right sensorsensor

Page 23: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

Cloud LiftCloud Lift

Page 24: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

DefuzzificationDefuzzification

• The triangles are usually added…The triangles are usually added…– Then the average of the addition is Then the average of the addition is

found as the defuzzified value.found as the defuzzified value.

If Ai, then Bi

If A1, then B1

If A2, then B2

B’1

B’2

B’i

X + B Defuzzification YA .

.

Page 25: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

ConclusionConclusion

• Fuzzy logic allows control with little Fuzzy logic allows control with little math.math.– It is very difficult and often impossible to It is very difficult and often impossible to

represent a natural process with an represent a natural process with an accurate equation accurate equation

• Fuzzy Logic is another way to look at Fuzzy Logic is another way to look at the world.the world.

• Step back and consider the problem. Step back and consider the problem. It doesn’t always involve huge, It doesn’t always involve huge, difficult solutions.difficult solutions.

Page 26: Fuzzy Logic and Sun Tracking Systems Ryan Johnson December 9, 2002 Calvin College ENGR315A

Questions?Questions?