"What is the light in the room?" - should it even matter. You can use one program for all lighting conditions by calibrating the color/light sensor of the LEGO Mindstorms EV3/NXT robots.
- 03 May 2015
This is the seven video tutorial on the Capapult and we show how you can calibrate the light/color sensor to make sure the Catapult could still work in different lighting conditions.
The problem is simple - you build a robot for a specific task. For solving a specific problem and this robot uses a light/color sensors. It probably works every time until you change the lights in the rooms or you switch to a different room.
This is where calibration comes to play. You tell the sensor basically how "much light" there is in the room and what should be considered black/white as colors. This could greatly vary. Another example where you should use calibration is when following lines with EV3 Mindstorms robots.
All episodes from the series:
How to use the Light/Color Sensors with the Catapult built from EV3/NXT
How to use the Ultrasonic Sensor with the Catapult built from EV3/NXT (Part 5)
Catapult build from LEGO Mindstorms EV3/NXT (Part 4 - EV3 clutch and loading)
Catapult build from LEGO Mindstorms EV3/NXT (Part 3 - Automatic loading)
Catapult build from LEGO Mindstorms EV3/NXT (Part 2 - Base)
Calibrating the EV3 color sensor
Calibration program written in EV3-G
- In the previous episode we implemented a catapult that can load and fire automatically using the color sensor but we stopped on calibrating. In this episode we're going to implement the calibration of the sensor so that when the light turns off the catapult will continue working.
Initially we start with the program from the previous episode. Check out the link below and you can remind yourself. We would like to calibrate the sensor and the parts of calibrating process holes. We wait for a push of a button. We compare that we have pressed, for example the second button is pressed and released. When the second button is pressed, released this means the last button in the middle, we take the value of the color sensor and to set this value as the maximum value.
The purpose of a calibration process is to keep the minimum and the maximum value detected by the color sensor applied for your lighting conditions in their own currently. The next step is to calibrate the minimum value. Again we wait for red button to be pressed, second button bumped. We set the minimum value. Again, we wait for a button. We set the maximum value. We wait for a button, we set the minimum value. We will wait again, and after the button is pressed for the third time, the program continues as it shoots. Loading can find... Let me just check, bump. This is the whole program. I'll move this here to make it more readable, and let's run the program. The program is running and we are at our maximum value that the sensor detects the back of the brick which we consider the maximum. We press the button once. Then as the second step, we must load the catapult manually.
The sensor detects black or this should be considered its minimum value. Let's press the button again.
Now we release the catapult and we start the program.
Let's do the same experiment, this time turning the lights in the room off. The lights in the room are turned off, and again we detect our maximum value. Press the button, then reload the catapult. Now we detect our minimum value. Press the button, then we release the catapult and restart the program.
As you can see, even without lights in the room because we have calibrated the sensor, the program still works.
Courses and lessons with this Tutorial
This Tutorial is used in the following courses and lessons
A robot a "day" keeps the questions awake. Version 1
"How to use the LEGO robots to facilitate the learning of robotics by my student at home" or simply put - "what to build now?"
After enrolling in this course we will send you a few (1-2-3) emails each month with a title "A robot a 'day'". Each email contains a robot building instructions and/or video tutorials and/or tasks that should be accomplished. After a task is accomplished we might sometimes ask for a video or picture.
This process gives a structure of the learning process where you can learn from the content. The student participates in a course, but from home and on the schedule that you decide.
Add some sensors to the Catapult. Robot 9 and a Half
This video lesson shows a very interesting specific example on how to use the LEGO Mindstorms EV3 Ultrasonic Sensor. The sensor detects if the catapult is loaded or if we have just fired an element. At the end of the lesson I also offer an interesting challenge that you could use in your classroom or at home.
- 3d_rotation 1