Turning and Motor Synchronization
A robot with two drive wheels and a trailing coast wheel (a tri-bot) can be made to turnby driving the two drive wheels at di erent rates. Consider the circular track in Figure
motors with a speed ratio of 15
25 = 3
5 . Of course there are many di erent power settings for
the motors that yield this ratio. In fact, any pair of left and right motor power settings that
reduce to this fraction will cause the tri-bot to move along this track of radius 20cm. The
only di erence will be in how fast the robot moves along the track. A ratio of 15 : 25 will
move only half as fast as a ratio of 30 : 50.
RobotC provides convenient commands for controlling a pair of motors. Listing 7.1 shows
how to control the relative speeds of the two motors.
# pragma config (Motor , motorC , Left , tmotorNormal , PIDControl )
# pragma config (Motor , motorA , Right , tmotorNormal , PIDControl )
task main () {
nSyncedMotors = synchAC ; // Left motor slaved to Right motor
nSyncedTurnRatio = +60; // Left motor turns 60% of right motor
motor [ Right ] = 50; // Right motor moves at 50% power
// Left motor automatically moves at 30%
// because of synch and synch ratio.
wait1Msec (1000);
}
Listing 7.1: This program will drive a tri-bot with trackwidth 10cm around a circle of radius
20cm.
The left motor is synchronized to the right motor with the instruction, nSyncedMotors
= synchAC;. The relative speed of the left motor to the right motor is set at +60% (roughly
3 : 5) with the instruction nSyncedTurnRatio = +60;. Subsequently, when the right motor
is activated with the power 50, the left motor is automatically activated with a power that
is 60% of the right's{in this case, roughly 30. With the speed ratio at 3 : 5, the tri-bot will
move around a track of radius 20cm for 1 second.
In the previous example, we assumed that the center of the circle about which the robot
turned was to the left (or right) of the robot. Suppose the center of the circle is between the
drive wheels (under the robot) as in Figure 7.2. This situation occurs when r < w=2.
Notice that in this case, the numerator of equation (7.1) is negative indicating that the
left wheel turns in the opposite direction of the right wheel. The path of the left wheel is
indicated by the inside black circle. The path of the right wheel is indicated by the outside
black circle. The arrows show the direction of travel and starting point of each wheel.
The dotted blue line shows the path of the midpoint of the distance between the wheels.
Additional information on motor synchronization is available here.1

No comments:
Post a Comment