Let's record the values of the Gyro Sensor while the robot is moving and is trying to keep its orientation straight. This is an interesting experiment and we will have to use file access to write the values to a file.
- #662
- 10 Jan 2018
- 6:30
- LEGO MINDSTORMS, LEGO MINDSTORMS EV3
- FIRST LEGO League, EV3-G, Experiment, EV3, Gyro Sensor, Sensors, Physics, FLL, Programming
File access
You can not implement an experiment where you plot the values of the gyro sensor and at the same time take its value and use it in a program. That's why we would have to use file access. The block for file access writes the value on a new line.
Analysis with LibreOffice
For plotting the values recorded in the file and for creating a chart from them we use LibreOffice Calc. You could give it a try.
Conclusion
What conclusion can you make from the values that are shown? What you could see from the graphic is that every time the robot makes a mistake and the gyro sensor detects, the program will steer the robot in the reverse direction.
Datalog of the Gyro sensor when moving forward and keeping the orientation straight
The data log from the experiment when moving forward and keeping straight with an implementation for Proportional compensation.
Курсове и занятия включващи този Урок
Този Урок е използван в следните курсове и занятия.

Moving Straight with LEGO Mindstorms EV3 robots
One of the most controversial topics when it comes to LEGO Mindstorms robots is how to make them move in a straight line. This is a problem that has caused a lot of confusion among teachers, parents, rookie teams and students. The robot makes about 2-3 centimetres error for every meter, which is about an inch for every 3-4 feets. In this course, I would like to discuss the different ways in which you can improve the behaviour of the robot and how you could make it move in a straight line with the help of the LEGO Mindstorms EV3 Gyro Sensor.
- 24
- 102:09
- 3

PID Algorithm for Moving Straight with Gyro Sensor. Proportional Part
The first part of making the robot move straight is to keep it oriented straight. While it moves it could make an error and turn slightly to the right and then the program should turn in back to the left to make its orientation straight. In this video tutorial, we would discuss how to implement a program to keep the robot orientation straight even when we are pushing or pulling it to either side and in the same time it has different wheels.
- 5
- 0
- 0
- 3d_rotation 1