传动系统#

Introduction#

A VEX V5 drivetrain allows the robot to move continuously or for set distances, rotate by degrees or to a heading, and respond to changes in its rotational orientation.

If the drivetrain is configured with an Inertial Sensor, GPS Sensor, or Gyro Sensor, the drivetrain will be able to make more precise forward, reverse, and turning movements by tracking the sensor’s heading and rotation.

The Drivetrain category also includes configuration blocks that let you set drive and turn speeds, define stopping behavior, apply timeouts to avoid execution stalls, and manually update the robot’s heading or rotation values. These features provide flexibility when designing autonomous behaviors or real-time adjustments.

Below is a list of available blocks:

Actions – Drive or turn the robot for a set distance, angle, or continuously.

  • drive – Drives the robot continuously forward or in reverse.

  • drive for – Drives the robot for a set distance.

  • turn – Turns the robot continuously left or right.

  • turn for – Turns the robot a specific number of degrees.

  • turn to heading – Turns the robot to face a specific absolute heading.

  • turn to rotation – Turns the robot to reach a specific cumulative rotation.

  • stop driving – Stops all robot movement.

Settings – Configure drivetrain speeds, stopping, timeouts, and rotation values.

Values – Return drivetrain motion status, heading, rotation, velocity, and current draw.

  • calibrate drivetrain – Calibrates the drivetrain’s configured Inertial, GPS, or Gyro Sensor.

  • drive is done? – Returns a Boolean indicating whether the drivetrain is no longer moving.

  • drive is moving? – Returns a Boolean indicating whether the drivetrain is currently moving.

  • drive heading – Returns the drivetrain’s heading angle (0 to 359.99 degrees).

  • drive rotation – Returns how much the drivetrain has turned since the project started.

  • drive velocity – Returns the drivetrain’s current velocity in % or rpm.

  • drive current – Returns the current (in amps) drawn by the drivetrain’s motors.

  • drive power – Returns the amount of electrical power the drivetrain is consuming in watts.

  • drive torque – Returns the amount of torque currently being applied by the drivetrain in inch-pounds (InLb) or Newton-meters (Nm).

  • drive efficiency – Returns the current efficiency of the drivetrain.

  • drive temperature – Returns the current temperature of the drivetrain’s motors.

Actions#

drive#

The drive block moves the drivetrain forward or in reverse using the current drive velocity. This block runs continuously until another Drivetrain block interrupts it or the project stops.

aria-description 放在这里#
驱动 [向前 v]

Parameters

Description

direction

The direction in which the robot drives:

  • forward
  • reverse

Example

aria-description 放在这里#
当开始
[Drive forward, then stop.]
驱动 [向前 v]
等待 [2] 秒
驱动停止

drive for#

The drive for block moves the drivetrain forward or in reverse for a specified distance using the current drive velocity.

aria-description 放在这里#
驱动 [向前 v] [200] [毫米 v] ▶

Parameters

Description

direction

The direction in which the robot drives:

  • forward
  • reverse

distance

The distance the robot drives, as an integer or decimal.

unit

The unit of measurement:

  • mm (millimeters)
  • inches

expanding arrow

By default, this is a waiting block, so the drivetrain will finish moving before running the next block. To make the drivetrain start moving and immediately run the next block right away, expand the block to say and don’t wait.

Example

aria-description 放在这里#
当开始
[Drive forwards and backwards.]
驱动 [向前 v] [200] [毫米 v] ▶
等待 [1] 秒
驱动 [反 v] [200] [毫米 v] ▶

turn#

The turn block turns the drivetrain continuously left or right using the current turn velocity. The drivetrain will keep turning until another Drivetrain block runs or the project stops.

aria-description 放在这里#
[右 v] 转

Parameters

Description

direction

The direction in which the robot turns:

  • left
  • right

Example

aria-description 放在这里#
当开始
[Turn right, then stop.]
[右 v] 转
等待 [2] 秒
驱动停止

turn for#

The turn for block turns the drivetrain left or right for a specific number of degrees using the current turn velocity.

aria-description 放在这里#
[右 v] 转 [90] 度 ▶

Parameters

Description

direction

The direction in which the robot turns:

  • left
  • right

angle

The number of degrees the robot turns, as an integer or decimal.

expanding arrow

By default, this is a waiting block, so the drivetrain will finish turning before running the next block. To make the drivetrain start turning and immediately run the next block right away, expand the block to say and don’t wait.

Example

