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.
- #653
- 10 Jan 2018
- 5:13
- LEGO MINDSTORMS, LEGO MINDSTORMS EV3
- Move straight, FIRST LEGO League, Box Robots, EV3-G, EV3, Gyro Sensor, Sensors, Physics, FLL, Programming
Proportional Part
As the robot moves slightly to the left we will steer it to the right. If it moves slightly to the right we will steer it to the left. We get the angle that the gyro is detecting. If this angle is 0, this means we are moving forward. If this angle is not zero, this means we are not oriented straight. So we must take the difference and apply this difference to the steering block. The farther it moves from the 0, the greater the steering should be. This is what proportional means. As the error gets larger we should proportionally try to move in the reverse direction.
Different wheels
The robot has different wheels. The experiment will keep the robot straight even though it has different wheels because it will be constantly compensating for the turning.
Pushing/pulling the robot while moving
While the robot is moving we can push or pull it and it will correct for this very large error and continue moving forward.
Program for keeping the robot straight with the Gyro Sensor (Proportional compensation)
Proportional implementation for keeping the LEGO Mindstorms robot straight. The program will take the value of the Mindstorms Gyro sensor and will apply this value to the steering block. This will make the robot steer in a direction that would put the robot in a straight position again.
English
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 it back to the left and make it's orientation straight. In this video tutorial we'll 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. What we are doing here is called the proportional part of the algorithm. So, we have a gyro sensor - this one here and we just mount it on the front and we know how to use it and there is no drift. So, these are the preconditions. Now, we have our straight line and let's discuss the proportional part. As the robot moves like this it can move slightly to the right. This is my right. And when it moves slightly to the right we must return the robot to the left. We get the angle from the gyro sensor. The gyro sensor is detecting the angle and if the angle is 0, this means that we are moving forward and we are keeping a straight line. If this angle is not 0, this means that we are not oriented straight. So, if this angle is not 0 like this, we are not oriented straight. So, we must take the difference between 0 which is in this direction and the direction of the gyro sensor and we must take this difference and apply it to the robot. The further it moves from the 0, so if we are for example like this, the greater the steering should be. So, if we are far away from our 0, so if you've turned to the right pretty much like 90 degrees, we must apply this difference to the steering and it will return us back to the initial position. This is what proportional means. As the error gets larger, we should proportionally try to move in the reverse direction. Let's implement this program. Starting with the program. First, we take the block for detecting the value of the gyro sensor. And in my case the gyro sensor is connected on port 4. Then we must move with the robot and we just take a steering block. And in this steering block we just move forward with motors B and C. And if the gyro sensor detects 0, then we must move with the steering 0. But if the gyro sensor detects - or + or any difference, we must apply this difference to the steering block. So, we just add this difference to the steering block and then we put this whole program in a loop like this. And we said that we would like the loop to finish in about 5 seconds. So, this simple program is the proportional part of an algorithm where you can keep the robot orientation straight. It's very simple. We just do the following thing - we take the value of the gyro sensor and we apply this value of the gyro sensor to the steering. If the gyro sensor is with value 0, then we just move forward. But if the gyro sensor detects something, we must turn in the reverse direction. So, it also depends - check out your motors if these are B - C or C - B to know whether the steering is applied in the right way. But for our robot this is OK. Let's run the program and see how the robot behaves.
What you just saw are the two robots - the Box Robot and the Five Minute Robot and they are keeping the orientation straight and even if we push or pull them from one of the sides, they will try to return so that they are oriented straight ahead so the gyro sensor detects 0. It is worth mentioning that this would even work if the two wheels are with different size which is quite funny. You might have a robot where one of the wheels is larger than the other and it will still try to move forward and it will move forward very well.
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
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
FIRST LEGO League 2020-2021 RePlay Solutions and review with SPIKE Prime
This course presents Solutions and Review of the FIRST LEGO League 2020-2021 RePlay competition. We do such a course every year after the competition. By moving through the course lessons, building the robot and attachment and completing the missions you will learn how to achieve FLL mission following good engineering principles for building robots, attachments and developing programs. Upon completion of the course you will have many new ideas about how to approach mission on every FLL robotics competition and how to help your team score more points.
- 74
- 158:11
- 15
M11. Treadmill
This FIRST LEGO League robotics video tutorial is about the Treadmill mission and how it could be accomplished. The mission is from FLL 2020 RePlay competition. Almost every year there is a mission of this type where the robot must spend a lot of time with the mission model in order to turn or lift something. These are quite interesting and challenging missions.
- 4
- 0
- 0
- 3d_rotation 3