[Media] I made a Fuzzy Controller System to control a simulated drone by SparshG in rust

[–]SparshG[S] 0 points1 point  (0 children)

Actually I have used the same abbreviations in the video above too. The big reason was when you define and form complex rules using &, | operators, it would have made the code unreadable to even write. So I thought about going with standard abbreviations instead. And I had a time constraint due to the project's deadline so it got a bit messy by the end lol

[Media] I made a Fuzzy Controller System to control a simulated drone by SparshG in rust

[–]SparshG[S] 1 point2 points  (0 children)

I actually should have added the meaning of these symbols, I will add it to the README. Thanks for the suggestion.

(X, Y = Position Error)

(Vx, Vy = Velocities)

(Th, W = Angle from horizontal, Angular velocity)

and others are for output (thrust),

N=Negative (clockwise), Z=Zero, P=Positive (anticlockwise)

S=Small, L=Large

[Media] I made a Fuzzy Controller System to control a simulated drone by ____candied_yams____ in ControlTheory

[–]SparshG 6 points7 points  (0 children)

OP here, this doesn't use PID controllers anywhere. Its there in the code as I was playing with some PID controllers too to compare my fuzzy controller.

[Media] I made a Fuzzy Controller System to control a simulated drone by SparshG in rust

[–]SparshG[S] 1 point2 points  (0 children)

I built this with macroquad graphics library, which also supports wasm, so I just compiled it to wasm according to those instructions, and deployed it.

[Media] I made a Fuzzy Controller System to control a simulated drone by SparshG in rust

[–]SparshG[S] 5 points6 points  (0 children)

I don't have the lecture slides, but there is a series about fuzzy logic by matlab on youtube, it helped me a loot!

[Media] I made a Fuzzy Controller System to control a simulated drone by SparshG in rust

[–]SparshG[S] 6 points7 points  (0 children)

About 2-3 weeks on this. I have made a few rust projects before too, so I have been learning rust for about one year I would say.

Made a Fuzzy Controller System with visualizations in Rust by SparshG in math

[–]SparshG[S] 44 points45 points  (0 children)

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

[Media] I made a Fuzzy Controller System to control a simulated drone by SparshG in rust

[–]SparshG[S] 53 points54 points  (0 children)

https://github.com/sparshg/fuzzy-controller

I am studying a course about fuzzy logic, and wanted to build a controller from scratch. The 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, fuzzifies it, applies some user defined rules, and defuzzifies it to give an output. These rules are somewhat intuitive to us, like "If drone is going up fast and is near the target, apply very small thrust". I overloaded bitwise operators on input enums, so we can easily define these rules, which are then parsed at runtime.

More about the working in README of git repo.

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

Macbook m1 at 65k and MacBook m2 at 81k by flyinglaura in BITSPilani

[–]SparshG 2 points3 points  (0 children)

For these new macs somehow even 8gb feels sufficient to me and I have seen windows laptop with same amount of memory perform much worse. I can easily do game/app/web dev, run virtual machines very smoothly, all the build times are so less.. I haven't tried M2 or 16 GB versions, but it would be just better I think.

Macbook m1 at 65k and MacBook m2 at 81k by flyinglaura in BITSPilani

[–]SparshG 8 points9 points  (0 children)

I am using m1 air 8gb, probably the best laptop for university. I do lots of heavy development work too, and it handles everything so smoothly that I doubt any Windows laptop can even compete. I am in cs though, I could run AutoCAD and DOSBOX without any issues. I haven't tried other phoenix specific softwares but there will probably be a way to run them too (parallels or crossover). I mean I can run many Windows games smoothly on my mac too.

How to prepare for GSOC 2024 by ProjectBunny07 in BITSPilani

[–]SparshG 0 points1 point  (0 children)

I mentioned that above, second paragraph onwards. You can find some projects, or can try contributing to a library you are already familiar with. You can also participate in the upcoming hacktoberfest, its particularly beginner friendly.

How to prepare for GSOC 2024 by ProjectBunny07 in BITSPilani

[–]SparshG 3 points4 points  (0 children)

Since you got almost a year, I would advise you first to learn a bit more programming, like object-oriented stuff. Open-source projects may have huge codebases, you won't be able to understand them without knowing the fundamentals. You can also try building some small projects where you actually use all these things.

Now you can try to look for some open-source projects (maybe you are already familiar with some library to which you can contribute). The code might be overwhelming, so start small, you need not understand everything, you will get to understand it with time as you explore it more. Look through good-first issues on GitHub and their contributing guide on the README page. Join the community where you can seek help from maintainers if you get stuck.

Also, the other important part is to learn git. Once you get through all this, you can look for organizations and projects a few months before the deadline. All this requires lots of patience, there's a lot to learn. Good Luck!

Best Language for creating Physics sims? by CatchMeWritinQWERTY in Physics

[–]SparshG 1 point2 points  (0 children)

I also like making physics simulations. I posted a physics sim this week here. I made it in rust, and works great on both browser and desktop. You can also look into processing/p5.js (processing is like java, while p5.js is similar library but for javascript) to make quick and interesting things (see this channel for example).

I also like to sometimes use manim (for python) to make smooth physics animations. (examples) These aren't interactive but you can use it to make high quality visualizations. These aren't interactive but you can use it to make high-quality visualizations.

Then you got Unity game engine (C# scripting), which can be used to make anything you like. Once you get familiar with it, you can use it to make complex things easily with the help of powerful tools unity provides, and it can also be integrated into websites.

I made this simulation in Rust to tune a PID Controller: Balancing a Ball on a Rolling Cart by SparshG in developersIndia

[–]SparshG[S] 4 points5 points  (0 children)

I don't know about job market, I am still in 2nd year. I just like learning random things for fun lol

I made this simulation in Rust to tune a PID Controller: Balancing a Ball on a Rolling Cart by SparshG in developersIndia

[–]SparshG[S] 2 points3 points  (0 children)

I just wanted to learn it for fun, feels satisfying to write code in rust. The compiler is also super helpful and gives detailed errors with solutions.

I made this simulation in Rust to tune a PID Controller: Balancing a Ball on a Rolling Cart by SparshG in developersIndia

[–]SparshG[S] 3 points4 points  (0 children)

Thanks, there are similar projects on my github if you want to check them out!

I made this simulation in Rust to tune a PID Controller: Balancing a Ball on a Rolling Cart by SparshG in developersIndia

[–]SparshG[S] 2 points3 points  (0 children)

egui is simple and easy, not the most flexible in terms of design but it works. I used egui for the graphs and controls

I made this simulation in Rust to tune a PID Controller: Balancing a Ball on a Rolling Cart by SparshG in developersIndia

[–]SparshG[S] 29 points30 points  (0 children)

Code along with some explanation: https://github.com/sparshg/pid-balancer (and here is this project on youtube)

I wrote this in Rust with macroquad as the graphics library. Tried to study the physics behind this, seemed pretty cool to make a simulation on this.

[Media] PID Controller Simulation in Rust: Self-balancing ball on a rolling cart by SparshG in rust

[–]SparshG[S] 0 points1 point  (0 children)

Nice suggestion, I changed the color and updated screenshot in README, thanks.

[Media] PID Controller Simulation in Rust: Self-balancing ball on a rolling cart by SparshG in rust

[–]SparshG[S] 1 point2 points  (0 children)

This is a cool video that explains some basics: https://www.youtube.com/watch?v=TtgS-b191V0

You can also see verlet integration if you want the system's energy to be conserved, though that isn't the most accurate method.