Gyro Sensor Tests

Image taken from

Gyro Boy – Image taken from

I spent some time today playing with the Gyro Sensor.  There seemed to be a lot of issues with it last weekend as I was training a group of teachers.  Though I don’t doubt any of the problems they had (I was there!  I saw it!), I got perfect results every time I tried to use it.

DRIFT – Gyro sensors suffer from drift.  Perhaps a more saaavy engineer could describe it properly, but for me drift means the gyro sensor will start registering numbers even when it is not moving at all.  The way to account for this is to constantly unplug and replug the gyro sensor in when using it.  I did that each time I used it in the following experiments, always using Port View to make sure it read like this:


1. The first program I tried was from Robot Educator.  It has you use the Gyro sensor in the Change Angle configuration.  Robot turns to the right, and stops after an increase of 45, the drives straight.  Here’s what the program looks like:


And here’s the video:

2. Next I tried the same program but with an increase of 90 (right angle).


3. After the change in angle worked, I tried using the gyro sensor in the compare angle configuration.  This first time I again turned to the right until the sensor sensed an angle greater than 45.


4. Similar to last time I kept everything the same but changed the compare to > 90.


5. Now I tried left turns because this is what caused so many problems at the training.  First up is left turn change in angle decrease of 45.  Decrease because the numbers get negative as you turn to the left.


6. Same, but with decrease of 90.  Forgot to get a screen shot of this one.

7.  Wanted to use the compare angle configuration, but made a mistake.  I programmed turn left, stop when gyro sensor sense and angle greater than -45.  Can you guess what happened?


Yep, zero is greater than -45 so the robot stopped turning immediately (faster than you can see) and went straight.

8. Corrected previous example, changed to less than -45.


9. And finally I went with compare angle, less than -90.


Fortunately the gyro sensor worked fine in my tests.  Unfortunately I couldn’t repeat the mistakes that my students made during training last weekend. 




2 thoughts on “Gyro Sensor Tests

  1. Hi. I’ve been searching the internet for solutions to the gyro problem. I just purchased 2 educator kits +expansion packs and the software to build a project for my Engineering 102 class. My goal is to build an arm which can draw with a writing utensil of some sort and is remote controllable. I’ve been trying to make a joystick with two gyro sensors inside the handle to control the X and Y axis, to allow simultaneous control in all directions of the arm. But the drift has killed my joystick. There is a reset block in the LABView program which can reset the gyro back to zero, but the only way to implement it was by building a trigger connected to a touch sensor into the joystick which resets the gyros when pulled. I have springs and a ball joint underneath the stick to allow for 360 degree movement and springs it back to center, but if I cannot get the gyros to work, the joystick is useless. I may just end up using two motors as a joystick, but I’d rather use these gyros for what it appears they were designed for. Any advice?

    • Marc, I’m sorry it took me so long to respond to this.
      First let me say that sounds like an amazing project. Second let me say it sounds waaaay beyond what I usually do. I’m really excited to hear about Mindstorms being used in Engineering classes at the upper levels. Too often Robotics is relegated to Middle School. It sounds like you’ve found some good uses for it at the HS (or is it college?) level.
      You neglect to mention if you’re using EV3 or NXT. If the latter, then I would suggest trying a third party sensor like Dexter Industries’ dIMU Inertial Motion Sensor. ( This sensor is a 3 in 1; it measures acceleration, tilt, and speed of rotation on all 3 axes. That might help you out. Please keep me updated on your project.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s