Lego EV3: Eντολή Move Tank Block

The Move Tank block can make a robot drive forward, backward, turn, or stop. Use the Move Tank block for robot vehicles that have two Large Motors, with one motor driving the left side of the vehicle and the other the right side. You can make the two motors go at different speeds or in different directions to make your robot turn.

Left motor
Right motor

Tips and Tricks
Robot vehicles with two drive motors can also be controlled by the Move Steering block. The Move Steering block is similar to the Move Tank block, but has a different way of controlling turns.
Choose your Motor Ports and Control Mode

Port Selector
Mode Selector
Inputs


Select the two motors (A, B, C, or D) that you want the Move Tank block to control by using the Port Selector on the top of the block. Click on each motor letter to choose the port for that motor. The first port should be the motor on the left side of the vehicle, and the second port should be the motor on the right side.

 

Tips and Tricks
Make sure that with your robot facing “forward”, the motor on the left side is the first one listed in the Port Selector. Otherwise, your robot will turn in the wrong direction.
Use the Mode Selector to select how you want to control the motors. After selecting the mode, you can choose values for the inputs. The inputs available will change depending on the mode. The modes and inputs are described below.
Modes
On

The On mode turns both motors on, then immediately continues to the next block in the program. You can control the speed and direction of the motors using the Power Left and Power Right inputs. The motors will run until they are stopped or changed by another block later in the program, or until the program ends.

Example
Use the On mode when you want other blocks in your program to control how long the motors stay on. In this program the robot drives straight forward. When the touch sensor is pressed the robot stops.
Off

The Off mode turns both motors off. Use the Off mode to stop a robot that was started by the On mode earlier in the program. See the example above.

If Brake at End is True, the motors are stopped immediately. The motors will be held in their stopped position until another Move or Motor block starts them, or until the program ends. If Brake at End is False, power to the motors is simply turned off. The motors will coast using any remaining momentum until they stop, or until another Move or Motor block starts.

On For Seconds

On for Seconds turns both motors on for the number of seconds in the Seconds input, then turns them off. The block will wait until the time has passed before the program will continue to the next block.

You can control the speed and direction of your robot using the Power Left and Power Right inputs. Use Brake at End to stop your robot after exactly the specified number of seconds.

Example
This program will make a robot drive straight forward at full power for 2 seconds, then stop.
Tips and Tricks
You can use a decimal point in the Seconds input to get an exact amount of time, such as 3.5 for three and a half seconds, and 0.25 seconds for one quarter of a second.
On For Degrees

On for Degrees turns both motors on, waits until one of them has turned for the number of degrees of rotation in the Degrees input, and then turns both motors off. This can be used to make your robot travel a specific distance or turn a specific amount. 360 degrees of rotation corresponds to one full turn of a motor.

You can control the speed and direction of your robot using the Power Left and Power Right inputs. Use Brake at End to stop your robot after exactly the specified number of degrees.”

Example 1
This program will make a robot drive straight forward at 75% power until the motors have turned 900 degrees (two and a half rotations), then stop. Using the same value for Power Left and Power Right makes the robot drive straight.
Tips and Tricks
The distance that your robot will travel depends on the Degrees input. However, the distance also depends on the diameter of the drive wheels used and other physical factors. The internal rotation sensors in the motors measure the amount of rotation at the motor hubs.
Example 2

The program below will make a robot turn in an arc to the right, because Power Left is greater than Power Right. The turn will continue until the left motor (the outside and faster one) has turned exactly 900 degrees, then the robot will stop.

Example 3
This program will make a robot do a “spin turn” by making the two motors turn in different directions. Using a negative number for Power Right makes the right motor turn backwards. The robot will turn until the left motor has turned 250 degrees forward, then the robot will stop. The right motor will turn 250 degrees backwards.
Tips and Tricks
Note that the Degrees input measures the amount of motor rotation of the forward or faster motor, not the change in the robot’s direction when turning. The change in the robot’s direction will depend on wheel diameter, wheel spacing, and other factors.
On For Rotations

On for Rotations turns both motors on, waits until one of them has turned for the number of rotations in the Rotations input, then turns both motors off. This can be used to make your robot travel a specific distance or turn a specific amount.

You can control the speed and direction of your robot using the Power Left and Power Right inputs. Use Brake at End to stop your robot after exactly the specified number of rotations.”

Example
This program will make a robot drive straight forward at 50% power (using 50 for both Power Left and Power Right) until the motors have turned 3 full rotations. It will then drive straight backwards (using negative power) for 3 rotations and stop where it started.
Tips and Tricks
The On for Rotations mode is exactly the same as the On for Degrees mode, but it uses a different unit of rotation. You can also use a decimal point in the Rotations input to get parts of a rotation. The following examples show two different ways to get the same amount of rotation:
Rotations Degrees
1 360
2 720
0.5 180
1.25 450
7.2 2592
Motor Power and Direction

The Power Left and Power Right inputs accept a number from -100 to 100. Positive and negative numbers make the Large Motor turn in different directions, as shown in the graphic below.

Positive Power
Negative Power

You can change the normal rotation direction for a motor using the Invert Motor block. If a motor direction has been inverted, the effect of positive and negative power levels will be the opposite of that shown above.

Tips and Tricks
The rotation speed of a motor will be roughly proportional to the power level specified, although rotation speed is also affected by how much load is put on the motor.
Inputs
The inputs of the Move Tank block control the details of how the motors will operate. You can enter the input values directly into the block. Alternatively, the values can be supplied by Data Wires from the outputs of other Programming Blocks. The inputs available and their functions depend on the control mode you selected.
Input Type Allowed Values Notes
Power Left Numeric -100 to 100 Motor power level for the left motor.
See Motor Power and Direction.
Power Right Numeric -100 to 100 Motor power level for the right motor.
See Motor Power and Direction.
Brake at End Logic True/False Applies when the block finishes.
If True, the motors are stopped immediately and held in position.
If False, motor power stops and the motors are allowed to coast.
Seconds Numeric ≥ 0 Movement time in seconds.
Degrees Numeric Any Number Amount of movement amount in degrees. 360 degrees make a full rotation.
Rotations Numeric Any Number Amount of movement in rotations.
Αλλαγή μεγέθους γραμματοσειράς
Αντίθεση