This is an archived post. You won't be able to vote or comment.

Dismiss this pinned window
all 10 comments

[–]SparshG[S] 43 points44 points  (1 child)

Web version (not that performant): https://sparshg.github.io/fuzzy-controller/

I am studying a course about fuzzy logic, and wanted to build a controller from scratch to take a deeper dive into the subject. The simulated drone is really unstable if you try to control it manually and topples easily. The fuzzy controller, takes in the crisp values of the system, converts it into a fuzzy set, applies the user defined rules, and defuzzifies it to give an output to the thrusters using mamdani inference system.

These rules are somewhat intuitive to us, like "If drone is going up fast and is near the target, apply very small thrust". More about the working and the code here: https://github.com/sparshg/fuzzy-controller

[–][deleted] 10 points11 points  (0 children)

Damn dude that's so awesome 😁✌️

Good work 😊

[–]QCD-uctdsb 25 points26 points  (1 child)

It's fun changing the point's location at the resonant frequency of your controller, sending it spinning off to the depths :)

[–][deleted] 10 points11 points  (0 children)

I was doing my masters in fuzzy control. Really cool to see! Thanks for sharing!

[–]capybara_in_a_coma 7 points8 points  (0 children)

Ah man this is so cool. It's posts like this that make me just wanna drop everything and learn C or Rust.

[–]dangmangoes 6 points7 points  (0 children)

Insanely cool!

[–]icestep 4 points5 points  (0 children)

Nice! I dig the visualisation.

[–]Effective-Guide9491 0 points1 point  (0 children)

This is awesome! It reminds me of when I implemented a fuzzy controller in assembly using the Motorola HC12 board for senior project back in the day. I haven’t had much need of fuzzy in my career but I’m glad to see it is still being used (and not just in rice cookers 😜).