Experiment and Data Logging of the Gyro Sensor Pro Preview

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

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.  


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. 

Courses and lessons with this Tutorial

This Tutorial is used in the following courses and lessons

Image for Moving Straight with LEGO Mindstorms EV3 robots
  • 24
  • 102:09
  • 3
Image for PID Algorithm for Moving Straight with Gyro Sensor. Proportional Part
  • 5
  • 0
  • 0
  • 3d_rotation 1