aria-description 放在这里#
当开始
[Turn left, then turn around to the right.]
[左 v] 转 [90] 度 ▶
[右 v] 转 [180] 度 ▶

turn to heading#

The turn to heading block turns the drivetrain to face a specific heading using the current turn velocity.

Note: This block is only available if the drivetrain is configured with an Inertial Sensor, GPS Sensor, or Gyro Sensor in the Devices window.

aria-description 放在这里#
归位至 (90) 度 ▶

Parameters

Description

heading

The absolute heading the drivetrain will turn to, from -360 to 360 degrees.

expanding arrow

By default, this is a waiting block, so the drivetrain will finish turning before running the next block. To make the drivetrain start turning and immediately run the next block right away, expand the block to say and don’t wait.

Example

aria-description 放在这里#
当开始
[Turn to face the cardinal directions.]
归位至 [90] 度 ▶
等待 [2] 秒
归位至 [180] 度 ▶
等待 [2] 秒
归位至 [270] 度 ▶
等待 [2] 秒
归位至 [0] 度 ▶
等待 [2] 秒

turn to rotation#

The turn to rotation block turns the drivetrain to face a specific rotational value using the current turn velocity.

Note: This block is only available if the drivetrain is configured with an Inertial Sensor, GPS Sensor, or Gyro Sensor in the Devices window.

aria-description 放在这里#
转向至 [90] 度 ▶

Parameters

Description

rotation

The cumulative rotation value the robot will turn to, as an integer or decimal.

expanding arrow

By default, this is a waiting block, so the drivetrain will finish turning before running the next block. To make the drivetrain start turning and immediately run the next block right away, expand the block to say and don’t wait.

Example

aria-description 放在这里#
当开始
[Turn left, then spin in a circle clockwise and face right.]
转向至 [-90] 度 ▶
等待 [2] 秒
转向至 [450] 度 ▶

stop driving#

The stop driving block immediately stops all movement of the drivetrain.

aria-description 放在这里#
驱动停止

Parameters

Description

This block has no parameters.

Example

aria-description 放在这里#
当开始
[Drive forward, then stop.]
驱动 [向前 v]
等待 [4] 秒
驱动停止

Settings#

set drive velocity#

The set drive velocity block sets the movement velocity as a percentage for all subsequent movement blocks in the project. By default, this is 50%.

aria-description 放在这里#
设定驱动速度为 (50)%

Parameters

Description

velocity

Sets the movement velocity from 0% to 100%.

Example

当开始
[Drive forward at the default velocity.]
驱动 [向前 v] (100) [毫米 v] ▶
等待 (1) 秒
[Move slower.]
设定驱动速度为 (20)%
驱动 [向前 v] (100) [毫米 v] ▶
等待 (1) 秒
[Move faster.]
设定驱动速度为 (100)%
驱动 [向前 v] (100) [毫米 v] ▶
等待 (1) 秒

set turn velocity#

The set turn velocity block sets the default velocity as a percentage for all subsequent turn blocks in the project. By default, this is 50%.

aria-description 放在这里#
set turn velocity to [50] %

Parameters

Description

velocity

Sets the turn velocity from 0% to 100%.

Example

当开始
[Turn at default velocity.]
[右 v] 转 (100) 度 ▶
等待 (1) 秒
[Turn slower.]
设定转向速度为 (20)%
[右 v] 转 (100) 度 ▶
等待 (1) 秒
[Turn faster.]
设定转向速度为 (100)%
[右 v] 转 (100) 度 ▶
等待 (1) 秒

set drive stopping#

The set drive stopping block sets how the drivetrain behaves when drivetrain movement ends.

aria-description 放在这里#
设定驱动停止模式为 [刹车 v]

Parameters

Description

stopping behavior

Sets how the drivetrain stops:

  • brake – Stops immediately.
  • coast – Slows gradually to a stop.
  • hold – Stops and resists movement using motor feedback.

set drive timeout#

The set drive timeout block sets a time limit for how long a Drivetrain block will wait to reach its target. If the robot cannot complete the movement within the set time, it will stop automatically and continue with the next block.

Note: The drivetrain’s time limit is used to prevent Drivetrain blocks that do not reach their target position from stopping the execution of other blocks in the stack.

aria-description 放在这里#
设定驱动超时为 (1) 秒

Parameters

Description

time

The maximum number of seconds a Drivetrain block will run before stopping and moving to the next block.

set drive heading#

The set drive heading block sets the gyro’s current heading to a specified value.

Note: This block is only available if the drivetrain is configured with an Inertial Sensor, GPS Sensor, or Gyro Sensor in the Devices window.

