Gyroscope
Measure yaw rotation in degrees
Add-On Required: This feature requires the Simulink Coder Support Package for ARM Cortex-based VEX Microcontroller add-on.
Libraries:
Simulink Coder Support Package for ARM Cortex-based VEX
Microcontroller/Sensors
Description
The Gyroscope block measures the angle of rotation (yaw) along the single axis of the gyroscope sensor. In the graphic, the arrow above the vertical axis indicates yaw. The direction of the arrow shows the positive direction of the reading for the gyroscope sensor.
The block outputs angle (in degrees) as a double-precision scalar value. When you rotate the gyroscope sensor in a clockwise direction, the tick count decreases. When you rotate the encoder in a counterclockwise direction, the tick count increases.
Using the Calibration multiplier parameter, calibrate the gyroscope and reduce drifts in the gyroscope sensor readings. Drifts are positive or negative bias introduced in the readings due to the external factors such as temperature, mechanical vibration, and motor magnetic field influence. A calibrated sensor helps you reduce drifts and obtain an acceptable range of accuracy in the readings from the sensor. To learn how to calibrate the gyroscope sensor, see .
During simulations, without the hardware, this block emits zeroes if there is no source block connected to the simulation input port. See Block Produces Zeros or Does Nothing in Simulation. To achieve simulation behavior, connect a source block from the Utilities library in VEX microcontroller library.
During code generation, any simulation block that is connected to the input port of the Gyroscope block is ignored and has no effect on the generated code.
For the code generated from this block to work properly with the gyroscope sensor, connect a VEX 7.2 volt battery to the microcontroller. Before you download the program to the VEX microcontroller, turn on the battery. After turning on the battery, do not move the robot on which the gyroscope sensor is mounted for proper initialization of the gyroscope.
Ports
Input
Output
Parameters
Version History
Introduced in R2017a