Gyro Sensor

In Chapter 4, Sensors and Control, when we introduced the Gyro Sensor, we wrote a program that stopped the rotation of the robot when the Gyro Sensor reached a certain value. As we noticed, the robot always overshot this value. In Chapter 7, Advanced Programming, we tried to compensate for the overshooting with a two-level controller. Here we show a program where the measurement from the Gyro Sensor goes into a proportional controller.

You will find that this method is significantly more precise and useful in making exact turns.

Gyro Sensor

The preceding program asks the robot to rotate through a given angle and slow to a stop. If we used a smaller ...

Get Learning LEGO MINDSTORMS EV3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.