Wall following algorithm机器人沿墙算法(二)

转载自:http://forums.trossenrobotics.com/tutorials/how-to-diy-128/following-a-wall-3283/

Following a Wall

Lots of people want to build a robot that navigates a house. I always suggest starting a little lower. Let's follow a wall. This tutorial will show you how to follow a wall with a single IR sensor, and two motors on the robot.

A Bang-Bang Controller

While speed control of a motor typically requires fancy PID controllers, our wall following can use something simpler, called a Bang-Bang controller. The controller is called "bang-bang," because it is either on or off, it has no values in between. Our controller will steer away from the wall when too close to it, and steer towards the wall at all other times. If we do this fast enough, the robot will look like it is going straight along the wall. Since our IR sensor updates at about 30hz, we will try to update our motor speeds at the same rate. The image below, shows approximately what we are doing, and when our controller switches:

An important point, is to make sure you adjust for any difference in your motors, try some experiments to find a set of values that actually steer to the left a bit, and a second set of values that steer to the right a bit.

A Bang-Bang-Bang-Bang Controller
Our controller above is nice, but it might not be enough, what if we get way too close, or way too far away? A typical extension is to add two extra states, one for each of the conditions. If our turn values are high enough, this can even let us turn around inside or outside corners.

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值