Follow an object using the LEGO Mindstorms Ultrasonic Sensor. Object moves away, the robot moves with the object. The program is very useful if you are doing STEM classes and you want to demonstrate results. People react very well to a robot following you like a dog for example.
- #145
- 15 Oct 2015
- 5:43
Previous video tutorials:
Follow an object with the Ultrasonic sensor
EV3-G program for following and object with the LEGO Mindstorms EV3 robots
English
The next program with our ultrasonic sensor is to make the robot follow my hand. Аs I move my hand away from the robot, I would like the robot to follow it and to keep at a distance of about 4 inches, like this.
Download, run the program.
Now I move my hand and the robot moves forward. The only thing that we should add to this program is that when I move my hand the robot should move at exactly the same distance, so it should keep 10 cm.
Move, stop and move my hand and it continues moving. How can we make this process repeatable, moving and keeping distance of 10 cm? Since we want this whole process of moving forward, stopping and moving forward to repeat we need to use a loop.
What we want to repeat are the following blocks. First moving forward, waiting until we see an object, stopping and then waiting until the object moves away and when the object moves away we return to the beginning of the loop and we'll move the motor forward until we detect an object and when the object moves away we start again and move forward for undefined amount of time. This way we'll get our robot to follow the object in this case my hand. Let's see if the program works correctly.
The robot moves forward, reaches my hand, I move my hand and the robot moves with the hand.
What you can see is that we have this not very smooth movement of the motors. How can we improve this? What we want to change in our program is the Tank block with the stop option. We want to change it so it does not break when stopping but to coast, so it's stopping very slowly not immediately and this will probably make following the object a little smoother. Let's see if this works.
I'll stop the program now. Let's run it again and what happens. We move with the robot forward until it sees my hand
but it does not stop.
It moves it's smother but there is a glitch and the glitch happens if the sensor is very near to my hand. Now is following, it's very smooth but if my hand is very near to the sensor, like this, the robot won't stop.
So we have the program for following my hand but as we have the coast option it is possible if the object moves very slowly we actually touch the object and when we are touching the sensor is not able to detect any distance to the object and it's not working as expected. It might return a maximum distance or it might return 0 but if the object touches the sensor, the sensor is not returning correct values. As a result from this video we have a program for following an object that is moving.
In the next video we'll set few tasks that you can implement for the ultrasonic sensor so that you can learn more about it.
Курсове и занятия включващи този Урок
Този Урок е използван в следните курсове и занятия.
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
Ultrasonic Sensor
We are introducing the LEGO Mindstorms EV3 Ultrasonic Sensor. The first program is actually to detect an object and stop near it, at about 4 inches/10 centimeters. The ultrasonic sensor could be used during robotics competitions, but most of its use is for experiments.
- 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
Ultrasonic Sensor Theory and Practice
We are introducing the LEGO Mindstorms EV3 Ultrasonic Sensor. The first program is actually to detect an object and stop near it, at about 4 inches/10 centimeters. The ultrasonic sensor could be used during robotics competitions, but most of its use is for experiments.
- 4
- 0
- 0
- 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
Ultrasonic Sensor
We are introducing the LEGO Mindstorms EV3 Ultrasonic Sensor. The first program is actually to detect an object and stop near it, at about 4 inches/10 centimeters. The ultrasonic sensor could be used during robotics competitions, but most of its use is for experiments.
- 4
- 0
- 3
- 3d_rotation 0