В момента ресурсът е наличен само на английски

How to Use EV3 Gyro Sensor of the LEGO Mindstorms Robotics Set

This video tutorial reviews the EV3 Gyro Sensor and the HiTechnic Gyro Sensor for the LEGO Mindstorms NXT robotics Kit. We compare the two sensors and demonstrate them in action.

  • #50
  • 13 Dec 2013
  • 8:47

In the video, we answer the question what a Gyro Sensor is - a sensor, that tells you at what degrees you have rotated it and what is the rate of rotation (degrees per second) is. We compare the two sensors using the EV3 Experiment Software, which tells us that the EV3 Gyro Sensor is much more precise. Fortunatelly, we can use both sensors with the EV3 software, without the need of installing additional blocks, as it was the case with the NXT-G. At the end we see what is the difference in the values of the EV3 Gyro Sensor after three times running one and the same program. 

In conclusion, the EV3 Gyro Sensor is quite accurate and for sure will improve your performance during the FIRST LEGO League competition, but still you should not rely only on the Gyro Sensor for positioning on the field.

New and Updated videos in a whole playlist:

EV3 basics course. Mindstorms EV3 Gyro Sensor

Top designed by Mr. Blune from the Noun Project

English

One difference between the NXT kit and the EV3 kit is the existence of the new EV3 Gyro Sensor. There was a Gyro sensor for the NXT kit but it was manifactured by High Tech which means that it wasn't allowed on the FIRST LEGO League competition. Whereas the new EV3 Gyro Sensor is manifactured by LEGO and so it's allowed on the FIRST LEGO League competition. Last, makes it quite interesting for the participating things. In the next few minutes I will show you the differences between the two sensors. And some possible uses for the sensors during the competition.

First of all, what is the Gyro Sensor? If you ask with idiom the gyroscope is device for measuring or maintaining orientation based on the principles of !angular momentum*. Said with other words, the Gyro sensor could tell you what is the change in its position. And by this I don't need the change in milimeters or meters or whatever. But change in rotation,so it tells you at what degrees it has changed starting from its based position. So, when we run the program if the sensor is like this and we take the robot at 90 degrees the Gyro sensor will tell you that it has been rotated at 90 degrees. This can be quite useful during the competition because you could try to make perfect turns with it. And with this will be better for your orientation on the field. But now, let's see what we can actually do with the program and the Gyro sensor. I've connected EV3 brick to the computer and as you could see the computer detects two sensors. In Port 2 we have EV3 Gyro sensor and in Port 1 we have NXT Gyro sensor. Which in this case is detected as NXT sound sensor but now I will take Gyro sensor block, set it to Port 1 Here is a warning that on Port 1 we don't have Gyro sensor but still I will download the program.

Now as you could see the sensor on Port 1 is detected as Gyro sensor. Ok let's see what are the settings of the Gyro sensor block. First we have the reset option which means that we reset the value of the Gyro sensor and it starts measuring from this point on. This is the automatically each time we run the EV3 program. Then we have the measure option where we can measure the angle at which we have rotated the EV3 Gyro sensor or the rate of rotation. This means that it will return value of the number of degrees per second at which we rotate the Gyro Sensor. And of course we can read both lines senteniously.

We have also the compare option where for instance we get set traceful value for the angle and if we want to turn our robot at 90 degrees we should set it greater or equal to 90. and then stop the motors. Now I will use a program we have created in the last episode, which use the Raw sensor value block. And thanks to this program I will compare the Raw Sensor values of the two sensors. Something that is quite important is that the two sensors should be stable when the value is reset or when start the program. So in our case I'm using NXT brick as table ground where I have put 2 sensors. You could see the value of the EV3 sensor which is below the value of the NXT sensor. Now when I rotate the sensor this way the values are getting lower and lower until we reach somewhere here which is 90 degrees turn. And as you could read the value of the EV3 sensor is 82. Then if we get the other way their value is getting greater and greater. Ok. Now let's get back to the program. Now I will be using the Data **** section of the EV3 Software. Here in green we have on Port 1 the NXT Gyro sensor and in gray on Port 2 we have EV3 Gyro Sensor. The default value of the EV3 Gyro sensor is 0 whereas the default value of the NXT Gyro sensor is 2400. So I have aligned the two values so that we have similar results. Within the time frame of 10 seconds and with 100 samples per second we'll run the experiment in order to see what is the difference between the values of the two sensors. So I'll run the experiment and move the NXT brick with the two sensors slowly left and right. Let's see what will happen.

Ok, as we could see the graphic of the EV3 Gyro sensor is a lot smoother than the green one. And that's because the EV3 Gyro sensor makes 3 times more measures per second than the NXT Gyro Sensor. Also as you could see the change of their values is opposite so you should keep that in mind when you're using the two sensors. The good news is that within the EV3 software you could use the NXT Gyro sensor whereas within the NXT-G wasn't possible. But still is quite hard to use it because it's quite hard to read the values and use them properly. Now let's continue with some simple examples and simple programs with the EV3 Gyro sensor. I have done this simple program, first we clear the screen and then we do the following thing three times. Moving motor B at power 50 for 1 rotation, we detect the value of the EV3 Gyro sensor and display it on the screen. Then we wait for one second before we reset the value in order to be sure that the Gyro sensor is stable and the value will be correct. Then we repeat the same thing but this time we display the value below the first one and the third time below the second one. At the end we wait for 10 seconds in order to have time to see what has happened. So let's run the program.

And after the three runs, the values of the sensor are 94,90 and 89 which means the sensor is quite persistent in the values and can be quite accurate but still it could not rely on your positioning only to the Gyro sensor because you make perfect turn but still you could slip and it cannot guarantee your end position. So if you have any further questions on the Gyro sensor please leave a comment under the video.