nxtprograms.com

Fun Projects for your LEGO® MINDSTORMS® NXT!

Home     Projects     Help     Contacts

 
   
   

Workaround for Inventor Hub Gyro Sensor Bug

The built-in gyro sensor in the LEGO MINDSTORMS Inventor hub allows a program to sense the angular direction of the hub (in all three axes: roll, pitch, and yaw). This can be used to make a robot drive straight in a certain direction or turn more reliably by a certain angle, for example.

There appears to be a bug in the internal gyro software that makes it not work sometimes. For example, it might always report a yaw angle of 0, no matter what direction the robot is facing, which will cause incorrect results in your programs that try to use the gyro.

I'm not sure what causes the bug or exactly what circumstances trigger it, but in practice it frequently happens when you power up the hub not connected to your programming computer/device and try to run an already-downloaded program on it. However, if you connect the hub to a computer via a USB cable, power it up, and download or run the program while connected, it will work.

If you have trouble with a program using the gyro, try this workaround:

  1. Power down the hub (hold down the large round button until it shuts off)
  2. Take the hub next to a desktop computer (Mac or Windows) that has the MINDSTORMS programming software installed, so that you can connect it.
  3. While it is still off, position the hub flat on the floor or desk so that the matrix display and buttons are facing up.
  4. Connect the hub via a USB cable to the computer.
  5. When the hub is connected, it should power up automatically.
  6. Open the program you want to run on the computer and download it to one of the slots on the hub.
  7. Disconnect the hub from the computer
  8. Prepare the starting position of the robot and run the program.
  9. If this still doesn't work, then try these instructions again except in step 3 orient the brick the way it will be in the model and program you are trying to run.
 

Home     Projects     Help     Contacts

 

Copyright © 2007-2021 by Dave Parker.  All rights reserved. 
All project designs, images, and programs are protected by copyright.  Please see the usage policy.