• 沒有找到結果。

模糊控制器的控制規則

第五章 模糊控制器運作流程

5.4 模糊控制器的控制規則

5. 修正型中心平均法(modified center average defuzzifier)

最後再回到原本的問題,一開始也提到,所要觀察的變數為汽車 與目的地之間的距離 s 與汽車當時的瞬時速度 v,而最後要輸入給受 控端(也就是汽車)的變數為汽車的新速度 vout,也就是根據當時的 距離和速度來決定的新速度。

首先,先將汽車與目的地的距離 s 模糊化,我們將距離 s 如圖 5-5 表示:

很近 近 稍遠 遠 很遠 1

0 200 400 600 800 1000 1200

圖 5-5 距離 s 的模糊變數

圖 5-6 則是汽車速度 v 的模糊集合:

很慢 慢 中 快 很快 1

0 100 200 300 400 500 600

圖 5-6 汽車速度 v 的模糊變數

基本上,模糊控制器的輸出(也就是要給汽車的新速度)本身也 是一個模糊集合,只不過在最後解模糊化的部份在演算明確值時,是 利用到此輸出的模糊集合,而輸出的模糊集合如圖 5-7:

很慢 慢 中 快 很快 1

0 100 200 300 400 500 600

圖 5-7 控制器的輸出值 vout 的模糊變數

在決定好輸入與輸出的模糊變數之後,接下來是決定其控制規 則,模糊控制規則的制定是根據控制要求而來,其表示法如下:

第 i 個規則:if s is Ai1 and v is Ai2 then vout is Bi

命 題 部 推 論 部 i = 1,2,……n

在此以兩個輸入一個輸出的模糊控制器,共制定出 25 個控制規則如 下:

第 1 個規則:if s is 很近 and v is 很慢 then vout is 很慢 第 2 個規則:if s is 近 and v is 很慢 then vout is 中 第 3 個規則:if s is 稍遠 and v is 很慢 then vout is 快 第 4 個規則:if s is 遠 and v is 很慢 then vout is 很快 第 5 個規則:if s is 很遠 and v is 很慢 then vout is 很快 第 6 個規則:if s is 很近 and v is 慢 then vout is 很慢 第 7 個規則:if s is 近 and v is 慢 then vout is 中 第 8 個規則:if s is 稍遠 and v is 慢 then vout is 快 第 9 個規則:if s is 遠 and v is 慢 then vout is 快 第 10 個規則:if s is 很遠 and v is 慢 then vout is 很快 第 11 個規則:if s is 很近 and v is 中 then vout is 很慢 第 12 個規則:if s is 近 and v is 中 then vout is 慢 第 13 個規則:if s is 稍遠 and v is 中 then vout is 中 第 14 個規則:if s is 遠 and v is 中 then vout is 快 第 15 個規則:if s is 很遠 and v is 中 then vout is 很快 第 16 個規則:if s is 很近 and v is 快 then vout is 很慢 第 17 個規則:if s is 近 and v is 快 then vout is 慢

第 18 個規則:if s is 稍遠 and v is 快 then vout is 慢 第 19 個規則:if s is 遠 and v is 快 then vout is 中 第 20 個規則:if s is 很遠 and v is 快 then vout is 很快 第 21 個規則:if s is 很近 and v is 很快 then vout is 很慢 第 22 個規則:if s is 近 and v is 很快 then vout is 很慢 第 23 個規則:if s is 稍遠 and v is 很快 then vout is 很慢 第 24 個規則:if s is 遠 and v is 很快 then vout is 中 第 25 個規則:if s is 很遠 and v is 很快 then vout is 很快

以上是以兩個模糊變數中的所有歸屬函數,所列出的所有可能的命 題,以及根據每一個命題而產生的推論。這樣的控制規則不見得是最 好的,不過,控制規則的好壞並不在本論文的討論範圍。

為了方便接下來的敘述,在此我們先把上述的控制規則整理成如 圖 5-8 的形式:

VC:Very Close VLS:Very Low Speed C:Close LS:Low Speed SF:Small Far MS:Middle Speed F:Far HS:High Speed VF:Very Far VHS:Very High Speed

圖 5-8 控制規則表