Fuzzy Logic Controller For An Inverted Pendulum System
Fuzzy Logic Controller For An Inverted Pendulum System
Cliiii;~
- 185 -
I
il
- 186 -
V. DERIVATION OF FUZZY LOGIC CONTROLLER Fuzzy Logic Controller
FOP. INVERTED PENDULUM
1. The expected pole angle and angular velocity are zero. -0.7 -0.3 03 07
If 0 is positive and w is positive, then F is PM
If 0 is positive and w is zero, then F is PS
If 0 is positive and w is negative, then F is Z
If 8 is negative and 0) is positive, then F is Z
If 0 is negative and 63 is zero, then F is NS
If 0 is negative and LO is negative, then F is NM
If 0 is zero and w is ]positive,then F is PS
If 8 is zero and w is negative, then F is NS
2. The expected cart position and velocity are zero.
Fig. 4 Membership functions for 8, w, x ,v and V
If x is zero and v is positive, then F is PM
If x is zero and v is negative, then F is NM The inference result of each rule consists of two parts, the
If x positibn is posibive and v is positive, then F is PB compatibility (weighting factor), w,, of the individual rule,
If x is negative and 11 is negative, then F is NB and the output terminal voltage, V,, according to the rule. The
defuzzified (center of gravity) output terminal voltage V can
According to these criteria, 22 actual rules are derived to therefore be found as
keep the pole upright aqd make the cart remain at the center
of the track. A sample of the rules aie as follows: If 8 is NE3
and w is PM then V is NM; If 8 is Z and w is PB then V is
PB; If 0 is Z and w is Z and x is N and v is P then V is PS; If where N is the maximum number of effective rules.
8 is Z and w is PS aiidx is N and v is P then V is PM.
i
- 187 -
. ,. . ...... _.
.... .. . . .. .
.... - .....
time (sec)
(4
ortant notes fo
ntradictions between IU
- 188 -
scaling factors or, altematively, tuning the peaks of the 0.1 I
- 189 -