Early tests with the line tracker have shown that the same input value to a motor can yield a totally different speed for a different motor. In order to drive in a straight line, the motor speeds need to be controlled. Of course the preferred way to do this is to use the encoders.
The original idea was to make a control loop as can be seen in the included figure. The idea was to only regulate one wheel speed and make it go slower or faster than the other wheel according to the encoder difference. This was found to be rather difficult since the speed doesn't increase linearly with the motor input value. So the decision has been made to only slow down a wheel if it leads in number of encoder counts over another wheel with a minimum speed of 0 (so no speeds are allowed opposed to the direction of propagation).
Today, work has continued on the motor controllers. A function drive_controlled(ref_dist, speed) has been made with input variables a reference distance (so far in increments, however this will be millimeters) and a speed value. The function has been programmed in such a way that a negative reference distance will automatically switch the motor directions, so speed can be implemented in an absolute manner.
The controller consists of a proportional gain only which is multiplied with an error signal. The error is defined as the difference of the absolute value of both encoder signals.
Geen opmerkingen:
Een reactie posten