The Gyro sensor in LEGO Mindstorms EV3 sets is new for the sets and we answer basic questions about its usage. The sensor detect when the whole constructions turns at a particular angle, but there are a number of gotchas in using it.
- #154
- 01 Jan 2017
- 5:40
The Gyro Sensor could be attached and be useful in almost any robot construction. Using it during a FIRST LEGO League (FLL) or World Robotics Olympiad (WRO) competition is also possible and with a little programing could solve many challenges.
The sensor detects Angle on which it has rotate or the Rate at which it is rotating. Knowing the angle of rotation is a precision way to know where the robot is in space.
English
In this series of video tutorials we'll do a short introduction into the EV3 Mindstorms gyro sensor. How you can use it, what's the purpose and how you program this sensor.
Again it will be a very basic introduction so do not expect especially from this course any more advanced stuff. But we'll enter into more advanced stuff in the next videos. Gyro sensor, so with the gyro sensor first you have to do is to add this sensor to the robot. I'll now remove the light sensor, from previous tutorials and I'll add the gyro sensor. Of course you can add it in many different ways, I'll just add it on this attachment and I'll attach the cable to the gyro sensor. In my case the gyro sensor is attached to port 3. Now what the gyro sensor does is it can tell you several things. The thing that we are interested in now is that the gyro sensor can give you the angle of rotation, how much have you rotated he robot. If this is 0 when you rotate the robot, this will 90 degrees, this will be 180 and this will be one full turn. You might remember that when you program the robot and you set the number of rotations that you want one of the motors to turn if the motor turns for one rotation or 360 degrees, this does not mean that the whole robot will turn 360 degrees it will be only the motor and it might, depending on the size of the wheel and the construction of the robot, turning the motor for 360 degrees might turn the robot, but in most of the cases it won't turn the robot for one full rotation. This is something that we'll use the gyro sensor, to tell us when have we reached 90 degrees, so that we are sure that we can turn the robot to a 90 degrees angle. Let's check out the program. In the program what I would like to do is to turn the robot with motor A. I'll configure it to turn forward. This will make our robot turn left. We are turning motor A, but we are turning it just on, not for a certain number of rotations, just on. This motor turns and the whole robot turns with the motor. Then we are waiting until as with the other sensors, until something happens. Until an event happens. In this case we are waiting for the gyro sensor to reach an angle of exactly 90 degrees. So we are waiting for the gyro sensor to reach an angle of 90 degrees. It's not a good practice to set this comparison to equal so we want to set it to greater than, or equal, because it might be 91 degrees depending on the configuration of the sensor.
That's why we are setting it to greater than or equal to 90 degrees. Again, we are turning with motor A until the gyro sensor detects that the whole robot has turned to a 90 degree angle and then we stop with motor A.
Something that you should notice is again that the gyro sensor is attached to port 3 that's the default port for the gyro sensor. Download and run the program. Start.
Now what you see here is that the program is actually not correct. We are turning with motor A and we would expect to stop at 90 degrees. Again, we start the program.
Something in our very simple program is not working and that something that most of the rookie teams and students that are introduced to the EV3 software are wondering around and the problem is that this sensor detects the angle of turning, but this angle can be positive or negative. When we are turning in this direction then angle that the sensor detects is negative and when we are turning in this direction the sensor detects a positive angle of turning. That's quite of distinction because here the sensor returns negative numbers, as an angle of turning, we can't actually stop our program because we are expecting for something greater than 90 degrees, but it's always a negative. I'll show it on the software. Download and run the program. Let's just set the angle to 0 and I'll now run the program.
What you'll notice is that right here, when we detect the value for the sensor
we see that the value is minus 4 hundred and something. While the robot is turning the angle returned from the sensor is negative. Let's turn it again.
It turns, I'll stop the program, zoom it and the value is negative. In order to detect a 90 degrees angle, we must turn in the other direction. What you have to remember from this video is the gyro sensor returns the angle of turning of the whole construction in space, the angle space and it has a positive value and a negative value depending on the direction in which we are turning. If we are turning in this direction it has a negative value. If we are turning in this direction it has a positive value.
Courses and lessons with this Tutorial
This Tutorial is used in the following courses and lessons
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
Gyro Sensor Introduction
The Gyro sensor in LEGO Mindstorms EV3 sets is new for the sets and we answer basic questions about its usage. The sensor detect when the whole constructions turns at a particular angle, but there are a number of gotchas in using it.
- 5
- 0
- 3
- 3d_rotation 0
EV3 Basic Course. Introduction to robot programming, construction and sensor use
This course is designed for students, mentors and teachers that are completely new to LEGO Mindstorms EV3 robots and would like to start using them to learn, in classes or at competitions. It is quite different from previously built resources at FLLCasts because it makes no assumption on any previous knowledge and tries to introduce everything step-by-step.
- 38
- 193:26
- 30
Gyro Sensor
The Gyro sensor in LEGO Mindstorms EV3 sets is new for the sets and we answer basic questions about its usage. The sensor detect when the whole constructions turns at a particular angle, but there are a number of gotchas in using it.
- 5
- 0
- 3
- 3d_rotation 0
Instructors Remote Training
If you are working with students and you want to introduce Robotics to your class or you want to mentor a FLL team, but you are insecure about your technical knowledge in the Robotics field, then this is the right place for you. Having in mind teachers' busy schedule, we have design two different schedules and added an option to design one just for you. FLLCasts's Mindstorms EV3 Robotics Online Training is the perfect match for any teacher.
After the completion of each task the participant has to upload his solution for verification.
- 136
- 280:11
- 156
Gyro Sensor
The Gyro sensor in LEGO Mindstorms EV3 sets is new for the sets and we answer basic questions about its usage. The sensor detect when the whole constructions turns at a particular angle, but there are a number of gotchas in using it.
- 4
- 0
- 4
- 3d_rotation 0
Instructors Remote Training
If you are working with students and you want to introduce Robotics to your class or you want to mentor a FLL team, but you are insecure about your technical knowledge in the Robotics field, then this is the right place for you. Having in mind teachers' busy schedule, we have design two different schedules and added an option to design one just for you. FLLCasts's Mindstorms EV3 Robotics Online Training is the perfect match for any teacher.
After the completion of each task the participant has to upload his solution for verification.
- 136
- 280:11
- 156
Gyro Sensor Theory
The Gyro sensor in LEGO Mindstorms EV3 sets is new for the sets and we answer basic questions about its usage. The sensor detect when the whole constructions turns at a particular angle, but there are a number of gotchas in using it.
- 4
- 0
- 0
- 3d_rotation 0