Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Fuzzy Logic Controller

Evaluate fuzzy inference system

  • Library:
  • Fuzzy Logic Toolbox

Description

The Fuzzy Logic Controller block implements a fuzzy inference system (FIS) in Simulink®. You specify the FIS to evaluate using the FIS name parameter.

For more information on fuzzy inference, see Fuzzy Inference Process.

To display the fuzzy inference process in the Rule Viewer during simulation, use the Fuzzy Logic Controller with Ruleviewer block.

Ports

Input

expand all

For a single-input fuzzy inference system, the input is a scalar signal. For a multi-input fuzzy system, combine the inputs into a vector signal using blocks such as:

Output

expand all

For a single-output fuzzy inference system, the output is a scalar signal. For a multi-output fuzzy system, the output is a vector signal. To split system outputs into scalar signals, use the Demux block.

Fuzzified input values, obtained by evaluating the input membership functions of each rule at the current input values.

fi is an NR-by-NU matrix signal, where NR is the number of FIS rules and NU is the number of FIS inputs. Element (i,j) of fi is the value of the input membership function for the jth input in the ith rule.

For more information on fuzzifying input values, see Fuzzify Inputs.

Dependencies

To enable this port, select the Fuzzified inputs (fi) parameter.

Rule firing strengths, obtained by evaluating the antecedent of each rule; that is, applying the fuzzy operator to the values of the fuzzified inputs.

rfs is a column vector signal of length NR, where element i is the firing strength of the ith rule.

For more information on applying fuzzy operators, see Apply Fuzzy Operator.

Dependencies

To enable this port, select the Rule firing strengths (rfs) parameter.

Rule outputs, obtained by evaluating the consequent of each rule; that is, applying the rule firing strengths to the output membership functions using the implication method specified in the FIS.

For a Mamdani system, each rule output is a fuzzy set. In this case, ro is an NS-by-(NRNY) matrix signal, where NS is the number of sample points used for evaluating output variable ranges, and NY is the number of output variables. Each column of ro contains the output fuzzy set for one rule. The first NR columns contain the rule outputs for the first output variable, the next NR columns correspond to the second output variable, and so on.

For a Sugeno system, each rule output is a scalar value. In this case, ro is an NR-by-NY matrix signal. Element (j,k) of ro is the value of the kth output variable for the jth rule.

For more information on fuzzy implication, see Apply Implication Method and What Is Sugeno-Type Fuzzy Inference?

Dependencies

  • To enable this port, select the Rule outputs (ro) parameter.

  • To specify NS, use the Number of samples for output discretization parameter.

Aggregate output for each output variable, obtained by combining the corresponding outputs from all the rules using the aggregation method specified in the FIS.

For a Mamdani system, the aggregate result for each output variable is a fuzzy set. In this case, ao is as an NS-by-NY matrix signal. Each column of ao contains the aggregate fuzzy set for one output variable.

For a Sugeno system, the aggregate result for each output variable is a scalar value. In this case, ao is a row vector signal of length NY, where element k is the aggregate result for the kth output variable.

For more information on fuzzy aggregation, see Aggregate All Outputs and What Is Sugeno-Type Fuzzy Inference?

Dependencies

  • To enable this port, select the Aggregated outputs (ao) parameter.

  • To specify NS, use the Number of samples for output discretization parameter.

Parameters

expand all

Fuzzy inference system to evaluate, specified as one of the following:

  • Structure — Specify the name of a FIS structure in the MATLAB® workspace.

    To create a fuzzy inference system, you can:

  • File name — Specify the name of a .fis file in the current working folder or on the MATLAB path. Including the file extension in the file name is optional.

    To save a fuzzy inference system to a .fis file:

    • In Fuzzy Logic Designer or Neuro-Fuzzy Designer, select File > Export > To File.

    • At the command line, use writefis.

Number of samples for discretizing the range of output variables, specified as an integer greater than 1. This value corresponds to the number of points in the output fuzzy set for each rule.

To reduce memory usage while evaluating a Mamdani FIS, specify a lower number of samples. Doing so sacrifices the accuracy of the defuzzified output value. Specifying a low number of samples can make the output area for defuzzification zero. In this case, the defuzzified output value is the midpoint of the output variable range.

Note

The block ignores this parameter when evaluating a Sugeno FIS.

Signal data type, specified as one of the following:

  • double — Double-precision signals

  • single — Single-precision signals

  • fixdt(1,16,0) — Fixed-point signals with binary point scaling

  • fixdt(1,16,2^0,0) — Fixed-point signals with slope and bias scaling

  • Expression — Expression that evaluates to one of these data types

For fixed-point data types, you can configure the signedness, word length, and scaling parameters using the Data Type Assistant. For more information, see Specifying a Fixed-Point Data Type (Simulink).

Enable output port for accessing intermediate fuzzified input data.

Enable output port for accessing intermediate rule firing strength data.

Enable output port for accessing intermediate rule output data.

Enable output port for accessing intermediate aggregate output data.

Simulation mode, specified as one of the following:

  • Interpreted execution — Simulate fuzzy systems using precompiled MEX files for single and double data types. Using this option reduces the initial compilation time of the model.

  • Code generation — Simulate fuzzy system without precompiled MEX files. Use this option when simulating fuzzy systems for code generation applications.

For fixed-point data types, the Fuzzy Logic Controller block always simulates using Code generation mode.

Extended Capabilities

Fixed-Point Conversion
Design and simulate fixed-point algorithms using Fixed-Point Designer™.

Introduced before R2006a

Was this topic helpful?