Tuesday, March 10, 2009

DESIGNING A SWIFT SMOOTH LINE GUIDED ROBOT

Due to the inherent unpredictability of motors, constructing a motor driven Robot requires information by means of sensors to make the robot move in a predefined path. Following a straight line is the most common scenario. As the size of the Robot and the complexity of the task increases, it becomes necessary that the movement should be as smooth and fast as possible. Also the actual path followed by the Robot must be very close to the line. The following text considers the important factors to be considered while designing such a Robot.

Assumptions:
1) The robot is driven by two motors at the rear end which have unequal speeds.
2) The front of the robot is supported by wheels similar to castor wheels which make differential drive possible.
3) The robot the gets information from a set of sensors placed in a line perpendicular to direction of motion
4) The line acts as a guide for the robot and it is not necessary that the robot must strictly stay on the line always.

Factors to consider while designing:
1) Distance between motors and sensors.
2) The algorithm to adjust motor speeds.
3) Position on the sensors
4) Number of sensors

Factor 1) determines how early the robot gets the information about its orientation. Factor 2) determines how efficiently the robot uses the information.

In an ideal situation (mentioned below), 3) and 4) are not relevant. But since the ideal situation is not practical, 3) and 4) are to be considered.

Our goal is to make the robot follow the line which is achieved if the speed of motors is the same. Thus, in an ideal case, the speed of the faster motor is stabilized at the speed of the slower motor. Does this reduce the overall speed of the robot?

Suppose,
X=speed of faster motor.
Y=speed of slower motor. X>Y.

Consider the three cases:
1) Robot moves with its motors at full speed i.e X and Y.
2) Robot moves with the speed of motor X reduced to Y.
3) Robot moves with the speed of motor X reduced lower than Y.

Intuitively, we might think that faster speed is achieved if the robot motion follows case 1) for majority of time and case 2) and 3) during course correction. But it is not the case.

This is because in the first case the robot moves faster, but its speed component towards the direction of the straight line cannot be more than Y.

The proof that the average speed of the faster motor is Y is simple.

Proof:
Suppose the robot must move a distance of ‘a’.
Speed of slower motor = Y.
Speed of faster motor is variable with variation Y-D to Y+D’,
Y+D’<=X. Time taken by slower motor= (a/Y) = Time taken by faster motor. Thus average speed of faster motor is Y. Note: Distance ‘a’ is not the straight line, but the zigzag path about the straightline. D and D’ mentioned in the above proof depends on all three factors 1), 2) and 3) mentioned above. For smooth robot motion it is important to keep D and D’ as low as possible. This also has an indirect effect on the time taken by the robot to move a certain distance. The maximum value of D and D’ is directly related to factor 1). This is because, as the difference b/w the motor speeds increase, the information about the deviation in orientation is obtained fastest if the sensors are very far away from the motors. If S is this distance, D--0 and D’-->0 as S-->infinity since S ‘amplifies’ the deviation.
Also, if ‘A’ is the length of the straight line, as D-->0 and D’-->0, a-->A.
Also since a>A, decreasing D’ also makes the robot faster.

Thus in ideal case 1 sensor is sufficient to guide the robot if we can be sure that one motor is always faster than the other. If this is not the case 2 sensors are sufficient.

Since the ideal case is not practical we need to consider factors 3) and 4).

Factor 3) comes in picture here since it is important to position two sensors to sense the edges of the line rather than the middle of the line. The positioning of other sensors should be optimized so that no sensor is redundant.

To more closely examine the influence of factors 3) and 4), lets introduce the concept of a state.
Each state describes the corrective action being taken by the robot namely,
a) No correction
b) Left correction due to right deviation.
c) Right correction due to left deviation.

The states b) and c) have a number of substates. This number depends on factors 3) and 4). Each substate indicates a higher level of deviation from the course in the corresponding direction.

It is easy to see that increasing the number of sensors increases the number of states.
But a little thought should convince us that with the same number of sensors cleverly placed will increase the number of states.

Each substate corresponds to a particular angle of deviation of the robot from the straight line. Keeping factors 3) and 4) constant, factor 1) determines the difference in the angle of deviation for each sub state.

Now we need to consider the algorithm which changes the state of the robot according to the sensor input, and accordingly adjusts the speed of the motor. The process of adjusting the speed of the motor is important.

In most of the implementations, there are some predetermined speeds of the motors for each state. As the robot moves from one state to another, these speeds are set abruptly.
Thus if the number of states are small, it results in abrupt change of direction and thus a jerk in the robot motion. This can be minimized by following a different approach as follows:

When the robot is in state b) or c), instead of abruptly changing the motor speed, the faster motor can be decelerated. As the robot moves from one substate to the next in the same state (which indicates increasing deviation), the rate of change of deceleration can be increased. This ensures smooth robot movement. Thus we are effectively getting an infinite number of states with a limited number of sensor states.

The algorithm can be further enhanced to make the robot learn the speeds of motors and thus stabilize the speed of the faster motor very close to the slower motor and thus almost achieve the ideal case(mentioned above).

Conclusion:
While designing a robot which is guided by a line, it is important to maximize the distance between the sensors and motors, optimize the number of sensors and distance between them based on the width of the line to get maximum states. Determine the deceleration values for each sub state to get a smooth motion.

Factor 1) is constrained by the dimension of the robot parallel to its motion.
Factor 3) is constrained by the cost of each sensor, power consumption of sensors and dimension of the robot perpendicular to its motion.
Factor 4) depends on the width of the line and minimum distance required between each sensor.
Factor 2) is one area which can be improved on and on so that D-->0 and D’-->0 using the least number of sensors.

No comments:

Post a Comment