aria-description 放在这里#
设定底盘归位至 (0) 度

Parameters

Description

heading

The heading value to assign, in degrees.

Example

aria-description 放在这里#
当开始
[Turn to the left.]
设定底盘归位至 (90) 度
归位至 (0) 度 ▶

set drive rotation#

The set drive rotation block sets the gyro’s current cumulative rotation value.

Note: This block is only available if the drivetrain is configured with an Inertial Sensor, GPS Sensor, or Gyro Sensor in the Devices window.

aria-description 放在这里#
设定底盘转向至 (0) 度

Parameters

Description

rotation

The cumulative rotation value to assign, in degrees.

Example

aria-description 放在这里#
当开始
[Spin counterclockwise two times.]
设定底盘转向至 (720) 度
转向至 (0) 度 ▶

Values#

calibrate drivetrain#

The calibrate drivetrain block calibrates the drivetrain’s configured Inertial, GPS, or Gyro Sensor. All subsequent blocks will wait for the calibration to complete before executing. Calibration is an internal procedure that measures and compensates for sensor noise and drift over a specified period. During this time, the sensor must remain completely still (i.e., on a stable surface without any external movement). Movement during calibration will produce inaccurate results.

Note: This block is only available if the drivetrain is configured with an Inertial Sensor, GPS Sensor, or Gyro Sensor in the Devices window.

校准底盘

Parameters

Description

This block has no parameters.

drive is done?#

The drive is done? block returns a Boolean indicating whether the drivetrain is not moving.

  • True - The drivetrain is not moving.

  • False - The drivetrain is moving.

Note: This block only detects movement from blocks that can expand to show the and don’t wait option.

<驱动已结束?>

Parameters

Description

This block has no parameters.

drive is moving?#

The drive is moving? block returns a Boolean indicating whether the drivetrain is moving.

  • True - The drivetrain is moving.

  • False - The drivetrain is not moving.

Note: This block only detects movement from blocks that can expand to show the and don’t wait option.

<驱动进行中?>

Parameters

Description

This block has no parameters.

drive heading#

The drive heading block returns the drivetrain’s heading angle as a decimal number, in the range 0 to 359.99 degrees.

Note: This block is only available if the drivetrain is configured with an Inertial Sensor, GPS Sensor, or Gyro Sensor in the Devices window.

(底盘归位角度值)

Parameters

Description

This block has no parameters.

Example

当开始
[Display the heading after turning.]
[右 v] 转 (450) 度 ▶
在屏幕上打印 (底盘归位角度值)◀ 并设定光标为下一行

drive rotation#

The drive rotation block returns how much the drivetrain has turned since the project started, in degrees: positive for clockwise, negative for counterclockwise.

Note: This block is only available if the drivetrain is configured with an Inertial Sensor, GPS Sensor, or Gyro Sensor in the Devices window.

(底盘转向角度值)

Parameters

Description

This block has no parameters.

Example

当开始
[Display the rotation after turning.]
[右 v] 转 (450) 度 ▶
在屏幕上打印 (底盘转向角度值)◀ 并设定光标为下一行

drive velocity#

The drive velocity block returns the current speed of the drivetrain in a range from -100% to 100% or -127 rpm to 127 rpm.

(驱动速度 [% v])

Parameters

Description

unit

The unit of measurement:

  • %
  • rpm – revolutions per minute

drive current#

The drive current block returns the amount of electrical current the drivetrain is drawing in a range from 0.0 to 1.2 amps (amperes).

(驱动电流安培值)

Parameters

Description

This block has no parameters.

drive power#

The drive power block returns the amount of electrical power the drivetrain is consuming in a range from 0.0 to 22.0 watts.

(驱动功率瓦特值)

Parameters

Description

This block has no parameters.

drive torque#

The drive torque block returns the amount of torque currently being applied by the drivetrain in a range from 0.0 to 22.0 inch-pounds (InLb) or 0.0 to 2.1 Newton-meters (Nm).

(驱动扭矩 [InLb v] 值)

Parameters

Description

unit

The unit of measurement:

  • InLb – inch-pounds
  • Nm – Newton-meters

drive efficiency#

The drive efficiency block returns the current efficiency of the drivetrain as a percent.

(驱动效率百分比)

Parameters

Description

This block has no parameters.

drive temperature#

The drive temperature block returns the current temperature of the drivetrain’s motors as a percent.

(驱动温度百分比)

Parameters

Description

This block has no parameters.