The first step in designing a fuzzy system with the Fuzzy System Designer is to create the input and output linguistic variables for the system. In the vehicle maneuvering example described in the topics on fuzzy system design, the fuzzy system has two linguistic input variables, Vehicle Position x and Vehicle Orientation β, and one linguistic output variable, Steering Angle φ.
Tip��The graphs in the Creating Membership Functions topic illustrate the range and membership functions for each of these linguistic variables.
Complete the following steps to create an input linguistic variable that corresponds to the Vehicle Position x input linguistic variable of the vehicle maneuvering example.
Select Tools�Control Design and Simulation�Fuzzy System Designer to launch the Fuzzy System Designer and display the Variables page.
Click the Add Input Variable button to the right of the Input variables list to display the Edit Variable dialog box.
In the Name text box, enter vehicle-position.
Specify the Range by entering 0 in the minimum field and 10 in the maximum field. This specifies that the position of the vehicle relative to the destination ranges from 0.0 to 10.0 meters.
Click the Add Membership Function button under the Membership functions control to enable the control and create a new membership function for the vehicle-position linguistic variable.
In the Name text box, enter left.
Select Trapezoid from the Shape pull-down menu to specify that a trapezoid function determines the degrees of membership for the linguistic variable.
Click the Color field to select the color to use for the membership function in the Membership functions graph.
In the Points array, enter the following numbers, one for each element of the array: 0, 0, 1, 4. These points specify the values of the linguistic variable corresponding to the base and top points, in order from left to right and base to top, of the membership function.
Repeat steps 5 through 9 for each of the following membership functions for Vehicle Position x, using the shape and points shown in the following table:
Membership Function
Shape
Points
left-center
Triangle
3, 4, 5
center
Triangle
4.5, 5, 5.5
right-center
Triangle
5, 6, 7
right
Trapezoid
6, 9, 10, 10
Note��The Points array requires that each point for a given membership function be greater than or equal to all previous points. If the array automatically changes your entries to fit this requirement, try entering points from left to right.
You can compare the Membership functions graph to the Vehicle Position graph in the Creating Membership Functions topic to confirm your entries.
Click the OK button to save your changes and return to the Variables page. The
vehicle-position input variable appears in the Input variables list and the corresponding membership functions appear in the Input variable membership functions graph.
Repeat steps 2 through 11 to create a vehicle-orientation input linguistic variable that corresponds to the Vehicle Orientation β variable of the vehicle maneuvering example. The following graph shows the range and membership functions for the variable.
Note��For the purposes of this tutorial, you can use approximate values for the points of the membership functions.