There are definite benefits to using a robot with a rounded chassis and close-fitting wheels. Round robots have excellent drivability; if your S3 hits a chair leg or wall it can rotate in place to find an escape route. A square-shaped robot can catch its corners on obstacles where a round robot would not. Further, robots with a symmetrical drive configuration located at their center line have the ability to make zero-turn radius (ZTR) maneuvers. Because the S3 can scribble or draw with a Sharpie® pen placed in its pen port (or with certain dry-erase markers for use on white boards) both of these features are particularly important.
Let’s take a look at the various turn options for the S3.
Zero-Turn Radius (ZTR)
A ZTR turn requires the two drive wheels to move in opposite directions at the same speed for the same duration of time. This type of turn causes the S3 to pivot in place in a clockwise or counterclockwise direction. Speed and time combine to control the amount of rotation. We will demonstrate this when we discuss the rotate and drive a turn blocks later in the tutorial.
Locking one wheel in place and driving the other in either direction is a one-wheel turn. These turns make a tight outer radius equal to twice the diameter of the S3 robot. To make a turn at a tighter radius both drive wheels are used with the second wheel rotating the opposite direction at a different speed (remember, equal speed in the opposite direction equals a zero-turn radius). Different wheel speeds and duration combine to control the rotation amount and size of radius. One-wheel turns are best made with the drive speed block covered previously in Drive There and Back Again.
Driving both wheels forward (or both backward) at different speeds creates a wide-radius turn. The S3 moves along a wide arc as it moves forward or backward. Speed and time values combine to control the radius and the length of the arc. You can play around with adjusting these values to change your robot's behavior.
Did You Know?
The S3 is the third edition of a very successful run of Scribbler robots that started with the original blue colored Scribbler Robot (shown in the robot comparison image from the Setting Up BlocklyProp for the S3 tutorial). The original blue Scribbler did not have any wheel encoders (used to accurately measure wheel movement) and it used a single-core processor called the BASIC Stamp 2. The BASIC Stamp 2 is only capable of doing one thing at a time, so it was unable to drive the wheels and monitor encoders simultaneously. The S3 robot uses the Propeller multicore microcontroller, which is capable of handling multiple simultaneous operations.
The limited capability of the single-core processor in the original Scribbler Robot made it a challenge to drive in an accurate straight line or curved path.
Turns Using the Drive Block
The drive block can be found in the ACTIONS > MOTORS category. As you learned in the Driving Basics tutorial, you can control the direction of travel, path of travel, and speed. This is a non-blocking command because it runs continuously until it is changed.
Direction of travel is either forward or backward.
The directional drop down choices on the drive block adjust the approximate direction of one or both wheels in the following manner:
- straight: both wheels turn at 100% of the chosen speed (straight travel, no turn)
- slightly to the right or left: the inside wheel turns at 75% of the speed of the outside wheel (a wide-radius turn)
- gently to the right or left: the inside wheel turns at 50% of the speed of the outside wheel (a medium-radius turn)
- sharply to the right or left: the inside wheel wheel turns at 25% of the speed of the outside wheel (a tight-radius turn)
The speed drop down choices set the approximate overall speed (for straight travel) or the speed of the the outside wheel (in a right or left turn, or arc).
- full: 100% of full speed
- a quick: 75% of full speed
- a gentle: 50% of full speed
- a slow: 25% of full speed
Let’s take a quick look at an example program that makes the S3 drive forward and gently to the right at full speed, then backward and gently to the right at a gentle speed to about where it started (because speed is not actually linear, there may be some difference in distance traveled in each direction).
- Build this example and try it out:
Using the drive block to drive a specific distance is a function of time (given in the wait block) and speed. Precise, encoder-based movements are only available in more advanced blocks like drive speed and drive distance.
Zero-Turn Radius Turns Using the Rotate Block
The rotate block (located in the ACTIONS>MOTORS category) controls zero-turn radius (ZTR) turns. This block combines drop down menus for direction (clockwise or counterclockwise), with degrees to rotate (or any number between 1 and 359 may also be entered manually), and speed. The rotate block is very useful for the type of dead-reckoning precision movements used in artwork, maze-solving, and return-to-home challenges. This block is a time-blocking command (it runs until it’s finished, and then the S3 stops):
- Try the example below. For feedback, use the right two LEDs set to green to indicate clockwise movement and the left two LEDs set green for counterclockwise movement:
- Try adding more to this program. For example, performing different degree turns at different speeds, or modifying the light patterns you use.
The ACTIONS > MOTORS category contains blocks that allow you to input precise travel distances for each wheel. The following drive distance block can be particularly useful for sensor-based navigation where you want the robot to perform a turn in response to an input (light level, object detected) in a repeatable manner. For example, sensing surrounding light levels, and then turning a particular distance based on the amount of light detected. You may have seen your robot do this already if you tried running its default demo program #2.
The ACTIONS > MOTORS menu drive a turn block is for moving the S3 through a turn with number of degrees, radius value, and top speed set by the user. This block can do zero-turn radius and arc turns depending on your radius value (leave at 0 for a ZRT turn, put in a value greater than 0 for an arc).
Did You Know?
The drive a turn block could be used as part of a navigation program that takes and saves distance measurements with a PING))) sensor mounted on the robot at 0, 90, and 180 degree positions. This would allow the S3 to find the most open area to navigate towards as it roams. As you will learn in future tutorials, the infrared sensors built into your robot detect the presence of an object up to 18” away, but do not actually provide feedback on how far the obstacle actually is. A PING))) can sense an obstacle (ultrasonically) and provide a distance measurement of its location up to to 100 cm away.
- Write a BlocklyProp program that rotates the S3 in place (ZTR) for 360 degrees using the rotate block.
- Write a program to rotate the S3 360 degrees using a one wheel turn using the drive speed block. How will you control the amount of rotation?
- Finally, write a program to steer the S3 in a full circle (using any radius you wish), stopping at the point where you started.
- Write a program to steer the S3 forward along a serpentine path forward and then backward ending as close to where you began as possible.
Special thanks to Parallax friend Whit Stodghill for his assistance in writing, editing, and testing material for these S3 tutorials.