top of page

fuzzy logic

Engine

Unity

Language

C#

Project Type

Course Work

Role

Solo

Duration

~2 Weeks

Part of my maths and AI module we had to create a Fuzzy Logic race car controller. This would take the car's in two inputs, the distance from the racing line (the orange line in the video) and its velocity relative to said line. The controller would then output the necessary acceleration to get the car back to the line.

To start this assignment, I created a rule set that would describe all the states the two inputs would have and the resultant outputs. This resulted in the table of rules on the right. From this, the various membership functions were created in MATLAB, and are shown below. The graph for velocity is identical to the distance one.

Fuzzy Logic Rule Set
graph.png
long graph.png
biggraph.png

When all the rules and membership functions are combined, they produce the graph on the left. For the actual application, I chose to use Unity as it would be the easiest one for me to properly implement it in. As such all the before mentioned rules were coded in C#, as was the defuzzification method, in this case the Center of Gravity method was used (said method is shown in the video about halfway through).

©2018 by Andrew Milne. Proudly created with Wix.com

bottom of page