Project time frame: Jan - May 2019
|
Executable download: LINK
|
Project type: Coursework
|
A quick design for the rules of the membership functions, table on the top, was quickly adapted to the final version, the second table, used for the application. The reason for this re-design was that the car would receive a drastic change in speed when passing the threshold between the zero and hard left or hard right membership functions.
The rules designed from the final table and implemented into Matlab's FIS can also be seen on the right. The output was assigned 5 membership functions; Hard Left, Left, Zero (No Change), Right and Hard Right. The outputs domain was set to -1 to 1 (same as the inputs) to allow for scaling in applications when required. |
The tables below are examples of output calculations based on the Distance and Velocity inputs. Each Distance value was tested with Velocity of -1, 0 and 1. The left table holds the results gathered from using Matlab and the right table holds the results from using the Application.
After comparing the tables, it was discovered that there was a considerable difference between the two sets of data. This could be due to differences in the data structures used (double vs long vs float), the way the defuzzification method is calculated, rounding errors and even rounding to different decimal places. |
From gathering the values from one test run in the Test Mode, the velocity values are just slightly bigger than the distance and exactly mirrored. For example, -263.6 and 263.6.
There could have been more test data however that was deemed unnecessary as the results would have been almost identical due to the nature of the code. The only factor that would affect the results would be the delta time. |