Book Image

Learning Lego Mindstorms EV3

By : Gary Garber
Book Image

Learning Lego Mindstorms EV3

By: Gary Garber

Overview of this book

Table of Contents (19 chapters)
Learning LEGO MINDSTORMS EV3
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
10
Other Programming Languages
Index

The gOS My Block


All gyros drift over time. The gOS My Block measures this drift and the resulting bias error in the rate of the Gyro Sensor. As a FIRST LEGO League tournament host, one of the largest complaints about the EV3 Gyro Sensor I hear about is the drift in the sensor readings. If you look at the HiTechnic sensor block, you may notice an input for a bias offset. Even after using the Gyro Sensor reset block, the Gyro Sensor may still not read 0. If you change the mode of the Gyro Sensor while it is perfectly still, it will reset to 0, but that is not done in the Gyro Boy program. The gOS My Block compensates for this bias. You can think of this as a DC offset that you may see in electrical signals.

The gOS My Block measures the Gyro offset and then subtracts this value from the calculations used later to keep Gyro Boy balanced. The robot needs to be completely stationary while the offset is determined. This could be fixed by adding a one-time delay at the start of the program. A...