Inertial Sensor - V5 Sensor


The Inertial Sensor is a combination of a 3-axis (X,Y, and Z) accelerometer and a 3-axis gyroscope. The accelerometer will detect a change in motion (acceleration) in any direction and the gyroscope electronically maintains a reference position so it can measure a rotational change of position in any direction against this reference.

The combination of these two devices in one sensor allows for effective and accurate navigation, as well as, controlling any change in the motion of a robot. A detection of a change in motion can help decrease the chance of a robot falling over when it is driving or while it is climbing over an obstacle.

The housing of this sensor has a single mounting hole which allows it to be easily mounted to the robot’s structure. In addition, there is a small indentation in front of the mounting hole which marks the sensor’s reference point. On the bottom of the housing there is a round boss which is sized to be inserted into a square hole of a piece of structural metal. This will keep the sensor fixed to its attachment point. On the back of the sensor housing is a V5 Smart Port.

Sensor's reference point Round boss on bottom of housing

There is a diagram on the housing next to the mounting hole which indicates the orientation of the axis for the Inertial Sensor.

In order for the Inertial sensor to be functional with the V5 Brain, the sensor’s V5 Smart Port and a V5 Brain’s Smart Port need to be connected with a V5 Smart Cable. The Inertial Sensor will work with any of the 21 Smart Ports on the Brain. When connecting a V5 Smart Cable to the ports, be sure the cable’s connector is fully inserted into the port and the connector’s locking tab is fully engaged.

V5 Interial Sensor Inertial Sensor Smart Port V5 Brain Smart Port

How the Inertial Sensor Works

Both the accelerometer portion and the gyroscope portion of this sensor produce a smart signal feedback to the V5 Brain.

Accelerometer: The accelerometer measures how fast the sensor changes its motion (accelerates) along the X axis, the Y axis, and/or the Z axis. These axis are determined by the orientation of the Inertial sensor. For example, one orientation could have a robot’s X axis as its forward and backward motion, its Y axis as its side to side motion, and its Z axis as its up and down motion (such as the robot lifting itself up off the field on a suspension pole).

The accelerometer measures a change in motion when its internal electronics detects a change in inertia and this creates a change in its reading. The faster the change in motion the more the reading changes. Note: This may be a larger positive value or a larger negative value depending on the direction of the motion along the axis.

Acceleration is measured in g’s (unit of gravitational acceleration). The maximum measurement limit for the accelerometer portion of the Inertial Sensor is up to 4g. This is more than enough to measure and control most robot behaviors.

Gyroscope: The gyroscope, rather than measuring linear motion along the 3 axis, measures the rotational motion around the 3 axis. The sensor measures this rotation when the internal electronics create a fixed reference point. As the sensor rotates away from this reference point it changes the output signal.

It takes a short period of time for a gyroscope to establish its reference point (calibration). This is commonly called the initialization or startup time. (Note: It is recommended using 2 seconds for a calibration time or start the sensor’s calibration within the pre-auton portion of the competition template. When using the sensor within the VEXcode V5 Blocks/Text drivetrain functions, the calibration is included within the function.)

An electronic gyroscope also has a maximum rate of rotation. That is, if the object the sensor is measuring is spinning faster than the gyroscope can measure its rotation, the sensor will return incorrect readings. The maximum rotation rate for the Inertial Sensor is up to 1000 degrees/second. Once again, this is more than enough to measure and control all but extreme robot behaviors.

Axis labeled on Inertial Sensor 3 Axis 3 Rotational Axis

The Inertial Sensor needs to be paired with a programming language such as the VEXcode V5 Blocks or Text to create a user program for the V5 Brain to utilize the sensor’s readings to control the robot’s behavior.

The V5 Brain in concert with a user program can be used to convert the Inertial Sensor readings into many measurements including: a heading, an amount of rotation, a rate of rotation, an orientation, and an amount of acceleration.

Placement of the Inertial Sensor

The placement of the Inertial Sensor is very important to its accurate readings. As previously mentioned, it is essential to align the Inertial Sensor along the axis the robot will be experiencing a change in motion. This alignment determines how the sensor produces measurements in reference to the spatial orientation of the robot. These measurements allow the user program to change the robot’s behavior.

There might be an isolated case where an Inertial Sensor will be placed on a robot’s external component, but for most applications, the sensor will be placed on the drivetrain’s chassis.

Reading Inertial Sensor Values: It is helpful to use the Device Info screen on the V5 Brain to see the values the Inertial Sensor is returning. This can be done with the sensor connected to the Brain by:

  1. Remove the V5 Brain Magnetic Screen Protector, turn on the Brain, and touch the Devices Icon.

  2. Touch the Inertial Sensor icon on the Device Info screen.

  3. Touch the Calibrate frame on the Inertial screen.

  4. Move the Inertial Sensor forward and backward, side to side, up and down, and rotate it in different directions. This should change the values on the screen and rotate the 3-D cube.

