FLCU – Fuzzy logic controller unit

Block SymbolLicensing group: ADVANCED
PIC

Function Description
The FLCU block implements a simple fuzzy logic controller with two inputs and one output. Introduction to fuzzy logic problems can be found in [3].

The output is defined by trapezoidal membership functions of linguistic terms of the u and v inputs, impulse membership functions of linguistic terms of the y output and inference rules in the form

If (u is Ui ) AND (v is V j ), then (y is Y k ),

where Ui,i = 1,…,nu are the linguistic terms of the u input; V j,j = 1,…,nv are the linguistic terms of the v input and Y k,k = 1,…,ny are the linguistic terms of the y output. Trapezoidal (triangular) membership functions of the u and v inputs are defined by four numbers as depicted below.

PIC

Not all numbers x1,…,x4 are mutually different in triangular functions. The matrices of membership functions of the u and v input are composed of rows [x1,x2,x3,x4]. The dimensions of matrices mfu and mfv are (nu× 4) and (nv× 4) respectively.

The impulse 1st order membership functions of the y output are defined by the triplet

yk,ak,bk,

where yk is the value assigned to the linguistic term Y k,k = 1,…,ny in the case of ak = bk = 0. If ak≠0 and bk ≠0, then the term Y k is assigned the value of yk + aku + bkv. The output membership function matrix sty has a dimension of (ny× 3) and contains the rows [yk,ak,bk],k = 1,…,ny.

The set of inference rules is also a matrix whose rows are [il ,jl,kl,wl],l = 1,…,nr, where il ,jl and kl defines a particular linguistic term of the u and v inputs and y output respectively. The number wl defines the weight of the rule in percents wl ∈{0,1,…,100}. It is possible to suppress or emphasize a particular inference rule if necessary.

Inputs

u

First analog input of the block

Double (F64)

v

Second analog input of the block

Double (F64)

Outputs

y

Analog output of the block

Double (F64)

ir

Dominant rule

Long (I32)

wr

Degree of truth of the dominant rule

Double (F64)

Parameters

umax

Upper limit of the u input  ⊙1.0

Double (F64)

umin

Lower limit of the u input  ⊙-1.0

Double (F64)

nu

Number of membership functions of the input u   ↓1  ↑25 ⊙3

Long (I32)

vmax

Upper limit of the v input  ⊙1.0

Double (F64)

vmin

Lower limit of the v input  ⊙-1.0

Double (F64)

nv

Number of membership functions of the input v   ↓1  ↑25 ⊙3

Long (I32)

ny

Number of membership functions of the output y   ↓1  ↑100 ⊙3

Long (I32)

nr

Number of inference rules   ↓1  ↑25 ⊙3

Long (I32)

mfu

Matrix of membership functions of the input u  ⊙[-1 -1 -1 0; -1 0 0 1; 0 1 1 1]

Double (F64)

mfv

Matrix of membership functions of the input v  ⊙[-1 -1 -1 0; -1 0 0 1; 0 1 1 1]

Double (F64)

sty

Matrix of membership functions of the output y  ⊙[-1 0 0; 0 0 0; 1 0 0]

Double (F64)

rls

Matrix of inference rules  ⊙[1 2 3 100; 1 1 1 100; 1 0 3 100]

Byte (U8)

2020 © REX Controls s.r.o., www.rexygen.com