Inertial and Gyro Sensor#
Introducción#
The VEX IQ (2nd gen) Brain features a built-in Inertial Sensor that includes a 3-axis gyroscope for measuring rotational movement and a 3-axis accelerometer for detecting changes in motion. This sensor is automatically configured and ready to use at the start of every project. For additional sensing options, an external Gyro Sensor is also available, but it must be configured before use. The Inertial Sensor can track orientation, heading, and acceleration, while the Gyro Sensor measures rotational movement only.
Below is a list of all blocks:
Gyro Sensing — Work with heading and rotation tracking.
calibrate gyro — Calibrates an external Gyro Sensor for stable heading tracking.
calibrate BrainInertial — Calibrates the brain’s built-in Inertial Sensor for stable heading tracking.
set Inertial/Gyro heading — Sets the sensor’s heading to a specified value.
set Inertial/Gyro rotation — Sets the sensor’s rotation value.
angle of Inertial/Gyro heading — Returns the sensor’s current heading.
angle of Inertial/Gyro rotation — Returns the sensor’s cumulative rotation.
rate of gyro — Returns the angular velocity.
Inertial Sensing — Use the accelerometer in the Inertial Sensor.
acceleration — Returns linear acceleration along the x, y, or z axis.
gyro rate — Returns angular velocity around the x, y, or z axis.
orientation — Returns roll, pitch, or yaw based on tilt and rotation.
Detección giroscópica#
calibrar el giroscopio#
El bloque calibrar giro calibra un sensor giroscópico. Todos los bloques subsiguientes esperarán a que se complete la calibración antes de ejecutarse. La calibración es un procedimiento interno que mide y compensa el ruido y la deriva del sensor durante un período específico. Durante este tiempo, el sensor giroscópico debe permanecer completamente inmóvil (es decir, sobre una superficie estable sin ningún movimiento externo). El movimiento durante la calibración producirá resultados inexactos.
Note: This block is only available if there is a configured Gyro Sensor.
calibrar [Gyro 1 v] durante [2 v] segundo
Parámetros |
Descripción |
|---|---|
giroscopio |
The Gyro Sensor to calibrate. |
duración |
¿Cuánto tiempo se debe calibrar el sensor en segundos?:
|
Ejemplo
cuando empezó
[Calibrate a Gyro Sensor and display its angle of heading.]
calibrar [Gyro 1 v] durante [2 v] segundo
imprimir ([Gyro 1 v] rumbo en grados) en [Brain v] ◀ y coloque el cursor en la siguiente fila
calibrar BrainInertial#
The calibrate BrainInertial block calibrates the brain’s built-in Inertial 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 brain must remain completely still (i.e., on a stable surface without any external movement). Movement during calibration will produce inaccurate results.
Los cerebros VEX intentan calibrarse automáticamente al inicio de cada proyecto. Sin embargo, si el robot se transporta o se mueve durante el inicio del proyecto, el sensor podría no calibrarse correctamente o generar una calibración incorrecta.
calibrar BrainInertial
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
[Calibrate the Brain's sensor and display its angle of heading.]
calibrar BrainInertial
imprimir ([BrainInertial v] rumbo en grados) en [Brain v] ◀ y coloque el cursor en la siguiente fila
set Inertial/Gyro heading#
The set Inertial/Gyro heading block sets the Gyro Sensor’s heading to a specified value.
Establecer el rumbo [Gyro 1 v] a (0) grado
Parámetros |
Descripción |
|---|---|
giroscopio |
The Inertial or Gyro Sensor to set the heading of. |
título |
El valor a utilizar para el nuevo rumbo en el rango de 0 a 359,99 grados. |
Ejemplo
cuando empezó
[Turn to the new 0 degrees heading.]
Establecer el rumbo [Gyro 1 v] a (90) grado
girar hacia el rumbo (0) grados ▶
set Inertial/Gyro rotation#
The set Inertial/Gyro rotation block sets the Gyro Sensor’s heading to a specified value.
Establezca la rotación [Gyro 1 v] a (0) grado
Parámetros |
Descripción |
|---|---|
giroscopio |
The Inertial or Gyro Sensor to set the rotation of. |
rotación |
The value to use for the new rotation as a decimal number or integer. |
Ejemplo
cuando empezó
[Turn to the new 0 rotation.]
Establezca la rotación [Gyro 1 v] a (-100) grado
girar a rotación (0) grados ▶
angle of Inertial/Gyro heading#
The angle of Inertial/Gyro heading block returns the Gyro Sensor’s heading angle as a decimal number, in the range 0 to 359.99 degrees.
([Gyro 1 v] rumbo en grados)
Parámetros |
Descripción |
|---|---|
giroscopio |
The Inertial or Gyro Sensor to return the heading from. |
Ejemplo
cuando empezó
[Display the Gyro Sensor's heading before and after rotating.]
imprimir ([Gyro 1 v] rumbo en grados) en [Brain v] ◀ y coloque el cursor en la siguiente fila
girar [derecha v] por (390) grado ▶
imprimir ([Gyro 1 v] rumbo en grados) en [Brain v] ◀ y coloque el cursor en la siguiente fila
angle of Inertial/Gyro rotation#
The angle of Inertial/Gyro rotation block returns how much the Gyro Sensor has turned since it started, in degrees as a decimal number: positive for clockwise, negative for counterclockwise.
([Gyro 1 v] rotación en grados)
Parámetros |
Descripción |
|---|---|
giroscopio |
The Inertial or Gyro Sensor to return the rotation from. |
Ejemplo
cuando empezó
[Display the Gyro Sensor's angle of rotation before and after rotating.]
imprimir ([Gyro 1 v] rotación en grados) en [Brain v] ◀ y coloque el cursor en la siguiente fila
girar [derecha v] por (390) grado ▶
imprimir ([Gyro 1 v] rotación en grados) en [Brain v] ◀ y coloque el cursor en la siguiente fila
velocidad del giroscopio#
El bloque velocidad de giro devuelve la velocidad de rotación actual del sensor giroscópico en dps.
([Gyro 1 v] tasa de dps)
Parámetros |
Descripción |
|---|---|
giroscopio |
The Gyro Sensor to return the rotation speed from. |
Ejemplo
cuando empezó
[Display the Gyro Sensor's current rotation speed.]
turno [derecha v]
esperar (1) segundos
imprimir ([Gyro 1 v] tasa de dps) en [Brain v] ◀ y coloque el cursor en la siguiente fila
Detección inercial#
aceleración#
The acceleration block returns the brain’s acceleration along the specified axis (forward, rightward, or downward) in units of g, ranging from -4.00 to 4.00.
(Aceleración inercial del eje [incógnita v] en g)
Parámetros |
Descripción |
|---|---|
eje |
El eje para devolver la aceleración de:
|
Ejemplo
cuando empezó
[Display the acceleration along the x-axis while the drivetrain is moving.]
Establezca la precisión de impresión en [0.01 v] sobre [Brain v]
establecer la velocidad de accionamiento al (100)%
imprimir [Resting: ] en [Brain v] ◀ y coloque el cursor en la siguiente fila
imprimir (Aceleración inercial del eje [incógnita v] en g) en [Brain v] ◀ y coloque el cursor en la siguiente fila
esperar (1) segundos
unidad [adelante v] para (500) [mm v] ◀ y no esperes
esperar (0.1) segundos
imprimir [Startup : ] en [Brain v] ◀ y coloque el cursor en la siguiente fila
imprimir (Aceleración inercial del eje [incógnita v] en g) en [Brain v] ◀ y coloque el cursor en la siguiente fila
tasa de giro#
The gyro rate block returns the brain’s current rotation speed in dps as a decimal number.
(Velocidad de giro inercial del cerebro del eje [incógnita v] en dps)
Parámetros |
Descripción |
|---|---|
eje |
El eje para devolver la velocidad de rotación de:
|
Ejemplo
cuando empezó
[Display the gyro rate around the z-axis while the drivetrain is turning.]
turno [derecha v]
esperar (1) segundos
imprimir (Velocidad de giro inercial del cerebro del eje [z v] en dps) en [Brain v] ◀ y coloque el cursor en la siguiente fila
orientación#
The orientation block returns the brain’s roll, pitch, or yaw, in the range of -180.00 to 180.00 degrees as a decimal number.
(Orientación inercial del cerebro de [rollo v] en grados)
Parámetros |
Descripción |
|---|---|
eje |
El eje de orientación:
|
Ejemplo
cuando empezó
[Display the roll, pitch, and yaw of the Brain as it is rotated by hand.]
para siempre
borrar todas las filas en [Brain v]
imprimir (Orientación inercial del cerebro de [rollo v] en grados) en [Brain v] ◀ y coloque el cursor en la siguiente fila
imprimir (Orientación inercial del cerebro de [paso v] en grados) en [Brain v] ◀ y coloque el cursor en la siguiente fila
imprimir (Orientación inercial del cerebro de [guiñada v] en grados) en [Brain v] ◀ y coloque el cursor en la siguiente fila
Coloque el cursor en la fila (1) columna (1) de [Brain v]
esperar (0.05) segundos
fin