Placement determines rotation: For the next example, let’s say the Inertial Sensor is mounted such that the side with the mounting hole of the sensor is pointed towards the front of the robot’s chassis and the VEX logo of the sensor is facing up by mounting it on top of the frame. In this orientation, + X axis direction points forward, + Y Axis direction points right, and + Z Axis direction points down to the floor. If the user program has the robot rotate to a positive heading, the robot will rotate clockwise.

Now let’s relocate the sensor. This time the mounting hole is still pointing towards the front of the robot, but it is mounted under the frame with the VEX logo facing down towards the floor. In this orientation, + X axis direction still points forward, + Y Axis direction now points left, and + Z Axis direction now points up towards the ceiling. With this new orientation of the sensor, if the user program has the robot rotate to a positive heading, the robot will rotate counterclockwise.

VEX logo facing up VEX logo faces down

Hopefully, this example illustrates the importance of the alignment of the Inertial Sensor. The sensor follows the right hand rule which states: If the thumb of the right hand points towards the positive direction of the axis, the fingers will point in the positive direction of rotation.

Right Hand Rule

As important as the alignment of the sensor’s axis is in reference to the axis of the robot, its location in reference to the robot’s pivot point (point of rotation) does not matter. The sensor treats the robot as a solid body so the Inertial Sensor can be placed anywhere on the robot as long as it is aligned with the axis which are intended to be measured.

Common Uses of the Inertial Sensor:

The Inertial Sensor can produce several measurements which can be used to change the behavior of the robot. Some of these include:

Heading: When the Inertial sensor is used to move the robot to a heading, it will move to a fixed heading in reference to a point which is established when the sensor was calibrated. In other words, if the robot is set to a heading of 90o from its starting position, it does not matter whether the robot has a current heading of 45o or a heading of 120o, it will turn to reach a heading of 90o.

Amount of rotation: Unlike the heading value, the amount of rotation has the robot rotating a certain amount from its current orientation. In this case, if the robot turns 90o and then turns 90o again, it will be at 180o to its starting position.

Rate of rotation: The rate of rotation is how fast the robot spins. Whether the robot is turning to a heading or rotating for an amount, the speed at which the drive wheels are turning will determine how fast the robot turns. Some of the units used to measure this are degrees per second (dps) and revolutions per minute (rpm).

Acceleration: As mentioned previously the Inertial Sensor can measure acceleration, how fast the robot changing its motion along an axis. Interestingly, while the robot is stationary, its side to side and its front and back acceleration will be 0g, but the robot’s up and down acceleration will read 1g because the Earth’s gravity is exerting 1g of force on the robot.

Pendulum: An interesting classroom activity is to mount an Inertial Sensor to a long piece of structural metal and then attach the other end to a stationary tower with a shaft or shoulder screw so it can swing down like a pendulum. Next, attach a long Smart Cable between a V5 Brain/Control System and the sensor. Program the V5 Brain to print the sensor’s acceleration values to the Brain’s Color Touch Screen. Have the students explore how swinging the Inertia Sensor on the end of the pendulum changes the sensor’s values.

Tumble Robot: Another fun classroom activity is to have the students assemble a Tumble Robot. A Tumble Robot is designed to be able to drive upside down as well as right side up. Have the students write a user program using the Inertial Sensor to navigate a path. Then have them investigation how the robot’s behavior changes when it is driving upside down.

Tumble Robot

Uses of the Inertial Sensor on a Competition Robot:

The Inertial Sensor will provide a great competitive advantage for competition robots. Some of these uses include:

Navigation: In addition to setting headings or the amount of rotation for the robot to turn, the Inertial Sensor readings can be used to program the robot so it will travel in a straight line along a given heading. This is especially helpful during the autonomous portion of a match or during a Programming Skills run. Also, through the use of some higher-order mathematics, it is possible to use the acceleration values to write a function which can determine the robot’s change in position.

Stability: Perhaps one of the most disheartening things is to see your robot sprawled out on the playing field after it has tipped over. The Inertial Sensor can be used during both operator controlled and autonomous periods to detect if the robot is starting to tip and then the user program can make the robot take an auto-corrective action. This could take place while the robot is driving fully extended or while the robot is attempting to climb an obstacle.

No matter what the application the VEX V5 Inertial Sensor is used for, there is no doubt it will be a welcomed addition for teams. The function of the sensor’s values are open for the imagination of the user.

The V5 Inertial Sensor is available on the VEX website.