Sample Application


To demonstrate the fuzzy logic functions, we'll build a very simple battery charger simulation (which will lack some physical details).

Our mythical battery charger operates within an environment where at times a charging voltage exists (for example, from a set of solar cells ), and a load exists. The voltage from the solar panels provides the ability to charge the battery while the load discharges the battery into the operating circuit. Our charger provides two modes of operation, trickle charge mode and fast charge mode. In trickle charge mode, only a small amount of current is permitted to pass into the battery to provide a very small amount of charge. In fast charge mode, all available current is provided to the charger for the onboard batteries.

From a control systems perspective, what is necessary is a way to determine when to go into fast charge mode and when to switch to trickle charge mode. When a battery charges, the temperature of the battery will rise. When the battery is fully charged, the additional current arriving at the battery will be realized as heat. Therefore, when the battery gets hot, it's probably a good indication that the battery is fully charged and to switch to trickle charge mode. We can also measure the voltage of our battery to determine if it has reached its limit, and then switch it into trickle charge mode. When the battery is neither hot nor has the battery reached its voltage limit, it's safe to switch to fast charge mode. These are simplified rules, as the derivative of the battery temperature is a better indication of battery charge.

Fuzzy Battery Charge Control

As defined, the battery charger has two modes of operation: trickle and fast charge modes. Two sensors exist to monitor the battery: voltage and temperature. To control the charge of the battery we'll use the following fuzzy rules:

 if  m_voltage_high  ( voltage ) then mode = trickle_charge if  m_temperature_hot  ( temperature ) then mode = trickle_charge if ( (  not  (  m_voltage_high  ( voltage )))  AND  (  not  (  m_temperature_hot  ( temperature ))) ) then mode = fast_charge 

Note that these rules are sub-optimal, since the last rule could cover all cases. We'll use three rules to cover more of the available fuzzy operators.

Identifying the fuzzy rules is one of the first steps. This is readily known from system operators or through analysis of the problem. Defining how the linguistics map to the real world is the next problem. This is the process of creating the membership functions.

Fuzzy Charge Membership Functions

Creating the membership functions takes the fuzzy linguistic names and maps them to the real world values in the particular domain. In this example, we'll specify two variables : voltage and temperature. The voltage and temperature membership graphs (showing the actual membership functions) are shown in Figures 9.6 and 9.7 respectively.

click to expand
Figure 9.6: Fuzzy voltage membership graph.
click to expand
Figure 9.7: Fuzzy temperature membership graph.

The voltage membership graph defines three membership functions within the voltage domain: low, medium, and high. Similarly, the temperature domain also defines three: cold, warm, and hot. These artificial values are for demonstration purposes only and do not represent any type of battery technology.

Note  

One can easily see patterns in the membership functions. For this reason, a number of helper functions are provided in source to facilitate creating these membership shapes (including the spike pattern, not shown in these graphs).

On the CD  

The source code for the fuzzy logic battery charge simulator can be found on the CD-ROM at ./software/ch9/fuzzy/.




Visual Basic Developer
Visual Basic Developers Guide to ASP and IIS: Build Powerful Server-Side Web Applications with Visual Basic. (Visual Basic Developers Guides)
ISBN: 0782125573
EAN: 2147483647
Year: 1999
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net