The robot can move with different speed by applying different power to the motors. It will most of the time make smaller deviations when it moves slower. But you can't just move with a power of 10 all the time. This is a way too slow especially for competitions like FIRST LEGO League or World Robot Olympiad. In this video tutorial I would like to discuss the balance between motor power and robot movement error, how does the battery influence the power of the robot and to conduct an EV3-G experiment that will record the values of the Gyro Sensor along with the current power.
- 09 Jan 2018
- LEGO MINDSTORMS, LEGO MINDSTORMS EV3
- Move straight, FIRST LEGO League, EV3-G, EV3, Experiment, Gyro Sensor, Sensors, Physics, FLL, Programming
Different deviation for different motor power
The speed of the robot has great influence on the traction between the tires and the surface. This is the first thing that you have to be careful about. It also seems that with larger motor power there are greater deviations from the straight line, probably because the motors get out of sync for longer periods.
Influence of the battery
Value of "100" in the block for moving forward generally means that the robot is moving forward as fast as it can. As fast as the weight of the robot allows it and as fast as the battery allows it. So the LEGO Mindstorms robot is doing it's best, but this means that the robot depends on the battery. When the battery is drained the robot will have different behaviour. That is not good. You should always try to develop robots that do not depend on the battery for their precision.
The experiment shows a plot of the current power and the value of the gyro sensor. Try to analyse the plot. What conclusions can you make from the it.
The experiment contains a plot of the Curren Power of Motors B and C and the values of the Gyro Sensor when the robot is moving with a power of 100%. What you could see is that it is not actually moving with a power of 100% because the current power is about 75-80%.
The robot can move with different speed by applying different power to the motors. It will most of the time make smaller deviations if it moves slower. But you can't just move with a power of 10 all the time. This is way too slow especially for competitions like FIRST Lego League or the World Robot Olympiad. In this video tutorial I would like to discuss the balance between motor power and robot movement error. How does the battery influence the power of the robot and how to conduct an EV3-G experiment that will record the values of the gyro sensor along with the current power? The experiment will be the following - we'll take the Box Robot and the Five Minute Robot and we'll just move with the power of 50. And we'll see the deviation. Then we'll move with the power of 100 and we'll see the deviation. And we'll probably conclude that if we move slower, we'll make smaller mistakes.
You saw the difference for the Box Robot Now let's see the difference for the Five Minute Bot.
Our next step is to do a very interesting experiment with our robot and in the experiment we'll see the current power and the value of the gyro sensor. So, I'll create a new experiment. It will be here. First, we'll have to remove the sensors that we don't want to see. In my case these are the 3 color sensors that are also attached to this robot and I would like to see only the gyro sensor and its values. And I would like to see them in red. Then I don't want to see motor A so I'll remove motor A and I would like to see motor B and C. Then I would like to do a small program where my robot moves forward. So, in our case for our Box Robot this means -100. And let's make it move for 10 rotations. These are 10 rotations. The robot will move forward for 10 rotations and in the same time this experiment will plot the values of the gyro sensor and the values of the current power for the motors. So, let's start our experiment.
Our experiment continues for 10 seconds and we have our values. First, we have this red line here that show us the value of the gyro sensor and as you can see probably there was some deviation in the gyro sensor for about 2 or 3 degrees because it started from 0 and after 10 rotations it has turned. But where do we see the values for the current power? What we must do is to click here and this will show us the values for the current power of the motors. Because our values are minus because our robot is moving in a reverse direction and we have the values of the current power. And what we can see is right here - this here is the power of the motor and even though we set -100 as you can remember our robot never reached 100. It kind of like stayed at 75. And this very much depends on the battery. So, we've seen values like 80, we've seen values like 60, so you would like to move with a power of 100 but the power of the motor - the current power will be about 75. And as you can see it slightly moves in different directions for the different motors. So, this here is a slightly deviation in one of the motors, this here in another. So, this is what the PID algorithm that's embedded in the EV3 set is doing. It is keeping both of the motors in sync with almost the same power. And at the end when we reach the end because we were turning for like 10 rotations we must stop. And to stop we see that the power suddenly becomes positive -
the current power is positive which means that the brick is trying to stop the motors and after this point the motors actually stop. And if you look closely, you can see that there are some deviations in the gyro sensor when there are deviations in the current power of the motors. So, when the motors make a mistake also the gyro sensor detects a mistake in the robot. For example, right here when the robot is accelerating you can see that we've started with the gyro sensor that's about 0 degrees pointing forward and at the end of the acceleration which is somewhere here after about a second we can see that there is probably already a degree of error in the gyro sensor. Then we continue moving forward and the error becomes larger and larger. So, the robot is turning slightly to one side and this is very important to understand that you would like to have the motors work in sync and the internal PID algorithm is doing its best but at the end you have some differences and these differences have an influence on the gyro sensor and how the robot is moving. And these differences depend on the battery.
Courses and lessons with this Tutorial
This Tutorial is used in the following courses and lessons