C 中的模糊逻辑隶属函数

发布于 2024-08-12 06:43:07 字数 135 浏览 16 评论 0原文

我正在尝试用 C 语言为一个爱好机器人项目实现模糊逻辑隶属函数,但我不太确定如何开始。

我有关于某个点附近的物体的输入,例如距离或哪些方向是畅通/受阻的,并且我想映射这些输入属于非常近、近、远、非常远等集合的强度。有人知道如何开始吗?谢谢。

I'm trying to implement a fuzzy logic membership function in C for a hobby robotics project but I'm not quite sure how to start.

I have inputs about objects near a point, such as distance or which directions are clear/obstructed, and I want to map how strongly these inputs belong to sets like very near, near, far, very far. Does anyone have a tip on how to start? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

青巷忧颜 2024-08-19 06:43:07

免责声明:我从未实现过模糊控制器(我在现实生活中只使用过 PI 或 PID),控制类是 10 年前的。

这是一个演示,演示了如何使用距离和角度作为输入,以功率作为输出向目标移动。 FuzzyTech 定位起重机的示例
这仅介绍了主题和理论,即没有代码。

最好的来源可能是机器人小组之一
例如西雅图机器人协会模糊逻辑教程它是技术性的......而且很长。

如果您可以访问技术期刊,请在 Google 学术搜索 "模糊逻辑""路径规划"机器人

如果您正在寻找有关如何实现模糊逻辑的一些想法,那么也许某位微芯片制造商的应用说明可以帮助您入门,例如 Microchip 关于 Airflow 的论文控制伺服控制。我知道这不是 Arduino,但 Microchips 的论文通常都非常清晰地呈现。

最后是 C++ 中的一个示例,它可能比您想要的更复杂。 免费模糊逻辑库
祝你好运。

Disclaimer: I've never implemented a fuzzy controller (I've only ever used PI or PID in real-life) and control class was 10 years ago.

Here's an presentation demonstrating moving towards a target using distance and angle for inputs and power as the output. FuzzyTech's Example positioning a crane
This just presents the topic and theory i.e. no code.

Best source is probably one of the robotics groups
e.g Seattle Robotic Society fuzzy logic tutorial it is technical ... and long.

if you can access technical journals then search Google scholar for "fuzzy logic" "path planning" robotics

if you're looking for some ideas on how to implement fuzzy logic then perhaps a Application Note from one of the microchip manufactures will get you started e.g Microchip's paper on Airflow control or servo control. I know it's not Arduino but Microchips papers are usually very clearly presented.

And finally an example in c++ its probably more complex than you're looking for. Free fuzzy logic library
Good luck.

玩世 2024-08-19 06:43:07

我不是模糊逻辑专家,但根据我的基本理解,你可以首先确定什么距离构成近(比如10厘米)远(比如1m),然后你使用概率来填充之间的范围(所以55cm 可能是 50% 近,50% 远)。然后,您对其他属性执行类似的操作,并将与每个属性相关的概率与更多概率相结合。

您有设计模糊控制的好参考吗?

我想你可以从这里开始。我认为他们至少描述了简单的模糊化和去模糊化例程。

I'm not expert with fuzzy logic, but according to my basic understanding, you could start by deciding what distances would constitute near (say 10 cm) far (say 1m), then you use probabilities to fill in the range in between (so 55cm might be 50% near, 50% far). Then you do something similar for your other properties, and combine the probabilities associated with each property with more probabilities.

Do you have a good reference for designing fuzzy controls?

I suppose you could start here. I think they at least describe simple fuzzification and defuzzification routines.

蓝眼泪 2024-08-19 06:43:07

MakeProto 的人员为模糊系统创建了一个自动代码生成器,可以从 Matlab 模糊系统或手动定义的模糊系统输出 C 代码。

可能值得一看。

http://makeproto.com/blog/?p=35

The guys at MakeProto have created an automatic code generator for Fuzzy Systems that outputs C code from Matlab fuzzy systems, or by a hand-defined fuzzy system.

Might be worth taking a look at.

http://makeproto.com/blog/?p=35

拥醉 2024-08-19 06:43:07

模糊推理系统可以用C 和C++ 实现。了解如何在 c 中构建模糊逻辑

Fuzzy inference system can be implemented in both C and C++. Learn How to frame fuzzy logic in c

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文