You are on page 1of 6

PROGRAMMING ASSIGNMENT

Solve Greg Viots Fuzzy Cruise Control System using MATLAB


The controller is used to maintain a vehicle at a desired speed. The system consists of two fuzzy inputs namely speed difference and acceleration. The fuzzy output is throttle control.

Fuzzy rule base


A sample fuzzy rule base governing the cruise control is given below 1. If (speed difference is NL) and (acceleration is ZE) then (throttle control is PL) 2. If (speed difference is ZE) and (acceleration is NL) then (throttle control is PL) 3. If (speed difference is NM) and (acceleration is ZE) then (throttle control is PM) 4. If (speed difference is NS) and (acceleration is PS) then (throttle control is PS) 5. If (speed difference is PS) and (acceleration is NS) then (throttle control is NS) 6. If (speed difference is PL) and (acceleration is ZE) then (throttle control is NL) 7. If (speed difference is ZE) and (acceleration is NS) then (throttle control is PS) 8. If (speed difference is ZE) and (acceleration is NM) then (throttle control is PM) NL: Negative Large; PM : Positive Medium; ZE: Zero NS: Negative Small; PL: Positive Large; PS: Positive Small NM: Negative Medium

Let the measured normalized speed difference be 100 and the normalized acceleration be 70.

Open matlab and type fuzzy .Now a dialog box appears as shown below

Here only one input is shown but we need two inputs in this problem. To add more inputs Edit add variable input

Now two inputs will appear. The name of inputs and outputs can be changed. Range is also entered.

Next double click the input. Then a dialog box will appear as shown. Here we can edit the membership functions as required.

To add more MF: Edit add MF input variable enter the required number. Name of the MF, range , type, parameters are entered.

After entering the values of all the membership function we can enter the fuzzy rule base. For this double click the box mamdani. Then a rule editor dialog box appears. Required rules are chosen. After selecting each rule click add rule.

Now to view the output View rules

From here we can view the output.

You might also like