智能车制作

 找回密码
 注册

扫一扫,访问微社区

查看: 867|回复: 0
打印 上一主题 下一主题

[软件类] 新手,求帮忙

[复制链接]

5

主题

10

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
216
QQ
威望
128
贡献
56
兑换币
63
注册时间
2014-12-18
在线时间
16 小时
跳转到指定楼层
1#
发表于 2015-3-16 22:56:05 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
1贡献
float Pos_cal(void)
{
   float fValue=0.0;
   float Value=0.0;
   
   LR_Add = 64-middle;
   
   //LR_Add = 64-(k1+k2)/2;
   //LR_Sub = k1-k2;
   
   
   Dir_Error[2] =  Dir_Error[1];   
   Dir_Error[1] =  Dir_Error[0];
   Dir_Error[0] = LR_Add;
     
    Dir_Deviation[2] = Dir_Deviation[1];
    Dir_Deviation[1] = Dir_Deviation[0];
    Dir_Deviation[0] = Dir_Error[0]- Dir_Error[1];
   
   Fuzzy_lishudu(LR_Add,Dir_Deviation[0]);
   
   Dir_P = Fuzzy_Kp(0,0);
   //Dir_I = Fuzzy_Ki(10,1);
   //Dir_D = Fuzzy_Kd(0,0);
    Value = LR_Add*Dir_P +Dir_Deviation[0]*Dir_I/100.0+Dir_Error[1]*Dir_D/100.0;
         
    fValue=Value;
   
   return  fValue;
}
新手不理解,能不能解释一下,越清楚越好,谢谢

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关于我们|联系我们|小黑屋|智能车制作 ( 黑ICP备2022002344号

GMT+8, 2024-9-27 23:31 , Processed in 0.065695 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表