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

A robot needs a reference for its movement from one location to another. One way of doing this is by following a line. The other way is to use the existing walls around us to guide the robot to move from one location to another.A robot uses the obstacle/range sensor to do this job.A robot can be designed to either follow a wall on the left side or on the right side. This is useful for solving a maze, which is similar to following the wall.
 

  • How to follow the wall?

The simplest and efficient way for a robot to follow the wall is to use three IR obstacle sensors s1,s2 and s3 on either side of the robot. S1 and S3 is used to follow the wall, while S2 is used to maintain a safe distance from the wall at all time. A micro controller reads the IR sensor output and makes decision in the manner explained below.It is necessary to make sure at all the time, that the robot is neither far away(robot will  loose its path) from the wall or too close to the wall(avoid collision).
Note: It is also possible to use a single IR/Ultrasonic range finder mounted on servo to scan the distance over a range.This is slightly a complicated design involving  expensive components. We will cover this topic in the later section.
 

The algorithm for following the wall is explained in detail below:

For a Bot to follow and move along the wall, it is always necessary to keep its position parallel to the wall.
When a robot is parallel to the wall at a safe distance from the wall, sensor S1 and S3 are both activated. This state can be read by the micro controller and move the motors in both forward direction. This results in the robot following the wall.


When a robot starts to move away from the wall either because of the wall, or because of the change in direction of the robot, the sensor S1 is deactivated as its distance from the wall is now increased.
But the sensor S3 is still active  which means , the robot is not too far off from the wall. Its just directed away from the wall. To make the robot align parallel to the wall, the robot has to move close to the wall. To achieve this Motor M2 is stopped and M1 is in forward direction.
The bot should continue in this direction till the sensor S1 is activated but not S2.

When a robot starts to move towards the wall either because of the wall, or because of the change in direction of the robot, the sensor S3 is deactivated as its distance from the wall is now increased.
But the sensor S1 is still active  which means , the robot is just directed towards the wall. To make the robot align parallel to the wall, the robot has to move away from the wall. To achieve this Motor M1 is stopped and M2 is in forward direction.
The bot should continue in this direction till the sensor S3 is activated but not S2.

As mentioned earlier it is always necessary for a robot to keep a safe distance from the wall. When a robot moves too close to the wall, all the sensors S1, S2 and S3 are all activated. Now the robot has to be moved away from the wall. This is done by moving the motor M2 in forward direction and M1 being stopped.
 

Note:

1.The position of all the sensors need not be placed as described in the pic. The range of the sensor S2 has to be set low if all the sensors are in a straight line. If the range cannot be adjusted, then the sensor S2 can be placed at a longer distance as in the pictures.

2.Keep a low speed for better results when following the wall.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值