4.4. FUZZY CONTROLLER DESIGN 147
providing as much force as needed to bring the velocity to the desired level. If
the actual velocity is more than the desired velocity, we need to reduce the force
so that the vehicle can decelerate and attain the desired velocity. If the vehicle
is at the desired velocity, we apply sufficient force to maintain the velocity at
the set-point. This knowledge of the system behavior allows us to formulate a
set of general rules. Following are some example rules:
ïIf velocity error is positive and acceleration is negative then apply maxi-
mum force.
ïIf velocity error is negative and acceleration is positive then apply mini-
mum force.
ïIf velocity error is zero and acceleration is zero then apply normal force.
The fuzzy controller we wish to design would require two inputs, namely
velocity error and acceleration, in order to generate the appropriate output,
namely engine force. Schematically, this is illustrated in Figure 4.2.
Figure 4.2. Design of fuzzy controller
Using theMatlabFuzzy Toolbox, we can set up prototype triangular fuzzy
sets for the fuzzy variables, namely, velocity error, acceleration, and engine force.
Typefuzzyat theMatlabprompt to bring up the fuzzy inference system (FIS)
editor. The result is illustrated in Figure 4.3 (a), (b), and (c).
(a) Velocity error (b) Acceleration
Figure 4.3. Prototype membership functions for automobile cruise control