Sensor inercial y giroscópico#
Introducción#
The VEX IQ (2nd gen) Brain has a built-in Inertial Sensor. This sensor measures how the Brain is moving and turning.
The built-in Inertial Sensor uses two parts to do this. The gyroscope measures turning, such as heading, rotation, gyro rate, and orientation. The accelerometer measures changes in motion, such as speeding up or slowing down.
The built-in Inertial Sensor is automatically configured and ready to use at the start of every project. An external Gyro Sensor can also be used, but it must be configured before use. The external VEX IQ Gyro Sensor measures turning only.
A continuación se muestra una lista de todos los bloques:
Gyro Sensing — Work with heading and rotation values.
calibrate gyro — Calibrates a configured external Gyro Sensor.
calibrate BrainInertial — Calibrates the Brain’s built-in Inertial Sensor.
set Inertial/Gyro heading — Sets the sensor’s current heading to a new heading value.
set Inertial/Gyro rotation — Sets the sensor’s current rotation to a new rotation value.
angle of Inertial/Gyro heading — Reports the direction the sensor is facing, from 0 to 359.99 degrees.
angle of Inertial/Gyro rotation — Reports how far the sensor has turned.
rate of gyro — Reports the external Gyro Sensor’s current rotation speed.
Inertial Sensing — Use the built-in BrainInertial Sensor.
acceleration — Reports how quickly the Brain is speeding up or slowing down on the selected axis.
gyro rate — Reports how fast the Brain is rotating on the selected axis.
orientation — Reports the Brain’s roll, pitch, or yaw angle.
Detección giroscópica#
calibrar el giroscopio#
The calibrate gyro stack block calibrates a configured external Gyro Sensor.
Calibration helps the Gyro Sensor measure turns correctly. Keep the sensor still during calibration. If the sensor moves during calibration, heading and rotation values may not measure turns correctly.
The project will wait until calibration is done before the next block in the stack runs.
Nota: Este bloque solo está disponible si hay un sensor giroscópico configurado.
calibrar [Gyro 1 v] durante [2 v] segundo
Parámetros |
Descripción |
|---|---|
giroscopio |
The external 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 stack block calibrates the Brain’s built-in Inertial Sensor.
Calibration helps the Inertial Sensor measure turns correctly. Keep the Brain still during calibration. If the Brain moves during calibration, heading, rotation, gyro rate, and orientation values may not measure correctly.
The project will wait until calibration is done before the next block in the stack runs.
VEX Brains attempt to calibrate themselves automatically at the start of every project. However, if the robot is being carried or moved during project start, the sensor may fail to calibrate properly or yield incorrect calibration.
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
Establecer rumbo inercial/giroscopio#
A heading is the direction the sensor is facing, measured in degrees from 0 to 359.99. The set Inertial/Gyro heading stack block changes the sensor’s current heading to a new heading value.
For example, if the sensor has turned to face right, setting the heading to 0 degrees makes that right-facing position the new 0 degrees. Then the sensor can track other headings based on that new direction.
Establecer el rumbo [Gyro 1 v] a (0) grado
Parámetros |
Descripción |
|---|---|
giroscopio |
The Inertial or Gyro Sensor to use. |
título |
The heading value, in degrees, to set for the sensor. This can be a value from 0 to 359.99. |
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 ▶
Configurar la rotación inercial/girográfica#
Rotation is how much the sensor has turned, measured in degrees. Unlike heading, rotation can increase past 359.99 degrees or decrease below 0 degrees. At the beginning of a project, the rotation value is set to 0 degrees. The set Inertial/Gyro rotation stack block changes the sensor’s current rotation to a new value.
For example, if the sensor has made two full turns to the right, its rotation value will be 720 degrees. Setting the rotation to 0 degrees will reset that rotation from 720 to 0 degrees. Then the sensor can track rotations based on that new value.
Establezca la rotación [Gyro 1 v] a (0) grado
Parámetros |
Descripción |
|---|---|
giroscopio |
The Inertial or Gyro Sensor to use. |
rotación |
The rotation value, in degrees, to set for the sensor. This can be an integer or a decimal. |
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 ▶
ángulo de rumbo inercial/giroscopio#
A heading is the direction the sensor is facing, measured in degrees from 0 to 359.99. The angle of Inertial/Gyro heading reporter block reports the sensor’s current heading.
The starting heading is 0 degrees. If the sensor turns past 359.99 degrees, the heading wraps back to 0 degrees.
([Gyro 1 v] rumbo en grados)
Parámetros |
Descripción |
|---|---|
giroscopio |
The Inertial or Gyro Sensor to report 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
ángulo de rotación inercial/giróscopo#
Rotation is how much the sensor has turned, measured in degrees. Unlike heading, rotation can increase past 359.99 degrees or decrease below 0 degrees. At the beginning of a project, the rotation value is set to 0 degrees. The angle of Inertial/Gyro rotation reporter block reports the sensor’s current rotation.
Turning right increases the rotation, and turning left decreases the rotation. For example, making two full turns to the right will report a rotation of 720 degrees. Turning one full turn to the left from 0 degrees will report a rotation of -360 degrees.
([Gyro 1 v] rotación en grados)
Parámetros |
Descripción |
|---|---|
giroscopio |
The Inertial or Gyro Sensor to report 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#
The rate of gyro reporter block reports the external Gyro Sensor’s current rotation speed in degrees per second \(dps\). The value can be positive or negative depending on the direction the Gyro Sensor is rotating.
([Gyro 1 v] tasa de dps)
Parámetros |
Descripción |
|---|---|
giroscopio |
The external Gyro Sensor to report 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#
Acceleration is how quickly the Brain is speeding up or slowing down. The acceleration reporter block reports the Brain’s acceleration along the selected axis, from -4.00 G to 4.00 G.
A G is a unit used to measure acceleration. 1 G is about the acceleration you feel from gravity while sitting still.
The value can be positive or negative depending on the direction of acceleration on the selected axis. The axis options are x, y, and z.
(Aceleración inercial del eje [incógnita v] en g)
Parámetros |
Descripción |
|---|---|
eje |
The axis to measure acceleration on:
|
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#
Gyro rate is how fast the Brain is rotating. The gyro rate reporter block reports the Brain’s current rotation speed along the selected axis in degrees per second \(dps\) as a decimal number.
The value can be positive or negative depending on the direction the Brain is rotating on that axis.
(Velocidad de giro inercial del cerebro del eje [incógnita v] en dps)
Parámetros |
Descripción |
|---|---|
eje |
The axis to report gyro rate on:
|
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#
Orientation is the Brain’s current angle on a selected turning axis. The orientation reporter block reports the Brain’s roll, pitch, or yaw, from -180.00 to 180.00 degrees.
Roll, pitch, and yaw describe different ways the Brain can tilt or turn.
(Orientación inercial del cerebro de [rollo v] en grados)
Parámetros |
Descripción |
|---|---|
eje |
The orientation axis to report:
|
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


